BaseClusterInsertionBoundary.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef BOUNDARIES_BASECLUSTERINSERTIONBOUNDARY_H
27 #define BOUNDARIES_BASECLUSTERINSERTIONBOUNDARY_H
28 
29 
30 
31 #include "InsertionBoundary.h"
32 #include "BaseCluster.h"
33 #include "Math/Vector.h"
34 #include "Math/PSD.h"
35 
36 class BaseParticle;
37 
38 class RNG;
39 
47 {
48 public:
49 
54 
59 
64 
68  BaseClusterInsertionBoundary* copy() const override;
69 
71  void setRandomised(bool randomised);
72 
74  bool getRandomised();
75 
77  unsigned int getNumberOfClusterInserted();
78 
81 
86  void setGeometry(Vec3D posMin, Vec3D posMax);
87 
91  void setVelocityRange(Vec3D velMin, Vec3D velMax);
92 
99  void setAdditionalClusterProperties(Mdouble collisionTimeOverTimeStep, Mdouble velocityDampingModulus, Mdouble energyRatioTolerance);
100 
113  void setOutputClusterProperties(bool doCdatOutput, bool doOverlOutput, bool doAmatOutput, bool doIntStrucOutput,
114  bool doVtkOutput, bool doRestartOutput, bool doFStatOutput, bool doEneOutput);
115 
119  void placeParticle(BaseParticle* p, RNG& random) override;
120 
124  void checkBoundaryBeforeTimeStep(DPMBase* md) override;
125 
129  void read(std::istream& is) override;
130 
134  void write(std::ostream& os) const override;
135 
136 
137 private:
138 
142  std::string getName() const override;
143 
144  /*
145  * ----------------------------------------------------
146  * VARIABLES
147  * ----------------------------------------------------
148  */
149 
150  // Position in which the cluster will be created and also added in the domain.
152 
153 
154 protected:
155 
156  //number of cluster inserted
157  unsigned int nClusterInserted_;
158 
159  //Radius of the particle composing the cluster
161 
162  //Particles
163  //\brief Total number of particles.
165 
166  //species with which the cluster will be created.
168 
169  // File
170  //\brief bool used to define whether or not cluster data output must be created.
172  //\brief bool used to define whether or not overlap data output must be created.
174  //\brief bool used to define whether or not adjacency matrix output must be created.
176  //\brief bool used to define whether or not cluster internal structure output must be created.
178  //\brief bool used to define whether or not vtk output must be created.
180  //\brief bool used to define whether or not restart output must be created.
182  //\brief bool used to define whether or not fStat output must be created.
184  //\brief bool used to define whether or not eneOutput output must be created.
186 
187 
188  //\brief Size dispersity of particles: must be between 0 and 1
190  //\brief Value of damping modulus for velocity.
192  // \brief Number of points used for creating internal structure's file.
194  // \brief Energy ratio threshold under wich the simulation can be considered static.
196 
197  //\brief Ratio between collision time and time step: should be at least 50.
199 
200  /*
201  * \brief Minimal and maximal positions defining the boundary's boundaries,
202  * and minimum and maximum velocity of the particles to be inserted.
203  */
205 
206  // Bool defining if the user has set the radius of a single particle composing the cluster OR the number of
207  // particles inside the cluster.
209 
210  // Vectors defining cluster radii and position for class FixedClusterInsertionBoundary
211  std::vector<Vec3D> clusterPositions_;
212  std::vector<Mdouble> clusterRadii_;
213 
214  //Variable used to switch the randomise() process
216 };
217 
218 #endif
219 
Definition: BaseClusterInsertionBoundary.h:47
bool isIntStrucOutputOn_
Definition: BaseClusterInsertionBoundary.h:177
bool isFStatOutputOn_
Definition: BaseClusterInsertionBoundary.h:183
std::vector< Vec3D > clusterPositions_
Definition: BaseClusterInsertionBoundary.h:211
void read(std::istream &is) override
reads boundary properties from istream
Definition: BaseClusterInsertionBoundary.cc:256
bool isOverlOutputOn_
Definition: BaseClusterInsertionBoundary.h:173
int nInternalStructurePoints_
Definition: BaseClusterInsertionBoundary.h:193
bool isCdatOutputOn_
Definition: BaseClusterInsertionBoundary.h:171
BaseClusterInsertionBoundary * copy() const override
Creates a copy on the heap and returns a pointer.
Definition: BaseClusterInsertionBoundary.cc:171
void setRandomised(bool randomised)
this turns off the randomise(): created for UnitTests.
Definition: BaseClusterInsertionBoundary.cc:180
Vec3D velMin_
Definition: BaseClusterInsertionBoundary.h:204
void setRadiusMicroParticle(Mdouble rMP)
this sets the radius of the micro particle composing the cluster.
Definition: BaseClusterInsertionBoundary.cc:192
Mdouble energyRatioTolerance_
Definition: BaseClusterInsertionBoundary.h:195
void checkBoundaryBeforeTimeStep(DPMBase *md) override
Fills the boundary with clusters.
Definition: BaseClusterInsertionBoundary.cc:248
bool isRestartOutputOn_
Definition: BaseClusterInsertionBoundary.h:181
Vec3D position_
Definition: BaseClusterInsertionBoundary.h:151
bool isAmatOutputOn_
Definition: BaseClusterInsertionBoundary.h:175
Mdouble velocityDampingModulus_
Definition: BaseClusterInsertionBoundary.h:191
std::vector< Mdouble > clusterRadii_
Definition: BaseClusterInsertionBoundary.h:212
unsigned int nClusterInserted_
Definition: BaseClusterInsertionBoundary.h:157
Mdouble collisionTimeOverTimeStep_
Definition: BaseClusterInsertionBoundary.h:198
void setVelocityRange(Vec3D velMin, Vec3D velMax)
Sets the velocity range of the ClusterInsertionBoundary.
Definition: BaseClusterInsertionBoundary.cc:208
LinearPlasticViscoelasticFrictionSpecies * clusterSpecies_
Definition: BaseClusterInsertionBoundary.h:167
bool isVtkOutputOn_
Definition: BaseClusterInsertionBoundary.h:179
void setOutputClusterProperties(bool doCdatOutput, bool doOverlOutput, bool doAmatOutput, bool doIntStrucOutput, bool doVtkOutput, bool doRestartOutput, bool doFStatOutput, bool doEneOutput)
sets cluster whether or not cluster output files will be created, for example:
Definition: BaseClusterInsertionBoundary.cc:222
Mdouble sizeDispersityParticle_
Definition: BaseClusterInsertionBoundary.h:189
Mdouble radiusParticle_
Definition: BaseClusterInsertionBoundary.h:160
std::string getName() const override
Returns the name of the object.
Definition: BaseClusterInsertionBoundary.cc:327
BaseClusterInsertionBoundary()
Constructor; sets everything to 0.
Definition: BaseClusterInsertionBoundary.cc:34
void setAdditionalClusterProperties(Mdouble collisionTimeOverTimeStep, Mdouble velocityDampingModulus, Mdouble energyRatioTolerance)
sets additional cluster properties as:
Definition: BaseClusterInsertionBoundary.cc:214
void write(std::ostream &os) const override
writes boundary properties to ostream
Definition: BaseClusterInsertionBoundary.cc:289
bool isEneOutputOn_
Definition: BaseClusterInsertionBoundary.h:185
~BaseClusterInsertionBoundary() override
Destructor: default destructor.
void placeParticle(BaseParticle *p, RNG &random) override
Generates a random position, velocity for the cluster p.
Definition: BaseClusterInsertionBoundary.cc:237
bool randomised_
Definition: BaseClusterInsertionBoundary.h:215
int nParticles_
Definition: BaseClusterInsertionBoundary.h:164
unsigned int getNumberOfClusterInserted()
this returns the number of cluster inserted.
Definition: BaseClusterInsertionBoundary.cc:188
Vec3D posMax_
Definition: BaseClusterInsertionBoundary.h:204
Vec3D velMax_
Definition: BaseClusterInsertionBoundary.h:204
bool getRandomised()
this returns a bool which indicates if the process is randomised (true) or not (false).
Definition: BaseClusterInsertionBoundary.cc:184
void setGeometry(Vec3D posMin, Vec3D posMax)
Sets the geometry (position and velocity distribution) of the ClusterInsertionBoundary.
Definition: BaseClusterInsertionBoundary.cc:202
Vec3D posMin_
Definition: BaseClusterInsertionBoundary.h:204
bool setRadiusParticleAndNotNumberOfParticles_
Definition: BaseClusterInsertionBoundary.h:208
Definition: BaseParticle.h:54
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:77
Boundary structure for boundaries used for insertion of particles.
Definition: InsertionBoundary.h:50
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:53
Contains material and contact force properties.
Definition: Species.h:35
Definition: Vector.h:51