LeesEdwardsBoundary Class Reference

Class which creates a boundary with Lees-Edwards type periodic boundary conditions. More...

#include <LeesEdwardsBoundary.h>

+ Inheritance diagram for LeesEdwardsBoundary:

Public Member Functions

 LeesEdwardsBoundary ()
 
 LeesEdwardsBoundary (const LeesEdwardsBoundary &other)
 Copy constructor. More...
 
void set (std::function< Mdouble(Mdouble)> shift, std::function< Mdouble(Mdouble)> velocity, Mdouble left, Mdouble right, Mdouble down, Mdouble up)
 Sets all boundary properties. More...
 
void updateBoundaries (Mdouble left, Mdouble right, Mdouble down, Mdouble up)
 
void read (std::istream &is) override
 Reads all boundary properties from a stream. More...
 
void write (std::ostream &os) const override
 Writes all boundary properties to a stream. More...
 
std::string getName () const override
 Returns the name of the object. More...
 
LeesEdwardsBoundarycopy () const override
 Creates a copy of the object. More...
 
Mdouble getHorizontalDistance (BaseParticle &p, bool &positive)
 Returns distance from given particle to the closest horizontal wall. More...
 
Mdouble getVerticalDistance (BaseParticle &p, bool &positive)
 Returns distance from given particle to the closest vertical wall. More...
 
void shiftHorizontalPosition (BaseParticle *p, bool positive)
 Applies a horizontal shift to the given particle. More...
 
void shiftVerticalPosition (BaseParticle *p, bool positive)
 Applies a vertical shift to the given particle. More...
 
void checkBoundaryAfterParticleMoved (BaseParticle *p)
 Checks if particle crossed a boundary wall and if so, applies periodic shift. More...
 
void checkBoundaryAfterParticlesMove (ParticleHandler &pH) override
 Checks if particles need to be adjusted after their position has been updated. More...
 
void createPeriodicParticle (BaseParticle *p, ParticleHandler &pH) override
 
void createPeriodicParticles (ParticleHandler &pH) override
 Creates horizontal and vertical periodic copies of given particle, if needed. More...
 
void createHorizontalPeriodicParticle (BaseParticle *p, ParticleHandler &pH)
 Creates horizontal periodic copies of given particle, if needed. More...
 
void createVerticalPeriodicParticle (BaseParticle *p, ParticleHandler &pH)
 Creates vertical periodic copies of given particle, if needed. More...
 
Mdouble getCurrentShift ()
 
Mdouble getCurrentVelocity ()
 
void setShift (std::function< Mdouble(Mdouble)>)
 
void setVelocity (std::function< Mdouble(Mdouble)>)
 
- 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

Mdouble left_
 
Mdouble right_
 (signed) Horizontal distance between the left wall and the origin More...
 
Mdouble down_
 (signed) Horizontal distance between the right wall and the origin More...
 
Mdouble up_
 (signed) Vertical distance between the bottom wall and the origin More...
 
std::function< Mdouble(Mdouble)> shift_
 (signed) Vertical distance between the top wall and the origin More...
 
std::function< Mdouble(Mdouble)> velocity_
 

Detailed Description

Class which creates a boundary with Lees-Edwards type periodic boundary conditions.

A LeesEdwardsBoundary is like a PeriodicBoundary, but when a particle crosses one edge and is copied to the other side then the particle is also shifted. This sort of boundary is useful for studying shear flows.

See also Lees and Edwards (J. Phys. C 1921, doi:1088/0022-3719/5/15/006). Inherits from BaseBoundary.

Todo:

Add link to paper by Lees-Edwards in the documentation of this class.

Is implemented for 2D only now. Needs extension to 3D.

Constructor & Destructor Documentation

◆ LeesEdwardsBoundary() [1/2]

LeesEdwardsBoundary::LeesEdwardsBoundary ( )
inline
51  {
52 #ifdef MERCURYDPM_USE_MPI
53  MPIContainer& communicator = MPIContainer::Instance();
54  if (communicator.getNumberOfProcessors() > 1)
55  {
56  logger(WARN,"LeesEdwardsBoundaries are currently not implemented in parallel MercuryDPM");
57  }
58 #endif
59  }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
@ WARN
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:130
std::size_t getNumberOfProcessors() const
Get the total number of processors participating in this simulation.
Definition: MpiContainer.cc:104
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134

