22 #ifndef POLYGONPOINT_HPP
23 #define POLYGONPOINT_HPP
25 #include <LbmLib/include/nodes/LagrangianPoint.hpp>
26 #include <LbmLib/include/geometry/Connection.hpp>
27 #include <LbmLib/include/GlobalSimulationParameters.hpp>
28 #include <UtilLib/include/Log.hpp>
29 #include <boost/geometry/geometries/point.hpp>
90 virtual std::string
getType()
const;
137 unsigned int getId()
const;
143 template<std::
size_t K>
144 void setConnection(
const std::shared_ptr<LbmLib::geometry::Connection> newconnection)
146 assert(K==0 || K==1);
147 if (this->connections_[K] !=
nullptr) {
148 if (newconnection !=
nullptr) {
149 std::stringstream message;
150 message << std::setprecision(12) <<
151 "GeometryNode::setConnection<" << K <<
">() on point ID= "<< this->
getId() <<
152 " (" << this->
getXPos() <<
"," << this->
getYPos() <<
"): overwrite non-nullptr entry (this should not happen)";
153 lbm_fail(message.str().c_str());
156 this->connections_[K] = newconnection;
163 template<std::
size_t K>
166 if (this->connections_[K] ==
nullptr) {
167 std::stringstream message;
168 message << std::setprecision(12) <<
169 "GeometryNode::getConnection<" << K <<
">() on point ID= "<< this->
getId() <<
171 " at time " << Parameters.getCurrentIteration() <<
172 ": nullptr found (this should not happen)";
173 LOG(UtilLib::logINFO) << message.str().c_str();
175 assert(K==0 || K==1);
176 assert(this->connections_[K] !=
nullptr);
177 return this->connections_[K];
200 void perturbatePosition();
205 const unsigned int id_;
211 16> neighbourPhysicalNodes_;
217 std::array<std::shared_ptr<LbmLib::geometry::Connection>,
225 #endif // POLYGONPOINT_HPP
void setConnection(const std::shared_ptr< LbmLib::geometry::Connection > newconnection)
setter for the Kth Connection
void addPhysicalNode(PhysicalNode *const physicalNode, unsigned int pos)
addPhysicalNode Adds a physical node at a certain position
virtual std::string getType() const
getType The type of a node class
void setForce(Field< double > f)
set the force of this node
unsigned int getDomainIdOfAdjacentConnections(void) const
get the domainID of the (max two) adjacent *Connection*s
class representing a geometry node
double getYPos() const
getYPos Getter for the Y position
class representing a physical node
void collectVelocity()
collectVelocity collects the velocities from the fluid nodes to the geometry Nodes ...
void distributeForce()
distributes the Force to the fluid nodes
bool isUpdateNeeded() const
isUpdateNeeded Calculates if the connections of this points need to be updates
void move()
movePoint Moves the geomety node exactly one timestep
double getXPos() const
getXPos Getter for the X position
const std::shared_ptr< LbmLib::geometry::Connection > getConnection() const
getter for the Kth Connection
unsigned int getId() const
getter for the node id
virtual void setPos(double x, double y)
setPos Set the position new override to make sure that perturbation occures
~GeometryNode()
~GeometryNode Destructor
void writeNode(std::ostream *stream)
writes the node to the stream
GeometryNode(double x, double y, unsigned int id)
GeometryNode constructs a Geometry node.
void addForce(Field< double > f)
adds the force to the force of this node
The LagrangianPoint class A class for storing a point's coordinates and its velocity This class is th...