|
#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) override |
reads wall More... | |
void | oldRead (std::istream &is) |
void | write (std::ostream &os) const override |
outputs wall More... | |
std::string | getName () const override |
Returns the name of the object. More... | |
Vec3D & | getNormal () |
Mdouble | getOpeningAngle () |
angle between walls in radians More... | |
void | createPeriodicParticle (BaseParticle *p, ParticleHandler &pH) override |
void | createPeriodicParticles (ParticleHandler &pH) override |
void | checkBoundaryAfterParticleMoved (BaseParticle *P) |
void | checkBoundaryAfterParticlesMove (ParticleHandler &pH) override |
Virtual function that does things to particles, each time step after particles have moved. More... | |
Public Member Functions inherited from BaseBoundary | |
BaseBoundary () | |
default constructor. More... | |
BaseBoundary (const BaseBoundary &b) | |
copy constructor More... | |
~BaseBoundary () override | |
destructor More... | |
virtual void | createPeriodicParticle (BaseParticle *p UNUSED, ParticleHandler &pH UNUSED) |
Creates a periodic particle in case of periodic boundaries in serial build. More... | |
virtual void | createPeriodicParticles (ParticleHandler &pH UNUSED) |
Creates periodic copies of given particle in case of periodic boundaries. More... | |
virtual void | checkBoundaryBeforeTimeStep (DPMBase *md) |
Virtual function that does things before each time step. More... | |
virtual void | actionsBeforeTimeLoop () |
Virtual function that does something after DPMBase::setupInitialConditions but before the first time step. More... | |
virtual void | modifyGhostAfterCreation (BaseParticle *particle, int i) |
virtual void | writeVTK (std::fstream &file) |
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 | |
Default constructor. More... | |
BaseObject (const BaseObject &p)=default | |
Copy constructor, copies all the objects BaseObject contains. More... | |
virtual | ~BaseObject ()=default |
virtual destructor More... | |
virtual void | moveInHandler (unsigned int index) |
Except that it is virtual, it does the same thing as setIndex() does. More... | |
void | setIndex (unsigned int index) |
Allows one to assign an index to an object in the handler/container. More... | |
void | setId (unsigned long 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... | |
void | setGroupId (unsigned groupId) |
unsigned | getGroupId () const |
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... | |
void AngledPeriodicBoundary::checkBoundaryAfterParticleMoved | ( | BaseParticle * | P | ) |
References distance(), Global_Physical_Variables::P, and shiftPosition().
Referenced by checkBoundaryAfterParticlesMove().
|
overridevirtual |
Virtual function that does things to particles, each time step after particles have moved.
checks whether given particle passed the boundary, and if so, does something special with it. This is called after the particles moved, but before the force-computation. NB: virtual function
[in] | P | Particle checked |
[out] | pH | the particle handler. |
Reimplemented from BaseBoundary.
References BaseHandler< T >::begin(), checkBoundaryAfterParticleMoved(), and BaseHandler< T >::end().
|
finalvirtual |
Used to create a copy of the object NB: purely virtual function.
Implements BaseBoundary.
References MPIContainer::getNumberOfProcessors(), MPIContainer::Instance(), logger, and WARN.
|
override |
References ParticleHandler::addObject(), BaseParticle::copy(), BaseInteractable::copyInteractionsForPeriodicParticles(), distance(), ParticleHandler::getLargestParticle(), BaseParticle::getMaxInteractionRadius(), BaseParticle::getPeriodicFromParticle(), BaseParticle::setPeriodicFromParticle(), and shiftPosition().
Referenced by createPeriodicParticles().
|
override |
References createPeriodicParticle(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), and constants::i.
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.
References Global_Physical_Variables::P.
Referenced by checkBoundaryAfterParticleMoved(), and createPeriodicParticle().
References Vec3D::dot(), leftNormal_, leftWall_, origin_, Global_Physical_Variables::P, and rightNormal_.
|
overridevirtual |
Returns the name of the object.
Implements BaseObject.
Vec3D & AngledPeriodicBoundary::getNormal | ( | ) |
References leftNormal_, leftWall_, and rightNormal_.
Mdouble AngledPeriodicBoundary::getOpeningAngle | ( | ) |
angle between walls in radians
References Vec3D::dot(), leftNormal_, and rightNormal_.
void AngledPeriodicBoundary::oldRead | ( | std::istream & | is | ) |
References leftNormal_, origin_, rightNormal_, and set().
|
overridevirtual |
reads wall
Implements BaseBoundary.
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 |
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 AngledPeriodicBoundarySecondUnitTest::AngledPeriodicBoundarySecondUnitTest(), AngledPeriodicBoundaryUnitTest::AngledPeriodicBoundaryUnitTest(), oldRead(), read(), and FullRestartTest::setupInitialConditions().
void AngledPeriodicBoundary::shiftPosition | ( | BaseParticle * | P | ) |
shifts the particle (after distance set the left_wall value)
References differenceNormal_, differenceRadialAxis_, Vec3D::dot(), constants::i, leftNormal_, leftRadialAxis_, leftWall_, origin_, Global_Physical_Variables::P, rightNormal_, rightRadialAxis_, rotateLeft, and rotateRight.
Referenced by checkBoundaryAfterParticleMoved(), and createPeriodicParticle().
only needed in StatisticsVector
References differenceNormal_, differenceRadialAxis_, Vec3D::dot(), leftNormal_, leftRadialAxis_, leftWall_, origin_, rightNormal_, and rightRadialAxis_.
|
overridevirtual |
outputs wall
Implements BaseBoundary.
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.
Referenced by set().
|
private |
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
outward unit normal vector for left wall
Referenced by distance(), getNormal(), getOpeningAngle(), oldRead(), read(), set(), shiftPosition(), shiftPositions(), and write().
|
private |
outward unit normal vector for left wall
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
true if closest wall is the left wall
Referenced by distance(), getNormal(), shiftPosition(), and shiftPositions().
|
private |
common point of both walls
Referenced by distance(), oldRead(), read(), set(), shiftPosition(), shiftPositions(), and write().
|
private |
outward unit normal vector for right wall
Referenced by distance(), getNormal(), getOpeningAngle(), oldRead(), read(), set(), shiftPosition(), shiftPositions(), and write().
|
private |
outward unit normal vector for right wall
Referenced by set(), shiftPosition(), and shiftPositions().
|
private |
Referenced by set(), and shiftPosition().
|
private |
Referenced by set(), and shiftPosition().