MercuryDPM
0.10
|
Defines a pair of periodic walls. The particles are in {x: position_left<=normal*x <position_right}, with normal being the outward unit normal vector of the right wall. If a particle moves outside these boundaries, it will be shifted. More...
#include <PeriodicBoundary.h>
Public Member Functions | |
virtual PeriodicBoundary * | copy () const |
BaseBoundary copy method. More... | |
void | set (Vec3D normal_, Mdouble position_left_, Mdouble position_right_) |
Defines a periodic wall, given a normal vector s.t. More... | |
void | set (Vec3D normal_, Mdouble position_left_, Mdouble position_right_, Vec3D shift_direction) |
For general parallelogramic domains, the direction of the shift vector has to be set manually. More... | |
void | move_left (Mdouble position_) |
Allows the left periodic wall to be moved to a new position and automatically changes its shift value. More... | |
void | move_right (Mdouble position_) |
Allows the right periodic wall to be moved to a new position and automatically changes its shift value. More... | |
Mdouble | distance (BaseParticle &P) |
Returns the distance of the wall to the particle, and sets left_wall = true, if the left wall is the wall closest to the particle. More... | |
Mdouble | distance (const Vec3D &P) |
void | shift_position (BaseParticle *F0) |
shifts the particle (after distance set the left_wall value) More... | |
Vec3D | get_shifted_position (Vec3D &Position) |
returns the shifted particle w/o actually shifting More... | |
void | shift_positions (Vec3D &PI, Vec3D &PJ) |
shifts two particles More... | |
void | get_close_together (Vec3D &P, Vec3D &Q) |
shift P such that it is closest to Q More... | |
void | read (std::istream &is) |
reads wall More... | |
void | print (std::ostream &os) const |
outputs wall More... | |
Vec3D & | get_normal () |
int | createPeriodicParticles (BaseParticle *P, ParticleHandler &pH) |
bool | checkBoundaryAfterParticleMoved (BaseParticle *P, ParticleHandler &pH UNUSED) |
![]() | |
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 | |
bool | left_wall |
true if closest wall is the left wall More... | |
Vec3D | normal |
outward unit normal vector for right wall More... | |
Mdouble | position_left |
position of left wall, s.t. normal*x=position_left More... | |
Mdouble | position_right |
position of right wall, s.t. normal*x=position_right More... | |
Mdouble | factor |
This is the normal to rescale to unit vectoers. More... | |
Vec3D | shift |
shift from left to right boundary More... | |
Defines a pair of periodic walls. The particles are in {x: position_left<=normal*x <position_right}, with normal being the outward unit normal vector of the right wall. If a particle moves outside these boundaries, it will be shifted.
Definition at line 35 of file PeriodicBoundary.h.
|
inline |
Definition at line 201 of file PeriodicBoundary.h.
References distance(), and shift_position().
|
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 38 of file PeriodicBoundary.h.
|
inline |
Definition at line 177 of file PeriodicBoundary.h.
References ParticleHandler::addObject(), BaseParticle::copy(), distance(), BaseParticle::get_InteractionRadius(), BaseParticle::get_PeriodicFromParticle(), ParticleHandler::getLargestParticle(), TangentialSpringParticle::reverseTangentialSprings(), BaseParticle::set_periodicFromParticle(), and shift_position().
|
inline |
Returns the distance of the wall to the particle, and sets left_wall = true, if the left wall is the wall closest to the particle.
Since this function should be called before calculating any Particle-Wall interactions, it can also be used to set the shift vector in case of curved walls.
Definition at line 96 of file PeriodicBoundary.h.
References BaseParticle::get_Position().
Referenced by checkBoundaryAfterParticleMoved(), createPeriodicParticles(), MD::do_integration_after_force_computation(), StatisticsVector< T >::evaluate_force_statistics(), StatisticsVector< T >::evaluate_particle_statistics(), and StatisticsVector< T >::evaluate_wall_force_statistics().
Definition at line 100 of file PeriodicBoundary.h.
References left_wall, normal, position_left, and position_right.
shift P such that it is closest to Q
Definition at line 149 of file PeriodicBoundary.h.
References Vec3D::GetLength2, normal, shift, and sqr.
|
inline |
Definition at line 175 of file PeriodicBoundary.h.
References normal.
returns the shifted particle w/o actually shifting
Definition at line 125 of file PeriodicBoundary.h.
References left_wall, and shift.
|
inline |
Allows the left periodic wall to be moved to a new position and automatically changes its shift value.
Definition at line 75 of file PeriodicBoundary.h.
References factor, normal, position_left, position_right, and shift.
|
inline |
Allows the right periodic wall to be moved to a new position and automatically changes its shift value.
Definition at line 82 of file PeriodicBoundary.h.
References factor, normal, position_left, position_right, and shift.
|
inline |
outputs wall
Definition at line 168 of file PeriodicBoundary.h.
References normal, position_left, position_right, and shift.
|
inline |
reads wall
Definition at line 162 of file PeriodicBoundary.h.
References normal, position_left, position_right, and shift.
|
inline |
Defines a periodic wall, given a normal vector s.t.
all particles are within {x: position_left<=normal*x<position_right}. The shift vector is set assuming that the domain is rectangular (shift parallel to normal).
Definition at line 52 of file PeriodicBoundary.h.
References factor, normal, position_left, position_right, and shift.
Referenced by MD::load_par_ini_file(), Chute::setup_particles_initial_conditions(), and ChuteBottom::setup_particles_initial_conditions().
|
inline |
For general parallelogramic domains, the direction of the shift vector has to be set manually.
Definition at line 63 of file PeriodicBoundary.h.
References factor, normal, position_left, position_right, and shift.
|
inline |
shifts the particle (after distance set the left_wall value)
Definition at line 113 of file PeriodicBoundary.h.
References left_wall, BaseParticle::move(), and shift.
Referenced by checkBoundaryAfterParticleMoved(), createPeriodicParticles(), MD::do_integration_after_force_computation(), and StatisticsVector< T >::evaluate_particle_statistics().
shifts two particles
Definition at line 135 of file PeriodicBoundary.h.
References left_wall, and shift.
Referenced by StatisticsVector< T >::evaluate_force_statistics(), and StatisticsVector< T >::evaluate_wall_force_statistics().
|
private |
This is the normal to rescale to unit vectoers.
Definition at line 215 of file PeriodicBoundary.h.
Referenced by move_left(), move_right(), and set().
|
private |
true if closest wall is the left wall
Definition at line 211 of file PeriodicBoundary.h.
Referenced by distance(), get_shifted_position(), shift_position(), and shift_positions().
|
private |
outward unit normal vector for right wall
Definition at line 212 of file PeriodicBoundary.h.
Referenced by distance(), get_close_together(), get_normal(), move_left(), move_right(), print(), read(), and set().
|
private |
position of left wall, s.t. normal*x=position_left
Definition at line 213 of file PeriodicBoundary.h.
Referenced by distance(), move_left(), move_right(), print(), read(), and set().
|
private |
position of right wall, s.t. normal*x=position_right
Definition at line 214 of file PeriodicBoundary.h.
Referenced by distance(), move_left(), move_right(), print(), read(), and set().
|
private |
shift from left to right boundary
Definition at line 216 of file PeriodicBoundary.h.
Referenced by get_close_together(), get_shifted_position(), move_left(), move_right(), print(), read(), set(), shift_position(), and shift_positions().