References MPIContainer::getNumberOfProcessors(), MPIContainer::Instance(), logger, and WARN.

Referenced by copy().

◆ LeesEdwardsBoundary() [2/2]

LeesEdwardsBoundary::LeesEdwardsBoundary ( const LeesEdwardsBoundary other)

Copy constructor.

31  : BaseBoundary(other)
32 {
33  shift_ = other.shift_;
34  velocity_ = other.velocity_;
35  left_ = other.left_;
36  right_ = other.right_;
37  down_ = other.down_;
38  up_ = other.up_;
39 }
BaseBoundary()
default constructor.
Definition: BaseBoundary.cc:32
Mdouble down_
(signed) Horizontal distance between the right wall and the origin
Definition: LeesEdwardsBoundary.h:153
Mdouble left_
Definition: LeesEdwardsBoundary.h:151
Mdouble right_
(signed) Horizontal distance between the left wall and the origin
Definition: LeesEdwardsBoundary.h:152
Mdouble up_
(signed) Vertical distance between the bottom wall and the origin
Definition: LeesEdwardsBoundary.h:154
std::function< Mdouble(Mdouble)> velocity_
Definition: LeesEdwardsBoundary.h:156
std::function< Mdouble(Mdouble)> shift_
(signed) Vertical distance between the top wall and the origin
Definition: LeesEdwardsBoundary.h:155

References down_, left_, right_, shift_, up_, and velocity_.

Member Function Documentation

◆ checkBoundaryAfterParticleMoved()

void LeesEdwardsBoundary::checkBoundaryAfterParticleMoved ( BaseParticle p)

Checks if particle crossed a boundary wall and if so, applies periodic shift.

Checks if the particle has to be shifted into the main domain (i.e., if the particle has crossed any of the boundary walls) and if so performs the shift

Parameters
[in]pA pointer to the BaseParticle that is checked
303 {
304  bool positive;
305  while (getVerticalDistance(*p, positive) < 0)
306  {
307  shiftVerticalPosition(p, positive);
308  }
309  while (getHorizontalDistance(*p, positive) < 0)
310  {
311  shiftHorizontalPosition(p, positive);
312  }
313 }
Mdouble getVerticalDistance(BaseParticle &p, bool &positive)
Returns distance from given particle to the closest vertical wall.
Definition: LeesEdwardsBoundary.cc:142
Mdouble getHorizontalDistance(BaseParticle &p, bool &positive)
Returns distance from given particle to the closest horizontal wall.
Definition: LeesEdwardsBoundary.cc:120
void shiftHorizontalPosition(BaseParticle *p, bool positive)
Applies a horizontal shift to the given particle.
Definition: LeesEdwardsBoundary.cc:165
void shiftVerticalPosition(BaseParticle *p, bool positive)
Applies a vertical shift to the given particle.
Definition: LeesEdwardsBoundary.cc:184

References getHorizontalDistance(), getVerticalDistance(), shiftHorizontalPosition(), and shiftVerticalPosition().

Referenced by checkBoundaryAfterParticlesMove().

◆ checkBoundaryAfterParticlesMove()

void LeesEdwardsBoundary::checkBoundaryAfterParticlesMove ( ParticleHandler pH)
overridevirtual

Checks if particles need to be adjusted after their position has been updated.

Reimplemented from BaseBoundary.

316 {
317  for (auto p = pH.begin(); p != pH.end(); ++p)
318  {
320  }
321 }
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:690
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:704
void checkBoundaryAfterParticleMoved(BaseParticle *p)
Checks if particle crossed a boundary wall and if so, applies periodic shift.
Definition: LeesEdwardsBoundary.cc:302

References BaseHandler< T >::begin(), checkBoundaryAfterParticleMoved(), and BaseHandler< T >::end().

◆ copy()

LeesEdwardsBoundary * LeesEdwardsBoundary::copy ( ) const
overridevirtual

Creates a copy of the object.

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

Returns
pointer to the copy on the heap

Implements BaseBoundary.

110 {
111  return new LeesEdwardsBoundary(*this);
112 }
LeesEdwardsBoundary()
Definition: LeesEdwardsBoundary.h:50

