MercuryDPM
Alpha
|
Class which creates a boundary with Lees-Edwards type periodic boundary conditions. More...
#include <ShearBoxBoundary.h>
Public Member Functions | |
void | set (std::function< double(double, double)> velocity, Mdouble left, Mdouble right, Mdouble down, Mdouble up) |
Sets all boundary properties. More... | |
void | read (std::istream &is) |
Reads all boundary properties from a stream. More... | |
void | write (std::ostream &os) const |
Writes all boundary properties to a stream. More... | |
virtual std::string | getName () const |
Returns the name of the object. More... | |
ShearBoxBoundary * | copy () const |
Creates a copy of the object. More... | |
Mdouble | getHorizontalDistance (BaseParticle &p, bool &positive) |
Returns distance from given particle to the closest horizontal wall. More... | |
Mdouble | getVerticalDistance (BaseParticle &p, bool &positive) |
Returns distance from given particle to the closest vertical wall. More... | |
void | shiftHorizontalPosition (BaseParticle *p, bool positive) |
Applies a horizontal shift to the given particle. More... | |
void | shiftVerticalPosition (BaseParticle *p, bool positive) |
Applies a vertical shift to the given particle. More... | |
bool | checkBoundaryAfterParticleMoved (BaseParticle *p, ParticleHandler &pH UNUSED) |
Checks if particle crossed a boundary wall and if so, applies periodic shift. More... | |
void | createPeriodicParticles (BaseParticle *p, ParticleHandler &pH) |
Creates horizontal and vertical periodic copies of given particle, if needed. More... | |
void | createHorizontalPeriodicParticles (BaseParticle *p, ParticleHandler &pH) |
Creates horizontal periodic copies of given particle, if needed. More... | |
void | createVerticalPeriodicParticles (BaseParticle *p, ParticleHandler &pH) |
Creates vertical periodic copies of given particle, if needed. More... | |
void | setVelocity (std::function< double(double, double)>) |
Public Member Functions inherited from BaseBoundary | |
BaseBoundary () | |
default constructor. More... | |
BaseBoundary (const BaseBoundary &b) | |
copy constructor More... | |
virtual | ~BaseBoundary () |
destructor More... | |
virtual void | createPeriodicParticles (BaseParticle *P UNUSED, ParticleHandler &pH UNUSED) |
Creates periodic copies of given particle in case of periodic boundaries. More... | |
virtual bool | checkBoundaryAfterParticleMoved (BaseParticle *P UNUSED, ParticleHandler &pH UNUSED) |
Checks if given particle passed the boundary. More... | |
virtual void | checkBoundaryBeforeTimeStep (DPMBase *md UNUSED) |
Fills a (3D) boundary with particles. More... | |
void | setHandler (BoundaryHandler *handler) |
Sets the boundary's BoundaryHandler. More... | |
BoundaryHandler * | getHandler () const |
Returns the boundary's BoundaryHandler. More... | |
Public Member Functions inherited from BaseObject | |
BaseObject () | |
Default constructor. More... | |
BaseObject (const BaseObject &p) | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject () |
virtual destructor More... | |
virtual void | moveInHandler (const unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (const unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (const unsigned int id) |
Assigns a unique identifier to each object in the handler (container) which remains constant even after the object is deleted from the container/handler. More... | |
unsigned int | getIndex () const |
Returns the index of the object in the handler. More... | |
unsigned int | getId () const |
Returns the unique identifier of any particular object. More... | |
Private Attributes | |
Mdouble | left_ |
Mdouble | right_ |
(signed) Horizontal distance between the left wall and the origin More... | |
Mdouble | down_ |
(signed) Horizontal distance between the right wall and the origin More... | |
Mdouble | up_ |
(signed) Vertical distance between the bottom wall and the origin More... | |
std::function< double(double, double)> | velocity_ |
(signed) Vertical distance between the top wall and the origin More... | |
Class which creates a boundary with Lees-Edwards type periodic boundary conditions.
See also [insert link to the original paper by LE]. Inherits from BaseBoundary.
Add link to paper by Lees-Edwards in the documentation of this class.
Is implemented for 2D only now. Needs extension to 3D.
Definition at line 42 of file ShearBoxBoundary.h.
bool ShearBoxBoundary::checkBoundaryAfterParticleMoved | ( | BaseParticle * | p, |
ParticleHandler &pH | UNUSED | ||
) |
Checks if particle crossed a boundary wall and if so, applies periodic shift.
Checks if the particle has to be shifted into the main domain (i.e., if the particle has crossed any of the boundary walls) and if so performs the shift
[in] | p | A pointer to the BaseParticle that is checked |
Definition at line 259 of file ShearBoxBoundary.cc.
References getHorizontalDistance(), getVerticalDistance(), shiftHorizontalPosition(), and shiftVerticalPosition().
|
virtual |
Creates a copy of the object.
Copy method; creates a copy on the heap and returns its pointer.
Implements BaseBoundary.
Definition at line 82 of file ShearBoxBoundary.cc.
void ShearBoxBoundary::createHorizontalPeriodicParticles | ( | BaseParticle * | p, |
ParticleHandler & | pH | ||
) |
Creates horizontal periodic copies of given particle, if needed.
Check if periodic copies of the particle in horizontal direction have to be made (i.e., if the distance of the particle to either of the horizontal boundary walls is smaller than its radius plus the radius of the largest particle in the system), and if so makes them
[in] | p | A pointer to the BaseParticle that is checked |
[out] | pH | A reference to the ParticleHandler where periodic copies will be added |
Definition at line 177 of file ShearBoxBoundary.cc.
References ParticleHandler::addObject(), BaseParticle::copy(), BaseInteractable::copyInteractionsForPeriodicParticles(), getHorizontalDistance(), BaseParticle::getInteractionRadius(), ParticleHandler::getLargestParticle(), BaseParticle::getPeriodicFromParticle(), BaseParticle::setPeriodicFromParticle(), and shiftHorizontalPosition().
Referenced by createPeriodicParticles(), and createVerticalPeriodicParticles().
void ShearBoxBoundary::createPeriodicParticles | ( | BaseParticle * | p, |
ParticleHandler & | pH | ||
) |
Creates horizontal and vertical periodic copies of given particle, if needed.
Check if periodic copies of the particle have to be made for the contact detection and if so makes them
[in] | p | A pointer to the BaseParticle that is checked |
[out] | pH | A reference to the ParticleHandler where periodic copies will be added |
Definition at line 248 of file ShearBoxBoundary.cc.
References createHorizontalPeriodicParticles(), and createVerticalPeriodicParticles().
void ShearBoxBoundary::createVerticalPeriodicParticles | ( | BaseParticle * | p, |
ParticleHandler & | pH | ||
) |
Creates vertical periodic copies of given particle, if needed.
Check if periodic copies of the particle in vertical direction have to be made (i.e., if the distance of the particle to either of the vertical boundary walls is smaller than its radius plus the radius of the largest particle in the system), and if so makes them
[in] | p | A pointer to the BaseParticle that is checked |
[out] | pH | A reference to the ParticleHandler where periodic copies will be added |
Definition at line 212 of file ShearBoxBoundary.cc.
References ParticleHandler::addObject(), BaseParticle::copy(), BaseInteractable::copyInteractionsForPeriodicParticles(), createHorizontalPeriodicParticles(), getHorizontalDistance(), BaseParticle::getInteractionRadius(), ParticleHandler::getLargestParticle(), BaseHandler< T >::getLastObject(), BaseParticle::getPeriodicFromParticle(), getVerticalDistance(), BaseParticle::setPeriodicFromParticle(), shiftHorizontalPosition(), and shiftVerticalPosition().
Referenced by createPeriodicParticles().
Mdouble ShearBoxBoundary::getHorizontalDistance | ( | BaseParticle & | p, |
bool & | positive | ||
) |
Returns distance from given particle to the closest horizontal wall.
Returns the distance between BaseParticle p and the closest boundary wall in horizontal direction
[in] | p | A reference to the BaseParticle |
[out] | positive | A boolean which is true when the left wall is closest |
Definition at line 93 of file ShearBoxBoundary.cc.
References BaseInteractable::getPosition(), left_, right_, and Vec3D::X.
Referenced by checkBoundaryAfterParticleMoved(), createHorizontalPeriodicParticles(), and createVerticalPeriodicParticles().
|
virtual |
Returns the name of the object.
Implements BaseObject.
Definition at line 73 of file ShearBoxBoundary.cc.
Mdouble ShearBoxBoundary::getVerticalDistance | ( | BaseParticle & | p, |
bool & | positive | ||
) |
Returns distance from given particle to the closest vertical wall.
Returns the distance between BaseParticle p and the closest wall in vertical direction
[in] | p | A reference to the BaseParticle |
[out] | positive | A boolean which is true when the bottom wall is closest |
Definition at line 114 of file ShearBoxBoundary.cc.
References down_, BaseInteractable::getPosition(), up_, and Vec3D::Y.
Referenced by checkBoundaryAfterParticleMoved(), and createVerticalPeriodicParticles().
|
virtual |
Reads all boundary properties from a stream.
Reads all the properties of the ShearBoxBoundary from an std::istream
[in,out] | is | The stream from which the parameters are read |
Implements BaseBoundary.
Definition at line 52 of file ShearBoxBoundary.cc.
References down_, left_, BaseBoundary::read(), right_, UNUSED, up_, and velocity_.
void ShearBoxBoundary::set | ( | std::function< double(double, double)> | velocity, |
Mdouble | left, | ||
Mdouble | right, | ||
Mdouble | down, | ||
Mdouble | up | ||
) |
Sets all boundary properties.
Allows the user to set all the properties of the ShearBoxBoundary at once.
[in] | velocity | The difference in velocities at which the bottom and to wall move |
[in] | left | The (signed) distance between the origin and the left wall |
[in] | right | The (signed) distance between the origin and the right wall |
[in] | down | The (signed) distance between the origin and the top wall |
[in] | up | The (signed) distance between the origin and the bottom wall |
Definition at line 39 of file ShearBoxBoundary.cc.
References down_, left_, right_, up_, and velocity_.
void ShearBoxBoundary::setVelocity | ( | std::function< double(double, double)> | velocity | ) |
Definition at line 273 of file ShearBoxBoundary.cc.
References velocity_.
void ShearBoxBoundary::shiftHorizontalPosition | ( | BaseParticle * | p, |
bool | positive | ||
) |
Applies a horizontal shift to the given particle.
Shifts the BaseParticle p in horizontal direction to its 'periodic' position, i.e. over the horizontal length of the boundary.
[in] | p | A reference to the BaseParticle that has to be shifted |
[in] | positive | A boolean which determines the direction of the shift NB: TRUE if particle is closest to the left boundary wall |
Definition at line 136 of file ShearBoxBoundary.cc.
References BaseInteractable::addVelocity(), BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), BaseInteractable::getPosition(), DPMBase::getTime(), left_, BaseInteractable::move(), right_, velocity_, and Vec3D::Z.
Referenced by checkBoundaryAfterParticleMoved(), createHorizontalPeriodicParticles(), and createVerticalPeriodicParticles().
void ShearBoxBoundary::shiftVerticalPosition | ( | BaseParticle * | p, |
bool | positive | ||
) |
Applies a vertical shift to the given particle.
Shifts the BaseParticle p in vertical direction to its 'periodic' position, i.e. over the vertical length of the boundary.
[in] | p | A reference to the BaseParticle that has to be shifted |
[in] | positive | A boolean which determines the direction of the shift NB: TRUE if particle is closest to the bottom boundary wall |
Definition at line 158 of file ShearBoxBoundary.cc.
References down_, BaseInteractable::move(), and up_.
Referenced by checkBoundaryAfterParticleMoved(), and createVerticalPeriodicParticles().
|
virtual |
Writes all boundary properties to a stream.
Writes all the properties of the ShearBoxBoundary to an std::ostream
[out] | os | The stream to which the parameters are written |
Implements BaseBoundary.
Definition at line 64 of file ShearBoxBoundary.cc.
References down_, left_, right_, up_, and BaseBoundary::write().
|
private |
(signed) Horizontal distance between the right wall and the origin
Definition at line 116 of file ShearBoxBoundary.h.
Referenced by getVerticalDistance(), read(), set(), shiftVerticalPosition(), and write().
|
private |
Definition at line 114 of file ShearBoxBoundary.h.
Referenced by getHorizontalDistance(), read(), set(), shiftHorizontalPosition(), and write().
|
private |
(signed) Horizontal distance between the left wall and the origin
Definition at line 115 of file ShearBoxBoundary.h.
Referenced by getHorizontalDistance(), read(), set(), shiftHorizontalPosition(), and write().
|
private |
(signed) Vertical distance between the bottom wall and the origin
Definition at line 117 of file ShearBoxBoundary.h.
Referenced by getVerticalDistance(), read(), set(), shiftVerticalPosition(), and write().
|
private |
(signed) Vertical distance between the top wall and the origin
Definition at line 118 of file ShearBoxBoundary.h.
Referenced by read(), set(), setVelocity(), and shiftHorizontalPosition().