AngledPeriodicBoundary.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 AngledPeriodicBoundary_H
6 #define AngledPeriodicBoundary_H
7 
8 #include "BaseBoundary.h"
9 #include "Math/Vector.h"
10 #include "Math/Matrix.h"
11 
12 class BaseParticle;
13 
14 class ParticleHandler;
15 
25 {
26 public:
27 
31  AngledPeriodicBoundary* copy() const final;
32 
33  //todo constructors instead of set functions?
34  //AngledPeriodicBoundary (Vec3D normal_left_, Vec3D normal_right_, Vec3D origin_)
35 
39  void set(Vec3D normalLeft, Vec3D normalRight, Vec3D origin);
40 
49 
53  //this function should be cheap, as it has to be computed for all particles
54  Mdouble distance(const Vec3D& P);
55 
61 
62 
66  void shiftPositions(Vec3D& P1, Vec3D& P2);
67 
71  void read(std::istream& is) override;
72 
76  void oldRead(std::istream& is);
77 
81  void write(std::ostream& os) const override;
82 
86  std::string getName() const override;
87 
91  Vec3D& getNormal();
92 
97 
99 
103  void createPeriodicParticles(ParticleHandler& pH) override;
104 
110 
112 
113 private:
114  //values set by the user
119 
124 
129  //values set by the code
133  bool leftWall_;
150 
152 
154 
163 
167  //Vec3D angularShift_;
168 };
169 
170 #endif
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: AngledPeriodicBoundary.h:25
void checkBoundaryAfterParticleMoved(BaseParticle *P)
Definition: AngledPeriodicBoundary.cc:297
Vec3D & getNormal()
Definition: AngledPeriodicBoundary.cc:234
void checkBoundaryAfterParticlesMove(ParticleHandler &pH) override
Virtual function that does things to particles, each time step after particles have moved.
Definition: AngledPeriodicBoundary.cc:305
bool leftWall_
true if closest wall is the left wall
Definition: AngledPeriodicBoundary.h:133
Matrix3D rotateLeft
Definition: AngledPeriodicBoundary.h:151
Mdouble getOpeningAngle()
angle between walls in radians
Definition: AngledPeriodicBoundary.cc:245
Vec3D origin_
common point of both walls
Definition: AngledPeriodicBoundary.h:128
Vec3D rightRadialAxis_
outward unit normal vector for right wall
Definition: AngledPeriodicBoundary.h:141
void createPeriodicParticle(BaseParticle *p, ParticleHandler &pH) override
Definition: AngledPeriodicBoundary.cc:253
Vec3D rightNormal_
outward unit normal vector for right wall
Definition: AngledPeriodicBoundary.h:123
Matrix3D rotateRight
Definition: AngledPeriodicBoundary.h:153
void shiftPositions(Vec3D &P1, Vec3D &P2)
only needed in StatisticsVector
Definition: AngledPeriodicBoundary.cc:162
Vec3D commonAxis_
The normalized cross product of the left and right normal vector. This vector points in the direction...
Definition: AngledPeriodicBoundary.h:162
AngledPeriodicBoundary * copy() const final
Used to create a copy of the object NB: purely virtual function.
Definition: AngledPeriodicBoundary.cc:15
Vec3D leftRadialAxis_
outward unit normal vector for left wall
Definition: AngledPeriodicBoundary.h:137
void oldRead(std::istream &is)
Definition: AngledPeriodicBoundary.cc:205
void set(Vec3D normalLeft, Vec3D normalRight, Vec3D origin)
Defines a periodic wall.
Definition: AngledPeriodicBoundary.cc:39
Vec3D leftNormal_
Definition: AngledPeriodicBoundary.h:118
Vec3D differenceNormal_
Definition: AngledPeriodicBoundary.h:149
void createPeriodicParticles(ParticleHandler &pH) override
Definition: AngledPeriodicBoundary.cc:285
std::string getName() const override
Returns the name of the object.
Definition: AngledPeriodicBoundary.cc:226
Mdouble distance(const BaseParticle &P)
Returns the distance of the wall to the particle and sets left_wall = true, if the left wall is the w...
Definition: AngledPeriodicBoundary.cc:73
void shiftPosition(BaseParticle *P)
shifts the particle (after distance set the left_wall value)
Definition: AngledPeriodicBoundary.cc:104
void write(std::ostream &os) const override
outputs wall
Definition: AngledPeriodicBoundary.cc:215
void read(std::istream &is) override
reads wall
Definition: AngledPeriodicBoundary.cc:194
Vec3D differenceRadialAxis_
Definition: AngledPeriodicBoundary.h:145
Definition: BaseBoundary.h:28
Definition: BaseParticle.h:33
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
Container to store pointers to all particles.
Definition: ParticleHandler.h:28
Definition: Kernel/Math/Vector.h:30
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286