26 #ifndef PeriodicBoundary_H
27 #define PeriodicBoundary_H
143 void read(std::istream& is)
override;
149 void oldRead(std::istream& is);
154 void write(std::ostream& os)
const override;
159 virtual std::string
getName()
const override;
Mdouble getDistanceLeft() const
Returns the distance of the left wall to the origin, in normal direction.
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a periodic wall.
virtual std::string getName() const override
Returns the name of the object.
MERCURY_DEPRECATED void oldRead(std::istream &is)
deprecated version of CubeInsertionBoundary::read().
Mdouble scaleFactor_
This is the normal to rescale the normal vector to a unit vectors.
void createPeriodicParticles(BaseParticle *p, ParticleHandler &pH)
Checks distance of particle to closest wall and creates periodic copy if necessary.
void moveRight(Mdouble distanceRight)
Sets the distance from the origin of the 'right' periodic wall.
Mdouble getDistanceRight() const
Returns the distance of the right wall to the origin, in normal direction.
Mdouble distanceRight_
position of right wall, s.t. normal*x=position_right
Vec3D getNormal() const
returns the vector normal to the periodic boundary
PeriodicBoundary * copy() const override
copy method
PeriodicBoundary()
default constructor
Vec3D getShift() const
Returns the vector going from the left to the right side of the periodic boundary.
Vec3D normal_
outward unit normal vector for right wall
#define MERCURY_DEPRECATED
~PeriodicBoundary()
destructor
Defines a pair of periodic walls. Inherits from BaseBoundary.
bool checkBoundaryAfterParticleMoved(BaseParticle *p, ParticleHandler &pH UNUSED)
Checks if particle has crossed either boundary wall, and applies a shift if that is the case...
Mdouble getDistance(const BaseParticle &p) const
Returns the distance of the wall to the particle.
void moveLeft(Mdouble distanceLeft)
Sets the distance from the origin of the 'left' periodic wall.
bool isClosestToLeftBoundary(const BaseParticle &p) const
Returns TRUE if last particle/position checked is closest to the 'left' wall, and FALSE if it is clos...
void shiftPosition(BaseParticle *p) const
shifts the particle
Mdouble distanceLeft_
position of left wall, s.t. normal*x=position_left
Container to store all BaseParticle.
Vec3D shift_
shift from left to right boundary
Implementation of a 3D vector (by Vitaliy).
void write(std::ostream &os) const override
writes boundary properties to ostream
void read(std::istream &is) override
reads boundary properties from istream
void shiftPositions(Vec3D &postition1, Vec3D &postion2) const
shifts two positions