MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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_
 

Detailed Description

Definition at line 37 of file CubeDeletionBoundary.h.

Constructor & Destructor Documentation

CubeDeletionBoundary::CubeDeletionBoundary ( )

default constructor

Definition at line 35 of file CubeDeletionBoundary.cc.

References DEBUG, logger, posMax_, and posMin_.

Referenced by copy().

36 {
37  posMin_ = Vec3D(0, 0, 0);
38  posMax_ = Vec3D(0, 0, 0);
39  logger(DEBUG, "CubeDeletionBoundary::CubeDeletionBoundary() finished");
40 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
DeletionBoundary()
default constructor
Definition: Vector.h:49
CubeDeletionBoundary::~CubeDeletionBoundary ( )
override

destructor

Definition at line 42 of file CubeDeletionBoundary.cc.

References DEBUG, and logger.

43 {
44  logger(DEBUG, "CubeDeletionBoundary::~CubeDeletionBoundary() finished");
45 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")

Member Function Documentation

CubeDeletionBoundary * CubeDeletionBoundary::copy ( ) const
overridevirtual

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

Implements BaseBoundary.

Definition at line 53 of file CubeDeletionBoundary.cc.

References CubeDeletionBoundary().

54 {
55  return new CubeDeletionBoundary(*this);
56 }
CubeDeletionBoundary()
default constructor
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.

Definition at line 61 of file CubeDeletionBoundary.cc.

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

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 }
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
Mdouble Y
Definition: Vector.h:65
Mdouble Z
Definition: Vector.h:65
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.

Definition at line 90 of file CubeDeletionBoundary.cc.

91 {
92  return "CubeDeletionBoundary";
93 }
void CubeDeletionBoundary::read ( std::istream &  is)
overridevirtual

reads boundary properties from istream

Implements BaseBoundary.

Definition at line 72 of file CubeDeletionBoundary.cc.

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

73 {
75  std::string dummy;
76  is >> dummy >> posMin_
77  >> dummy >> posMax_;
78 }
void read(std::istream &is) override
Reads some boundary properties from an std::istream.
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
void CubeDeletionBoundary::set ( Vec3D  posMin,
Vec3D  posMax 
)

Sets boundary position based on two opposite corners.

Definition at line 47 of file CubeDeletionBoundary.cc.

References posMax_, and posMin_.

48 {
49  posMin_ = posMin;
50  posMax_ = posMax;
51 }
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
void CubeDeletionBoundary::write ( std::ostream &  os) const
overridevirtual

writes boundary properties to ostream

Implements BaseBoundary.

Definition at line 80 of file CubeDeletionBoundary.cc.

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

81 {
83  os << " posMin " << posMin_ << " posMax " << posMax_;
84 }
Vec3D posMin_
Minimal and maximal positions defining the boundary's boundaries.
void write(std::ostream &os) const override
Writes the boundary properties to an std::ostream.

Member Data Documentation

Vec3D CubeDeletionBoundary::posMax_
private

Definition at line 85 of file CubeDeletionBoundary.h.

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

Vec3D CubeDeletionBoundary::posMin_
private

Minimal and maximal positions defining the boundary's boundaries.

Definition at line 85 of file CubeDeletionBoundary.h.

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


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