References LeesEdwardsBoundary().

◆ createHorizontalPeriodicParticle()

void LeesEdwardsBoundary::createHorizontalPeriodicParticle ( BaseParticle p,
ParticleHandler pH 
)

Creates horizontal periodic copies of given particle, if needed.

Check if periodic copies of the particle in horizontal direction have to be made (i.e., if the distance of the particle to either of the horizontal boundary walls is smaller than its radius plus the radius of the largest particle in the system), and if so makes them

Parameters
[in]pA pointer to the BaseParticle that is checked
[out]pHA reference to the ParticleHandler where periodic copies will be added
208 {
209  bool positive; // TRUE if the particle is closest to the left boundary
210  // wall (set by getVerticalDistance in the following if-statement)
211  //
212  // Note, 'positive' is passed by reference to getHorizontalDistance
213  // check if particle is close enough to either of the walls
215  if (getHorizontalDistance(*p, positive) < maxDistance)
216  {
217  // create a periodic copy of the particle
218  BaseParticle* F0 = p->copy();
219  pH.addObject(F0);
221 
222  // If Particle is doubly shifted, get correct original particle
223  BaseParticle* From = p;
224  while (From->getPeriodicFromParticle() != nullptr)
225  From = From->getPeriodicFromParticle();
226  F0->setPeriodicFromParticle(From);
227 
228  // shift the copy to the 'periodic' position
229  shiftHorizontalPosition(F0, positive);
230 
231  // NB: No extra creation of possible vertical copies of the horizontal copy
232  // here (as compared to createVerticalPeriodicParticle), because these would
233  // overlap with the extra creation of horizontal copies in createVerticalPeriodicParticle.
234  }
235 }
double Mdouble
Definition: GeneralDefine.h:34
void copyInteractionsForPeriodicParticles(const BaseInteractable &p)
Copies interactions to this BaseInteractable whenever a periodic copy made.
Definition: BaseInteractable.cc:386
Definition: BaseParticle.h:54
void setPeriodicFromParticle(BaseParticle *p)
Assigns the pointer to the 'original' particle this one's a periodic copy of (used in periodic bounda...
Definition: BaseParticle.h:441
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
void addObject(BaseParticle *P) override
Adds a BaseParticle to the ParticleHandler.
Definition: ParticleHandler.cc:171
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
Definition: ParticleHandler.cc:534

References ParticleHandler::addObject(), BaseParticle::copy(), BaseInteractable::copyInteractionsForPeriodicParticles(), getHorizontalDistance(), ParticleHandler::getLargestParticle(), BaseParticle::getMaxInteractionRadius(), BaseParticle::getPeriodicFromParticle(), BaseParticle::setPeriodicFromParticle(), and shiftHorizontalPosition().

Referenced by createPeriodicParticle(), and createVerticalPeriodicParticle().

◆ createPeriodicParticle()

void LeesEdwardsBoundary::createPeriodicParticle ( BaseParticle p,
ParticleHandler pH 
)
override

Check if periodic copies of the particle have to be made for the contact detection and if so makes them

Parameters
[in]pA pointer to the BaseParticle that is checked
[out]pHA reference to the ParticleHandler where periodic copies will be added
283 {
286 }
void createVerticalPeriodicParticle(BaseParticle *p, ParticleHandler &pH)
Creates vertical periodic copies of given particle, if needed.
Definition: LeesEdwardsBoundary.cc:245
void createHorizontalPeriodicParticle(BaseParticle *p, ParticleHandler &pH)
Creates horizontal periodic copies of given particle, if needed.
Definition: LeesEdwardsBoundary.cc:207

References createHorizontalPeriodicParticle(), and createVerticalPeriodicParticle().

Referenced by createPeriodicParticles().

◆ createPeriodicParticles()

void LeesEdwardsBoundary::createPeriodicParticles ( ParticleHandler pH)
override

Creates horizontal and vertical periodic copies of given particle, if needed.

289 {
290  unsigned numberOfParticles = pH.getSize();
291  for (unsigned i = 0; i < numberOfParticles; i++)
292  {
294  }
295 }
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void createPeriodicParticle(BaseParticle *p, ParticleHandler &pH) override
Definition: LeesEdwardsBoundary.cc:282
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References createPeriodicParticle(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), and constants::i.

