revision: v0.14
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...
 
virtual 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...
 
MERCURY_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

36 {
37  posMin_ = Vec3D(0, 0, 0);
38  posMax_ = Vec3D(0, 0, 0);
39  logger(DEBUG, "CubeDeletionBoundary::CubeDeletionBoundary() finished", true);
40 }

References FATAL, logger, posMax_, and posMin_.

Referenced by copy().

◆ ~CubeDeletionBoundary()

CubeDeletionBoundary::~CubeDeletionBoundary ( )
override

destructor

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

References FATAL, 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.

54 {
55  return new CubeDeletionBoundary(*this);
56 }

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.

62 {
63  if (posMin_.X < position.X && position.X < posMax_.X
64  && posMin_.Y < position.Y && position.Y < posMax_.Y
65  && posMin_.Z < position.Z && position.Z < posMax_.Z
66  )
67  return -1;
68  else
69  return 1;
70 }

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.

91 {
92  return "CubeDeletionBoundary";
93 }

◆ read()

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

reads boundary properties from istream

Implements BaseBoundary.

73 {
75  std::string dummy;
76  is >> dummy >> posMin_
77  >> dummy >> posMax_;
78 }

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

◆ set()

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

Sets boundary position based on two opposite corners.

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

References posMax_, and posMin_.

Referenced by CubeDeletionBoundarySelfTest::setupInitialConditions().

◆ write()

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

writes boundary properties to ostream

Implements BaseBoundary.

81 {
83  os << " posMin " << posMin_ << " posMax " << posMax_;
84 }

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:
DeletionBoundary::write
void write(std::ostream &os) const override
Writes the boundary properties to an std::ostream.
Definition: DeletionBoundary.cc:268
DeletionBoundary::DeletionBoundary
DeletionBoundary()
default constructor
Definition: DeletionBoundary.cc:39
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
CubeDeletionBoundary::CubeDeletionBoundary
CubeDeletionBoundary()
default constructor
Definition: CubeDeletionBoundary.cc:35
Vec3D
Definition: Vector.h:50
Log::FATAL
@ FATAL
CubeDeletionBoundary::posMax_
Vec3D posMax_
Definition: CubeDeletionBoundary.h:85
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
DeletionBoundary::read
void read(std::istream &is) override
Reads some boundary properties from an std::istream.
Definition: DeletionBoundary.cc:239
CubeDeletionBoundary::posMin_
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
Definition: CubeDeletionBoundary.h:85
Vec3D::Z
Mdouble Z
Definition: Vector.h:65