BasePeriodicBoundary Class Referenceabstract

#include <BasePeriodicBoundary.h>

+ Inheritance diagram for BasePeriodicBoundary:

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...
 
BasePeriodicBoundarycopy () 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...
 
PeriodicBoundaryHandlergetPeriodicHandler () 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...
 
BoundaryHandlergetHandler () 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

PeriodicBoundaryHandlerperiodicHandler_
 pointer to the periodic boundary handler More...
 

Detailed Description

Inherits from BaseObject

Constructor & Destructor Documentation

◆ BasePeriodicBoundary() [1/2]

BasePeriodicBoundary::BasePeriodicBoundary ( )

default constructor.

Default constructor

36  : BaseBoundary()
37 {
38  periodicHandler_ = nullptr;
39 #ifdef DEBUG_CONSTRUCTOR
40  std::cout<<"BasePeriodicBoundary::BasePeriodicBoundary() finished"<<std::endl;
41 #endif
42 }
BaseBoundary()
default constructor.
Definition: BaseBoundary.cc:32
PeriodicBoundaryHandler * periodicHandler_
pointer to the periodic boundary handler
Definition: BasePeriodicBoundary.h:139

References periodicHandler_.

◆ BasePeriodicBoundary() [2/2]

BasePeriodicBoundary::BasePeriodicBoundary ( const BasePeriodicBoundary b)

copy constructor

Note: shallow copy! Otherwise the HGrid causes a stack overflow.

Copy constructor

49  : BaseBoundary(b)
50 {
52 #ifdef DEBUG_CONSTRUCTOR
53  std::cout<<"BasePeriodicBoundary::BasePeriodicBoundary(const BasePeriodicBoundary&b) finished"<<std::endl;
54 #endif
55 }

References periodicHandler_.

◆ ~BasePeriodicBoundary()

BasePeriodicBoundary::~BasePeriodicBoundary ( )
override

destructor

Destructor

61 {
62 #ifdef DEBUG_DESTRUCTOR
63  std::cout << "BasePeriodicBoundary::~BasePeriodicBoundary() finished"<<std::endl;
64 #endif
65 }

Member Function Documentation

◆ checkBoundaryAfterParticlesMove()

void BasePeriodicBoundary::checkBoundaryAfterParticlesMove ( ParticleHandler pH)
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

Parameters
[out]pHthe particle handler.
Returns
returns TRUE if given particle actually did pass the boundary

Reimplemented from BaseBoundary.

Reimplemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.

112 {
113 }

◆ copy()

BasePeriodicBoundary* BasePeriodicBoundary::copy ( ) const
overridepure virtual

Used to create a copy of the object NB: purely virtual function.

Implements BaseBoundary.

Implemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.

◆ createPeriodicParticles()

void BasePeriodicBoundary::createPeriodicParticles ( ParticleHandler pH)
override

Creates periodic ocpies of given particle in case of periodic boundaries in serial build.

Todo:
{JMFT: Should this be virtual?}

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

Parameters
[in,out]pHSystem'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
128 {
129 }

◆ getDistance() [1/2]

virtual Mdouble BasePeriodicBoundary::getDistance ( const BaseParticle particle) const
pure virtual

Returns the distance between a particle and the closest boundary, required for any periodic boundary.

Parameters
[in]particleThe distance between this particle and the closest boundary is calculated

Implemented in TimeDependentPeriodicBoundary, and PeriodicBoundary.

Referenced by PeriodicBoundaryHandler::computePeriodicComplexity().

◆ getDistance() [2/2]

virtual Mdouble BasePeriodicBoundary::getDistance ( const Vec3D position) const
pure virtual

Returns the distance between a position and the closest boundary.

Parameters
[in]positionThe distance between this particle and the closest boundary is calculated

Implemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.

◆ getPeriodicHandler()

PeriodicBoundaryHandler * BasePeriodicBoundary::getPeriodicHandler ( ) const

Returns the periodic boundary handler.

Returns the pointer to the BoundaryHandler the boundary belongs to

Returns
pointer to the handler
100 {
101  return periodicHandler_;
102 }

References periodicHandler_.

Referenced by SubcriticalMaserBoundaryTEST::activateMaser().

◆ isClosestToLeftBoundary()

virtual bool BasePeriodicBoundary::isClosestToLeftBoundary ( const Vec3D position) const
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)

Parameters
[in]positionThe position which is being checked

Implemented in TimeDependentPeriodicBoundary, and PeriodicBoundary.

Referenced by PeriodicBoundaryHandler::computePeriodicComplexity().

◆ modifyPeriodicComplexity()

void BasePeriodicBoundary::modifyPeriodicComplexity ( std::vector< int > &  complexity,
int &  totalPeriodicComplexity,
BaseParticle particle,
int  i 
) const
virtual

Modifies periodic complexity of a particle if necessary (i.e. maser boundary)

Reimplemented in SubcriticalMaserBoundaryTEST.

134 {
135 }

◆ performActionsBeforeAddingParticles()

void BasePeriodicBoundary::performActionsBeforeAddingParticles ( )
virtual

Actions that need to be performed before adding new ghost particles.

Reimplemented in SubcriticalMaserBoundaryTEST.

139 {
140 }

Referenced by PeriodicBoundaryHandler::performActionsBeforeAddingParticles().

◆ read()

void BasePeriodicBoundary::read ( std::istream &  is)
overridevirtual

Reads the object's id_ from given istream.

Reads the object's id_ from the given istream

Parameters
[in,out]isistream the id_ is read from

Implements BaseBoundary.

Reimplemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.

72 {
74 }
void read(std::istream &is) override=0
Reads the object's id_ from given istream NB: purely virtual function, overriding the version of Base...
Definition: BaseBoundary.cc:61

References BaseBoundary::read().

Referenced by PeriodicBoundary::read(), and TimeDependentPeriodicBoundary::read().

◆ setPeriodicHandler()

void BasePeriodicBoundary::setPeriodicHandler ( PeriodicBoundaryHandler periodicHandler)

Sets the periodicBoundaryHandler, required for parallel periodic boundaries.

Sets the pointer to the BoundaryHandler the boundary belongs to

Parameters
[in]handlerpointer to the boundary handler
91 {
92  periodicHandler_ = periodicHandler;
93 }

References periodicHandler_.

◆ shiftPosition()

virtual void BasePeriodicBoundary::shiftPosition ( BaseParticle particle) const
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

Parameters
[in]particlePointer to the particle that will shift position

Implemented in TimeDependentPeriodicBoundary, and PeriodicBoundary.

Referenced by PeriodicBoundaryHandler::shiftParticle().

◆ write()

void BasePeriodicBoundary::write ( std::ostream &  os) const
overridevirtual

Adds object's id_ to given ostream.

Adds the object's id_ to the given ostream

Parameters
[in]osostream the id_ is added to

Implements BaseBoundary.

Reimplemented in TimeDependentPeriodicBoundary, SubcriticalMaserBoundaryTEST, and PeriodicBoundary.

81 {
83 }
void write(std::ostream &os) const override=0
Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject.
Definition: BaseBoundary.cc:70

References BaseBoundary::write().

Referenced by PeriodicBoundary::write(), and TimeDependentPeriodicBoundary::write().

Member Data Documentation

◆ periodicHandler_

PeriodicBoundaryHandler* BasePeriodicBoundary::periodicHandler_
private

pointer to the periodic boundary handler

Referenced by BasePeriodicBoundary(), getPeriodicHandler(), and setPeriodicHandler().


The documentation for this class was generated from the following files: