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

#include <FiniteAxisSymmetricWall.h>

+ Inheritance diagram for FiniteAxisSymmetricWall:

Public Member Functions

 FiniteAxisSymmetricWall ()
 
 FiniteAxisSymmetricWall (const FiniteAxisSymmetricWall &p)
 
FiniteAxisSymmetricWallcopy () const
 Wall copy method. It calls the copy contrustor of this Wall, usefull for polymorfism. More...
 
bool get_distance_and_normal (BaseParticle &P, Mdouble &distance, Vec3D &normal_return)
 
void setSymmetryAxis (Vec3D new_axisOrigin, Vec3D new_axisOrientation)
 Defines an axisymmetric wall. More...
 
void read (std::istream &is)
 reads wall More...
 
void print (std::ostream &os) const
 outputs wall More...
 
Vec3D get_Velocity () const
 
void moveAxisOrigin (Vec3D velocity_, Mdouble dt)
 Allows the wall to be moved to a new position, and sets the velocity. More...
 
Vec3D getAxisOrigin () const
 
- Public Member Functions inherited from FiniteWall
 FiniteWall ()
 
void clear ()
 
void add_finite_wall (Vec3D normal, Vec3D point)
 Adds a wall to the set of finite walls, given an outward normal vector s.t. normal*x=normal*point. More...
 
void add_finite_wall (Vec3D normal_, Mdouble position_)
 Adds a wall to the set of finite walls, given an outward normal vector s. t. normal*x=position. More...
 
void create_open_prism_wall (std::vector< Vec3D > Points, Vec3D PrismAxis)
 
void create_prism_wall (std::vector< Vec3D > Points, Vec3D PrismAxis)
 
void create_open_prism_wall (std::vector< Vec3D > Points)
 
void create_prism_wall (std::vector< Vec3D > Points)
 
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...
 
Vec3D get_Velocity () const
 access function for velocity More...
 
- 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

Vec3D axisOrigin
 
Vec3D axisOrientation
 
Vec3D CartesianVelocity
 

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

Todo:
{Thomas: Can we rename AxisSymmetric with Axisymmetric? Can we rename FiniteWall with PolyhedralWall?}

Definition at line 32 of file FiniteAxisSymmetricWall.h.

Constructor & Destructor Documentation

FiniteAxisSymmetricWall::FiniteAxisSymmetricWall ( )
inline

Definition at line 35 of file FiniteAxisSymmetricWall.h.

References axisOrientation, axisOrigin, CartesianVelocity, and Vec3D::set_zero().

Referenced by copy().

35  : FiniteWall()
36  {
40  #ifdef CONSTUCTOR_OUTPUT
41  std::cout<<"FiniteAxisSymmetricWall() finished"<<std::endl;
42  #endif
43  }
void set_zero()
Definition: Vector.h:55
FiniteAxisSymmetricWall::FiniteAxisSymmetricWall ( const FiniteAxisSymmetricWall p)
inline

Definition at line 45 of file FiniteAxisSymmetricWall.h.

References axisOrientation, axisOrigin, and CartesianVelocity.

45  : FiniteWall(p)
46  {
50  #ifdef CONSTUCTOR_OUTPUT
51  std::cout<<"FiniteAxisSymmetricWall(const FiniteAxisSymmetricWall &p) finished"<<std::endl;
52  #endif
53  }

Member Function Documentation

FiniteAxisSymmetricWall* FiniteAxisSymmetricWall::copy ( ) const
inlinevirtual

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

Reimplemented from FiniteWall.

Definition at line 56 of file FiniteAxisSymmetricWall.h.

References FiniteAxisSymmetricWall().

57  {
58  return new FiniteAxisSymmetricWall(*this);
59  }
bool FiniteAxisSymmetricWall::get_distance_and_normal ( BaseParticle P,
Mdouble distance,
Vec3D normal_return 
)
inline
Todo:
{Kay found a bug here}
Todo:
Radius is based on Particle, not wall

Definition at line 61 of file FiniteAxisSymmetricWall.h.

References axisOrientation, axisOrigin, CartesianVelocity, Cross(), FiniteWall::get_distance_and_normal(), BaseParticle::get_Position(), Vec3D::GetLength(), Vec3D::is_zero(), BaseParticle::set_Position(), BaseWall::velocity, Vec3D::X, Vec3D::Y, and Vec3D::Z.

62  {
64  //transform to axisymmetric coordinates
65  Vec3D PO = P.get_Position() - axisOrigin; //move the coordinate system to the axis origin, so P0=(xhat,yhat,zhat)
66  Vec3D tangential = PO-P.get_Position().Z*axisOrientation; //tangential is the projection into the (xhat,yhat) plane
67  P.set_Position(Vec3D(tangential.GetLength(),0.0,Dot(axisOrientation,PO))); //now P=(r,phi,zhat) is cylindrical
68  tangential /= P.get_Position().X;
69  Vec3D normal_axisymmetric_coordinates;
70  //determine wall distance, normal and contact in axissymmetric coordinates
71  //and transform from axisymmetric coordinates
72  if(!FiniteWall::get_distance_and_normal(P, distance, normal_axisymmetric_coordinates))
73  {
74  //if not in contact
75  P.set_Position(PO + axisOrigin);
76  return false;
77  } else {
78  //if in contact
79  normal_return = normal_axisymmetric_coordinates.Z * axisOrientation + tangential*normal_axisymmetric_coordinates.X;
81  if (!velocity.is_zero()) { //assuming most walls have zero velocity, this if statement saves time
82  Vec3D angular = Cross(axisOrientation,tangential);
84  }
85  P.set_Position(PO + axisOrigin);
86  //std::cout << P.get_Position() << " v " << get_Velocity() << " cv " << velocity << std::endl;
87  return true;
88  }
89  }
Mdouble X
Definition: Vector.h:44
bool is_zero()
Definition: Vector.h:60
Vec3D velocity
velocity of the wall (used to calculate the relative velocity in the force calculation) ...
Definition: BaseWall.h:114
Matrix3D Cross(const Vec3D &A, const Matrix3D &B)
Definition: Matrix.h:198
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.
Definition: FiniteWall.h:150
const Vec3D & get_Position() const
Mdouble Y
Definition: Vector.h:44
Mdouble GetLength() const
Definition: Vector.h:248
Implementation of a 3D vector (by Vitaliy).
Definition: Vector.h:40
void set_Position(const Vec3D &_new)
Mdouble Z
Definition: Vector.h:44
Vec3D FiniteAxisSymmetricWall::get_Velocity ( ) const
inlinevirtual
Todo:
{Velocity is given in (R,phi,zhat) coordinates and has to be translated to (x,y,z)} access function for velocity

Implements BaseWall.

Definition at line 115 of file FiniteAxisSymmetricWall.h.

References CartesianVelocity.

Vec3D FiniteAxisSymmetricWall::getAxisOrigin ( ) const
inline

Definition at line 123 of file FiniteAxisSymmetricWall.h.

References axisOrigin.

void FiniteAxisSymmetricWall::moveAxisOrigin ( Vec3D  velocity_,
Mdouble  dt 
)
inline

Allows the wall to be moved to a new position, and sets the velocity.

Definition at line 118 of file FiniteAxisSymmetricWall.h.

References axisOrigin, and BaseWall::velocity.

118  {
119  velocity=velocity_;
120  axisOrigin+=velocity*dt;
121  }
Vec3D velocity
velocity of the wall (used to calculate the relative velocity in the force calculation) ...
Definition: BaseWall.h:114
void FiniteAxisSymmetricWall::print ( std::ostream &  os) const
inline

outputs wall

Definition at line 107 of file FiniteAxisSymmetricWall.h.

References axisOrientation, axisOrigin, and FiniteWall::print().

108  {
109  os << "FiniteAxisSymmetricWall axisOrigin "<<axisOrigin<<" axisOrientation "<<axisOrientation<<" ";
110  FiniteWall::print(os);
111  }
void print(std::ostream &os) const
outputs wall
Definition: FiniteWall.h:250
void FiniteAxisSymmetricWall::read ( std::istream &  is)
inline

reads wall

Definition at line 99 of file FiniteAxisSymmetricWall.h.

References axisOrientation, axisOrigin, and FiniteWall::read().

100  {
101  std::string dummy;
103  FiniteWall::read(is);
104  }
void read(std::istream &is)
reads wall
Definition: FiniteWall.h:233
void FiniteAxisSymmetricWall::setSymmetryAxis ( Vec3D  new_axisOrigin,
Vec3D  new_axisOrientation 
)
inline

Defines an axisymmetric wall.

Definition at line 92 of file FiniteAxisSymmetricWall.h.

References axisOrientation, axisOrigin, and Vec3D::normalize().

92  {
93  axisOrigin = new_axisOrigin;
94  axisOrientation = new_axisOrientation;
96  }
void normalize()
Definition: Vector.h:152

Member Data Documentation

Vec3D FiniteAxisSymmetricWall::axisOrientation
private
Vec3D FiniteAxisSymmetricWall::axisOrigin
private
Vec3D FiniteAxisSymmetricWall::CartesianVelocity
private

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