◆ createVerticalPeriodicParticle()

void LeesEdwardsBoundary::createVerticalPeriodicParticle ( BaseParticle p,
ParticleHandler pH 
)

Creates vertical periodic copies of given particle, if needed.

Check if periodic copies of the particle in vertical direction have to be made (i.e., if the distance of the particle to either of the vertical boundary walls is smaller than its radius plus the radius of the largest particle in the system), and if so makes them

Parameters
[in]pA pointer to the BaseParticle that is checked
[out]pHA reference to the ParticleHandler where periodic copies will be added
246 {
247  bool positive; // TRUE if the particle is closest to the bottom boundary
248  // wall (set by getVerticalDistance in the following if-statement)
249  // check if particle is close enough to either of the walls
251  if (getVerticalDistance(*p, positive) < maxDistance)
252  {
253  // create a periodic copy of the particle
254  BaseParticle* F0 = p->copy();
255  pH.addObject(F0);
257 
258  // If Particle is doubly shifted, get correct original particle
259  BaseParticle* From = p;
260  while (From->getPeriodicFromParticle() != nullptr)
261  From = From->getPeriodicFromParticle();
262  F0->setPeriodicFromParticle(From);
263 
264  // shift the copy to the 'periodic' position
265  shiftVerticalPosition(F0, positive);
266  while (getHorizontalDistance(*F0, positive) < 0)
267  {
268  shiftHorizontalPosition(F0, positive);
269  }
270 
271  // Create horizontal periodic copies of the copy particle, if needed (i.e.,
272  // if the original particle is in one of the boundary corners).
274  }
275 }
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634

References ParticleHandler::addObject(), BaseParticle::copy(), BaseInteractable::copyInteractionsForPeriodicParticles(), createHorizontalPeriodicParticle(), getHorizontalDistance(), ParticleHandler::getLargestParticle(), BaseHandler< T >::getLastObject(), BaseParticle::getMaxInteractionRadius(), BaseParticle::getPeriodicFromParticle(), getVerticalDistance(), BaseParticle::setPeriodicFromParticle(), shiftHorizontalPosition(), and shiftVerticalPosition().

Referenced by createPeriodicParticle().

◆ getCurrentShift()

Mdouble LeesEdwardsBoundary::getCurrentShift ( )
325 {
326  Mdouble time = getHandler()->getDPMBase()->getTime();
327  return shift_(time);
328 }
BoundaryHandler * getHandler() const
Returns the boundary's BoundaryHandler.
Definition: BaseBoundary.cc:143
DPMBase * getDPMBase()
Gets the problem that is solved using this handler.
Definition: BaseHandler.h:725
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808

References BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTime(), and shift_.

◆ getCurrentVelocity()

Mdouble LeesEdwardsBoundary::getCurrentVelocity ( )
331 {
332  Mdouble time = getHandler()->getDPMBase()->getTime();
333  return velocity_(time);
334 }

References BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTime(), and velocity_.

◆ getHorizontalDistance()

Mdouble LeesEdwardsBoundary::getHorizontalDistance ( BaseParticle p,
bool positive 
)

Returns distance from given particle to the closest horizontal wall.

Returns the distance between BaseParticle p and the closest boundary wall in horizontal direction

Parameters
[in]pA reference to the BaseParticle
[out]positiveA boolean which is true when the left wall is closest
Returns
The distance to the closes wall in horizontal direction
121 {
122  Mdouble left = p.getPosition().X - left_;
123  Mdouble right = right_ - p.getPosition().X;
124  if (left < right)
125  {
126  positive = true;
127  return left;
128  }
129  else
130  {
131  positive = false;
132  return right;
133  }
134 }
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Mdouble X
the vector components
Definition: Vector.h:66

References BaseInteractable::getPosition(), left_, right_, and Vec3D::X.

Referenced by checkBoundaryAfterParticleMoved(), createHorizontalPeriodicParticle(), and createVerticalPeriodicParticle().

◆ getName()

std::string LeesEdwardsBoundary::getName ( ) const
overridevirtual

Returns the name of the object.

Returns
The name of this object (i.e. "LeesEdwardsBoundary")

Implements BaseObject.

