revision: v0.14
BaseCluster.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 BaseCluster_H
27 #define BaseCluster_H
28 
29 #endif //BaseCluster_H
30 
31 #include <Mercury3D.h>
33 
34 
35 #ifdef MERCURY_USE_MPI
36 #include <mpi.h>
37 #include <MpiDataClass.h>
38 #include <MpiContainer.h>
39 #endif
40 
48 #ifndef BaseCluster_h
49 #define BaseCluster_h
50 class BaseCluster : public Mercury3D
51 {
52 public:
53 
54 /*
55  * ----------------------------------------------------------------------
56  * FUNCTIONS: setters and getters
57  * ----------------------------------------------------------------------
58  */
59 
63  BaseCluster();
64 
68  ~BaseCluster() final;
69 
73  Vec3D getPosition() const;
74 
78  void setPosition(Vec3D p);
79 
84 
89 
95  Mdouble getRadiusParticle() const;
96 
100  void setRadiusParticle(Mdouble rP);
101 
106 
111 
115  int getNumberOfParticles() const;
116 
120  void setNumberOfParticles(int nP);
121 
126  void setRadiusCluster(Mdouble rCR);
127 
132 
136  unsigned int getClusterId() const;
137 
141  void setClusterId(unsigned int iC);
142 
147 
152 
157 
162 
168 
174 
179 
184 
189  Vec3D getVelocity();
190 
195  void setVelocity(Vec3D v);
196 
201  bool isCdatOutputOn() const;
202 
206  void doCdatOutput(bool iCOO);
207 
211  bool isOverlOutputOn() const;
212 
216  void doOverlOutput(bool iOOO);
217 
221  bool isAmatOutputOn() const;
222 
227  void doAmatOutput(bool iAOO);
228 
232  bool isIntStrucOutputOn() const;
233 
238  void doIntStrucOutput(bool iISOO);
239 
243  bool isVtkOutputOn() const;
244 
248  void doVtkOutput(bool iVOO);
249 
253  bool isRestartOutputOn() const;
254 
259 
263  bool isFStatOutputOn() const;
264 
268  void doFStatOutput(bool isfStatOutputOn);
269 
273  bool isEneOutputOn() const;
274 
278  void doEneOutput(bool isEneOutputOn);
279 
284 
289 
290 /*
291  * ----------------------------------------------------------------------
292  * FUNCTIONS: overridden mercury3D functions
293  * ----------------------------------------------------------------------
294  */
295 
296 
300  void setupInitialConditions() override;
301 
306  void actionsAfterTimeStep() override;
307 
312  void actionsAfterSolve() override;
313 
317  void write(std::ostream& os, bool writeAllParticles) const override;
318 
322  void read(std::istream& is, ReadOptions opt = ReadOptions::ReadAll) override;
323 
328  void actionsOnRestart() override;
329 
333  void printTime() const override;
334 
335 private:
336  /*
337  * ----------------------------------------------------------------------
338  * FUNCTIONS: functions inside setupInitialConditions
339  * ----------------------------------------------------------------------
340  */
341 
345  void setRadii();
346 
350  void setSpecies();
351 
355  void setDomainLimits();
356 
360  void calculateTimeStep();
361 
365  void insertParticles();
366 
370  void makeCdatFile();
371 
375  void makeOverlFile();
376 
381  bool particleInsertionSuccessful(int n);
382 
383 
384 
385  /*
386  * ----------------------------------------------------------------------
387  * FUNCTIONS: functions inside actionsAfterTimeStep
388  * ----------------------------------------------------------------------
389  */
390 
394  void makeDataAnalysis();
395 
399  void writeToCdatFile();
400 
404  void writeToOverlFile();
405 
409  void applyCentralForce();
410 
414  void increaseForce();
415 
419  void dampVelocities();
420 
424  void decreaseForce();
425 
429  void dampForce();
430 
434  void createAdjacencyMatrix();
435 
439  void makeAmatFile();
440 
444  void writeAmatFile();
445 
450 
454  void makeGnuplotFile();
455 
460 
461 
462 
463  /*
464  * ----------------------------------------------------------------------
465  * VARIABLES: accessed by the user with setters and getters
466  * ----------------------------------------------------------------------
467  */
468 
469  //POSITION
470  //\brief Position where the cluster is inserted after creation.
472 
473  // TIME
474  //\brief Ratio between collision time and time step: should be at least 50.
476  // \brief Energy ratio threshold under wich the simulation can be considered static and so can be stopped.
478 
479  // PARTiCleS
480  //\brief Radius basing on which all radii will be computed.
482  // \brief Bool that saves whether or not the user has set the radius of the single particle composing the cluster.
483  bool setRadiusParticle_ = false;
484  //\brief Size dispersity of particles: must be between >= than 1.
486  //\brief Total number of particles.
488  // \brief Bool that saves whether or not the user has set the number of particles
489  bool setNumberOfParticles_ = false;
490 
491  // CLUSTER
492  //\brief Total number of particles.
493  unsigned int idCluster_;
494  //\brief Desired radius of the cluster.
496  // \brief Bool that saves whether or not the user has set the cluster radius
497  bool setRadiusCluster_ = false;
498  //\brief Velocity of the cluster after creation
500  //\brief mean cluster radius after creation.
502 
503  // CENTRAL FORCE
504  //\brief Value of damping modulus for velocity.
506 
507  // DATA ANALYSIS
508  // \brief Number of points used for computing internal structure.
510 
511  // SPECIES
512  //\brief particle species.
514 
515 
516  // File
517  //\brief bool used to define whether or not cluster data output must be created.
519  //\brief bool used to define whether or not overlap data output must be created.
521  //\brief bool used to define whether or not adjacency matrix output must be created.
523  //\brief bool used to define whether or not cluster internal structure output must be created.
525  //\brief bool used to define whether or not vtk output must be created.
527  //\brief bool used to define whether or not vtk output must be created.
529  //\brief bool used to define whether or not vtk output must be created.
531  //\brief bool used to define whether or not vtk output must be created.
533 
534 
535  /*
536  * ----------------------------------------------------------------------
537  * VARIABLES: never accessed by the user
538  * ----------------------------------------------------------------------
539  */
540 
541 
542  // PARTICLES
543  //\brief vector in which all radii will be stored after calculation.
544  std::vector<Mdouble> radii_;
545  //smallest radius
547  //\brief mass of the particle which has radius radiusParticle.
549  //\brief total volume of all particles.
551 
552  // GEOMETRY
553  //\brief size of the cubic domain.
555  //\brief center of mass.
557 
558  // CONTACT RELATED
559  //\brief adjacency matrix.
560  std::vector< std::vector<int> > adjacencyMatrix_;
561  //\brief mean coordination number.
563  //\brief maximum relative overlap.
565  //\brief mean relative overlap.
567  //\brief minimum relative overlap.
569  //\brief number of total intra-cluster bonds.
571 
572  // OUTPUT
573  //\brief cluster data file.
574  std::ofstream cdatFile_;
575  //\brief cluster overlap file.
576  std::ofstream overlFile_;
577  //\brief gnuplot file.
578  std::ofstream gnuplotFile_;
579  //\brief adjacency matrix file.
580  std::ofstream amatFile_;
581  //\brief internal structure file.
582  std::ofstream intStructFile_;
583  //\brief output time of files and print time.
585 
586  // DATA ANALYSIS
587  //\brief radius with which solid fraction is computed
589  //\brief solid fraction computed with the total particle volume and radiusForSolidFraction_.
591  //\brief solid fraction computed with internal structure analysis.
593 
594  // TIME
595  // stage of the simulation: 1 compression, 2 decompression, 3 relaxation, 4 simulation ended.
596  int stage_;
597  //\brief time flag used for the stages duration.
599  //\brief final time.
601 
602  // CENTRAL FORCE
603  //\brief maximum force modulus applied on particles (this value is then multiplied by distance from force center).
605  //\brief force modulus applied on particles at a certain simulation time.
607  //\brief time interval on which force is tuned (increased or decreased).
609  //\brief time interval on which velocity is tuned (increased or decreased).
611  //\brief time duration of force tuning (i.e. duration of compression and decompression stages).
613  //\brief maximum possible time duration of dissipation (i.e. duration of dissipation if energy ratio
614  // tollerance not reached).
616  //\brief Value of damping modulus for forceFactor.
618 
619 };
620 #endif
BaseCluster::setPosition
void setPosition(Vec3D p)
This sets the value of position_, which is the position in which the cluster will be inserted.
Definition: BaseCluster.cc:60
BaseCluster::getNumberOfInternalStructurePoints
int getNumberOfInternalStructurePoints() const
This returns the value of the number of particles used to compute internal structure.
Definition: BaseCluster.cc:209
BaseCluster::makeDataAnalysis
void makeDataAnalysis()
This functions computes some important cluster information needed by the program.
Definition: BaseCluster.cc:1255
BaseCluster::BaseCluster
BaseCluster()
Default constructor.
Definition: BaseCluster.cc:31
BaseCluster::doEneOutput
void doEneOutput(bool isEneOutputOn)
This sets the bool variable that defines whether the cluster ene output will be written or not.
Definition: BaseCluster.cc:376
BaseCluster::setRadiusCluster_
bool setRadiusCluster_
Definition: BaseCluster.h:497
BaseCluster::writeToCdatFile
void writeToCdatFile()
This writes on the cluster data output file.
Definition: BaseCluster.cc:1370
DPMBase::setName
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
BaseCluster::getClusterId
unsigned int getClusterId() const
This returns the value of the cluster ID.
Definition: BaseCluster.cc:175
BaseCluster::setNumberOfInternalStructurePoints
void setNumberOfInternalStructurePoints(int gL)
This sets the value of the number of particles used to compute the internal structure.
Definition: BaseCluster.cc:217
File::setFileType
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
DPMBase::readRestartFile
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:2921
DPMBase::setTimeStep
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
BaseCluster::clusterVelocity_
Vec3D clusterVelocity_
Definition: BaseCluster.h:499
BaseCluster::setRadii
void setRadii()
Sets all radii according to particleRadius and sizeDispersityParticle.
Definition: BaseCluster.cc:983
BaseCluster::createAdjacencyMatrix
void createAdjacencyMatrix()
This calculates the adjacency matrix of the cluster.
Definition: BaseCluster.cc:1539
DPMBase::getTimeStep
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
BaseCluster::isCdatOutputOn_
bool isCdatOutputOn_
Definition: BaseCluster.h:518
BaseCluster::doOverlOutput
void doOverlOutput(bool iOOO)
This sets the bool variable that defines whether the cluster overlap output will be written or not.
Definition: BaseCluster.cc:292
Vec3D::setZero
void setZero()
Sets all elements to zero.
Definition: Vector.cc:43
BaseCluster.h
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
BaseCluster
Definition: BaseCluster.h:51
BaseCluster::velocityDampingInterval_
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
BaseCluster::doIntStrucOutput
void doIntStrucOutput(bool iISOO)
This sets the bool variable that defines whether the cluster internal structure output will be writte...
Definition: BaseCluster.cc:320
BaseCluster::doAmatOutput
void doAmatOutput(bool iAOO)
This sets the bool variable that defines whether the cluster adjacency matrix output will be written ...
Definition: BaseCluster.cc:306
DPMBase::setParticlesWriteVTK
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:934
SpeciesHandler::clear
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: SpeciesHandler.h:54
BaseCluster::t0_
Mdouble t0_
Definition: BaseCluster.h:598
MercuryBase::read
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Reads the MercuryBase from an input stream, for example a restart file.
Definition: MercuryBase.cc:104
BaseCluster::meanRelativeOverlap_
Mdouble meanRelativeOverlap_
Definition: BaseCluster.h:566
BaseCluster::isVtkOutputOn_
bool isVtkOutputOn_
Definition: BaseCluster.h:526
BaseCluster::adjacencyMatrix_
std::vector< std::vector< int > > adjacencyMatrix_
Definition: BaseCluster.h:560
BaseCluster::setSpecies
void setSpecies()
Sets species of particles.
Definition: BaseCluster.cc:1002
BaseInteractable::setPosition
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
BaseCluster::getVelocityDampingModulus
Mdouble getVelocityDampingModulus() const
This returns the value of the velocity damping modulus.
Definition: BaseCluster.cc:192
BaseCluster::isOverlOutputOn_
bool isOverlOutputOn_
Definition: BaseCluster.h:520
logger
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
BaseCluster::minRelativeOverlap_
Mdouble minRelativeOverlap_
Definition: BaseCluster.h:568
DPMBase::random
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1390
BaseCluster::dampForce
void dampForce()
This damps values of forceModulus (stage = 3).
Definition: BaseCluster.cc:1529
Vec3D::X
Mdouble X
the vector components
Definition: Vector.h:65
BaseCluster::getPosition
Vec3D getPosition() const
This returns the value of position_, which is the position in which the cluster will be inserted.
Definition: BaseCluster.cc:52
BaseCluster::dissipationDuration_
Mdouble dissipationDuration_
Definition: BaseCluster.h:615
BaseCluster::insertParticles
void insertParticles()
Inserts particles inside the domain.
Definition: BaseCluster.cc:1077
BaseCluster::radiusParticle_
Mdouble radiusParticle_
Definition: BaseCluster.h:481
BaseCluster::getMeanClusterRadius
Mdouble getMeanClusterRadius()
this returns meanClusterRadius (radius of an ideal perfectly spherical cluster, there's no setter).
Definition: BaseCluster.cc:383
MercuryBase::checkParticleForInteraction
bool checkParticleForInteraction(const BaseParticle &P) final
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
Definition: MercuryBase.cc:594
BaseCluster::decreaseForce
void decreaseForce()
This linearly decreases values of forceModulus (stage = 2).
Definition: BaseCluster.cc:1521
BaseCluster::doCdatOutput
void doCdatOutput(bool iCOO)
This sets the bool variable that defines whether the cluster data output will be written or not.
Definition: BaseCluster.cc:278
BaseCluster::makeAmatFile
void makeAmatFile()
This creates the adjacency matrix file.
Definition: BaseCluster.cc:1562
DPMBase::ReadOptions
ReadOptions
Definition: DPMBase.h:243
BaseObject::setGroupId
void setGroupId(unsigned groupId)
Definition: BaseObject.h:131
BaseHandler::getSize
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
BaseCluster::setSizeDispersityParticle
void setSizeDispersityParticle(Mdouble sDP)
This sets the value of particles' dispersity in size.
Definition: BaseCluster.cc:117
Mercury3D
This adds on the hierarchical grid code for 3D problems.
Definition: Mercury3D.h:37
BaseCluster::boxSize_
Mdouble boxSize_
Definition: BaseCluster.h:554
DPMBase::restartFile
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1451
BaseCluster::setRadiusParticle_
bool setRadiusParticle_
Definition: BaseCluster.h:483
BaseCluster::maxRelativeOverlap_
Mdouble maxRelativeOverlap_
Definition: BaseCluster.h:564
MpiContainer.h
BaseCluster::idCluster_
unsigned int idCluster_
Definition: BaseCluster.h:493
BaseCluster::getNumberOfParticles
int getNumberOfParticles() const
This returns the value of the number of particles in the cluster.
Definition: BaseCluster.cc:126
BaseCluster::particleInsertionSuccessful
bool particleInsertionSuccessful(int n)
This function tries to insert the n-th particle (returns true if it manage to do that)....
Definition: BaseCluster.cc:1198
BaseParticle::setRadius
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
BaseCluster::writeToOverlFile
void writeToOverlFile()
This writes on the cluster overlap output file.
Definition: BaseCluster.cc:1437
BaseCluster::radiusCluster_
Mdouble radiusCluster_
Definition: BaseCluster.h:495
Vec3D
Definition: Vector.h:50
BaseCluster::meanCoordinationNumber_
Mdouble meanCoordinationNumber_
Definition: BaseCluster.h:562
BaseCluster::increaseForce
void increaseForce()
This linearly increases the value of forceModulus (stage = 1).
Definition: BaseCluster.cc:1499
BaseCluster::isAmatOutputOn
bool isAmatOutputOn() const
This returns the bool variable that defines whether the cluster adjacency matrix output is written or...
Definition: BaseCluster.cc:299
DPMBase::fStatFile
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1441
ParticleSpecies::getMassFromRadius
Mdouble getMassFromRadius(Mdouble radius) const
Definition: ParticleSpecies.cc:122
BaseCluster::makeOverlFile
void makeOverlFile()
Creates the cluster overlap output file.
Definition: BaseCluster.cc:1179
BaseCluster::isEneOutputOn
bool isEneOutputOn() const
This returns the bool variable that defines whether the cluster ene output is written or not.
Definition: BaseCluster.cc:369
BaseCluster::clusterTimeMax_
Mdouble clusterTimeMax_
Definition: BaseCluster.h:600
Mdouble
double Mdouble
Definition: GeneralDefine.h:34
BaseCluster::isIntStrucOutputOn_
bool isIntStrucOutputOn_
Definition: BaseCluster.h:524
BaseParticle::getRadius
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
BaseCluster::read
void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
Overrides DPMBase read(): in this all variables needed by the program for restarting are read.
Definition: BaseCluster.cc:838
BaseCluster::setNumberOfParticles_
bool setNumberOfParticles_
Definition: BaseCluster.h:489
BaseCluster::fileOutputTimeInterval_
Mdouble fileOutputTimeInterval_
Definition: BaseCluster.h:584
BaseCluster::collisionTimeOverTimeStep_
Mdouble collisionTimeOverTimeStep_
Definition: BaseCluster.h:475
ParticleHandler::getLargestParticle
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
Definition: ParticleHandler.cc:530
BaseInteractable::setVelocity
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
BaseCluster::isCdatOutputOn
bool isCdatOutputOn() const
This returns the bool variable that defines whether the cluster data output (which is NOT the mercury...
Definition: BaseCluster.cc:271
BaseCluster::radiusForSolidFraction_
Mdouble radiusForSolidFraction_
Definition: BaseCluster.h:588
BaseCluster::gnuplotFile_
std::ofstream gnuplotFile_
Definition: BaseCluster.h:578
BaseCluster::isFStatOutputOn_
bool isFStatOutputOn_
Definition: BaseCluster.h:530
double
VERBOSE
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
ERROR
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
DPMBase::getKineticEnergy
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
BaseCluster::isFStatOutputOn
bool isFStatOutputOn() const
This returns the bool variable that defines whether the cluster fStat output is written or not.
Definition: BaseCluster.cc:355
mathsFunc::sin
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
BaseCluster::getParticleSpecies
LinearPlasticViscoelasticFrictionSpecies * getParticleSpecies() const
This returns the species of the particle.
Definition: BaseCluster.cc:243
BaseParticle::setSpecies
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
DPMBase::setDomain
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1089
BaseCluster::makeCdatFile
void makeCdatFile()
Creates the cluster data output file.
Definition: BaseCluster.cc:1136
Vec3D::getLength
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
BaseCluster::makeGnuplotFile
void makeGnuplotFile()
This creates the gnuplot file needed for printing force vs overlaps values.
Definition: BaseCluster.cc:1688
BaseCluster::maximumForceModulus_
Mdouble maximumForceModulus_
Definition: BaseCluster.h:604
BaseCluster::doVtkOutput
void doVtkOutput(bool iVOO)
This sets the bool variable that defines whether the cluster vtk output will be written or not.
Definition: BaseCluster.cc:334
DPMBase::getTime
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
BaseCluster::overlFile_
std::ofstream overlFile_
Definition: BaseCluster.h:576
Species
Contains material and contact force properties.
Definition: Species.h:35
WARN
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
BaseCluster::solidFraction_
Mdouble solidFraction_
Definition: BaseCluster.h:590
BaseCluster::write
void write(std::ostream &os, bool writeAllParticles) const override
Overrides DPMBase write(): in this all variables needed by the program for restarting are written.
Definition: BaseCluster.cc:791
ParticleHandler::clear
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:973
BaseCluster::intStructFile_
std::ofstream intStructFile_
Definition: BaseCluster.h:582
Log::FATAL
@ FATAL
BaseCluster::getFinalMassFraction
Mdouble getFinalMassFraction()
This gets the final value obtained for the mass fraction;.
Definition: BaseCluster.cc:165
DPMBase::speciesHandler
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
helpers::round
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
BaseCluster::getVelocity
Vec3D getVelocity()
This gets the value of velocity after creation.
Definition: BaseCluster.cc:257
BaseCluster::solidFractionIntStruct_
Mdouble solidFractionIntStruct_
Definition: BaseCluster.h:592
BaseCluster::writeAmatFile
void writeAmatFile()
This writes on the adjacency matrix file.
Definition: BaseCluster.cc:1576
BaseCluster::isRestartOutputOn
bool isRestartOutputOn() const
This returns the bool variable that defines whether the cluster restart output is written or not.
Definition: BaseCluster.cc:341
BaseCluster::position_
Vec3D position_
Definition: BaseCluster.h:471
BaseCluster::amatFile_
std::ofstream amatFile_
Definition: BaseCluster.h:580
BaseCluster::setVelocity
void setVelocity(Vec3D v)
This sets the value of velocity after creation.
Definition: BaseCluster.cc:264
DPMBase::getElasticEnergy
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1521
BaseCluster::massParticle_
Mdouble massParticle_
Definition: BaseCluster.h:548
BaseCluster::actionsOnRestart
void actionsOnRestart() override
Overrides DPMBase actionsOnRestart(): in this all variables needed by the program for restarting are ...
Definition: BaseCluster.cc:884
BaseCluster::getEnergyRatioTolerance
Mdouble getEnergyRatioTolerance() const
This returns the value of the value of the energy ratio threshold under which the process can be cons...
Definition: BaseCluster.cc:226
BaseCluster::centerOfMass_
Vec3D centerOfMass_
Definition: BaseCluster.h:556
BaseCluster::setVelocityDampingModulus
void setVelocityDampingModulus(Mdouble vDM)
This sets the value of the velocity damping modulus.
Definition: BaseCluster.cc:200
BaseCluster::getAverageOverlap
Mdouble getAverageOverlap()
this returns the average overlap.
Definition: BaseCluster.cc:390
BaseCluster::isIntStrucOutputOn
bool isIntStrucOutputOn() const
This returns the bool variable that defines whether the cluster internal structure output is written ...
Definition: BaseCluster.cc:313
BaseCluster::sizeDispersityParticle_
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
BaseCluster::applyCentralForce
void applyCentralForce()
This applies force on each particle.
Definition: BaseCluster.cc:1480
BaseCluster::setDomainLimits
void setDomainLimits()
Sets domain limits.
Definition: BaseCluster.cc:1044
BaseCluster::stage_
int stage_
Definition: BaseCluster.h:596
SphericalParticle
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
BaseCluster::velocityDampingModulus_
Mdouble velocityDampingModulus_
Definition: BaseCluster.h:505
BaseCluster::doFStatOutput
void doFStatOutput(bool isfStatOutputOn)
This sets the bool variable that defines whether the cluster fStat output will be written or not.
Definition: BaseCluster.cc:362
DPMBase::setTimeMax
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
BaseCluster::isAmatOutputOn_
bool isAmatOutputOn_
Definition: BaseCluster.h:522
Vec3D::Y
Mdouble Y
Definition: Vector.h:65
BaseCluster::energyRatioTolerance_
Mdouble energyRatioTolerance_
Definition: BaseCluster.h:477
helpers::getLineFromStringStream
void getLineFromStringStream(std::istream &in, std::stringstream &out)
Reads a line from one stringstream into another, and prepares the latter for reading in.
Definition: Helpers.cc:423
DPMBase::getName
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:397
BaseCluster::forceDampingModulus_
Mdouble forceDampingModulus_
Definition: BaseCluster.h:617
BaseCluster::isEneOutputOn_
bool isEneOutputOn_
Definition: BaseCluster.h:532
constants::i
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
BaseCluster::dampVelocities
void dampVelocities()
This damps values of each particle velocity (stage = 1, stage = 2, stage = 3).
Definition: BaseCluster.cc:1508
BaseCluster::setNumberOfParticles
void setNumberOfParticles(int nP)
This sets the value of the number of particles in the cluster.
Definition: BaseCluster.cc:134
BaseCluster::isOverlOutputOn
bool isOverlOutputOn() const
This returns the bool variable that defines whether the cluster overlap output is written or not.
Definition: BaseCluster.cc:285
DPMBase::ReadOptions::ReadAll
@ ReadAll
BaseCluster::meanClusterRadius_
Mdouble meanClusterRadius_
Definition: BaseCluster.h:501
BaseHandler::getObject
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
BaseCluster::forceTuningDuration_
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
BaseCluster::calculateTimeStep
void calculateTimeStep()
Calculates the time step.
Definition: BaseCluster.cc:1059
BaseCluster::totalParticleVolume_
Mdouble totalParticleVolume_
Definition: BaseCluster.h:550
BaseCluster::setRadiusParticle
void setRadiusParticle(Mdouble rP)
This sets the value of particles' radius if there's no dispersity in size.
Definition: BaseCluster.cc:97
BaseCluster::printTime
void printTime() const override
Overrides DPMBase printTime(): this way variables of interest are shown.
Definition: BaseCluster.cc:944
DPMBase::eneFile
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1446
BaseCluster::isVtkOutputOn
bool isVtkOutputOn() const
This returns the bool variable that defines whether the cluster vtk output is written or not.
Definition: BaseCluster.cc:327
BaseCluster::cdatFile_
std::ofstream cdatFile_
Definition: BaseCluster.h:574
MercuryBase::write
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes all data into a restart file.
Definition: MercuryBase.cc:147
BaseCluster::~BaseCluster
~BaseCluster() final
Default destructor.
Definition: BaseCluster.cc:38
BaseCluster::nParticles_
int nParticles_
Definition: BaseCluster.h:487
BaseCluster::isRestartOutputOn_
bool isRestartOutputOn_
Definition: BaseCluster.h:528
BaseHandler::copyAndAddObject
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
n
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
BaseCluster::getCollisionTimeOverTimeStep
Mdouble getCollisionTimeOverTimeStep() const
This returns the value of the ratio between collision time and time step.
Definition: BaseCluster.cc:68
BaseHandler::begin
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:690
BaseCluster::smallestRadius_
Mdouble smallestRadius_
Definition: BaseCluster.h:546
MpiDataClass.h
RNG::getRandomNumber
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:142
DPMBase::setXBallsAdditionalArguments
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1338
BaseCluster::getRadiusParticle
Mdouble getRadiusParticle() const
This returns the value of particles' radius if there's no dispersity in size. In case of dispersity !...
Definition: BaseCluster.cc:88
BaseCluster::forceModulus_
Mdouble forceModulus_
Definition: BaseCluster.h:606
BaseCluster::nIntraClusterBonds_
int nIntraClusterBonds_
Definition: BaseCluster.h:570
BaseCluster::actionsAfterTimeStep
void actionsAfterTimeStep() override
Overrides DPMBase actionsAfterTimeStep(): in this compression and decompression are computed,...
Definition: BaseCluster.cc:621
LinearPlasticViscoelasticFrictionSpecies.h
DPMBase::particleHandler
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
Vec3D::Z
Mdouble Z
Definition: Vector.h:65
DPMBase::setSaveCount
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
BaseCluster::setEnergyRatioTolerance
void setEnergyRatioTolerance(Mdouble eRT)
This sets the value of the value of the energy ratio threshold under which the process can be conside...
Definition: BaseCluster.cc:234
BaseCluster::forceTuningInterval_
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
BaseCluster::doRestartOutput
void doRestartOutput(bool isRestartOutputOn)
This sets the bool variable that defines whether the cluster restart output will be written or not.
Definition: BaseCluster.cc:348
BaseParticle::getMass
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
BaseCluster::setClusterId
void setClusterId(unsigned int iC)
This sets the value of the cluster ID.
Definition: BaseCluster.cc:183
BaseCluster::setParticleSpecies
void setParticleSpecies(LinearPlasticViscoelasticFrictionSpecies *particleSpecies)
This sets the species of the particle.
Definition: BaseCluster.cc:250
BaseCluster::makeIntenalStructureFile
void makeIntenalStructureFile()
This creates the file needed for writing down datas from computeInternalStructure().
Definition: BaseCluster.cc:1719
Mercury3D.h
DPMBase::dataFile
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1436
BaseHandler::end
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:704
units::name
std::string name
Definition: MercuryProb.h:48
BaseCluster::setRadiusCluster
void setRadiusCluster(Mdouble rCR)
This sets the desired value of the cluster radius (there is no getter of this value,...
Definition: BaseCluster.cc:149
constants::inf
const Mdouble inf
Definition: GeneralDefine.h:44
BaseCluster::radii_
std::vector< Mdouble > radii_
Definition: BaseCluster.h:544
BaseCluster::particleSpecies_
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
BaseCluster::getSizeDispersityParticle
Mdouble getSizeDispersityParticle() const
This returns the value of particles' dispersity in size.
Definition: BaseCluster.cc:109
BaseCluster::actionsAfterSolve
void actionsAfterSolve() override
Overrides DPMBase actionsAfterSolve(): in this cluster data file and cluster overlap file are closed ...
Definition: BaseCluster.cc:733
BaseCluster::setupInitialConditions
void setupInitialConditions() override
Overrides DPMBase setupInitialConditions(): in this initial conditions for the problem are set.
Definition: BaseCluster.cc:425
BaseCluster::computeInternalStructure
void computeInternalStructure()
This computes the internal structure of the cluster.
Definition: BaseCluster.cc:1602
BaseCluster::nInternalStructurePoints_
int nInternalStructurePoints_
Definition: BaseCluster.h:509
mathsFunc::cos
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
DPMBase::interactionHandler
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1425
int
BaseCluster::setCollisionTimeOverTimeStep
void setCollisionTimeOverTimeStep(Mdouble cTOTS)
This sets the collisionTimeOverTimeStep number (which is the ratio between collision time and time st...
Definition: BaseCluster.cc:76