revision: v0.14
BaseClusterInsertionBoundary.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2020, 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 
InsertionBoundary
Boundary structure for boundaries used for insertion of particles.
Definition: InsertionBoundary.h:50
BaseClusterInsertionBoundary::isFStatOutputOn_
bool isFStatOutputOn_
Definition: BaseClusterInsertionBoundary.h:183
InsertionBoundary::read
void read(std::istream &is) override
Reads the boundary's id_ and maxFailed_.
Definition: InsertionBoundary.cc:471
BaseClusterInsertionBoundary::clusterPositions_
std::vector< Vec3D > clusterPositions_
Definition: BaseClusterInsertionBoundary.h:211
Vector.h
BaseClusterInsertionBoundary::setVelocityRange
void setVelocityRange(Vec3D velMin, Vec3D velMax)
Sets the velocity range of the ClusterInsertionBoundary.
Definition: BaseClusterInsertionBoundary.cc:208
BaseCluster.h
PSD.h
BaseClusterInsertionBoundary::nInternalStructurePoints_
int nInternalStructurePoints_
Definition: BaseClusterInsertionBoundary.h:193
BaseClusterInsertionBoundary::getName
std::string getName() const override
Returns the name of the object.
Definition: BaseClusterInsertionBoundary.cc:327
BaseClusterInsertionBoundary::BaseClusterInsertionBoundary
BaseClusterInsertionBoundary()
Constructor; sets everything to 0.
Definition: BaseClusterInsertionBoundary.cc:34
BaseClusterInsertionBoundary::nParticles_
int nParticles_
Definition: BaseClusterInsertionBoundary.h:164
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
BaseClusterInsertionBoundary::clusterSpecies_
LinearPlasticViscoelasticFrictionSpecies * clusterSpecies_
Definition: BaseClusterInsertionBoundary.h:167
BaseClusterInsertionBoundary::isEneOutputOn_
bool isEneOutputOn_
Definition: BaseClusterInsertionBoundary.h:185
BaseClusterInsertionBoundary::energyRatioTolerance_
Mdouble energyRatioTolerance_
Definition: BaseClusterInsertionBoundary.h:195
BaseClusterInsertionBoundary::setRadiusParticleAndNotNumberOfParticles_
bool setRadiusParticleAndNotNumberOfParticles_
Definition: BaseClusterInsertionBoundary.h:208
LinearPlasticViscoelasticFrictionSpecies
Species< LinearPlasticViscoelasticNormalSpecies, FrictionSpecies > LinearPlasticViscoelasticFrictionSpecies
Definition: LinearPlasticViscoelasticFrictionSpecies.h:34
BaseClusterInsertionBoundary::sizeDispersityParticle_
Mdouble sizeDispersityParticle_
Definition: BaseClusterInsertionBoundary.h:189
BaseClusterInsertionBoundary::~BaseClusterInsertionBoundary
~BaseClusterInsertionBoundary() override
Destructor: default destructor.
Vec3D
Definition: Vector.h:50
BaseClusterInsertionBoundary::isVtkOutputOn_
bool isVtkOutputOn_
Definition: BaseClusterInsertionBoundary.h:179
BaseClusterInsertionBoundary::randomised_
bool randomised_
Definition: BaseClusterInsertionBoundary.h:215
BaseClusterInsertionBoundary::nClusterInserted_
unsigned int nClusterInserted_
Definition: BaseClusterInsertionBoundary.h:157
BaseClusterInsertionBoundary::copy
BaseClusterInsertionBoundary * copy() const override
Creates a copy on the heap and returns a pointer.
Definition: BaseClusterInsertionBoundary.cc:171
RNG.h
BaseClusterInsertionBoundary::isAmatOutputOn_
bool isAmatOutputOn_
Definition: BaseClusterInsertionBoundary.h:175
InsertionBoundary::write
void write(std::ostream &os) const override
Writes the boundary's id_ and maxFailed_.
Definition: InsertionBoundary.cc:559
RNG
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:53
double
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
BaseClusterInsertionBoundary::position_
Vec3D position_
Definition: BaseClusterInsertionBoundary.h:151
Species
Contains material and contact force properties.
Definition: Species.h:35
BaseClusterInsertionBoundary::setGeometry
void setGeometry(Vec3D posMin, Vec3D posMax)
Sets the geometry (position and velocity distribution) of the ClusterInsertionBoundary.
Definition: BaseClusterInsertionBoundary.cc:202
Log::FATAL
@ FATAL
BaseClusterInsertionBoundary::clusterRadii_
std::vector< Mdouble > clusterRadii_
Definition: BaseClusterInsertionBoundary.h:212
InsertionBoundary.h
BaseClusterInsertionBoundary::isOverlOutputOn_
bool isOverlOutputOn_
Definition: BaseClusterInsertionBoundary.h:173
BaseClusterInsertionBoundary::velMax_
Vec3D velMax_
Definition: BaseClusterInsertionBoundary.h:204
BaseClusterInsertionBoundary::isRestartOutputOn_
bool isRestartOutputOn_
Definition: BaseClusterInsertionBoundary.h:181
BaseClusterInsertionBoundary::isIntStrucOutputOn_
bool isIntStrucOutputOn_
Definition: BaseClusterInsertionBoundary.h:177
BaseClusterInsertionBoundary::read
void read(std::istream &is) override
reads boundary properties from istream
Definition: BaseClusterInsertionBoundary.cc:256
BaseClusterInsertionBoundary::radiusParticle_
Mdouble radiusParticle_
Definition: BaseClusterInsertionBoundary.h:160
BaseClusterInsertionBoundary::isCdatOutputOn_
bool isCdatOutputOn_
Definition: BaseClusterInsertionBoundary.h:171
BaseClusterInsertionBoundary::getRandomised
bool getRandomised()
this returns a bool which indicates if the process is randomised (true) or not (false).
Definition: BaseClusterInsertionBoundary.cc:184
BaseParticle
Definition: BaseParticle.h:54
BaseClusterInsertionBoundary
Definition: BaseClusterInsertionBoundary.h:47
BaseClusterInsertionBoundary::setOutputClusterProperties
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
BaseClusterInsertionBoundary::checkBoundaryBeforeTimeStep
void checkBoundaryBeforeTimeStep(DPMBase *md) override
Fills the boundary with clusters.
Definition: BaseClusterInsertionBoundary.cc:248
BaseClusterInsertionBoundary::collisionTimeOverTimeStep_
Mdouble collisionTimeOverTimeStep_
Definition: BaseClusterInsertionBoundary.h:198
BaseClusterInsertionBoundary::write
void write(std::ostream &os) const override
writes boundary properties to ostream
Definition: BaseClusterInsertionBoundary.cc:289
BaseClusterInsertionBoundary::posMax_
Vec3D posMax_
Definition: BaseClusterInsertionBoundary.h:204
BaseClusterInsertionBoundary::setAdditionalClusterProperties
void setAdditionalClusterProperties(Mdouble collisionTimeOverTimeStep, Mdouble velocityDampingModulus, Mdouble energyRatioTolerance)
sets additional cluster properties as:
Definition: BaseClusterInsertionBoundary.cc:214
BaseClusterInsertionBoundary::velMin_
Vec3D velMin_
Definition: BaseClusterInsertionBoundary.h:204
BaseClusterInsertionBoundary::velocityDampingModulus_
Mdouble velocityDampingModulus_
Definition: BaseClusterInsertionBoundary.h:191
BaseParticle.h
BaseClusterInsertionBoundary.h
BaseClusterInsertionBoundary::getNumberOfClusterInserted
unsigned int getNumberOfClusterInserted()
this returns the number of cluster inserted.
Definition: BaseClusterInsertionBoundary.cc:188
BaseClusterInsertionBoundary::posMin_
Vec3D posMin_
Definition: BaseClusterInsertionBoundary.h:204
BaseClusterInsertionBoundary::setRandomised
void setRandomised(bool randomised)
this turns off the randomise(): created for UnitTests.
Definition: BaseClusterInsertionBoundary.cc:180
BaseClusterInsertionBoundary::placeParticle
void placeParticle(BaseParticle *p, RNG &random) override
Generates a random position, velocity for the cluster p.
Definition: BaseClusterInsertionBoundary.cc:237
BaseClusterInsertionBoundary::setRadiusMicroParticle
void setRadiusMicroParticle(Mdouble rMP)
this sets the radius of the micro particle composing the cluster.
Definition: BaseClusterInsertionBoundary.cc:192
DPMBase
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:76