SphereInsertionBoundary.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 MERCURYDPM_SPHEREINSERTIONBOUNDARY_H
6 #define MERCURYDPM_SPHEREINSERTIONBOUNDARY_H
7 
8 #include "InsertionBoundary.h"
9 #include "Math/Vector.h"
10 
16 {
17 public:
18 
23 
28 
33 
37  SphereInsertionBoundary *copy() const override;
38 
42  void set(BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin = 0,
43  Mdouble thetaMax = 2.0*constants::pi, Mdouble phiMin = 0, Mdouble phiMax = constants::pi,
44  Vec3D velMin = {0, 0, 0}, Vec3D velMax = {0, 0, 0});
45 
46  void
47  set(BaseParticle &particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin = 0,
48  Mdouble thetaMax = 2.0*constants::pi, Mdouble phiMin = 0, Mdouble phiMax = constants::pi,
49  Vec3D velMin = {0, 0, 0}, Vec3D velMax = {0, 0, 0});
50 
54  void
55  set(std::vector<BaseParticle*> particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin = 0,
56  Mdouble thetaMax = 2.0*constants::pi, Mdouble phiMin = 0, Mdouble phiMax = constants::pi,
57  Vec3D velMin = {0, 0, 0}, Vec3D velMax = {0,0,0});
58 
62  void set(BaseParticle* particleToCopy, unsigned int maxFailed, Mdouble radMin,
63  Mdouble radMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax, Vec3D velMin, Vec3D velMax,
64  Mdouble particleRMin, Mdouble particleRMax);
65 
69  void set(BaseParticle& particleToCopy, unsigned int maxFailed, Mdouble radMin, Mdouble radMax, Mdouble thetaMin,
70  Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax, Vec3D velMin, Vec3D velMax, Mdouble particleRMin,
71  Mdouble particleRMax);
72 
77  void setGeometry(Mdouble rMin, Mdouble rMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax);
78 
82  Vec3D getOrigin() const;
83 
87  void shiftBoundary(Vec3D shift) override;
88 
92  void placeParticle(BaseParticle* p, RNG& random) override;
93 
97  void read(std::istream& is) override;
98 
102  void write(std::ostream& os) const override;
103 
104 
105 private:
106 
110  std::string getName() const override;
111 
112 protected:
113 
118 
127 
132 };
133 
134 
135 #endif //MERCURYDPM_SPHEREINSERTIONBOUNDARY_H
float * p
Definition: Tutorial_Map_using.cpp:9
Definition: BaseParticle.h:33
Boundary structure for boundaries used for insertion of particles.
Definition: InsertionBoundary.h:29
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:32
Inserts particles in a sphere with a given radius, polar and azimuthal radius at a specific origin wh...
Definition: SphereInsertionBoundary.h:16
Vec3D getOrigin() const
Returns the origin of the spheres coordinate system.
Definition: SphereInsertionBoundary.cc:214
Mdouble radMax_
Definition: SphereInsertionBoundary.h:126
SphereInsertionBoundary()
Constructor; sets everything to 0.
Definition: SphereInsertionBoundary.cc:13
Mdouble thetaMax_
Definition: SphereInsertionBoundary.h:117
Vec3D origin_
origin of the sphere.
Definition: SphereInsertionBoundary.h:131
void setGeometry(Mdouble rMin, Mdouble rMax, Mdouble thetaMin, Mdouble thetaMax, Mdouble phiMin, Mdouble phiMax)
Sets the geometry (position and orientation) of the SphereInsertionBoundary.
Definition: SphereInsertionBoundary.cc:156
Mdouble phiMax_
Definition: SphereInsertionBoundary.h:122
void shiftBoundary(Vec3D shift) override
shift the origin of the sphere in the cartesian coordinate system
Definition: SphereInsertionBoundary.cc:205
void set(BaseParticle *particleToCopy, unsigned int maxFailed, Mdouble rMin, Mdouble rMax, Mdouble thetaMin=0, Mdouble thetaMax=2.0 *constants::pi, Mdouble phiMin=0, Mdouble phiMax=constants::pi, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
Sets the properties of the InsertionBoundary for mutliple different particle types.
Definition: SphereInsertionBoundary.cc:105
Mdouble phiMin_
Minimal and maximal polar angle in range [0,pi] defining the circle of the sphere in which insertion ...
Definition: SphereInsertionBoundary.h:122
std::string getName() const override
Returns the name of the object.
Definition: SphereInsertionBoundary.cc:260
void read(std::istream &is) override
reads boundary properties from istream
Definition: SphereInsertionBoundary.cc:223
void write(std::ostream &os) const override
writes boundary properties to ostream
Definition: SphereInsertionBoundary.cc:242
Mdouble radMin_
Minimal and maximal radius defining the inner and outer circle of the sphere in which insertion shoul...
Definition: SphereInsertionBoundary.h:126
void placeParticle(BaseParticle *p, RNG &random) override
Generates a random position, velocity for the particle p.
Definition: SphereInsertionBoundary.cc:171
Mdouble thetaMin_
Minimal and maximal azimuth angle in range [0,2*pi] defining the circle of the sphere in which insert...
Definition: SphereInsertionBoundary.h:117
SphereInsertionBoundary * copy() const override
Creates a copy on the heap and returns a pointer.
Definition: SphereInsertionBoundary.cc:50
~SphereInsertionBoundary() override
Destructor: default destructor.
Definition: Kernel/Math/Vector.h:30
const Mdouble pi
Definition: ExtendedMath.h:23
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286