MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseBoundary Class Referenceabstract

#include <BaseBoundary.h>

+ Inheritance diagram for BaseBoundary:

Public Member Functions

 BaseBoundary ()
 default constructor. More...
 
 BaseBoundary (const BaseBoundary &b)
 copy constructor More...
 
 ~BaseBoundary () override
 destructor More...
 
virtual BaseBoundarycopy () const =0
 Used to create a copy of the object NB: purely virtual function. More...
 
void read (std::istream &is) override=0
 Reads the object's id_ from given istream NB: purely virtual function, overriding the version of BaseObject. More...
 
void write (std::ostream &os) const override=0
 Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject. 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 checkBoundaryAfterParticlesMove (ParticleHandler &pH)
 Virtual function that does things to particles, each time step after particles have moved. 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

BoundaryHandlerhandler_
 pointer to the boundary's BoundaryHandler More...
 

Detailed Description

Inherits from BaseObject

Definition at line 48 of file BaseBoundary.h.

Constructor & Destructor Documentation

BaseBoundary::BaseBoundary ( )

default constructor.

Default constructor

Definition at line 32 of file BaseBoundary.cc.

References DEBUG, handler_, and logger.

33 {
34  handler_ = nullptr;
35  logger(DEBUG, "BaseBoundary::BaseBoundary() finished");
36 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:152
BaseBoundary::BaseBoundary ( const BaseBoundary b)

copy constructor

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

Copy constructor

Definition at line 42 of file BaseBoundary.cc.

43  : BaseObject(b)
44 {
45  handler_ = b.handler_;
46  logger(DEBUG, "BaseBoundary::BaseBoundary(const BaseBoundary &b) finished");
47 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BaseObject()=default
Default constructor.
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:152
BaseBoundary::~BaseBoundary ( )
override

destructor

Destructor

Definition at line 52 of file BaseBoundary.cc.

References DEBUG, and logger.

53 {
54  logger(DEBUG, "BaseBoundary::~BaseBoundary() finished");
55 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")

Member Function Documentation

void BaseBoundary::actionsBeforeTimeLoop ( )
virtual

Virtual function that does something after DPMBase::setupInitialConditions but before the first time step.

Can be used to perform actions before the time loop, but after setupInitialConditions.

Reimplemented in ConstantMassFlowMaserBoundary, SubcriticalMaserBoundary, and SubcriticalMaserBoundaryTEST.

Definition at line 125 of file BaseBoundary.cc.

References logger, and VERBOSE.

126 {
127  logger(VERBOSE, "In BaseBoundary::checkBoundaryBeforeTimeLoop\n");
128 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void BaseBoundary::checkBoundaryAfterParticlesMove ( ParticleHandler pH)
virtual

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

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

Reimplemented in PeriodicBoundary, ConstantMassFlowMaserBoundary, AngledPeriodicBoundary, SubcriticalMaserBoundary, BasePeriodicBoundary, LeesEdwardsBoundary, DeletionBoundary, HeaterBoundary, SubcriticalMaserBoundaryTEST, CircularPeriodicBoundary, FluxBoundary, StressStrainControlBoundary, and DropletBoundary.

Definition at line 113 of file BaseBoundary.cc.

114 {
115 }
void BaseBoundary::checkBoundaryBeforeTimeStep ( DPMBase md)
virtual

Virtual function that does things before each time step.

What this does depends on the type of boundary. For example, an InsertionBoundary introduces new particles (and how it does that in turn depends on the type of InsertionBoundary).

Parameters
[in]mdthe problem's DPMBase object

Reimplemented in BaseClusterInsertionBoundary, InsertionBoundary, RandomClusterInsertionBoundary, and FixedClusterInsertionBoundary.

Definition at line 101 of file BaseBoundary.cc.

102 {
103 }
void BaseBoundary::createPeriodicParticle ( BaseParticle *p  UNUSED,
ParticleHandler &pH  UNUSED 
)
virtual

Creates a periodic particle in case of periodic boundaries in serial build.

Used to create a single periodic copy of a particle in classes which implement periodic boundary conditions

Parameters
[in]pparticle of which periodic copies are to be created
[in]pHthe particle handler

Definition at line 81 of file BaseBoundary.cc.

82 {
83 }
void BaseBoundary::createPeriodicParticles ( ParticleHandler &pH  UNUSED)
virtual

Creates periodic copies of given particle in case of periodic boundaries.

Used to create periodic copies of particles in classes which implement periodic boundary conditions NB: virtual function

Parameters
[in]pHthe particle handler

Definition at line 91 of file BaseBoundary.cc.

92 {
93 }
BoundaryHandler * BaseBoundary::getHandler ( ) const

Returns the boundary's BoundaryHandler.

Returns the pointer to the BoundaryHandler the boundary belongs to

Returns
pointer to the handler

Definition at line 143 of file BaseBoundary.cc.

References handler_.

Referenced by SubcriticalMaserBoundaryTEST::actionsBeforeTimeLoop(), SubcriticalMaserBoundaryTEST::activateMaser(), SubcriticalMaserBoundary::activateMaser(), ConstantMassFlowMaserBoundary::activateMaser(), StressStrainControlBoundary::activateStrainRateControl(), SubcriticalMaserBoundary::addParticleToMaser(), ConstantMassFlowMaserBoundary::addParticleToMaser(), DeletionBoundary::checkBoundaryAfterParticleMoved(), DropletBoundary::checkBoundaryAfterParticlesMove(), StressStrainControlBoundary::checkBoundaryAfterParticlesMove(), SubcriticalMaserBoundaryTEST::checkBoundaryAfterParticlesMove(), PeriodicBoundary::checkBoundaryAfterParticlesMove(), ConstantMassFlowMaserBoundary::closeMaser(), StressStrainControlBoundary::computeStrainRate(), SubcriticalMaserBoundaryTEST::copyExtraParticles(), PeriodicBoundary::createGhostParticle(), SubcriticalMaserBoundaryTEST::deactivateMaser(), SubcriticalMaserBoundary::deactivateMaser(), StressStrainControlBoundary::determineLengthAndCentre(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), SubcriticalMaserBoundaryTEST::extendBottom(), InsertionBoundary::generateParticle(), LeesEdwardsBoundary::getCurrentShift(), LeesEdwardsBoundary::getCurrentVelocity(), SubcriticalMaserBoundaryTEST::performActionsBeforeAddingParticles(), SubcriticalMaserBoundary::read(), ConstantMassFlowMaserBoundary::read(), InsertionBoundary::read(), StressStrainControlBoundary::set(), InsertionBoundary::setVariableVolumeFlowRate(), ShearBoxBoundary::shiftHorizontalPosition(), LeesEdwardsBoundary::shiftVerticalPosition(), StressStrainControlBoundary::updateDomainSize(), and LeesEdwardsBoundary::write().

144 {
145  return handler_;
146 }
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:152
void BaseBoundary::modifyGhostAfterCreation ( BaseParticle particle,
int  i 
)
virtual

Reimplemented in SubcriticalMaserBoundaryTEST.

Definition at line 117 of file BaseBoundary.cc.

118 {
119 }
void BaseBoundary::setHandler ( BoundaryHandler handler)

Sets the boundary's BoundaryHandler.

Sets the pointer to the BounadaryHandler the boundary belongs to

Parameters
[in]handlerpointer to the boundary handler

Definition at line 134 of file BaseBoundary.cc.

References handler_.

Referenced by BoundaryHandler::addObject(), BoundaryHandler::readAndAddObject(), and StressStrainControlBoundary::set().

135 {
136  handler_ = handler;
137 }
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:152
void BaseBoundary::write ( std::ostream &  os) const
overridepure virtual
virtual void BaseBoundary::writeVTK ( std::fstream &  file)
inlinevirtual

Reimplemented in DropletBoundary.

Definition at line 112 of file BaseBoundary.h.

112 {}

Member Data Documentation

BoundaryHandler* BaseBoundary::handler_
private

pointer to the boundary's BoundaryHandler

Definition at line 152 of file BaseBoundary.h.

Referenced by BaseBoundary(), getHandler(), and setHandler().


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