ShearBoxBoundary.h
Go to the documentation of this file.
1 // This file is part of the MercuryDPM project (https://www.mercurydpm.org).
2 // Copyright (c), The MercuryDPM Developers Team. All rights reserved.
3 // License: BSD 3-Clause License; see the LICENSE file in the root directory.
4 
5 #ifndef ShearBoxBoundary_H
6 #define ShearBoxBoundary_H
7 
8 #include "BaseBoundary.h"
9 
10 #include <functional>
11 
12 class ParticleHandler;
13 
22 {
23 public:
24 
28  void set(std::function<double(double, double)> velocity, Mdouble left, Mdouble right, Mdouble down, Mdouble up);
29 
33  void read(std::istream& is) override;
34 
38  void write(std::ostream& os) const override;
39 
43  std::string getName() const override;
44 
48  ShearBoxBoundary* copy() const override;
49 
53  Mdouble getHorizontalDistance(BaseParticle& p, bool& positive);
54 
58  Mdouble getVerticalDistance(BaseParticle& p, bool& positive);
59 
63  void shiftHorizontalPosition(BaseParticle* p, bool positive);
64 
68  void shiftVerticalPosition(BaseParticle* p, bool positive);
69 
74 
79 
84 
89 
90  void setVelocity(std::function<double(double, double)>);
91 
92 private:
97  std::function<double(double, double)> velocity_;
98 };
99 
100 #endif
#define UNUSED
Definition: GeneralDefine.h:18
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseBoundary.h:28
Definition: BaseParticle.h:33
Container to store pointers to all particles.
Definition: ParticleHandler.h:28
Class which creates a boundary with Lees-Edwards type periodic boundary conditions.
Definition: ShearBoxBoundary.h:22
void createPeriodicParticle(BaseParticle *p, ParticleHandler &pH) override
Creates horizontal and vertical periodic copies of given particle, if needed.
Definition: ShearBoxBoundary.cc:234
Mdouble getVerticalDistance(BaseParticle &p, bool &positive)
Returns distance from given particle to the closest vertical wall.
Definition: ShearBoxBoundary.cc:95
std::string getName() const override
Returns the name of the object.
Definition: ShearBoxBoundary.cc:53
Mdouble right_
(signed) Horizontal distance between the left wall and the origin
Definition: ShearBoxBoundary.h:94
void write(std::ostream &os) const override
Writes all boundary properties to a stream.
Definition: ShearBoxBoundary.cc:44
void shiftHorizontalPosition(BaseParticle *p, bool positive)
Applies a horizontal shift to the given particle.
Definition: ShearBoxBoundary.cc:118
ShearBoxBoundary * copy() const override
Creates a copy of the object.
Definition: ShearBoxBoundary.cc:62
Mdouble up_
(signed) Vertical distance between the bottom wall and the origin
Definition: ShearBoxBoundary.h:96
Mdouble getHorizontalDistance(BaseParticle &p, bool &positive)
Returns distance from given particle to the closest horizontal wall.
Definition: ShearBoxBoundary.cc:73
Mdouble down_
(signed) Horizontal distance between the right wall and the origin
Definition: ShearBoxBoundary.h:95
void createVerticalPeriodicParticle(BaseParticle *p, ParticleHandler &pH)
Creates vertical periodic copies of given particle, if needed.
Definition: ShearBoxBoundary.cc:197
void read(std::istream &is) override
Reads all boundary properties from a stream.
Definition: ShearBoxBoundary.cc:32
void set(std::function< double(double, double)> velocity, Mdouble left, Mdouble right, Mdouble down, Mdouble up)
Sets all boundary properties.
Definition: ShearBoxBoundary.cc:18
Mdouble left_
Definition: ShearBoxBoundary.h:93
void createHorizontalPeriodicParticle(BaseParticle *p, ParticleHandler &pH)
Creates horizontal periodic copies of given particle, if needed.
Definition: ShearBoxBoundary.cc:161
void shiftVerticalPosition(BaseParticle *p, bool positive)
Applies a vertical shift to the given particle.
Definition: ShearBoxBoundary.cc:141
std::function< double(double, double)> velocity_
(signed) Vertical distance between the top wall and the origin
Definition: ShearBoxBoundary.h:97
void setVelocity(std::function< double(double, double)>)
Definition: ShearBoxBoundary.cc:259
bool checkBoundaryAfterParticleMoved(BaseParticle *p, ParticleHandler &pH UNUSED)
Checks if particle crossed a boundary wall and if so, applies periodic shift.
Definition: ShearBoxBoundary.cc:245
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286