41 #ifdef DEBUG_CONSTRUCTOR
42 std::cout<<
"PeriodicBoundary::PeriodicBoundary() finished"<<std::endl;
51 #ifdef DEBUG_DESTRUCTOR
52 std::cout<<
"PeriodicBoundary::~PeriodicBoundary() finished"<<std::endl;
304 return "PeriodicBoundary";
BaseParticle * getLargestParticle() const
Gets a pointer to the largest BaseParticle (by interactionRadius) in this ParticleHandler.
Mdouble getDistance(BaseParticle &p)
Returns the distance of the wall to the particle.
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a periodic wall.
bool closestToLeftBoundary_
true if closest wall is the left wall
void shiftPosition(BaseParticle *p)
shifts the particle
MERCURY_DEPRECATED void oldRead(std::istream &is)
deprecated version of CubeInsertionBoundary::read().
void write(std::ostream &os) const =0
Adds object's id_ to given ostream NB: purely virtual function.
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 setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of.
void moveRight(Mdouble distanceRight)
Sets the distance from the origin of the 'right' periodic wall.
void write(std::ostream &os) const
writes boundary properties to ostream
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Mdouble distanceRight_
position of right wall, s.t. normal*x=position_right
PeriodicBoundary()
default constructor
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Vec3D normal_
outward unit normal vector for right wall
~PeriodicBoundary()
destructor
Defines a pair of periodic walls. Inherits from BaseBoundary.
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
bool checkBoundaryAfterParticleMoved(BaseParticle *p, ParticleHandler &pH UNUSED)
Checks if particle has crossed either boundary wall, and applies a shift if that is the case...
void read(std::istream &is)
reads boundary properties from istream
void moveLeft(Mdouble distanceLeft)
Sets the distance from the origin of the 'left' periodic wall.
virtual void addObject(BaseParticle *P)
Adds a BaseParticle to the ParticleHandler.
bool isClosestToLeftBoundary() const
Returns TRUE if last particle/position checked is closest to the 'left' wall, and FALSE if it is clos...
Mdouble distanceLeft_
position of left wall, s.t. normal*x=position_left
void copyInteractionsForPeriodicParticles(const BaseInteractable &p)
Copies interactions to this BaseInteractable whenever a periodic copy made.
Container to store all BaseParticle.
Vec3D shift_
shift from left to right boundary
void shiftPositions(Vec3D &postition1, Vec3D &postion2)
shifts two positions
PeriodicBoundary * copy() const
copy method
Implementation of a 3D vector (by Vitaliy).
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
Mdouble getInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e.g., when dealing with wet particles)
virtual std::string getName() const
Returns the name of the object.
virtual BaseParticle * copy() const
Particle copy method. It calls to copy constructor of this Particle, useful for polymorfism.
void read(std::istream &is)=0
Reads the object's id_ from given istream NB: purely virtual function.