MercuryDPM
Alpha
|
#include <AngledPeriodicBoundary.h>
Public Member Functions | |
AngledPeriodicBoundary * | copy () const final |
Used to create a copy of the object NB: purely virtual function. More... | |
void | set (Vec3D normalLeft, Vec3D normalRight, Vec3D origin) |
Defines a periodic wall. More... | |
Mdouble | distance (const BaseParticle &P) |
Returns the distance of the wall to the particle and sets left_wall = true, if the left wall is the wall closest to the particle. More... | |
Mdouble | distance (const Vec3D &P) |
void | shiftPosition (BaseParticle *P) |
shifts the particle (after distance set the left_wall value) More... | |
void | shiftPositions (Vec3D &P1, Vec3D &P2) |
only needed in StatisticsVector More... | |
void | read (std::istream &is) |
reads wall More... | |
void | oldRead (std::istream &is) |
void | write (std::ostream &os) const |
outputs wall More... | |
virtual std::string | getName () const |
Returns the name of the object. More... | |
Vec3D & | getNormal () |
Mdouble | getOpeningAngle () |
angle between walls in radians More... | |
void | createPeriodicParticles (BaseParticle *P, ParticleHandler &pH) |
bool | checkBoundaryAfterParticleMoved (BaseParticle *P, ParticleHandler &pH UNUSED) |
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 | |
Vec3D | leftNormal_ |
Vec3D | rightNormal_ |
outward unit normal vector for right wall More... | |
Vec3D | origin_ |
common point of both walls More... | |
bool | leftWall_ |
true if closest wall is the left wall More... | |
Vec3D | leftRadialAxis_ |
outward unit normal vector for left wall More... | |
Vec3D | rightRadialAxis_ |
outward unit normal vector for right wall More... | |
Vec3D | differenceRadialAxis_ |
Vec3D | differenceNormal_ |
Matrix3D | rotateLeft |
Matrix3D | rotateRight |
Vec3D | commonAxis_ |
The normalized cross product of the left and right normal vector. This vector points in the direction around which the particle is rotated when it is moved from one boundary to the other. This is an internal variable set in the constructor, thus cannot be changed directly by the user. More... | |
Definition at line 45 of file AngledPeriodicBoundary.h.
bool AngledPeriodicBoundary::checkBoundaryAfterParticleMoved | ( | BaseParticle * | P, |
ParticleHandler &pH | UNUSED | ||
) |
Definition at line 297 of file AngledPeriodicBoundary.cc.
References distance(), and shiftPosition().
|
finalvirtual |
Used to create a copy of the object NB: purely virtual function.
Implements BaseBoundary.
Definition at line 34 of file AngledPeriodicBoundary.cc.
void AngledPeriodicBoundary::createPeriodicParticles | ( | BaseParticle * | P, |
ParticleHandler & | pH | ||
) |
Definition at line 263 of file AngledPeriodicBoundary.cc.
References ParticleHandler::addObject(), BaseParticle::copy(), BaseInteractable::copyInteractionsForPeriodicParticles(), distance(), BaseParticle::getInteractionRadius(), ParticleHandler::getLargestParticle(), BaseParticle::getPeriodicFromParticle(), BaseParticle::setPeriodicFromParticle(), and shiftPosition().
Mdouble AngledPeriodicBoundary::distance | ( | const BaseParticle & | P | ) |
Returns the distance of the wall to the particle and sets left_wall = true, if the left wall is the wall closest to the particle.
Since this function should be called before calculating any Particle-Wall interactions, it can also be used to set the shift vector in case of curved walls.
Definition at line 84 of file AngledPeriodicBoundary.cc.
References BaseInteractable::getPosition().
Referenced by checkBoundaryAfterParticleMoved(), and createPeriodicParticles().
Definition at line 92 of file AngledPeriodicBoundary.cc.
References Vec3D::dot(), leftNormal_, leftWall_, origin_, and rightNormal_.
|
virtual |
Returns the name of the object.
Implements BaseObject.
Definition at line 236 of file AngledPeriodicBoundary.cc.
Vec3D & AngledPeriodicBoundary::getNormal | ( | ) |
Definition at line 244 of file AngledPeriodicBoundary.cc.
References leftNormal_, leftWall_, and rightNormal_.
Mdouble AngledPeriodicBoundary::getOpeningAngle | ( | ) |
angle between walls in radians
Definition at line 255 of file AngledPeriodicBoundary.cc.
References Vec3D::dot(), leftNormal_, and rightNormal_.
void AngledPeriodicBoundary::oldRead | ( | std::istream & | is | ) |
Definition at line 215 of file AngledPeriodicBoundary.cc.
References leftNormal_, origin_, rightNormal_, and set().
|
virtual |
reads wall
Implements BaseBoundary.
Definition at line 204 of file AngledPeriodicBoundary.cc.
References leftNormal_, origin_, BaseBoundary::read(), rightNormal_, and set().
Defines a periodic wall.
given a normal vector s.t. all particles are within {x: position_left<=normal*x<position_right}. The shift vector is set assuming that the domain is rectangular (shift parallel to normal).
[in] | normalLeft | |
[in] | normalRight | |
[in] | origin |
Definition at line 50 of file AngledPeriodicBoundary.cc.
References commonAxis_, Vec3D::cross(), differenceNormal_, differenceRadialAxis_, Vec3D::dot(), Vec3D::getLength(), leftNormal_, leftRadialAxis_, origin_, rightNormal_, rightRadialAxis_, rotateLeft, rotateRight, Vec3D::X, Vec3D::Y, and Vec3D::Z.
Referenced by oldRead(), and read().
void AngledPeriodicBoundary::shiftPosition | ( | BaseParticle * | P | ) |
shifts the particle (after distance set the left_wall value)
Definition at line 115 of file AngledPeriodicBoundary.cc.
References BaseParticle::accelerate(), BaseParticle::angularAccelerate(), differenceNormal_, differenceRadialAxis_, Vec3D::dot(), BaseInteractable::getAngularVelocity(), BaseObject::getIndex(), BaseInteractable::getInteractions(), BaseInteractable::getOrientation(), BaseInteractable::getPosition(), BaseInteractable::getVelocity(), leftNormal_, leftRadialAxis_, leftWall_, BaseInteractable::move(), origin_, rightNormal_, rightRadialAxis_, BaseInteractable::rotate(), rotateLeft, and rotateRight.
Referenced by checkBoundaryAfterParticleMoved(), and createPeriodicParticles().
only needed in StatisticsVector
Definition at line 172 of file AngledPeriodicBoundary.cc.
References differenceNormal_, differenceRadialAxis_, Vec3D::dot(), leftNormal_, leftRadialAxis_, leftWall_, origin_, rightNormal_, and rightRadialAxis_.
|
virtual |
outputs wall
Implements BaseBoundary.
Definition at line 225 of file AngledPeriodicBoundary.cc.
References leftNormal_, origin_, rightNormal_, and BaseBoundary::write().
|
private |
The normalized cross product of the left and right normal vector. This vector points in the direction around which the particle is rotated when it is moved from one boundary to the other. This is an internal variable set in the constructor, thus cannot be changed directly by the user.
Definition at line 179 of file AngledPeriodicBoundary.h.
Referenced by set().
|
private |
Definition at line 166 of file AngledPeriodicBoundary.h.
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
Definition at line 162 of file AngledPeriodicBoundary.h.
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
outward unit normal vector for left wall
Definition at line 135 of file AngledPeriodicBoundary.h.
Referenced by distance(), getNormal(), getOpeningAngle(), oldRead(), read(), set(), shiftPosition(), shiftPositions(), and write().
|
private |
outward unit normal vector for left wall
Definition at line 154 of file AngledPeriodicBoundary.h.
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
true if closest wall is the left wall
Definition at line 150 of file AngledPeriodicBoundary.h.
Referenced by distance(), getNormal(), shiftPosition(), and shiftPositions().
|
private |
common point of both walls
Definition at line 145 of file AngledPeriodicBoundary.h.
Referenced by distance(), oldRead(), read(), set(), shiftPosition(), shiftPositions(), and write().
|
private |
outward unit normal vector for right wall
Definition at line 140 of file AngledPeriodicBoundary.h.
Referenced by distance(), getNormal(), getOpeningAngle(), oldRead(), read(), set(), shiftPosition(), shiftPositions(), and write().
|
private |
outward unit normal vector for right wall
Definition at line 158 of file AngledPeriodicBoundary.h.
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
Definition at line 168 of file AngledPeriodicBoundary.h.
Referenced by set(), and shiftPosition().
|
private |
Definition at line 170 of file AngledPeriodicBoundary.h.
Referenced by set(), and shiftPosition().