MercuryDPM  Alpha
 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...
 
virtual ~BaseBoundary ()
 destructor More...
 
virtual BaseBoundarycopy () const =0
 Used to create a copy of the object NB: purely virtual function. More...
 
void read (std::istream &is)=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 =0
 Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject. 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...
 
BoundaryHandlergetHandler () 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 std::string getName () const =0
 A purely virtual function. 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

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

Detailed Description

Inherits from BaseObject

Definition at line 42 of file BaseBoundary.h.

Constructor & Destructor Documentation

BaseBoundary::BaseBoundary ( )

default constructor.

Default constructor

Definition at line 32 of file BaseBoundary.cc.

References handler_.

33 {
34  handler_ = nullptr;
35 #ifdef DEBUG_CONSTRUCTOR
36  std::cout<<"BaseBoundary::BaseBoundary() finished"<<std::endl;
37 #endif
38 }
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:108
BaseBoundary::BaseBoundary ( const BaseBoundary b)

copy constructor

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

Copy constructor

Definition at line 44 of file BaseBoundary.cc.

45  : BaseObject(b)
46 {
47  handler_ = b.handler_;
48 #ifdef DEBUG_CONSTRUCTOR
49  std::cout<<"BaseBoundary::BaseBoundary(const BaseBoundary &b) finished"<<std::endl;
50 #endif
51 }
BaseObject()
Default constructor.
Definition: BaseObject.cc:55
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:108
BaseBoundary::~BaseBoundary ( )
virtual

destructor

Destructor

Definition at line 56 of file BaseBoundary.cc.

57 {
58 #ifdef DEBUG_DESTRUCTOR
59  std::cout << "BaseBoundary::~BaseBoundary() finished"<<std::endl;
60 #endif
61 }

Member Function Documentation

bool BaseBoundary::checkBoundaryAfterParticleMoved ( BaseParticle *P  UNUSED,
ParticleHandler &pH  UNUSED 
)
virtual

Checks if given particle passed the boundary.

checks whether given particle passed the boundary, and if so, does something special with it. NB: virtual function

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

Definition at line 100 of file BaseBoundary.cc.

101 {
102  return false;
103 }
void BaseBoundary::checkBoundaryBeforeTimeStep ( DPMBase *md  UNUSED)
virtual

Fills a (3D) boundary with particles.

Is used to fill the insides of a 3D boundary with particles untill it is filled up.

Parameters
[in]mdthe problem's DPMBase object

Definition at line 110 of file BaseBoundary.cc.

111 {
112 }
virtual BaseBoundary* BaseBoundary::copy ( ) const
pure virtual
void BaseBoundary::createPeriodicParticles ( BaseParticle *P  UNUSED,
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]Pparticle of which periodic copies are to be created
[out]pHthe particle handler

Definition at line 88 of file BaseBoundary.cc.

89 {
90 }
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 127 of file BaseBoundary.cc.

References handler_.

Referenced by MaserBoundary::addParticleToMaser(), LeesEdwardsBoundary::getCurrentShift(), LeesEdwardsBoundary::getCurrentVelocity(), ShearBoxBoundary::shiftHorizontalPosition(), LeesEdwardsBoundary::shiftVerticalPosition(), and LeesEdwardsBoundary::write().

128 {
129  return handler_;
130 }
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:108
void BaseBoundary::read ( std::istream &  is)
pure virtual

Reads the object's id_ from given istream NB: purely virtual function, overriding the version of BaseObject.

Reads the object's id_ from the given istream

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

Implements BaseObject.

Implemented in PeriodicBoundary, InsertionBoundary, AngledPeriodicBoundary, CircularPeriodicBoundary, HopperInsertionBoundary, DeletionBoundary, CubeInsertionBoundary, ChuteInsertionBoundary, MaserBoundary, LeesEdwardsBoundary, and ShearBoxBoundary.

Definition at line 67 of file BaseBoundary.cc.

References BaseObject::read().

Referenced by LeesEdwardsBoundary::read(), ShearBoxBoundary::read(), MaserBoundary::read(), DeletionBoundary::read(), CircularPeriodicBoundary::read(), AngledPeriodicBoundary::read(), InsertionBoundary::read(), and PeriodicBoundary::read().

68 {
69  BaseObject::read(is);
70 }
virtual void read(std::istream &is)=0
A purely virtual method with an implementation which reads the index from the stream and assigns it t...
Definition: BaseObject.cc:124
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 118 of file BaseBoundary.cc.

References handler_.

Referenced by BoundaryHandler::addObject().

119 {
120  handler_ = handler;
121 }
BoundaryHandler * handler_
pointer to the boundary's BoundaryHandler
Definition: BaseBoundary.h:108
void BaseBoundary::write ( std::ostream &  os) const
pure virtual

Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject.

Adds the object's id_ to the given ostream

Parameters
[in]osostream the id_ is added to

Implements BaseObject.

Implemented in PeriodicBoundary, InsertionBoundary, AngledPeriodicBoundary, HopperInsertionBoundary, CircularPeriodicBoundary, DeletionBoundary, CubeInsertionBoundary, ChuteInsertionBoundary, MaserBoundary, LeesEdwardsBoundary, and ShearBoxBoundary.

Definition at line 76 of file BaseBoundary.cc.

References BaseObject::write().

Referenced by LeesEdwardsBoundary::write(), ShearBoxBoundary::write(), MaserBoundary::write(), DeletionBoundary::write(), CircularPeriodicBoundary::write(), AngledPeriodicBoundary::write(), InsertionBoundary::write(), and PeriodicBoundary::write().

77 {
79 }
virtual void write(std::ostream &os) const =0
A purely virtual function which has an implementation which writes the name and the object id_ to the...
Definition: BaseObject.cc:133

Member Data Documentation

BoundaryHandler* BaseBoundary::handler_
private

pointer to the boundary's BoundaryHandler

Definition at line 108 of file BaseBoundary.h.

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


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