101 {
102  return "LeesEdwardsBoundary";
103 }

◆ getVerticalDistance()

Mdouble LeesEdwardsBoundary::getVerticalDistance ( BaseParticle p,
bool positive 
)

Returns distance from given particle to the closest vertical wall.

Returns the distance between BaseParticle p and the closest wall in vertical direction

Parameters
[in]pA reference to the BaseParticle
[out]positiveA boolean which is true when the bottom wall is closest
Returns
The distance to the closes wall in vertical direction
143 {
144  Mdouble down = p.getPosition().Y - down_;
145  Mdouble up = up_ - p.getPosition().Y;
146  if (down < up)
147  {
148  positive = true;
149  return down;
150  }
151  else
152  {
153  positive = false;
154  return up;
155  }
156 }
Mdouble Y
Definition: Vector.h:66

References down_, BaseInteractable::getPosition(), up_, and Vec3D::Y.

Referenced by checkBoundaryAfterParticleMoved(), and createVerticalPeriodicParticle().

◆ read()

void LeesEdwardsBoundary::read ( std::istream &  is)
overridevirtual

Reads all boundary properties from a stream.

Reads all the properties of the LeesEdwardsBoundary from an std::istream

Parameters
[in,out]isThe stream from which the parameters are read

Implements BaseBoundary.

75 {
76  std::string dummy;
78  Mdouble shift;
79  Mdouble velocity;
80  is >> dummy >> left_ >> dummy >> right_ >> dummy >> down_ >> dummy >> up_ >> dummy >> shift >> dummy >> velocity;
81  shift_ = [shift, velocity](Mdouble time UNUSED) { return shift + velocity * time; };
82  velocity_ = [velocity](Mdouble time UNUSED) { return velocity; };
83 }
#define UNUSED
Definition: GeneralDefine.h:39
void read(std::istream &is) override=0
Reads the object's id_ from given istream NB: purely virtual function, overriding the version of Base...
Definition: BaseBoundary.cc:61

References down_, left_, BaseBoundary::read(), right_, shift_, UNUSED, up_, and velocity_.

◆ set()

void LeesEdwardsBoundary::set ( std::function< Mdouble(Mdouble)>  shift,
std::function< Mdouble(Mdouble)>  velocity,
Mdouble  left,
Mdouble  right,
Mdouble  down,
Mdouble  up 
)

Sets all boundary properties.

Allows the user to set all the properties of the LeesEdwardsBoundary at once.

Parameters
[in]velocityThe difference in velocities at which the bottom and to wall move
[in]leftThe (signed) distance between the origin and the left wall
[in]rightThe (signed) distance between the origin and the right wall
[in]downThe (signed) distance between the origin and the top wall
[in]upThe (signed) distance between the origin and the bottom wall
52 {
53  shift_ = shift;
54  velocity_ = velocity;
55  left_ = left;
56  right_ = right;
57  down_ = down;
58  up_ = up;
59 }

References down_, left_, right_, shift_, up_, and velocity_.

Referenced by StressStrainControlBoundary::set(), LeesEdwardsDemo::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), and FullRestartTest::setupInitialConditions().

◆ setShift()

void LeesEdwardsBoundary::setShift ( std::function< Mdouble(Mdouble)>  shift)
337 {
338  shift_ = shift;
339 }

References shift_.

◆ setVelocity()

void LeesEdwardsBoundary::setVelocity ( std::function< Mdouble(Mdouble)>  velocity)
342 {
343  velocity_ = velocity;
344 }

References velocity_.

◆ shiftHorizontalPosition()

void LeesEdwardsBoundary::shiftHorizontalPosition ( BaseParticle p,
bool  positive 
)

Applies a horizontal shift to the given particle.

Shifts the BaseParticle p in horizontal direction to its 'periodic' position, i.e. over the horizontal length of the boundary.

Parameters
[in]pA reference to the BaseParticle that has to be shifted
[in]positiveA boolean which determines the direction of the shift NB: TRUE if particle is closest to the left boundary wall
166 {
167  if (positive)
168  {
169  p->move(Vec3D(right_ - left_, 0.0, 0.0));
170  }
171  else
172  {
173  p->move(Vec3D(left_ - right_, 0.0, 0.0));
174  }
175 }
virtual void move(const Vec3D &move)
Moves this BaseInteractable by adding an amount to the position.
Definition: BaseInteractable.cc:215
Definition: Vector.h:51

