35 factor_=std::numeric_limits<double>::quiet_NaN();
36 position_=std::numeric_limits<double>::quiet_NaN();
37 holeRadius_=std::numeric_limits<double>::quiet_NaN();
38 #ifdef DEBUG_CONSTRUCTOR
39 std::cout<<
"InfiniteWall () finished"<<std::endl;
46 set(normal, position, holeRadius);
47 #ifdef DEBUG_CONSTRUCTOR
48 std::cout<<
"InfiniteWallWithHole(Vec3D normal, Mdouble position, Mdouble holeRadius) finished"<<std::endl;
59 #ifdef DEBUG_CONSTRUCTOR
60 std::cout<<
"InfiniteWall (const InfiniteWall &p) finished"<<std::endl;
114 return holeRadius_ - sqrt(pow(position.
X, 2) + pow(position.
Y, 2));
128 if (wallDistance > 0 && holeDistance > 0)
130 distance = sqrt(pow(wallDistance, 2) + pow(holeDistance, 2));
138 normal_return /= normal_return.
getLength();
142 else if (wallDistance > holeDistance)
144 distance = wallDistance;
151 distance = holeDistance;
191 return "InfiniteWallWithHole";
void write(std::ostream &os) const
outputs wall
void read(std::istream &is)
reads wall
Mdouble X
the vector components
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
bool getDistanceAndNormal(const BaseParticle &P, Mdouble &distance, Vec3D &normal_return) const
Since this function should be called before calculating any Particle-Wall interactions, it can also be used to set the normal vector in case of curved walls.
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
void oldRead(std::istream &is)
reads wall
Vec3D normal_
Outward normal vector, does not have to be a unit vector.
virtual std::string getName() const
Returns the name of the object.
InfiniteWallWithHole()
default constructor
void clear()
A function that removes all data from this BaseWall, so sets handler_ to nullptr. ...
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
void set(Vec3D normal, Mdouble position, Mdouble holeRadius)
Defines a standard wall, given an outward normal vector s. t. normal*x=position.
Mdouble getHoleDistance(const Vec3D &position) const
InfiniteWallWithHole * copy() const
Wall copy method. It calls the copy contrustor of this Wall, usefull for polymorfism.
Mdouble position_
position n*x=p
Mdouble getRadius() const
Returns the particle's radius_.
Vec3D getNormal()
access function for normal
Mdouble getPosition()
access function for position
void move_time(Mdouble dt)
Allows the wall to be moved to a new position (also orthogonal to the normal), and setting the veloci...
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Implementation of a 3D vector (by Vitaliy).
void moveTo(Mdouble position)
Allows the wall to be moved to a new position.
void write(std::ostream &os) const
Function that writes a BaseWall to an output stream, usually a restart file.
Mdouble getWallDistance(const Vec3D &position) const
Returns the distance of the wall to the particle.
void read(std::istream &is)
Function that reads a BaseWall from an input stream, usually a restart file.