MercuryDPM
Beta
|
Used for removing particles from the problem. Inherits from BaseBoundary. More...
#include <DeletionBoundary.h>
Public Member Functions | |
DeletionBoundary () | |
default constructor More... | |
~DeletionBoundary () | |
destructor More... | |
DeletionBoundary * | copy () const |
Copy method; creates copy on the heap and returns a pointer to it. More... | |
void | set (const Vec3D &normal, Mdouble distance) |
Sets boundary position based on a normal and distance. More... | |
void | move (Mdouble position) |
Sets the boundary's distance property to the given one. More... | |
Mdouble | getDistance (const Vec3D &position) const |
Returns the shortest distance between the boundary and given position. More... | |
bool | checkBoundaryAfterParticleMoved (BaseParticle *p, ParticleHandler &pH) |
Checks if particle passed the boundary and deletes the particle if so. More... | |
void | read (std::istream &is) |
Reads some boundary properties from an std::istream. More... | |
MERCURY_DEPRECATED void | oldRead (std::istream &is) |
Deprecated read method. use DeletionBoundary::read() instead. More... | |
void | write (std::ostream &os) const |
Writes the boundary properties to an std::ostream. More... | |
virtual std::string | getName () const |
Returns the name of the object. More... | |
Public Member Functions inherited from BaseBoundary | |
BaseBoundary () | |
default constructor. More... | |
BaseBoundary (const BaseBoundary &b) | |
copy constructor More... | |
virtual | ~BaseBoundary () |
destructor 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... | |
BoundaryHandler * | getHandler () 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 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 | |
Vec3D | normal_ |
outward unit normal vector More... | |
Mdouble | scaleFactor_ |
This is the factor to rescale the given normal vector to a unit vectors. More... | |
Mdouble | distance_ |
The boundary's distance from the origin. More... | |
Used for removing particles from the problem. Inherits from BaseBoundary.
Definition at line 40 of file DeletionBoundary.h.
DeletionBoundary::DeletionBoundary | ( | ) |
default constructor
Default constructor (calls the parent-constructor of BaseBoundary as well)
Definition at line 35 of file DeletionBoundary.cc.
References distance_, and scaleFactor_.
Referenced by copy().
DeletionBoundary::~DeletionBoundary | ( | ) |
bool DeletionBoundary::checkBoundaryAfterParticleMoved | ( | BaseParticle * | p, |
ParticleHandler & | pH | ||
) |
Checks if particle passed the boundary and deletes the particle if so.
Checks if particle has passed the boundary, and if so, deletes the particle.
[in] | p | pointer to the particle which is to be checked |
[out] | pH | the particle's ParticleHandler, from which the particle is removed in case it has passed the boundary. |
Definition at line 114 of file DeletionBoundary.cc.
References getDistance(), BaseObject::getIndex(), BaseInteractable::getPosition(), and ParticleHandler::removeObject().
|
virtual |
Copy method; creates copy on the heap and returns a pointer to it.
Copy function, which creates a copy and returns a pointer to that copy (on the heap)
Implements BaseBoundary.
Definition at line 60 of file DeletionBoundary.cc.
References DeletionBoundary().
Returns the shortest distance between the boundary and given position.
Calculates the shortest distance between the wall and given position.
[in] | position | the position of which the distance should be calculated. |
Definition at line 100 of file DeletionBoundary.cc.
References distance_, Vec3D::dot(), and normal_.
Referenced by checkBoundaryAfterParticleMoved().
|
virtual |
Returns the name of the object.
Returns the object's class name (i.e. 'DeletionBoundary').
Implements BaseObject.
Definition at line 165 of file DeletionBoundary.cc.
void DeletionBoundary::move | ( | Mdouble | distance | ) |
Sets the boundary's distance property to the given one.
Resets the boundary's 'distance' from the origin to be the one given.
[in] | distance | the new 'distance' between boundary and origin. see also comments of DeletionBoundary::set(). |
Definition at line 91 of file DeletionBoundary.cc.
References distance_, and scaleFactor_.
void DeletionBoundary::oldRead | ( | std::istream & | is | ) |
Deprecated read method. use DeletionBoundary::read() instead.
the deprecated version of the read-method. Should not be used by new users!
Definition at line 143 of file DeletionBoundary.cc.
References distance_, normal_, and scaleFactor_.
|
virtual |
Reads some boundary properties from an std::istream.
Reads a number of boundary properties from the given std::istream.
[in,out] | is | the istream |
Implements BaseBoundary.
Definition at line 129 of file DeletionBoundary.cc.
References distance_, normal_, BaseBoundary::read(), and scaleFactor_.
Sets boundary position based on a normal and distance.
Defines the placing of the (2D) boundary based on the given normal and distance.
[in] | normal | boundary normal vector |
[in] | distance | 'distance' between the origin and the boundary, such that the following relation is satisfied: \[ \mathbf{r} \cdot \mathbf{\hat{n}} = d \] in which \( \mathbf{\hat{n}} \) and \( d \) are the given normal vector and distance, respectively. NB: If the distance is the ACTUAL distance from the origin, the normal vector must be of UNIT LENGTH for the placing of the boundary to be done correctly. |
Definition at line 79 of file DeletionBoundary.cc.
References distance_, Vec3D::dot(), normal_, and scaleFactor_.
|
virtual |
Writes the boundary properties to an std::ostream.
Writes the boundary properties to an std::ostream.
[out] | os | the ostream the properties are to be written to. |
Implements BaseBoundary.
Definition at line 153 of file DeletionBoundary.cc.
References distance_, normal_, scaleFactor_, and BaseBoundary::write().
|
private |
The boundary's distance from the origin.
Definition at line 114 of file DeletionBoundary.h.
Referenced by DeletionBoundary(), getDistance(), move(), oldRead(), read(), set(), and write().
|
private |
outward unit normal vector
Definition at line 101 of file DeletionBoundary.h.
Referenced by getDistance(), oldRead(), read(), set(), and write().
|
private |
This is the factor to rescale the given normal vector to a unit vectors.
NB: Not only the normal vector is rescaled by this factor, also the 'distance' from the origin of the boundary is scaled by this factor! Also, once the boundary position is set with DeletionBoundary::set(), the arguments of any reset of the distance_ property (i.e. usage of DeletionBoundary::move()) will be rescaled by the same factor!
Definition at line 110 of file DeletionBoundary.h.
Referenced by DeletionBoundary(), move(), oldRead(), read(), set(), and write().