CubeDeletionBoundary Class Reference

#include <CubeDeletionBoundary.h>

+ Inheritance diagram for CubeDeletionBoundary:

Public Member Functions

 CubeDeletionBoundary ()
 default constructor More...
 
 ~CubeDeletionBoundary () override
 destructor More...
 
CubeDeletionBoundarycopy () const override
 Copy method; creates copy on the heap and returns a pointer to it. More...
 
void set (Vec3D posMin, Vec3D posMax)
 Sets boundary position based on two opposite corners. More...
 
Mdouble getDistance (const Vec3D &position) const override
 Returns a negative value if and only if the particle is inside the boundary. More...
 
void read (std::istream &is) override
 reads boundary properties from istream More...
 
void write (std::ostream &os) const override
 writes boundary properties to ostream More...
 
std::string getName () const override
 Returns the name of the object. More...
 
- Public Member Functions inherited from DeletionBoundary
 DeletionBoundary ()
 default constructor More...
 
 DeletionBoundary (DeletionBoundary const &d)
 default copy constructor More...
 
 ~DeletionBoundary () override
 destructor More...
 
DeletionBoundarycopy () const override
 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...
 
bool checkBoundaryAfterParticleMoved (BaseParticle *p, ParticleHandler &pH)
 Checks if particle is inside the boundary, and deletes the particle if so. More...
 
void checkBoundaryAfterParticlesMove (ParticleHandler &pH) override
 
unsigned int getNumberOfParticlesDeleted () const
 Gets the number of particles deleted by the boundary. More...
 
double getMassOfParticlesDeleted () const
 
double getVolumeOfParticlesDeleted () const
 
void reset ()
 
void activate ()
 Turns on the DeletionBoundary. More...
 
void deactivate ()
 Turns off the DeletionBoundary. More...
 
void trackOutflow (bool trackOutflow=true)
 Turns on the outflow tracker. More...
 
void read (std::istream &is) override
 Reads some boundary properties from an std::istream. More...
 
MERCURYDPM_DEPRECATED void oldRead (std::istream &is)
 Deprecated read method. use DeletionBoundary::read() instead. More...
 
void write (std::ostream &os) const override
 Writes the boundary properties to an std::ostream. More...
 
std::string getName () const override
 Returns the name of the object. 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 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

Vec3D posMin_
 Minimal and maximal positions defining the boundary's boundaries. More...
 
Vec3D posMax_
 

Constructor & Destructor Documentation

◆ CubeDeletionBoundary()

CubeDeletionBoundary::CubeDeletionBoundary ( )

default constructor

35 {
36  posMin_ = Vec3D(0, 0, 0);
37  posMax_ = Vec3D(0, 0, 0);
38  logger(DEBUG, "CubeDeletionBoundary::CubeDeletionBoundary() finished", true);
39 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ DEBUG
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
Definition: CubeDeletionBoundary.h:85
Vec3D posMax_
Definition: CubeDeletionBoundary.h:85
DeletionBoundary()
default constructor
Definition: DeletionBoundary.cc:39
Definition: Vector.h:51

References DEBUG, logger, posMax_, and posMin_.

Referenced by copy().

◆ ~CubeDeletionBoundary()

CubeDeletionBoundary::~CubeDeletionBoundary ( )
override

destructor

42 {
43  logger(DEBUG, "CubeDeletionBoundary::~CubeDeletionBoundary() finished", true);
44 }

References DEBUG, and logger.

Member Function Documentation

◆ copy()

CubeDeletionBoundary * CubeDeletionBoundary::copy ( ) const
overridevirtual

Copy method; creates copy on the heap and returns a pointer to it.

Implements BaseBoundary.

53 {
54  return new CubeDeletionBoundary(*this);
55 }
CubeDeletionBoundary()
default constructor
Definition: CubeDeletionBoundary.cc:34

References CubeDeletionBoundary().

◆ getDistance()

Mdouble CubeDeletionBoundary::getDistance ( const Vec3D position) const
overridevirtual

Returns a negative value if and only if the particle is inside the boundary.

Todo:
JMFT: Calculate the distance properly, not just 1 or -1.

Reimplemented from DeletionBoundary.

61 {
62  if (posMin_.X < position.X && position.X < posMax_.X
63  && posMin_.Y < position.Y && position.Y < posMax_.Y
64  && posMin_.Z < position.Z && position.Z < posMax_.Z
65  )
66  return -1;
67  else
68  return 1;
69 }
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble X
the vector components
Definition: Vector.h:66

References posMax_, posMin_, Vec3D::X, Vec3D::Y, and Vec3D::Z.

◆ getName()

std::string CubeDeletionBoundary::getName ( ) const
overridevirtual

Returns the name of the object.

Returns the object's class name (i.e. 'CubeDeletionBoundary').

Returns
the object's class name

Implements BaseObject.

90 {
91  return "CubeDeletionBoundary";
92 }

◆ read()

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

reads boundary properties from istream

Implements BaseBoundary.

72 {
74  std::string dummy;
75  is >> dummy >> posMin_
76  >> dummy >> posMax_;
77 }
void read(std::istream &is) override
Reads some boundary properties from an std::istream.
Definition: DeletionBoundary.cc:239

References posMax_, posMin_, and DeletionBoundary::read().

◆ set()

void CubeDeletionBoundary::set ( Vec3D  posMin,
Vec3D  posMax 
)

Sets boundary position based on two opposite corners.

47 {
48  posMin_ = posMin;
49  posMax_ = posMax;
50 }

References posMax_, and posMin_.

Referenced by CubeDeletionBoundarySelfTest::setupInitialConditions().

◆ write()

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

writes boundary properties to ostream

Implements BaseBoundary.

80 {
82  os << " posMin " << posMin_ << " posMax " << posMax_;
83 }
void write(std::ostream &os) const override
Writes the boundary properties to an std::ostream.
Definition: DeletionBoundary.cc:268

References posMax_, posMin_, and DeletionBoundary::write().

Member Data Documentation

◆ posMax_

Vec3D CubeDeletionBoundary::posMax_
private

◆ posMin_

Vec3D CubeDeletionBoundary::posMin_
private

Minimal and maximal positions defining the boundary's boundaries.

Referenced by CubeDeletionBoundary(), getDistance(), read(), set(), and write().


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