MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 
85  void setRadiusRange(Mdouble radMin, Mdouble radMax);
86 
91  void setGeometry(Vec3D posMin, Vec3D posMax, Vec3D velMin, Vec3D velMax);
92 
96  void setVelocityRange(Vec3D velMin, Vec3D velMax);
97 
104  void setAdditionalClusterProperties(Mdouble collisionTimeOverTimeStep, Mdouble velocityDampingModulus, Mdouble energyRatioTolerance);
105 
118  void setOutputClusterProperties(bool doCdatOutput, bool doOverlOutput, bool doAmatOutput, bool doIntStrucOutput,
119  bool doVtkOutput, bool doRestartOutput, bool doFStatOutput, bool doEneOutput);
120 
124  void placeParticle(BaseParticle* p, RNG& random) override;
125 
129  void checkBoundaryBeforeTimeStep(DPMBase* md) override;
130 
134  void read(std::istream& is) override;
135 
139  void write(std::ostream& os) const override;
140 
141 
142 private:
143 
147  std::string getName() const override;
148 
149  /*
150  * ----------------------------------------------------
151  * VARIABLES
152  * ----------------------------------------------------
153  */
154 
155  // Position in which the cluster will be created and also added in the domain.
157 
158 
159 protected:
160 
161  //number of cluster inserted
162  unsigned int nClusterInserted_;
163 
164  //Radius of the particle composing the cluster
166 
167  //Particles
168  //\brief Total number of particles.
170 
171  //species with which the cluster will be created.
173 
174  // File
175  //\brief bool used to define whether or not cluster data output must be created.
177  //\brief bool used to define whether or not overlap data output must be created.
179  //\brief bool used to define whether or not adjacency matrix output must be created.
181  //\brief bool used to define whether or not cluster internal structure output must be created.
183  //\brief bool used to define whether or not vtk output must be created.
185  //\brief bool used to define whether or not restart output must be created.
187  //\brief bool used to define whether or not fStat output must be created.
189  //\brief bool used to define whether or not eneOutput output must be created.
191 
192 
193  //\brief Size dispersity of particles: must be between 0 and 1
195  //\brief Value of damping modulus for velocity.
197  // \brief Number of points used for creating internal structure's file.
199  // \brief Energy ratio threshold under wich the simulation can be considered static.
201 
202  //\brief Ratio between collision time and time step: should be at least 50.
204 
205  /*
206  * \brief Minimal and maximal positions defining the boundary's boundaries,
207  * and minimum and maximum velocity of the particles to be inserted.
208  */
210 
211  // Bool defining if the user has set the radius of a single particle composing the cluster OR the number of
212  // particles inside the cluster.
214 
215  // Vectors defining cluster radii and position for class FixedClusterInsertionBoundary
216  std::vector<Vec3D> clusterPositions_;
217  std::vector<Mdouble> clusterRadii_;
218 
219  //Variable used to switch the randomise() process
221 
222 };
223 
224 /*
225  * write to file
226  */
227 std::ostream& operator<<(std::ostream& os, BaseClusterInsertionBoundary::Distribution type);
228 
229 /*
230  * read from file
231  */
232 std::istream& operator>>(std::istream& is, BaseClusterInsertionBoundary::Distribution& type);
233 
234 #endif
235 
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
Definition: DPMBase.h:72
void read(std::istream &is) override
reads boundary properties from istream
double Mdouble
Definition: GeneralDefine.h:34
Distribution
Defines a custom particle size distribution; distribution_ will always be used, unless particleSizeDi...
void checkBoundaryBeforeTimeStep(DPMBase *md) override
Fills the boundary with clusters.
void write(std::ostream &os) const override
writes boundary properties to ostream
bool getRandomised()
this returns a bool which indicates if the process is randomised (true) or not (false).
Boundary structure for boundaries used for insertion of particles.
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:
void setRandomised(bool randomised)
this turns off the randomise(): created for UnitTests.
This is a class that generates random numbers i.e. named the Random Number Generator (RNG)...
Definition: RNG.h:52
void setAdditionalClusterProperties(Mdouble collisionTimeOverTimeStep, Mdouble velocityDampingModulus, Mdouble energyRatioTolerance)
sets additional cluster properties as:
void placeParticle(BaseParticle *p, RNG &random) override
Generates a random position, velocity for the cluster p.
std::istream & operator>>(std::istream &is, BaseClusterInsertionBoundary::Distribution &type)
void setRadiusMicroParticle(Mdouble rMP)
this sets the radius of the micro particle composing the cluster.
unsigned int getNumberOfClusterInserted()
this returns the number of cluster inserted.
void setRadiusRange(Mdouble radMin, Mdouble radMax)
Sets the range of cluster radius that may be generated.
std::string getName() const override
Returns the name of the object.
BaseClusterInsertionBoundary()
Constructor; sets everything to 0.
void setVelocityRange(Vec3D velMin, Vec3D velMax)
Sets the velocity range of the ClusterInsertionBoundary.
void setGeometry(Vec3D posMin, Vec3D posMax, Vec3D velMin, Vec3D velMax)
Sets the geometry (position and velocity distribution) of the ClusterInsertionBoundary.
LinearPlasticViscoelasticFrictionSpecies * clusterSpecies_
Contains material and contact force properties.
Definition: Interaction.h:42
Definition: Vector.h:49
BaseClusterInsertionBoundary * copy() const override
Creates a copy on the heap and returns a pointer.
std::ostream & operator<<(std::ostream &os, BaseClusterInsertionBoundary::Distribution type)
~BaseClusterInsertionBoundary() override
Destructor: default destructor.