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

#include <CylindricalWall.h>

+ Inheritance diagram for CylindricalWall:

Public Member Functions

 CylindricalWall ()
 
 CylindricalWall (const CylindricalWall &p)
 
 CylindricalWall (double radius)
 
CylindricalWallcopy () const
 Wall copy method. It calls the copy contrustor of this Wall, usefull for polymorfism. More...
 
void clear ()
 
void set (Mdouble radius)
 Defines a standard wall, given an outward normal vector s. t. normal*x=position. More...
 
bool get_distance_and_normal (BaseParticle &P, Mdouble &distance, Vec3D &normal_return)
 Since this function should be called before calculating any Particle-Wall interactions, it can also be used to set the normal vector in case of curved walls. More...
 
void read (std::istream &is)
 reads wall More...
 
void print (std::ostream &os) const
 outputs wall More...
 
double get_Radius ()
 access function for radius More...
 
Vec3D get_Velocity () const
 
- Public Member Functions inherited from BaseWall
 BaseWall ()
 
 BaseWall (const BaseWall &p)
 
virtual ~BaseWall ()
 
virtual void move (Mdouble position_ UNUSED)
 Allows the wall to be moved to a new position. More...
 
virtual void move (Vec3D velocity_ UNUSED, Mdouble dt UNUSED)
 Allows the wall to be moved to a new position (also orthogonal to the normal), and setting the velocity. More...
 
virtual void move_time (Mdouble dt UNUSED)
 Allows the wall to be moved to a new position (also orthogonal to the normal), and setting the velocity. More...
 
virtual bool get_distance_and_normal (BaseParticle &P UNUSED, Mdouble &distance UNUSED, Vec3D &normal_return UNUSED)=0
 
void set_Velocity (Vec3D new_)
 access function for velocity More...
 
virtual void read (std::istream &is UNUSED)=0
 
virtual void print (std::ostream &os UNUSED) const =0
 
virtual void moveInHandler (int newPos)
 
int getIndSpecies () const
 
void setIndSpecies (const int _new)
 
const Vec3Dget_Force () const
 
const Vec3Dget_Torque () const
 
void set_Force (Vec3D _new)
 
void set_Torque (Vec3D _new)
 
void set_Index (int index)
 
void set_Id (int id)
 
void add_Force (Vec3D _new)
 
void add_Torque (Vec3D _new)
 

Private Attributes

Mdouble radius
 

Additional Inherited Members

- Public Attributes inherited from BaseWall
int indSpecies
 
- Protected Attributes inherited from BaseWall
Vec3D velocity
 velocity of the wall (used to calculate the relative velocity in the force calculation) More...
 

Detailed Description

Definition at line 32 of file CylindricalWall.h.

Constructor & Destructor Documentation

CylindricalWall::CylindricalWall ( )
inline

Definition at line 35 of file CylindricalWall.h.

Referenced by copy().

35  : BaseWall()
36  {
37  #ifdef CONSTUCTOR_OUTPUT
38  std::cout<<"CylindricalWall () finished"<<std::endl;
39  #endif
40  }
BaseWall()
Definition: BaseWall.h:38
CylindricalWall::CylindricalWall ( const CylindricalWall p)
inline

Definition at line 42 of file CylindricalWall.h.

References radius.

42  : BaseWall(p)
43  {
44  radius=p.radius;
45  #ifdef CONSTUCTOR_OUTPUT
46  std::cout<<"CylindricalWall (const CylindricalWall &p) finished"<<std::endl;
47  #endif
48  }
BaseWall()
Definition: BaseWall.h:38
CylindricalWall::CylindricalWall ( double  radius)
inline

Definition at line 50 of file CylindricalWall.h.

References radius.

50  : BaseWall()
51  {
52  this->radius=radius;
53  #ifdef CONSTUCTOR_OUTPUT
54  std::cout<<"CylindricalWall (double radius) finished"<<std::endl;
55  #endif
56  }
BaseWall()
Definition: BaseWall.h:38

Member Function Documentation

void CylindricalWall::clear ( )
inlinevirtual

Reimplemented from BaseWall.

Definition at line 64 of file CylindricalWall.h.

References BaseWall::indSpecies.

65  {
66  indSpecies = 0;
67  }
int indSpecies
Definition: BaseWall.h:36
CylindricalWall* CylindricalWall::copy ( ) const
inlinevirtual

Wall copy method. It calls the copy contrustor of this Wall, usefull for polymorfism.

Implements BaseWall.

Definition at line 59 of file CylindricalWall.h.

References CylindricalWall().

60  {
61  return new CylindricalWall(*this);
62  }
bool CylindricalWall::get_distance_and_normal ( BaseParticle P,
Mdouble distance,
Vec3D normal_return 
)
inline

Since this function should be called before calculating any Particle-Wall interactions, it can also be used to set the normal vector in case of curved walls.

Definition at line 76 of file CylindricalWall.h.

References BaseParticle::get_Position(), BaseParticle::get_Radius(), Vec3D::GetLength(), R, radius, Vec3D::X, Vec3D::Y, and Vec3D::Z.

77  {
78  double R=sqrt(pow(P.get_Position().X,2)+pow(P.get_Position().Y,2));
79  distance=radius-R;
80  if(distance>=P.get_Radius()) return false;
81 
82  normal_return.X=P.get_Position().X;
83  normal_return.Y=P.get_Position().Y;
84  normal_return.Z=0.0;
85  normal_return/=normal_return.GetLength();
86 
87  /*std::cout<<"Contact Cylindrical Wall"<<std::endl;
88  std::cout<<"Particle index="<<P.get_Index()<<" position="<<P.get_Position()<<" R="<<R<<std::endl;
89  std::cout<<"distance="<<distance<<" normal="<<normal_return<<std::endl;
90  std::cout<<"Overlap="<<distance-P.get_Radius()<<" velocity="<<P.get_Velocity()<<std::endl;*/
91  return true;
92  }
Mdouble X
Definition: Vector.h:44
Mdouble get_Radius() const
const Vec3D & get_Position() const
Mdouble Y
Definition: Vector.h:44
Mdouble GetLength() const
Definition: Vector.h:248
Mdouble Z
Definition: Vector.h:44
double CylindricalWall::get_Radius ( )
inline

access function for radius

Definition at line 106 of file CylindricalWall.h.

References radius.

106 {return radius;}
Vec3D CylindricalWall::get_Velocity ( ) const
inlinevirtual

Implements BaseWall.

Definition at line 107 of file CylindricalWall.h.

107 {return Vec3D(0.0,0.0,0.0);}
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
void CylindricalWall::print ( std::ostream &  os) const
inline

outputs wall

Definition at line 101 of file CylindricalWall.h.

References radius.

101  {
102  os << "CylindricalWall radius " << radius;
103  }
void CylindricalWall::read ( std::istream &  is)
inline

reads wall

Definition at line 95 of file CylindricalWall.h.

References radius.

95  {
96  std::string dummy;
97  is >> dummy >> radius;
98  }
void CylindricalWall::set ( Mdouble  radius)
inline

Defines a standard wall, given an outward normal vector s. t. normal*x=position.

Definition at line 70 of file CylindricalWall.h.

References radius.

71  {
72  this->radius=radius;
73  }

Member Data Documentation

Mdouble CylindricalWall::radius
private

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