|
#include <BasePeriodicBoundary.h>
Public Member Functions | |
BasePeriodicBoundary () | |
default constructor. More... | |
BasePeriodicBoundary (const BasePeriodicBoundary &b) | |
copy constructor More... | |
~BasePeriodicBoundary () override | |
destructor More... | |
void | read (std::istream &is) override |
Reads the object's id_ from given istream. More... | |
void | write (std::ostream &os) const override |
Adds object's id_ to given ostream. More... | |
BasePeriodicBoundary * | copy () const override=0 |
Used to create a copy of the object NB: purely virtual function. More... | |
void | setPeriodicHandler (PeriodicBoundaryHandler *periodicHandler) |
Sets the periodicBoundaryHandler, required for parallel periodic boundaries. More... | |
PeriodicBoundaryHandler * | getPeriodicHandler () const |
Returns the periodic boundary handler. More... | |
virtual Mdouble | getDistance (const BaseParticle &particle) const =0 |
Returns the distance between a particle and the closest boundary, required for any periodic boundary. More... | |
virtual Mdouble | getDistance (const Vec3D &position) const =0 |
Returns the distance between a position and the closest boundary. More... | |
virtual bool | isClosestToLeftBoundary (const Vec3D &position) const =0 |
Returns true if it is closer to the left boundary than the right boundary. More... | |
virtual void | shiftPosition (BaseParticle *particle) const =0 |
Shifts the position (and velocity) of to the ghost particle. More... | |
void | createPeriodicParticles (ParticleHandler &pH) override |
Creates periodic ocpies of given particle in case of periodic boundaries in serial build. More... | |
void | checkBoundaryAfterParticlesMove (ParticleHandler &pH) override |
Virtual function that does things to particles, each time step after particles have moved. More... | |
virtual void | modifyPeriodicComplexity (std::vector< int > &complexity, int &totalPeriodicComplexity, BaseParticle *particle, int i) const |
Modifies periodic complexity of a particle if necessary (i.e. maser boundary) More... | |
virtual void | performActionsBeforeAddingParticles () |
Actions that need to be performed before adding new ghost particles. 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 std::string | getName () const =0 |
A purely virtual function. 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 | |
PeriodicBoundaryHandler * | periodicHandler_ |
pointer to the periodic boundary handler More... | |
Inherits from BaseObject
BasePeriodicBoundary::BasePeriodicBoundary | ( | ) |
default constructor.
Default constructor
References periodicHandler_.
BasePeriodicBoundary::BasePeriodicBoundary | ( | const BasePeriodicBoundary & | b | ) |
copy constructor
Note: shallow copy! Otherwise the HGrid causes a stack overflow.
Copy constructor
References periodicHandler_.
|
override |
|
overridevirtual |
Virtual function that does things to particles, each time step after particles have moved.
checks whether particles have passed the boundary, and if so, does something special with it. (i.e. deletion boundary, insertion boundary) NB: virtual function
[out] | pH | the particle handler. |
Reimplemented from BaseBoundary.
Reimplemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.
|
overridepure virtual |
Used to create a copy of the object NB: purely virtual function.
Implements BaseBoundary.
Implemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.
|
override |
Creates periodic ocpies of given particle in case of periodic boundaries in serial build.
Checks the distance of given particle to the closest of both periodic walls, and creates a periodic copy of the particle if needed (i.e. if the particle is closer to the periodic wall than the radius of the largest particle in the system). NOTE: This is only for a serial build - periodic particles work different in parallel
[in,out] | pH | System's ParticleHandler, (1) from which the interaction radius of its largest particle is retrieved to determine the maximum distance from the wall at which a particle should still have a periodic copy created, and (2) to which a possible periodic copy of the particle will be added |
|
pure virtual |
Returns the distance between a particle and the closest boundary, required for any periodic boundary.
[in] | particle | The distance between this particle and the closest boundary is calculated |
Implemented in TimeDependentPeriodicBoundary, and PeriodicBoundary.
Referenced by PeriodicBoundaryHandler::computePeriodicComplexity().
Returns the distance between a position and the closest boundary.
[in] | position | The distance between this particle and the closest boundary is calculated |
Implemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.
PeriodicBoundaryHandler * BasePeriodicBoundary::getPeriodicHandler | ( | ) | const |
Returns the periodic boundary handler.
Returns the pointer to the BoundaryHandler the boundary belongs to
References periodicHandler_.
Referenced by SubcriticalMaserBoundaryTEST::activateMaser().
|
pure virtual |
Returns true if it is closer to the left boundary than the right boundary.
Computes if a certain position is close to the left boundary (true) or if it is not close to the left boundary (false)
[in] | position | The position which is being checked |
Implemented in TimeDependentPeriodicBoundary, and PeriodicBoundary.
Referenced by PeriodicBoundaryHandler::computePeriodicComplexity().
|
virtual |
Modifies periodic complexity of a particle if necessary (i.e. maser boundary)
Reimplemented in SubcriticalMaserBoundaryTEST.
|
virtual |
Actions that need to be performed before adding new ghost particles.
Reimplemented in SubcriticalMaserBoundaryTEST.
Referenced by PeriodicBoundaryHandler::performActionsBeforeAddingParticles().
|
overridevirtual |
Reads the object's id_ from given istream.
Reads the object's id_ from the given istream
[in,out] | is | istream the id_ is read from |
Implements BaseBoundary.
Reimplemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.
References BaseBoundary::read().
Referenced by PeriodicBoundary::read(), and TimeDependentPeriodicBoundary::read().
void BasePeriodicBoundary::setPeriodicHandler | ( | PeriodicBoundaryHandler * | periodicHandler | ) |
Sets the periodicBoundaryHandler, required for parallel periodic boundaries.
Sets the pointer to the BoundaryHandler the boundary belongs to
[in] | handler | pointer to the boundary handler |
References periodicHandler_.
|
pure virtual |
Shifts the position (and velocity) of to the ghost particle.
Shifts the position of a particle to the other boundary. Note: In some cases it doesnt only shift the position, but also other quantities such as velocity
[in] | particle | Pointer to the particle that will shift position |
Implemented in TimeDependentPeriodicBoundary, and PeriodicBoundary.
Referenced by PeriodicBoundaryHandler::shiftParticle().
|
overridevirtual |
Adds object's id_ to given ostream.
Adds the object's id_ to the given ostream
[in] | os | ostream the id_ is added to |
Implements BaseBoundary.
Reimplemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.
References BaseBoundary::write().
Referenced by PeriodicBoundary::write(), and TimeDependentPeriodicBoundary::write().
|
private |
pointer to the periodic boundary handler
Referenced by BasePeriodicBoundary(), getPeriodicHandler(), and setPeriodicHandler().