References left_, BaseInteractable::move(), and right_.

Referenced by checkBoundaryAfterParticleMoved(), createHorizontalPeriodicParticle(), and createVerticalPeriodicParticle().

◆ shiftVerticalPosition()

void LeesEdwardsBoundary::shiftVerticalPosition ( BaseParticle p,
bool  positive 
)

Applies a vertical shift to the given particle.

Shifts the BaseParticle p in vertical direction to its 'periodic' position, i.e. over the vertical length of the boundary.

Parameters
[in]pA reference to the BaseParticle that has to be shifted
[in]positiveA boolean which determines the direction of the shift NB: TRUE if particle is closest to the bottom boundary wall
185 {
186  Mdouble time = getHandler()->getDPMBase()->getTime();
187  if (positive)
188  {
189  p->move(Vec3D(shift_(time), up_ - down_, 0.0));
190  p->addVelocity(Vec3D(velocity_(time), 0.0, 0.0));
191  }
192  else
193  {
194  p->move(Vec3D(-shift_(time), down_ - up_, 0.0));
195  p->addVelocity(Vec3D(-velocity_(time), 0.0, 0.0));
196  }
197 }
void addVelocity(const Vec3D &velocity)
adds an increment to the velocity.
Definition: BaseInteractable.h:312

References BaseInteractable::addVelocity(), down_, BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTime(), BaseInteractable::move(), shift_, up_, and velocity_.

Referenced by checkBoundaryAfterParticleMoved(), and createVerticalPeriodicParticle().

◆ updateBoundaries()

void LeesEdwardsBoundary::updateBoundaries ( Mdouble  left,
Mdouble  right,
Mdouble  down,
Mdouble  up 
)
62 {
63  left_ = left;
64  right_ = right;
65  down_ = down;
66  up_ = up;
67 }

References down_, left_, right_, and up_.

◆ write()

void LeesEdwardsBoundary::write ( std::ostream &  os) const
overridevirtual

Writes all boundary properties to a stream.

Writes all the properties of the LeesEdwardsBoundary to an std::ostream

Parameters
[out]osThe stream to which the parameters are written

Implements BaseBoundary.

90 {
92  Mdouble time = getHandler()->getDPMBase()->getTime();
93  os << " left " << left_ << " right " << right_ << " down " << down_ << " up " << up_ << " shift " << shift_(time)
94  << " vel " << velocity_(time);
95 }
void write(std::ostream &os) const override=0
Adds object's id_ to given ostream NB: purely virtual function, overriding the version of BaseObject.
Definition: BaseBoundary.cc:70

References down_, BaseHandler< T >::getDPMBase(), BaseBoundary::getHandler(), DPMBase::getTime(), left_, right_, shift_, up_, velocity_, and BaseBoundary::write().

Member Data Documentation

◆ down_

Mdouble LeesEdwardsBoundary::down_
private

(signed) Horizontal distance between the right wall and the origin

Referenced by getVerticalDistance(), LeesEdwardsBoundary(), read(), set(), shiftVerticalPosition(), updateBoundaries(), and write().

◆ left_

◆ right_

Mdouble LeesEdwardsBoundary::right_
private

(signed) Horizontal distance between the left wall and the origin

Referenced by getHorizontalDistance(), LeesEdwardsBoundary(), read(), set(), shiftHorizontalPosition(), updateBoundaries(), and write().

◆ shift_

std::function<Mdouble(Mdouble)> LeesEdwardsBoundary::shift_
private

(signed) Vertical distance between the top wall and the origin

Referenced by getCurrentShift(), LeesEdwardsBoundary(), read(), set(), setShift(), shiftVerticalPosition(), and write().

◆ up_

Mdouble LeesEdwardsBoundary::up_
private

(signed) Vertical distance between the bottom wall and the origin

Referenced by getVerticalDistance(), LeesEdwardsBoundary(), read(), set(), shiftVerticalPosition(), updateBoundaries(), and write().

◆ velocity_

std::function<Mdouble(Mdouble)> LeesEdwardsBoundary::velocity_
private

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