CylinderInsertionBoundary.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 BOUNDARIES_CYLINDERINSERTIONBOUNDARY_H
6 #define BOUNDARIES_CYLINDERINSERTIONBOUNDARY_H
7 
8 #include "InsertionBoundary.h"
9 #include "Math/Vector.h"
10 
11 class BaseParticle;
12 
13 class RNG;
14 
21 {
22 public:
23 
28 
33 
38 
42  CylinderInsertionBoundary *copy() const override;
43 
47  void set(BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble hMin, Mdouble hMax,
48  Vec3D normal = {0, 0, 1}, Mdouble thetaMin = -constants::pi, Mdouble thetaMax = constants::pi, Vec3D velMin = {0, 0, 0}, Vec3D velMax = {0, 0, 0});
49 
50  void
51  set(BaseParticle &particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble hMin, Mdouble hMax,
52  Vec3D normal = {0, 0, 1}, Mdouble thetaMin = -constants::pi, Mdouble thetaMax = constants::pi, Vec3D velMin = {0, 0, 0}, Vec3D velMax = {0, 0, 0});
53 
57  void
58  set(std::vector<BaseParticle*> particleToCopy, unsigned int maxFailed, Mdouble rMin,
59  Mdouble rMax, Mdouble hMin, Mdouble hMax, Vec3D normal = {0, 0, 1}, Mdouble thetaMin = -constants::pi, Mdouble thetaMax = constants::pi, Vec3D velMin = {0, 0, 0},
60  Vec3D velMax = {0,0,0});
61 
65  void set(BaseParticle* particleToCopy, unsigned int maxFailed, Mdouble radMin,
66  Mdouble radMax, Mdouble hMin, Mdouble hMax, Vec3D normal, Mdouble thetaMin, Mdouble thetaMax, Vec3D velMin, Vec3D velMax,
67  Mdouble particleRMin, Mdouble particleRMax);
68 
72  void set(BaseParticle& particleToCopy, unsigned int maxFailed, Mdouble radMin, Mdouble radMax, Mdouble hMin,
73  Mdouble hMax, Vec3D normal, Mdouble thetaMin, Mdouble thetaMax, Vec3D velMin, Vec3D velMax, Mdouble particleRMin,
74  Mdouble particleRMax);
75 
80  void setGeometry(Mdouble rMin, Mdouble rMax, Mdouble hMin, Mdouble hMax, Mdouble thetaMin, Mdouble thetaMax, Vec3D normal);
81 
87 
91  Matrix3D getRotationMatrixX(Mdouble rotationAngle);
92 
96  Matrix3D getRotationMatrixY(Mdouble rotationAngle);
97 
101  Matrix3D getRotationMatrixZ(Mdouble rotationAngle);
102 
106  Vec3D getOrigin() const;
107 
112 
116  void shiftBoundary(Vec3D shift) override;
117 
121  void rotateBoundary(Vec3D angle) override;
122 
126  void placeParticle(BaseParticle* p, RNG& random) override;
127 
131  void read(std::istream& is) override;
132 
136  void write(std::ostream& os) const override;
137 
138 
139 private:
140 
144  std::string getName() const override;
145 
146 protected:
147 
152 
157 
162 
167 
172 };
173 
174 #endif
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseParticle.h:33
Inserts particles in a cylinder with a given radius, height and azimuthal radius at a specific origin...
Definition: CylinderInsertionBoundary.h:21
Matrix3D getOrientationMatrix() const
Returns the orientation matrix of the cylinder.
Definition: CylinderInsertionBoundary.cc:317
Mdouble radMax_
Definition: CylinderInsertionBoundary.h:156
CylinderInsertionBoundary * copy() const override
Creates a copy on the heap and returns a pointer.
Definition: CylinderInsertionBoundary.cc:52
void placeParticle(BaseParticle *p, RNG &random) override
Generates a random position, velocity for the particle p.
Definition: CylinderInsertionBoundary.cc:264
Mdouble radMin_
Minimal and maximal radius defining the inner and outer circle of the cylinder in which insertion sho...
Definition: CylinderInsertionBoundary.h:156
Matrix3D getRotationMatrixX(Mdouble rotationAngle)
gets the rotationMatrix for a rotation around the X axis by a certain angle
Definition: CylinderInsertionBoundary.cc:207
void read(std::istream &is) override
reads boundary properties from istream
Definition: CylinderInsertionBoundary.cc:327
void write(std::ostream &os) const override
writes boundary properties to ostream
Definition: CylinderInsertionBoundary.cc:347
void rotateBoundary(Vec3D angle) override
rotate the cylinder around its origin
Definition: CylinderInsertionBoundary.cc:253
Mdouble thetaMax_
Definition: CylinderInsertionBoundary.h:151
Matrix3D getRotationMatrixY(Mdouble rotationAngle)
gets the rotationMatrix for a rotation around the Y axis by a certain angle
Definition: CylinderInsertionBoundary.cc:222
std::string getName() const override
Returns the name of the object.
Definition: CylinderInsertionBoundary.cc:366
~CylinderInsertionBoundary() override
Destructor: default destructor.
CylinderInsertionBoundary()
Constructor; sets everything to 0.
Definition: CylinderInsertionBoundary.cc:13
void setGeometry(Mdouble rMin, Mdouble rMax, Mdouble hMin, Mdouble hMax, Mdouble thetaMin, Mdouble thetaMax, Vec3D normal)
Sets the geometry (position and orientation) of the CylinderInsertionBoundary.
Definition: CylinderInsertionBoundary.cc:161
Mdouble thetaMin_
Minimal and maximal azimuth angle in range [-pi,pi] defining the circle of the cylinder in which inse...
Definition: CylinderInsertionBoundary.h:151
void shiftBoundary(Vec3D shift) override
shift the origin of the cylinder in the cartesian coordinate system
Definition: CylinderInsertionBoundary.cc:299
Matrix3D orientationMatrix_
Orientation matrix which rotates the cylinder based on the chosen normal axis (the height axis of the...
Definition: CylinderInsertionBoundary.h:166
Mdouble hMax_
Definition: CylinderInsertionBoundary.h:161
Vec3D origin_
origin of the cylinder.
Definition: CylinderInsertionBoundary.h:171
Matrix3D getRotationMatrixZ(Mdouble rotationAngle)
gets the rotationMatrix for a rotation around the Z axis by a certain angle
Definition: CylinderInsertionBoundary.cc:237
void set(BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble hMin, Mdouble hMax, Vec3D normal={0, 0, 1}, Mdouble thetaMin=-constants::pi, Mdouble thetaMax=constants::pi, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
Sets the properties of the InsertionBoundary for mutliple different particle types.
Definition: CylinderInsertionBoundary.cc:109
Vec3D getOrigin() const
Returns the origin of the cylinders coordinate system.
Definition: CylinderInsertionBoundary.cc:308
void setOrientation(Vec3D normal)
sets the orientation of the Cylinder
Definition: CylinderInsertionBoundary.cc:177
Mdouble hMin_
Minimal and maximal height defining the cylinder in which insertion should happen.
Definition: CylinderInsertionBoundary.h:161
Boundary structure for boundaries used for insertion of particles.
Definition: InsertionBoundary.h:29
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:32
Definition: Kernel/Math/Vector.h:30
double angle(const double &t)
Angular position as a function of time t.
Definition: jeffery_orbit.cc:98
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
const Mdouble pi
Definition: ExtendedMath.h:23
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286