MercuryDPM  0.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DeletionBoundary Class Reference

#include <DeletionBoundary.h>

+ Inheritance diagram for DeletionBoundary:

Public Member Functions

 DeletionBoundary ()
 
DeletionBoundarycopy () const
 BaseBoundary copy method. More...
 
void set (Vec3D normal_, Mdouble position_)
 
Mdouble get_distance (const Vec3D &Position)
 
bool checkBoundaryAfterParticleMoved (BaseParticle *P, ParticleHandler &pH)
 
void read (std::istream &is)
 reads wall More...
 
void print (std::ostream &os) const
 outputs wall More...
 
- Public Member Functions inherited from BaseBoundary
virtual ~BaseBoundary ()
 
virtual int createPeriodicParticles (BaseParticle *P UNUSED, ParticleHandler &pH UNUSED)
 
virtual bool checkBoundaryAfterParticleMoved (BaseParticle *P UNUSED, ParticleHandler &pH UNUSED)
 
virtual void checkBoundaryActionsBeforeTimeStep (ParticleHandler &pH UNUSED, WallHandler &wH UNUSED, RNG &random UNUSED)
 
void set_Index (int index)
 
void set_Id (int id)
 
void setHandler (BoundaryHandler *handler)
 
virtual void read (std::istream &is UNUSED)=0
 reads boundary More...
 
virtual void print (std::ostream &os UNUSED) const =0
 outputs boundary More...
 
virtual void moveInHandler (int newPos)
 

Private Attributes

Vec3D normal
 
Mdouble position
 
Mdouble factor
 

Detailed Description

Definition at line 31 of file DeletionBoundary.h.

Constructor & Destructor Documentation

DeletionBoundary::DeletionBoundary ( )
inline

Definition at line 34 of file DeletionBoundary.h.

Referenced by copy().

34  : BaseBoundary()
35  {
36  #ifdef CONSTUCTOR_OUTPUT
37  std::cout<<"DeletionBoundary () finished"<<std::endl;
38  #endif
39  }

Member Function Documentation

bool DeletionBoundary::checkBoundaryAfterParticleMoved ( BaseParticle P,
ParticleHandler pH 
)
inline

Definition at line 59 of file DeletionBoundary.h.

References get_distance(), BaseParticle::get_Index(), BaseParticle::get_Position(), and BaseHandler< T >::removeObject().

60  {
61  if (get_distance(P->get_Position())<0)
62  {
63  pH.removeObject(P->get_Index());
64  return true;
65  }
66  else
67  return false;
68  };
int get_Index() const
const Vec3D & get_Position() const
virtual void removeObject(unsigned const int id)
Removes a Object from the BaseHandler.
Definition: BaseHandler.h:122
Mdouble get_distance(const Vec3D &Position)
DeletionBoundary* DeletionBoundary::copy ( ) const
inlinevirtual

BaseBoundary copy method.

It calls the copy constructor of this BaseBoundary, useful for polymorphism todo{Does this work correctly?}

Implements BaseBoundary.

Definition at line 41 of file DeletionBoundary.h.

References DeletionBoundary().

42  {
43  #ifdef CONSTUCTOR_OUTPUT
44  std::cerr << "virtual DeletionBoundary* copy() const finished" << std::endl;
45  #endif
46  return new DeletionBoundary(*this);
47  }
Mdouble DeletionBoundary::get_distance ( const Vec3D Position)
inline

Definition at line 56 of file DeletionBoundary.h.

References normal, and position.

Referenced by checkBoundaryAfterParticleMoved().

56 {return position - Dot(Position, normal);}
void DeletionBoundary::print ( std::ostream &  os) const
inline

outputs wall

Definition at line 77 of file DeletionBoundary.h.

References normal, and position.

77  {
78  os << "DeletionBoundary normal " << normal << " position " << position;
79  }
void DeletionBoundary::read ( std::istream &  is)
inline

reads wall

Definition at line 71 of file DeletionBoundary.h.

References normal, and position.

71  {
72  std::string dummy;
73  is >> dummy >> normal >> dummy >> position;
74  }
void DeletionBoundary::set ( Vec3D  normal_,
Mdouble  position_ 
)
inline

Definition at line 49 of file DeletionBoundary.h.

References factor, normal, and position.

50  {
51  factor = 1. / sqrt(Dot(normal_, normal_));
52  normal = normal_ * factor;
53  position = position_ * factor;
54  }

Member Data Documentation

Mdouble DeletionBoundary::factor
private

Definition at line 85 of file DeletionBoundary.h.

Referenced by set().

Vec3D DeletionBoundary::normal
private

Definition at line 83 of file DeletionBoundary.h.

Referenced by get_distance(), print(), read(), and set().

Mdouble DeletionBoundary::position
private

Definition at line 84 of file DeletionBoundary.h.

Referenced by get_distance(), print(), read(), and set().


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