revision: v0.14
BaseCluster Class Reference

#include <BaseCluster.h>

+ Inheritance diagram for BaseCluster:

Public Member Functions

 BaseCluster ()
 Default constructor. More...
 
 ~BaseCluster () final
 Default destructor. More...
 
Vec3D getPosition () const
 This returns the value of position_, which is the position in which the cluster will be inserted. More...
 
void setPosition (Vec3D p)
 This sets the value of position_, which is the position in which the cluster will be inserted. More...
 
Mdouble getCollisionTimeOverTimeStep () const
 This returns the value of the ratio between collision time and time step. More...
 
void setCollisionTimeOverTimeStep (Mdouble cTOTS)
 This sets the collisionTimeOverTimeStep number (which is the ratio between collision time and time step). More...
 
Mdouble getRadiusParticle () const
 This returns the value of particles' radius if there's no dispersity in size. In case of dispersity != 1, this is the radius from which all radii are computed (as a consequence in this case it is also the pseudo-averaged radius). More...
 
void setRadiusParticle (Mdouble rP)
 This sets the value of particles' radius if there's no dispersity in size. More...
 
Mdouble getSizeDispersityParticle () const
 This returns the value of particles' dispersity in size. More...
 
void setSizeDispersityParticle (Mdouble sDP)
 This sets the value of particles' dispersity in size. More...
 
int getNumberOfParticles () const
 This returns the value of the number of particles in the cluster. More...
 
void setNumberOfParticles (int nP)
 This sets the value of the number of particles in the cluster. More...
 
void setRadiusCluster (Mdouble rCR)
 This sets the desired value of the cluster radius (there is no getter of this value, but there is a getter of the actual mean cluster radius obtained, getMeanClusterRadius) More...
 
Mdouble getFinalMassFraction ()
 This gets the final value obtained for the mass fraction;. More...
 
unsigned int getClusterId () const
 This returns the value of the cluster ID. More...
 
void setClusterId (unsigned int iC)
 This sets the value of the cluster ID. More...
 
Mdouble getVelocityDampingModulus () const
 This returns the value of the velocity damping modulus. More...
 
void setVelocityDampingModulus (Mdouble vDM)
 This sets the value of the velocity damping modulus. More...
 
int getNumberOfInternalStructurePoints () const
 This returns the value of the number of particles used to compute internal structure. More...
 
void setNumberOfInternalStructurePoints (int gL)
 This sets the value of the number of particles used to compute the internal structure. More...
 
Mdouble getEnergyRatioTolerance () const
 This returns the value of the value of the energy ratio threshold under which the process can be considered static, and so over. More...
 
void setEnergyRatioTolerance (Mdouble eRT)
 This sets the value of the value of the energy ratio threshold under which the process can be considered static, and so over. More...
 
LinearPlasticViscoelasticFrictionSpeciesgetParticleSpecies () const
 This returns the species of the particle. More...
 
void setParticleSpecies (LinearPlasticViscoelasticFrictionSpecies *particleSpecies)
 This sets the species of the particle. More...
 
Vec3D getVelocity ()
 This gets the value of velocity after creation. More...
 
void setVelocity (Vec3D v)
 This sets the value of velocity after creation. More...
 
bool isCdatOutputOn () const
 This returns the bool variable that defines whether the cluster data output (which is NOT the mercury data output) is written or not. More...
 
void doCdatOutput (bool iCOO)
 This sets the bool variable that defines whether the cluster data output will be written or not. More...
 
bool isOverlOutputOn () const
 This returns the bool variable that defines whether the cluster overlap output is written or not. More...
 
void doOverlOutput (bool iOOO)
 This sets the bool variable that defines whether the cluster overlap output will be written or not. More...
 
bool isAmatOutputOn () const
 This returns the bool variable that defines whether the cluster adjacency matrix output is written or not. More...
 
void doAmatOutput (bool iAOO)
 This sets the bool variable that defines whether the cluster adjacency matrix output will be written or not. More...
 
bool isIntStrucOutputOn () const
 This returns the bool variable that defines whether the cluster internal structure output is written or not. More...
 
void doIntStrucOutput (bool iISOO)
 This sets the bool variable that defines whether the cluster internal structure output will be written or not. More...
 
bool isVtkOutputOn () const
 This returns the bool variable that defines whether the cluster vtk output is written or not. More...
 
void doVtkOutput (bool iVOO)
 This sets the bool variable that defines whether the cluster vtk output will be written or not. More...
 
bool isRestartOutputOn () const
 This returns the bool variable that defines whether the cluster restart output is written or not. More...
 
void doRestartOutput (bool isRestartOutputOn)
 This sets the bool variable that defines whether the cluster restart output will be written or not. More...
 
bool isFStatOutputOn () const
 This returns the bool variable that defines whether the cluster fStat output is written or not. More...
 
void doFStatOutput (bool isfStatOutputOn)
 This sets the bool variable that defines whether the cluster fStat output will be written or not. More...
 
bool isEneOutputOn () const
 This returns the bool variable that defines whether the cluster ene output is written or not. More...
 
void doEneOutput (bool isEneOutputOn)
 This sets the bool variable that defines whether the cluster ene output will be written or not. More...
 
Mdouble getMeanClusterRadius ()
 this returns meanClusterRadius (radius of an ideal perfectly spherical cluster, there's no setter). More...
 
Mdouble getAverageOverlap ()
 this returns the average overlap. More...
 
void setupInitialConditions () override
 Overrides DPMBase setupInitialConditions(): in this initial conditions for the problem are set. More...
 
void actionsAfterTimeStep () override
 Overrides DPMBase actionsAfterTimeStep(): in this compression and decompression are computed, depending on the variable stage_. More...
 
void actionsAfterSolve () override
 Overrides DPMBase actionsAfterSolve(): in this cluster data file and cluster overlap file are closed and a few final actions are executed. Details in BaseCluster.cc. More...
 
void write (std::ostream &os, bool writeAllParticles) const override
 Overrides DPMBase write(): in this all variables needed by the program for restarting are written. More...
 
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. More...
 
void actionsOnRestart () override
 Overrides DPMBase actionsOnRestart(): in this all variables needed by the program for restarting are initialized. More...
 
void printTime () const override
 Overrides DPMBase printTime(): this way variables of interest are shown. More...
 
- Public Member Functions inherited from Mercury3D
 Mercury3D ()
 This is the default constructor. All it does is set sensible defaults. More...
 
 Mercury3D (const DPMBase &other)
 Copy-constructor for creates an Mercury3D problem from an existing MD problem. More...
 
 Mercury3D (const Mercury3D &other)
 Copy-constructor. More...
 
void constructor ()
 Function that sets the SystemDimension and ParticleDimension to 3. More...
 
std::vector< BaseParticle * > hGridFindParticleContacts (const BaseParticle *obj) override
 Returns all particles that have a contact with a given particle. More...
 
- Public Member Functions inherited from MercuryBase
 MercuryBase ()
 This is the default constructor. It sets sensible defaults. More...
 
 ~MercuryBase () override
 This is the default destructor. More...
 
 MercuryBase (const MercuryBase &mercuryBase)
 Copy-constructor. More...
 
void constructor ()
 This is the actual constructor, it is called do both constructors above. More...
 
void hGridActionsBeforeTimeLoop () override
 This sets up the broad phase information, has to be done at this stage because it requires the particle size. More...
 
void hGridActionsBeforeTimeStep () override
 Performs all necessary actions before a time-step, like updating the particles and resetting all the bucket information, etc. More...
 
void read (std::istream &is, ReadOptions opt=ReadOptions::ReadAll) override
 Reads the MercuryBase from an input stream, for example a restart file. More...
 
void write (std::ostream &os, bool writeAllParticles=true) const override
 Writes all data into a restart file. More...
 
Mdouble getHGridCurrentMaxRelativeDisplacement () const
 Returns hGridCurrentMaxRelativeDisplacement_. More...
 
Mdouble getHGridTotalCurrentMaxRelativeDisplacement () const
 Returns hGridTotalCurrentMaxRelativeDisplacement_. More...
 
void setHGridUpdateEachTimeStep (bool updateEachTimeStep)
 Sets whether or not the HGrid must be updated every time step. More...
 
bool getHGridUpdateEachTimeStep () const final
 Gets whether or not the HGrid is updated every time step. More...
 
void setHGridMaxLevels (unsigned int HGridMaxLevels)
 Sets the maximum number of levels of the HGrid in this MercuryBase. More...
 
unsigned int getHGridMaxLevels () const
 Gets the maximum number of levels of the HGrid in this MercuryBase. More...
 
HGridMethod getHGridMethod () const
 Gets whether the HGrid in this MercuryBase is BOTTOMUP or TOPDOWN. More...
 
void setHGridMethod (HGridMethod hGridMethod)
 Sets the HGridMethod to either BOTTOMUP or TOPDOWN. More...
 
HGridDistribution getHGridDistribution () const
 Gets how the sizes of the cells of different levels are distributed. More...
 
void setHGridDistribution (HGridDistribution hGridDistribution)
 Sets how the sizes of the cells of different levels are distributed. More...
 
Mdouble getHGridCellOverSizeRatio () const
 Gets the ratio of the smallest cell over the smallest particle. More...
 
void setHGridCellOverSizeRatio (Mdouble cellOverSizeRatio)
 Sets the ratio of the smallest cell over the smallest particle. More...
 
bool hGridNeedsRebuilding ()
 Gets if the HGrid needs rebuilding before anything else happens. More...
 
virtual unsigned int getHGridTargetNumberOfBuckets () const
 Gets the desired number of buckets, which is the maximum of the number of particles and 10. More...
 
virtual Mdouble getHGridTargetMinInteractionRadius () const
 Gets the desired size of the smallest cells of the HGrid. More...
 
virtual Mdouble getHGridTargetMaxInteractionRadius () const
 Gets the desired size of the largest cells of the HGrid. More...
 
bool checkParticleForInteraction (const BaseParticle &P) final
 Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle. More...
 
bool checkParticleForInteractionLocal (const BaseParticle &P) final
 Checks if the given BaseParticle has an interaction with a BaseWall or other BaseParticles in a local domain. More...
 
virtual Mdouble userHGridCellSize (unsigned int level)
 Virtual function that enables inheriting classes to implement a function to let the user set the cell size of the HGrid. More...
 
void hGridInfo (std::ostream &os=std::cout) const
 Writes the info of the HGrid to the screen in a nice format. More...
 
- Public Member Functions inherited from DPMBase
void constructor ()
 A function which initialises the member variables to default values, so that the problem can be solved off the shelf; sets up a basic two dimensional problem which can be solved off the shelf. It is called in the constructor DPMBase(). More...
 
 DPMBase ()
 Constructor that calls the "void constructor()". More...
 
 DPMBase (const DPMBase &other)
 Copy constructor type-2. More...
 
virtual ~DPMBase ()
 virtual destructor More...
 
void autoNumber ()
 The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incrementRunNumberInFile(). More...
 
std::vector< intget1DParametersFromRunNumber (int size_x) const
 This turns a counter into 1 index, which is a useful feature for performing 1D parameter study. The index run from 1:size_x, while the study number starts at 0 (initially the counter=1 in COUNTER_DONOTDEL) More...
 
std::vector< intget2DParametersFromRunNumber (int size_x, int size_y) const
 This turns a counter into 2 indices which is a very useful feature for performing a 2D study. The indices run from 1:size_x and 1:size_y, while the study number starts at 0 ( initially the counter=1 in COUNTER_DONOTDEL) More...
 
std::vector< intget3DParametersFromRunNumber (int size_x, int size_y, int size_z) const
 This turns a counter into 3 indices, which is a useful feature for performing a 3D parameter study. The indices run from 1:size_x, 1:size_y and 1:size_z, while the study number starts at 0 ( initially the counter=1 in COUNTER_DONOTDEL) More...
 
int launchNewRun (const char *name, bool quick=false)
 This launches a code from within this code. Please pass the name of the code to run. More...
 
void setRunNumber (int runNumber)
 This sets the counter/Run number, overriding the defaults. More...
 
int getRunNumber () const
 This returns the current value of the counter (runNumber_) More...
 
virtual void decompose ()
 Sends particles from processorId to the root processor. More...
 
void solve ()
 The work horse of the code. More...
 
virtual void computeOneTimeStep ()
 Performs everything needed for one time step, used in the time-loop of solve(). More...
 
void checkSettings ()
 Checks if the essentials are set properly to go ahead with solving the problem. More...
 
void forceWriteOutputFiles ()
 Writes output files immediately, even if the current time step was not meant to be written. Also resets the last saved time step. More...
 
virtual void writeOutputFiles ()
 Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and .restart (see the Mercury website for more details regarding these files). More...
 
void solve (int argc, char *argv[])
 The work horse of the code. Can handle flags from the command line. More...
 
virtual void writeXBallsScript () const
 This writes a script which can be used to load the xballs problem to display the data just generated. More...
 
virtual Mdouble getInfo (const BaseParticle &P) const
 A virtual function that returns some user-specified information about a particle. More...
 
ParticleVtkWritergetVtkWriter () const
 
virtual void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void writeDataFile ()
 
void writeEneFile ()
 
void writeFStatFile ()
 
void fillDomainWithParticles (unsigned N=50)
 
bool readRestartFile (ReadOptions opt=ReadOptions::ReadAll)
 Reads all the particle data corresponding to a given, existing . restart file (for more details regarding restart files, refer to the training materials on the MercuryDPM website).Returns true if it is successful, false otherwise. More...
 
int readRestartFile (std::string fileName, ReadOptions opt=ReadOptions::ReadAll)
 The same as readRestartFile(bool), but also reads all the particle data corresponding to the current saved time step. More...
 
virtual BaseWallreadUserDefinedWall (const std::string &type) const
 Allows you to read in a wall defined in a Driver directory; see USER/Luca/ScrewFiller. More...
 
virtual void readOld (std::istream &is)
 Reads all data from a restart file, e.g. domain data and particle data; old version. More...
 
bool readDataFile (std::string fileName="", unsigned int format=0)
 This allows particle data to be reloaded from data files. More...
 
bool readParAndIniFiles (std::string fileName)
 Allows the user to read par.ini files (useful to read files produced by the MDCLR simulation code - external to MercuryDPM) More...
 
bool readNextDataFile (unsigned int format=0)
 Reads the next data file with default format=0. However, one can modify the format based on whether the particle data corresponds to 3D or 2D data- see Visualising data in xballs. More...
 
void readNextFStatFile ()
 Reads the next fstat file. More...
 
bool findNextExistingDataFile (Mdouble tMin, bool verbose=true)
 Finds and opens the next data file, if such a file exists. More...
 
bool readArguments (int argc, char *argv[])
 Can interpret main function input arguments that are passed by the driver codes. More...
 
bool checkParticleForInteractionLocalPeriodic (const BaseParticle &P)
 
void readSpeciesFromDataFile (bool read=true)
 
void importParticlesAs (ParticleHandler &particleHandler, InteractionHandler &interactionHandler, const ParticleSpecies *species)
 Copies particles, interactions assigning species from a local simulation to a global one. Useful for the creation of a cluster. More...
 
MERCURY_DEPRECATED FilegetDataFile ()
 The non const version. Allows one to edit the File::dataFile. More...
 
MERCURY_DEPRECATED FilegetEneFile ()
 The non const version. Allows to edit the File::eneFile. More...
 
MERCURY_DEPRECATED FilegetFStatFile ()
 The non const version. Allows to edit the File::fStatFile. More...
 
MERCURY_DEPRECATED FilegetRestartFile ()
 The non const version. Allows to edit the File::restartFile. More...
 
MERCURY_DEPRECATED FilegetStatFile ()
 The non const version. Allows to edit the File::statFile. More...
 
FilegetInteractionFile ()
 Return a reference to the file InteractionsFile. More...
 
MERCURY_DEPRECATED const FilegetDataFile () const
 The const version. Does not allow for any editing of the File::dataFile. More...
 
MERCURY_DEPRECATED const FilegetEneFile () const
 The const version. Does not allow for any editing of the File::eneFile. More...
 
MERCURY_DEPRECATED const FilegetFStatFile () const
 The const version. Does not allow for any editing of the File::fStatFile. More...
 
MERCURY_DEPRECATED const FilegetRestartFile () const
 The const version. Does not allow for any editing of the File::restartFile. More...
 
MERCURY_DEPRECATED const FilegetStatFile () const
 The const version. Does not allow for any editing of the File::statFile. More...
 
const FilegetInteractionFile () const
 
const std::string & getName () const
 Returns the name of the file. Does not allow to change it though. More...
 
void setName (const std::string &name)
 Allows to set the name of all the files (ene, data, fstat, restart, stat) More...
 
void setName (const char *name)
 Calls setName(std::string) More...
 
void setSaveCount (unsigned int saveCount)
 Sets File::saveCount_ for all files (ene, data, fstat, restart, stat) More...
 
void setFileType (FileType fileType)
 Sets File::fileType_ for all files (ene, data, fstat, restart, stat) More...
 
void setOpenMode (std::fstream::openmode openMode)
 Sets File::openMode_ for all files (ene, data, fstat, restart, stat) More...
 
void resetFileCounter ()
 Resets the file counter for each file i.e. for ene, data, fstat, restart, stat) More...
 
void closeFiles ()
 Closes all files (ene, data, fstat, restart, stat) that were opened to read or write. More...
 
void setLastSavedTimeStep (unsigned int nextSavedTimeStep)
 Sets the next time step for all the files (ene, data, fstat, restart, stat) at which the data is to be written or saved. More...
 
Mdouble getTime () const
 Returns the current simulation time. More...
 
Mdouble getNextTime () const
 Returns the current simulation time. More...
 
unsigned int getNumberOfTimeSteps () const
 Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has undergone so far. More...
 
void setTime (Mdouble time)
 Sets a new value for the current simulation time. More...
 
void setTimeMax (Mdouble newTMax)
 Sets a new value for the maximum simulation duration. More...
 
Mdouble getTimeMax () const
 Returns the maximum simulation duration. More...
 
void setLogarithmicSaveCount (Mdouble logarithmicSaveCountBase)
 Sets File::logarithmicSaveCount_ for all files (ene, data, fstat, restart, stat) More...
 
void setNToWrite (int nToWrite)
 set the number of elements to write to the screen More...
 
int getNToWrite () const
 get the number of elements to write to the More...
 
void setRotation (bool rotation)
 Sets whether particle rotation is enabled or disabled. More...
 
bool getRotation () const
 Indicates whether particle rotation is enabled or disabled. More...
 
void setWallsWriteVTK (FileType writeWallsVTK)
 Sets whether walls are written into a VTK file. More...
 
void setWallsWriteVTK (bool)
 Sets whether walls are written into a VTK file. More...
 
void setInteractionsWriteVTK (bool)
 Sets whether interactions are written into a VTK file. More...
 
void setParticlesWriteVTK (bool writeParticlesVTK)
 Sets whether particles are written in a VTK file. More...
 
void setSuperquadricParticlesWriteVTK (bool writeSuperquadricParticlesVTK)
 
FileType getWallsWriteVTK () const
 Returns whether walls are written in a VTK file. More...
 
bool getParticlesWriteVTK () const
 Returns whether particles are written in a VTK file. More...
 
bool getSuperquadricParticlesWriteVTK () const
 
Mdouble getXMin () const
 If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin. More...
 
Mdouble getXMax () const
 If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax. More...
 
Mdouble getYMin () const
 If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin. More...
 
Mdouble getYMax () const
 If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax. More...
 
Mdouble getZMin () const
 If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin. More...
 
Mdouble getZMax () const
 If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax. More...
 
Vec3D getMin () const
 
Vec3D getMax () const
 
void setXMin (Mdouble newXMin)
 Sets the value of XMin, the lower bound of the problem domain in the x-direction. More...
 
void setYMin (Mdouble newYMin)
 Sets the value of YMin, the lower bound of the problem domain in the y-direction. More...
 
void setZMin (Mdouble newZMin)
 Sets the value of ZMin, the lower bound of the problem domain in the z-direction. More...
 
void setXMax (Mdouble newXMax)
 Sets the value of XMax, the upper bound of the problem domain in the x-direction. More...
 
void setYMax (Mdouble newYMax)
 Sets the value of YMax, the upper bound of the problem domain in the y-direction. More...
 
void setZMax (Mdouble newZMax)
 Sets the value of ZMax, the upper bound of the problem domain in the z-direction. More...
 
void setMax (const Vec3D &max)
 Sets the maximum coordinates of the problem domain. More...
 
void setMax (Mdouble, Mdouble, Mdouble)
 Sets the maximum coordinates of the problem domain. More...
 
void setDomain (const Vec3D &min, const Vec3D &max)
 Sets the minimum coordinates of the problem domain. More...
 
void setMin (const Vec3D &min)
 Sets the minimum coordinates of the problem domain. More...
 
void setMin (Mdouble, Mdouble, Mdouble)
 Sets the minimum coordinates of the problem domain. More...
 
void setTimeStep (Mdouble newDt)
 Sets a new value for the simulation time step. More...
 
Mdouble getTimeStep () const
 Returns the simulation time step. More...
 
void setNumberOfOMPThreads (int numberOfOMPThreads)
 
int getNumberOfOMPThreads () const
 
void setXBallsColourMode (int newCMode)
 Set the xballs output mode. More...
 
int getXBallsColourMode () const
 Get the xballs colour mode (CMode). More...
 
void setXBallsVectorScale (double newVScale)
 Set the scale of vectors in xballs. More...
 
double getXBallsVectorScale () const
 Returns the scale of vectors used in xballs. More...
 
void setXBallsAdditionalArguments (std::string newXBArgs)
 Set the additional arguments for xballs. More...
 
std::string getXBallsAdditionalArguments () const
 Returns the additional arguments for xballs. More...
 
void setXBallsScale (Mdouble newScale)
 Sets the scale of the view (either normal, zoom in or zoom out) to display in xballs. The default is fit to screen. More...
 
double getXBallsScale () const
 Returns the scale of the view in xballs. More...
 
void setGravity (Vec3D newGravity)
 Sets a new value for the gravitational acceleration. More...
 
Vec3D getGravity () const
 Returns the gravitational acceleration. More...
 
void setDimension (unsigned int newDim)
 Sets both the system dimensions and the particle dimensionality. More...
 
void setSystemDimensions (unsigned int newDim)
 Sets the system dimensionality. More...
 
unsigned int getSystemDimensions () const
 Returns the system dimensionality. More...
 
void setParticleDimensions (unsigned int particleDimensions)
 Sets the particle dimensionality. More...
 
unsigned int getParticleDimensions () const
 Returns the particle dimensionality. More...
 
std::string getRestartVersion () const
 This is to take into account for different Mercury versions. Returns the version of the restart file. More...
 
void setRestartVersion (std::string newRV)
 Sets restart_version. More...
 
bool getRestarted () const
 Returns the flag denoting if the simulation was restarted or not. More...
 
void setRestarted (bool newRestartedFlag)
 Allows to set the flag stating if the simulation is to be restarted or not. More...
 
bool getAppend () const
 Returns whether the "append" option is on or off. More...
 
void setAppend (bool newAppendFlag)
 Sets whether the "append" option is on or off. More...
 
Mdouble getElasticEnergy () const
 Returns the global elastic energy within the system. More...
 
Mdouble getKineticEnergy () const
 Returns the global kinetic energy stored in the system. More...
 
Mdouble getGravitationalEnergy () const
 Returns the global gravitational potential energy stored in the system. More...
 
Mdouble getRotationalEnergy () const
 JMFT Returns the global rotational energy stored in the system. More...
 
Mdouble getTotalEnergy () const
 
Mdouble getTotalMass () const
 JMFT: Return the total mass of the system, excluding fixed particles. More...
 
Vec3D getCentreOfMass () const
 JMFT: Return the centre of mass of the system, excluding fixed particles. More...
 
Vec3D getTotalMomentum () const
 JMFT: Return the total momentum of the system, excluding fixed particles. More...
 
double getCPUTime ()
 
double getWallTime ()
 
virtual void hGridInsertParticle (BaseParticle *obj UNUSED)
 
virtual void hGridUpdateParticle (BaseParticle *obj UNUSED)
 
virtual void hGridRemoveParticle (BaseParticle *obj UNUSED)
 
bool mpiIsInCommunicationZone (BaseParticle *particle)
 Checks if the position of the particle is in an mpi communication zone or not. More...
 
bool mpiInsertParticleCheck (BaseParticle *P)
 Function that checks if the mpi particle should really be inserted by the current domain. More...
 
void insertGhostParticle (BaseParticle *P)
 This function inserts a particle in the mpi communication boundaries. More...
 
void updateGhostGrid (BaseParticle *P)
 Checks if the Domain/periodic interaction distance needs to be updated and updates it accordingly. More...
 
virtual void gatherContactStatistics (unsigned int index1, int index2, Vec3D Contact, Mdouble delta, Mdouble ctheta, Mdouble fdotn, Mdouble fdott, Vec3D P1_P2_normal_, Vec3D P1_P2_tangential)
 //Not unsigned index because of possible wall collisions. More...
 
void setNumberOfDomains (std::vector< unsigned > direction)
 Sets the number of domains in x-,y- and z-direction. Required for parallel computations. More...
 
void splitDomain (DomainSplit domainSplit)
 
std::vector< unsignedgetNumberOfDomains ()
 returns the number of domains More...
 
DomaingetCurrentDomain ()
 Function that returns a pointer to the domain corresponding to the processor. More...
 
void removeOldFiles () const
 
void setMeanVelocity (Vec3D V_mean_goal)
 This function will help you set a fixed kinetic energy and mean velocity in your system. More...
 
void setMeanVelocityAndKineticEnergy (Vec3D V_mean_goal, Mdouble Ek_goal)
 This function will help you set a fixed kinetic energy and mean velocity in your system. More...
 
Mdouble getTotalVolume () const
 Get the total volume of the cuboid system. More...
 
Matrix3D getKineticStress () const
 Calculate the kinetic stress tensor in the system averaged over the whole volume. More...
 
Matrix3D getStaticStress () const
 Calculate the static stress tensor in the system averaged over the whole volume. More...
 
Matrix3D getTotalStress () const
 Calculate the total stress tensor in the system averaged over the whole volume. More...
 
virtual void handleParticleRemoval (unsigned int id)
 Handles the removal of particles from the particleHandler. More...
 
virtual void handleParticleAddition (unsigned int id, BaseParticle *p)
 
void writePythonFileForVTKVisualisation () const
 

Private Member Functions

void setRadii ()
 Sets all radii according to particleRadius and sizeDispersityParticle. More...
 
void setSpecies ()
 Sets species of particles. More...
 
void setDomainLimits ()
 Sets domain limits. More...
 
void calculateTimeStep ()
 Calculates the time step. More...
 
void insertParticles ()
 Inserts particles inside the domain. More...
 
void makeCdatFile ()
 Creates the cluster data output file. More...
 
void makeOverlFile ()
 Creates the cluster overlap output file. More...
 
bool particleInsertionSuccessful (int n)
 This function tries to insert the n-th particle (returns true if it manage to do that). It is inside insertParticles(). More...
 
void makeDataAnalysis ()
 This functions computes some important cluster information needed by the program. More...
 
void writeToCdatFile ()
 This writes on the cluster data output file. More...
 
void writeToOverlFile ()
 This writes on the cluster overlap output file. More...
 
void applyCentralForce ()
 This applies force on each particle. More...
 
void increaseForce ()
 This linearly increases the value of forceModulus (stage = 1). More...
 
void dampVelocities ()
 This damps values of each particle velocity (stage = 1, stage = 2, stage = 3). More...
 
void decreaseForce ()
 This linearly decreases values of forceModulus (stage = 2). More...
 
void dampForce ()
 This damps values of forceModulus (stage = 3). More...
 
void createAdjacencyMatrix ()
 This calculates the adjacency matrix of the cluster. More...
 
void makeAmatFile ()
 This creates the adjacency matrix file. More...
 
void writeAmatFile ()
 This writes on the adjacency matrix file. More...
 
void computeInternalStructure ()
 This computes the internal structure of the cluster. More...
 
void makeGnuplotFile ()
 This creates the gnuplot file needed for printing force vs overlaps values. More...
 
void makeIntenalStructureFile ()
 This creates the file needed for writing down datas from computeInternalStructure(). More...
 

Private Attributes

Vec3D position_
 
Mdouble collisionTimeOverTimeStep_
 
Mdouble energyRatioTolerance_
 
Mdouble radiusParticle_
 
bool setRadiusParticle_ = false
 
Mdouble sizeDispersityParticle_
 
int nParticles_
 
bool setNumberOfParticles_ = false
 
unsigned int idCluster_
 
Mdouble radiusCluster_
 
bool setRadiusCluster_ = false
 
Vec3D clusterVelocity_
 
Mdouble meanClusterRadius_
 
Mdouble velocityDampingModulus_
 
int nInternalStructurePoints_
 
LinearPlasticViscoelasticFrictionSpeciesparticleSpecies_
 
bool isCdatOutputOn_
 
bool isOverlOutputOn_
 
bool isAmatOutputOn_
 
bool isIntStrucOutputOn_
 
bool isVtkOutputOn_
 
bool isRestartOutputOn_
 
bool isFStatOutputOn_
 
bool isEneOutputOn_
 
std::vector< Mdoubleradii_
 
Mdouble smallestRadius_
 
Mdouble massParticle_
 
Mdouble totalParticleVolume_
 
Mdouble boxSize_
 
Vec3D centerOfMass_
 
std::vector< std::vector< int > > adjacencyMatrix_
 
Mdouble meanCoordinationNumber_
 
Mdouble maxRelativeOverlap_
 
Mdouble meanRelativeOverlap_
 
Mdouble minRelativeOverlap_
 
int nIntraClusterBonds_
 
std::ofstream cdatFile_
 
std::ofstream overlFile_
 
std::ofstream gnuplotFile_
 
std::ofstream amatFile_
 
std::ofstream intStructFile_
 
Mdouble fileOutputTimeInterval_
 
Mdouble radiusForSolidFraction_
 
Mdouble solidFraction_
 
Mdouble solidFractionIntStruct_
 
int stage_
 
Mdouble t0_
 
Mdouble clusterTimeMax_
 
Mdouble maximumForceModulus_
 
Mdouble forceModulus_
 
Mdouble forceTuningInterval_
 
Mdouble velocityDampingInterval_
 
Mdouble forceTuningDuration_
 
Mdouble dissipationDuration_
 
Mdouble forceDampingModulus_
 

Additional Inherited Members

- Public Types inherited from DPMBase
enum  ReadOptions : int { ReadOptions::ReadAll, ReadOptions::ReadNoInteractions, ReadOptions::ReadNoParticlesAndInteractions }
 
enum  DomainSplit {
  DomainSplit::X, DomainSplit::Y, DomainSplit::Z, DomainSplit::XY,
  DomainSplit::XZ, DomainSplit::YZ, DomainSplit::XYZ
}
 
- Static Public Member Functions inherited from DPMBase
static void incrementRunNumberInFile ()
 Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store the new value in the counter file. More...
 
static int readRunNumberFromFile ()
 Read the run number or the counter from the counter file (COUNTER_DONOTDEL) More...
 
static bool areInContact (const BaseParticle *pI, const BaseParticle *pJ)
 Checks if two particle are in contact or is there any positive overlap. More...
 
- Public Attributes inherited from DPMBase
SpeciesHandler speciesHandler
 A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc. More...
 
RNG random
 This is a random generator, often used for setting up the initial conditions etc... More...
 
ParticleHandler particleHandler
 An object of the class ParticleHandler, contains the pointers to all the particles created. More...
 
ParticleHandler paoloParticleHandler
 Fake particleHandler created by Paolo needed temporary by just Paolo. More...
 
WallHandler wallHandler
 An object of the class WallHandler. Contains pointers to all the walls created. More...
 
BoundaryHandler boundaryHandler
 An object of the class BoundaryHandler which concerns insertion and deletion of particles into or from regions. More...
 
PeriodicBoundaryHandler periodicBoundaryHandler
 Internal handler that deals with periodic boundaries, especially in a parallel build. More...
 
DomainHandler domainHandler
 An object of the class DomainHandler which deals with parallel code. More...
 
InteractionHandler interactionHandler
 An object of the class InteractionHandler. More...
 
CGHandler cgHandler
 Object of the class cgHandler. More...
 
File dataFile
 An instance of class File to handle in- and output into a .data file. More...
 
File fStatFile
 An instance of class File to handle in- and output into a .fstat file. More...
 
File eneFile
 An instance of class File to handle in- and output into a .ene file. More...
 
File restartFile
 An instance of class File to handle in- and output into a .restart file. More...
 
File statFile
 An instance of class File to handle in- and output into a .stat file. More...
 
File interactionFile
 File class to handle in- and output into .interactions file. This file hold information about interactions. More...
 
Time clock_
 record when the simulation started More...
 
- Protected Member Functions inherited from Mercury3D
void hGridFindContactsWithinTargetCell (int x, int y, int z, unsigned int l)
 Finds contacts between particles in the target cell. More...
 
void hGridFindContactsWithTargetCell (int x, int y, int z, unsigned int l, BaseParticle *obj)
 Finds contacts between the BaseParticle and the target cell. More...
 
void computeWallForces (BaseWall *w) override
 Compute contacts with a wall. More...
 
void hGridFindParticlesWithTargetCell (int x, int y, int z, unsigned int l, BaseParticle *obj, std::vector< BaseParticle * > &list)
 Finds particles within target cell and stores them in a list. More...
 
void hGridGetInteractingParticleList (BaseParticle *obj, std::vector< BaseParticle * > &list) override
 Obtains all neighbour particles of a given object, obtained from the hgrid. More...
 
void computeInternalForces (BaseParticle *obj) override
 Finds contacts with the BaseParticle; avoids multiple checks. More...
 
bool hGridHasContactsInTargetCell (int x, int y, int z, unsigned int l, const BaseParticle *obj) const
 Tests if the BaseParticle has contacts with other Particles in the target cell. More...
 
bool hGridHasParticleContacts (const BaseParticle *obj) override
 Tests if a BaseParticle has any contacts in the HGrid. More...
 
void hGridRemoveParticle (BaseParticle *obj) override
 Removes a BaseParticle from the HGrid. More...
 
void hGridUpdateParticle (BaseParticle *obj) override
 Updates the cell (not the level) of a BaseParticle. More...
 
- Protected Member Functions inherited from MercuryBase
void hGridRebuild ()
 This sets up the parameters required for the contact model. More...
 
void hGridInsertParticle (BaseParticle *obj) final
 Inserts a single Particle to current grid. More...
 
void hGridUpdateMove (BaseParticle *iP, Mdouble move) final
 Computes the relative displacement of the given BaseParticle and updates the currentMaxRelativeDisplacement_ accordingly. More...
 
void hGridActionsBeforeIntegration () override
 Resets the currentMaxRelativeDisplacement_ to 0. More...
 
void hGridActionsAfterIntegration () override
 This function has to be called before integrateBeforeForceComputation. More...
 
HGridgetHGrid ()
 Gets the HGrid used by this problem. More...
 
const HGridgetHGrid () const
 Gets the HGrid used by this problem, const version. More...
 
bool readNextArgument (int &i, int argc, char *argv[]) override
 Reads the next command line argument. More...
 
- Protected Member Functions inherited from DPMBase
virtual void computeAllForces ()
 Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseInteractable::setTorque() More...
 
virtual void computeInternalForce (BaseParticle *, BaseParticle *)
 Computes the forces between two particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces) More...
 
virtual void computeExternalForces (BaseParticle *)
 Computes the external forces, such as gravity, acting on particles. More...
 
void computeForcesDueToWalls (BaseParticle *, BaseWall *)
 Computes the forces on the particles due to the walls (normals are outward normals) More...
 
virtual void actionsBeforeTimeLoop ()
 A virtual function. Allows one to carry out any operations before the start of the time loop. More...
 
virtual void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
virtual void computeAdditionalForces ()
 A virtual function which allows to define operations to be executed prior to the OMP force collect. More...
 
void writeVTKFiles () const
 
virtual void outputXBallsData (std::ostream &os) const
 This function writes the location of the walls and particles in a format the XBalls program can read. For more information on the XBalls program, see Visualising data in xballs. More...
 
virtual void outputXBallsDataParticle (unsigned int i, unsigned int format, std::ostream &os) const
 This function writes out the particle locations into an output stream in a format the XBalls program can read. For more information on the XBalls program, see Visualising data in xballs. More...
 
virtual void writeEneHeader (std::ostream &os) const
 Writes a header with a certain format for ENE file. More...
 
virtual void writeFstatHeader (std::ostream &os) const
 Writes a header with a certain format for FStat file. More...
 
virtual void writeEneTimeStep (std::ostream &os) const
 Write the global kinetic, potential energy, etc. in the system. More...
 
virtual void initialiseStatistics ()
 
virtual void outputStatistics ()
 
void gatherContactStatistics ()
 
virtual void processStatistics (bool)
 
virtual void finishStatistics ()
 
virtual void integrateBeforeForceComputation ()
 Update particles' and walls' positions and velocities before force computation. More...
 
virtual void integrateAfterForceComputation ()
 Update particles' and walls' positions and velocities after force computation. More...
 
virtual void checkInteractionWithBoundaries ()
 There are a range of boundaries one could implement depending on ones' problem. This methods checks for interactions between particles and such range of boundaries. See BaseBoundary.h and all the boundaries in the Boundaries folder. More...
 
void setFixedParticles (unsigned int n)
 Sets a number, n, of particles in the particleHandler as "fixed particles". More...
 
virtual bool continueSolve () const
 A virtual function for deciding whether to continue the simulation, based on a user-specified criterion. More...
 
void outputInteractionDetails () const
 Displays the interaction details corresponding to the pointer objects in the interaction handler. More...
 
bool isTimeEqualTo (Mdouble time) const
 Checks whether the input variable "time" is the current time in the simulation. More...
 
void removeDuplicatePeriodicParticles ()
 Removes periodic duplicate Particles. More...
 
void checkAndDuplicatePeriodicParticles ()
 For simulations using periodic boundaries, checks and adds particles when necessary into the particle handler. See DPMBase.cc and PeriodicBoundary.cc for more details. More...
 
void performGhostParticleUpdate ()
 When the Verlet scheme updates the positions and velocities of particles, ghost particles will need an update as wel. Their status will also be updated accordingly. More...
 
void deleteGhostParticles (std::set< BaseParticle * > &particlesToBeDeleted)
 
void synchroniseParticle (BaseParticle *, unsigned fromProcessor=0)
 
void performGhostVelocityUpdate ()
 updates the final time-step velocity of the ghost particles More...
 
void setSoftStop ()
 function for setting sigaction constructor. More...
 
- Static Protected Member Functions inherited from DPMBase
static void signalHandler (int signal)
 signal handler function. More...
 

Constructor & Destructor Documentation

◆ BaseCluster()

BaseCluster::BaseCluster ( )

Default constructor.

Default constructor.

31  {
32  logger(DEBUG, "BaseCluster::BaseCluster() finished");
33 }

References FATAL, and logger.

◆ ~BaseCluster()

BaseCluster::~BaseCluster ( )
final

Default destructor.

Default destructor.

38  {
39  logger(DEBUG, "BaseCluster::BaseClusterr() finished");
40 }

References FATAL, and logger.

Member Function Documentation

◆ actionsAfterSolve()

void BaseCluster::actionsAfterSolve ( )
overridevirtual

Overrides DPMBase actionsAfterSolve(): in this cluster data file and cluster overlap file are closed and a few final actions are executed. Details in BaseCluster.cc.

In this: -data analysis is computed and cluster data and cluster overlap file are written for the last time. -if stage == 3 that means that the simulation is over but the energy ratio threshold is not reached: for this reason the user gets a warning. -adjacency matrix file is created and written (if needed), -internal structure file is created and written (if needed), -gnuplot file is created and written (if needed), -all particles are centred around the center of mass and their velocity is set, for this reason the user gets a warning, -finally cluster data file and cluster overlap file are closed.

Reimplemented from DPMBase.

734 {
735 
737 
738  if ( isCdatOutputOn() )
739  writeToCdatFile();
740 
741  if ( isOverlOutputOn() )
743 
744  if (stage_ == 3)
745  logger(WARN, "Dissipation process not completed: final energyRatioTollerance_ = %."
746  "Try to increase energyRatioTollerance_ or decreasing velocityDampingModulus.",
748 
749  if (isAmatOutputOn())
750  {
751  logger(VERBOSE, "CREATING ADJACENCY MATRIX FILE\n");
753  makeAmatFile();
754  writeAmatFile();
755  }
756 
757  if (isIntStrucOutputOn())
758  {
759  logger(VERBOSE, "COMPUTING INTERNAL STRUCTURE FILE\n");
761  }
762 
763  if(isOverlOutputOn())
764  {
765  logger(VERBOSE, "COMPUTING GNUPLOT FILE\n");
766  makeGnuplotFile();
767  }
768 
769 
770  /*
771  * \brief with this loop all particles are moved so that center of mass == position_ and their velocity is set.
772  */
773  for (auto i = particleHandler.begin(); i != particleHandler.end(); ++i){
774  (*i)->setPosition( (*i)->getPosition() + position_ - centerOfMass_ );
775  (*i)->setVelocity( clusterVelocity_ );
776  }
777 
778  logger(VERBOSE, "CLUSTER CREATED.\n");
779 
780  if (isCdatOutputOn())
781  cdatFile_.close();
782 
783  if (isOverlOutputOn())
784  overlFile_.close();
785 }

References BaseHandler< T >::begin(), cdatFile_, centerOfMass_, clusterVelocity_, computeInternalStructure(), createAdjacencyMatrix(), BaseHandler< T >::end(), DPMBase::getElasticEnergy(), DPMBase::getKineticEnergy(), constants::i, isAmatOutputOn(), isCdatOutputOn(), isIntStrucOutputOn(), isOverlOutputOn(), logger, makeAmatFile(), makeDataAnalysis(), makeGnuplotFile(), overlFile_, DPMBase::particleHandler, position_, stage_, VERBOSE, WARN, writeAmatFile(), writeToCdatFile(), and writeToOverlFile().

◆ actionsAfterTimeStep()

void BaseCluster::actionsAfterTimeStep ( )
overridevirtual

Overrides DPMBase actionsAfterTimeStep(): in this compression and decompression are computed, depending on the variable stage_.

In this the process takes place: in particular after each time step the following tasks are computed (in order): -data analysis: calculating values of interest, -writing to cluster data file, -writing to overlap file, -increasing central force and damping velocity (stage == 1), decreasing central force and damp velocity (stage == 2), damp central force and damp velocity until the system is static (stage == 3).

Reimplemented from DPMBase.

622 {
624 
626  writeToCdatFile();
627 
630 
631  /*
632  * \brief If stage == 1 force is linearly increased and velocities are damped for a time T = forceTuningDuration.
633  * If t > T, stage is set to 2.
634  */
635  if (stage_ == 1)
636  {
637  if (getTime() - t0_ < forceTuningDuration_)
638  {
639  if (fmod(getTime() - t0_, forceTuningInterval_) < getTimeStep())
640  increaseForce();
641 
642  if (fmod(getTime() - t0_, velocityDampingInterval_) < getTimeStep())
643  dampVelocities();
644 
646  }
647  else
648  {
649  logger(VERBOSE, "DECREASING CENTRAL FORCE");
650 
651  t0_ = getTime();
652  stage_++;
653  }
654  }
655 
656  /*
657  * \brief If stage == 2 force is linearly decreased and velocities are damped for a time duration of T = forceTuningDuration.
658  * If t > T, stage is set to 3.
659  */
660  if (stage_ == 2)
661  {
662  if (getTime() - t0_ < forceTuningDuration_)
663  {
664  if (fmod(getTime() - t0_, forceTuningInterval_) < getTimeStep())
665  decreaseForce();
666 
667  if (fmod(getTime() - t0_, velocityDampingInterval_) < getTimeStep())
668  dampVelocities();
669 
671  }
672  else
673  {
674  logger(VERBOSE, "DISSIPATING ENERGY");
675 
676  t0_ = getTime();
679  stage_++;
680  }
681  }
682 
683  /*
684  * \details If stage == 3 force is exponentially decreased and velocities are damped for a time duration of T = dissipationDuration_.
685  * If t>T or if the energy ratio is below the minimum threshold calculation is concluded and a few last operation are computed.
686  * They are:
687  * -timeMax is set to getTime(), in order to stop the calculation,
688  * -stage is set to 4 (if the energy threshold is not reached stage will remain 3 (because the simulation is stopped by the previous
689  * definition of timeMax): if this happens the user gets a warning, see actionsAfterSolve()).
690  * If MERCURY_USE_MPI this process lasts for a time T = dissipationDuration_ - getTimeStep().
691  */
692  if (stage_ == 3)
693  {
694  // \brief Now force is damped and not decreased.
695  if (fmod(getTime() - t0_, forceTuningInterval_) < getTimeStep())
696  dampForce();
697 
698  if (fmod(getTime() - t0_, velocityDampingInterval_) < getTimeStep())
699  dampVelocities();
700 
702 #ifdef MERCURY_USE_MPI
704 #else
707 #endif
708  {
709  printTime();
710  logger(VERBOSE, "ENERGY DISSIPATED\n");
711 
712  // stage++ now is a flag used to understand if the dissipation procedure has been completed.
713  stage_++;
714 
715  setTimeMax(getTime());
716  }
717  }
718 
719 }

References applyCentralForce(), dampForce(), dampVelocities(), decreaseForce(), dissipationDuration_, energyRatioTolerance_, fileOutputTimeInterval_, forceTuningDuration_, forceTuningInterval_, DPMBase::getElasticEnergy(), DPMBase::getKineticEnergy(), DPMBase::getTime(), DPMBase::getTimeStep(), increaseForce(), isCdatOutputOn(), isOverlOutputOn(), logger, makeDataAnalysis(), printTime(), DPMBase::setSaveCount(), DPMBase::setTimeMax(), stage_, t0_, velocityDampingInterval_, VERBOSE, writeToCdatFile(), and writeToOverlFile().

◆ actionsOnRestart()

void BaseCluster::actionsOnRestart ( )
overridevirtual

Overrides DPMBase actionsOnRestart(): in this all variables needed by the program for restarting are initialized.

In this all variables needed by the program for restarting are initialized. DPMBase::readRestartFile() is included.

Reimplemented from DPMBase.

885 {
886  readRestartFile();
887 
889 
891 
893 
895 
897 
898  setXBallsAdditionalArguments("-v0 -p 10");
899 
901 
902  dataFile.setFileType(FileType::ONE_FILE);
903 
904  restartFile.setFileType(isRestartOutputOn()?FileType::ONE_FILE:FileType::NO_FILE);
905 
906  fStatFile.setFileType(isFStatOutputOn()?FileType::ONE_FILE:FileType::NO_FILE);
907 
908  eneFile.setFileType(isEneOutputOn()?FileType::ONE_FILE:FileType::NO_FILE);
909 
910  if (isCdatOutputOn())
911  {
912  std::ostringstream cdatName;
913  cdatName << getName() << ".cdat";
914  cdatFile_.open(cdatName.str(), std::ios::app);
915  }
916 
917  if (isOverlOutputOn())
918  {
919  std::ostringstream overlName;
920  overlName << getName() << ".overl";
921  overlFile_.open(overlName.str(), std::ios::app);
922  }
923 
924  logger(VERBOSE, "CALCULATION RESTARTED\n");
925 }

References cdatFile_, DPMBase::dataFile, dissipationDuration_, DPMBase::eneFile, fileOutputTimeInterval_, forceTuningDuration_, forceTuningInterval_, DPMBase::fStatFile, DPMBase::getName(), DPMBase::getTimeStep(), isCdatOutputOn(), isEneOutputOn(), isFStatOutputOn(), isOverlOutputOn(), isRestartOutputOn(), isVtkOutputOn(), logger, overlFile_, DPMBase::readRestartFile(), DPMBase::restartFile, File::setFileType(), DPMBase::setParticlesWriteVTK(), DPMBase::setSaveCount(), DPMBase::setXBallsAdditionalArguments(), velocityDampingInterval_, and VERBOSE.

◆ applyCentralForce()

void BaseCluster::applyCentralForce ( )
private

This applies force on each particle.

This applies force on each particle. The force applied is proportional to the distance from force center (which is position_) and normalized by a ( 1/(2r) + 1/norm ) factor: this way even if a particle is very close to the force center (so -forceModulus * distanceFromForceCenter / (2 * r) ~ 0 ) a force F = -forceModulus * distanceFromForceCenter / norm is applied, which is the minimum guaranteed. (r is radiusParticle and norm is the 2-norm of distanceFromForceCenter vector).

1481 {
1482  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p)
1483  {
1484  //\brief distance from the center of forces (which is position_).
1485  Vec3D distanceFromForceCenter = (*p) -> getPosition() - position_;
1486 
1487  //\brief norm of distanceFromForceCenter vector
1488  Mdouble norm = distanceFromForceCenter.getLength();
1489 
1490  (*p) -> addForce( -forceModulus_ * distanceFromForceCenter * (2*radiusParticle_ + norm) / (2*radiusParticle_*norm) );
1491 
1492  }
1493 }

References BaseHandler< T >::begin(), BaseHandler< T >::end(), forceModulus_, Vec3D::getLength(), getPosition(), DPMBase::particleHandler, position_, and radiusParticle_.

Referenced by actionsAfterTimeStep().

◆ calculateTimeStep()

void BaseCluster::calculateTimeStep ( )
private

Calculates the time step.

Calculates the time step over the smallest particle. After this the time step and the ratio between collision time and time step are printed.

1060 {
1061  // if constantRestitution(true) mass for collision time will be automatically set to 1, otherwise the smallest particle's mass will be used
1063 
1064  // printing values of timeStep and ratio between collisionTime and timeStep
1065  std::ostringstream printTimeStep;
1066  printTimeStep << "timeStep: " << std::setprecision(4) << getTimeStep() << std::endl
1067  << "cT/tS, at least: " << std::fixed << std::setprecision(1)
1069  << std::endl;
1070  logger(VERBOSE, printTimeStep.str());
1071 }

References collisionTimeOverTimeStep_, ParticleSpecies::getMassFromRadius(), BaseHandler< T >::getObject(), DPMBase::getTimeStep(), logger, particleSpecies_, DPMBase::setTimeStep(), smallestRadius_, DPMBase::speciesHandler, and VERBOSE.

Referenced by setupInitialConditions().

◆ computeInternalStructure()

void BaseCluster::computeInternalStructure ( )
private

This computes the internal structure of the cluster.

This computes the internal structure and solid fraction of the cluster. A total number of particles (equal to nInternalStructurePoints_) is tried to be inserted (with spherical coordinates identical to the ones used for inserting the actual particles) inside a sphere having radius radiusForSolidFraction_. If no interaction is found, nothing happens, otherwise the counuter nPointsInsideComponentsForMCTest is incremented and the corresponding position is written down in the internal structure file.

1603 {
1604 
1605 
1606 
1607  Vec3D mcPoint;
1608  SphericalParticle p0;
1609  Mdouble fictitiousGridPointRadiusRatio = 1.0e-5;
1611  p0.setRadius(radiusParticle_*fictitiousGridPointRadiusRatio);
1612  p0.setVelocity(Vec3D(0.0, 0.0, 0.0));
1613  int nMonteCarloSamplingPoints = nInternalStructurePoints_;
1614  Mdouble nPointsInsideComponentsForMCTest = 0;
1615 
1617 
1618  for (int i = 0; i < nMonteCarloSamplingPoints; ++i)
1619  {
1620 
1621  Mdouble theta = constants::pi * random.getRandomNumber(0, 2.0);
1622  Mdouble phi = acos(random.getRandomNumber(-1.0, 1.0));
1623  Mdouble rad = radiusForSolidFraction_*cbrt( random.getRandomNumber( 0, 1 ) );
1624 
1625  mcPoint.X = rad * sin(phi) * cos(theta);
1626  mcPoint.Y = rad * sin(phi) * sin(theta);
1627  mcPoint.Z = rad * cos(phi);
1628  mcPoint += centerOfMass_;
1629 
1630  p0.setPosition(mcPoint);
1631 
1632  if (!checkParticleForInteraction(p0)) // collision -> the counter goes to the mass fraction
1633  {
1634  nPointsInsideComponentsForMCTest++;
1635  intStructFile_ << std::scientific << std::setprecision(5) << std::setw(12) << mcPoint.X
1636  << std::setw(13) << mcPoint.Y << std::setw(13) << mcPoint.Z << std::setw(6) << 0 << std::endl;
1637  }
1638 
1639  }
1640 
1641  // Solid fraction (accordance between theoretical values and penetration depth max).
1642  // It is very important to notice that this value is accurate only if sliding friction is set to 0.5 and relative
1643  // tangential stiffness is set to 0.3 while creating the cluster. Different values do not guarantee accuracy.
1644  solidFractionIntStruct_ = nPointsInsideComponentsForMCTest/nMonteCarloSamplingPoints;
1645  Mdouble theoVal = 0.58 + 3*pow(0.58,2)*particleSpecies_->getPenetrationDepthMax();
1646  Mdouble diff = fabs(theoVal-solidFractionIntStruct_);
1647  Mdouble accordance = (theoVal - diff)/theoVal;
1648  // Solid fraction (accordance between theoretical values and average overlap).
1649  // It is very important to notice that this value is accurate only if sliding friction is set to 0.5 and relative
1650  // tangential stiffness is set to 0.3 while creating the cluster. Different values do not guarantee accuracy.
1651  solidFractionIntStruct_ = nPointsInsideComponentsForMCTest/nMonteCarloSamplingPoints;
1652  Mdouble theoValAvOverl = 0.58 + 3*pow(0.58,2)*meanRelativeOverlap_;
1653  Mdouble diffAvOverl = fabs(theoValAvOverl-solidFractionIntStruct_);
1654  Mdouble accordanceAvOverl = (theoValAvOverl - diffAvOverl)/theoValAvOverl;
1655 
1656  intStructFile_ << "n_points_inside_boundary: " << std::scientific << nMonteCarloSamplingPoints << std::endl;
1657  intStructFile_ << "n_points_inside_components: " << nPointsInsideComponentsForMCTest << std::endl;
1658  intStructFile_ << "solidFractionIntStruct_: " << std::fixed << std::setprecision(6) << solidFractionIntStruct_
1659  << ", accordance with theoretical values: " << 100*accordance << "%." << std::endl
1660  << "Accordance with average overlap: " << 100*accordanceAvOverl << "%." << std::endl
1661  << "It is very important to notice that this formula is accurate only if sliding friction" << std::endl
1662  << "is set to 0.5 and relative tangential stiffness is set to 0.3 while creating the cluster." << std::endl
1663  << "Different values do not guarantee accuracy." << std::endl << std::endl;
1664 
1665  /*
1666  * computeInternalStructure output is set to VERBOSE in order not to have too much output. If the user needs it,
1667  * it is enough to set it to INFO.
1668  */
1669 
1670  std::ostringstream printResults;
1671  printResults << "n_points_inside_boundary: " << std::scientific << nMonteCarloSamplingPoints << std::endl;
1672  printResults << "n_points_inside_components: " << nPointsInsideComponentsForMCTest << std::endl;
1673  printResults << "solidFractionIntStruct_: " << std::fixed << std::setprecision(6) << solidFractionIntStruct_
1674  << ", accordance with theoretical values: " << 100*accordance << "%." << std::endl
1675  << "Accordance with average overlap: " << 100*accordanceAvOverl << "%." << std::endl
1676  << "It is very important to notice that this formula is accurate only if sliding friction" << std::endl
1677  << "is set to 0.5 and relative tangential stiffness is set to 0.3 while creating the cluster." << std::endl
1678  << "Different values do not guarantee accuracy." << std::endl << std::endl;
1679  logger(VERBOSE, printResults.str());
1680 }

References centerOfMass_, MercuryBase::checkParticleForInteraction(), mathsFunc::cos(), BaseHandler< T >::getObject(), RNG::getRandomNumber(), constants::i, intStructFile_, logger, makeIntenalStructureFile(), meanRelativeOverlap_, nInternalStructurePoints_, particleSpecies_, constants::pi, radiusForSolidFraction_, radiusParticle_, DPMBase::random, BaseInteractable::setPosition(), BaseParticle::setRadius(), BaseParticle::setSpecies(), BaseInteractable::setVelocity(), mathsFunc::sin(), solidFractionIntStruct_, DPMBase::speciesHandler, VERBOSE, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by actionsAfterSolve().

◆ createAdjacencyMatrix()

void BaseCluster::createAdjacencyMatrix ( )
private

This calculates the adjacency matrix of the cluster.

This calculates the adjacency matrix of the cluster. Firstly a NxN matrix is created and filled with zeros. with a for cycle on the interactions then, if there's a contact between particle i and j adjacencyMatrix(i,j) = adjacencyMatrix(j,i) = 1. (N is the number of particles).

1540 {
1541  for (int i = 0; i < particleHandler.getSize(); i++)
1542  {
1543  std::vector<int> temporaryRowVector;
1544  temporaryRowVector.reserve(particleHandler.getSize());
1545 
1546  for (int j = 0; j < particleHandler.getSize(); j++)
1547  temporaryRowVector.push_back(0);
1548 
1549  adjacencyMatrix_.push_back(temporaryRowVector);
1550  }
1551 
1552  for (auto i = interactionHandler.begin(); i != interactionHandler.end(); ++i)
1553  {
1554  adjacencyMatrix_[(*i) -> getP() -> getIndex()][(*i) -> getI() -> getIndex()] = 1;
1555  adjacencyMatrix_[(*i) -> getI() -> getIndex()][(*i) -> getP() -> getIndex()] = 1;
1556  }
1557 }

References adjacencyMatrix_, BaseHandler< T >::begin(), BaseHandler< T >::end(), BaseHandler< T >::getSize(), constants::i, DPMBase::interactionHandler, and DPMBase::particleHandler.

Referenced by actionsAfterSolve().

◆ dampForce()

void BaseCluster::dampForce ( )
private

This damps values of forceModulus (stage = 3).

This damps values of forceModulus (stage = 3). Damping is done by a factor forceDampingModulus_.

1530 {
1532 }

References forceDampingModulus_, and forceModulus_.

Referenced by actionsAfterTimeStep().

◆ dampVelocities()

void BaseCluster::dampVelocities ( )
private

This damps values of each particle velocity (stage = 1, stage = 2, stage = 3).

This damps values of each particle velocity (stage = 1, stage = 2, stage = 3). Damping is done by a factor velocityDampingModulus.

1509 {
1510  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p)
1511  {
1512  (*p) -> setVelocity(velocityDampingModulus_*( (*p) -> getVelocity() ));
1513  }
1514 }

References BaseHandler< T >::begin(), BaseHandler< T >::end(), getVelocity(), DPMBase::particleHandler, setVelocity(), and velocityDampingModulus_.

Referenced by actionsAfterTimeStep().

◆ decreaseForce()

void BaseCluster::decreaseForce ( )
private

This linearly decreases values of forceModulus (stage = 2).

This linearly decreases values of forceModulus (stage = 2). forceModulus varies from maximumForceModulus to 0 linearly with time. Actually last value reached of forceModulus with this is maximumForceModulus * timeStep / forceTuningDuration because this process is discrete: starting from this value forceModulus will then be damped in stage = 3.

1522 {
1524 }

References forceModulus_, forceTuningDuration_, DPMBase::getTime(), maximumForceModulus_, and t0_.

Referenced by actionsAfterTimeStep().

◆ doAmatOutput()

void BaseCluster::doAmatOutput ( bool  iAOO)

This sets the bool variable that defines whether the cluster adjacency matrix output will be written or not.

This sets the bool variable that defines whether the cluster adjacency matrix output will be written or not.

306  {
307  isAmatOutputOn_ = iAOO;
308 }

References isAmatOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doCdatOutput()

void BaseCluster::doCdatOutput ( bool  iCOO)

This sets the bool variable that defines whether the cluster data output will be written or not.

This sets the bool variable that defines whether the cluster data output will be written or not.

278  {
279  isCdatOutputOn_ = iCOO;
280 }

References isCdatOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doEneOutput()

void BaseCluster::doEneOutput ( bool  e)

This sets the bool variable that defines whether the cluster ene output will be written or not.

This sets the bool variable that defines whether the cluster ene output will be written or not.

376  {
377  isEneOutputOn_ = e;
378 }

References isEneOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doFStatOutput()

void BaseCluster::doFStatOutput ( bool  fS)

This sets the bool variable that defines whether the cluster fStat output will be written or not.

This sets the bool variable that defines whether the cluster fStat output will be written or not.

362  {
363  isFStatOutputOn_ = fS;
364 }

References isFStatOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doIntStrucOutput()

void BaseCluster::doIntStrucOutput ( bool  iISOO)

This sets the bool variable that defines whether the cluster internal structure output will be written or not.

This sets the bool variable that defines whether the cluster internal structure output will be written or not.

320  {
321  isIntStrucOutputOn_ = iISOO;
322 }

References isIntStrucOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doOverlOutput()

void BaseCluster::doOverlOutput ( bool  iOOO)

This sets the bool variable that defines whether the cluster overlap output will be written or not.

This sets the bool variable that defines whether the cluster overlap output will be written or not.

292  {
293  isOverlOutputOn_ = iOOO;
294 }

References isOverlOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doRestartOutput()

void BaseCluster::doRestartOutput ( bool  r)

This sets the bool variable that defines whether the cluster restart output will be written or not.

This sets the bool variable that defines whether the cluster restart output will be written or not.

348  {
349  isRestartOutputOn_ = r;
350 }

References isRestartOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ doVtkOutput()

void BaseCluster::doVtkOutput ( bool  iVOO)

This sets the bool variable that defines whether the cluster vtk output will be written or not.

This sets the bool variable that defines whether the cluster vtk output will be written or not.

334  {
335  isVtkOutputOn_ = iVOO;
336 }

References isVtkOutputOn_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ getAverageOverlap()

Mdouble BaseCluster::getAverageOverlap ( )

this returns the average overlap.

this returns the average overlap.

390  {
391  return meanRelativeOverlap_;
392 }

References meanRelativeOverlap_.

◆ getClusterId()

unsigned int BaseCluster::getClusterId ( ) const

This returns the value of the cluster ID.

This returns the value of the cluster ID.

175  {
176  return idCluster_;
177 }

References idCluster_.

Referenced by makeCdatFile().

◆ getCollisionTimeOverTimeStep()

Mdouble BaseCluster::getCollisionTimeOverTimeStep ( ) const

This returns the value of the ratio between collision time and time step.

This returns the value of the ratio between collision time and time step

68  {
70 }

References collisionTimeOverTimeStep_.

Referenced by makeCdatFile().

◆ getEnergyRatioTolerance()

Mdouble BaseCluster::getEnergyRatioTolerance ( ) const

This returns the value of the value of the energy ratio threshold under which the process can be considered static, and so over.

This returns the value of the value of the energy ratio threshold under which the process can be considered static, and so over.

226  {
227  return energyRatioTolerance_;
228 }

References energyRatioTolerance_.

Referenced by makeCdatFile().

◆ getFinalMassFraction()

Mdouble BaseCluster::getFinalMassFraction ( )

This gets the final value obtained for the mass fraction;.

This return the value of the obtained mass fraction (could be a little different than the desired). In particular, if the internal structure output is computed, the value for the mass fraction will be solidFractionIntStruct_ (computed within the internal structure and more precise), otherwise it will be solidFraction_.

165  {
168  else
169  return solidFraction_;
170 }

References isIntStrucOutputOn_, solidFraction_, and solidFractionIntStruct_.

◆ getMeanClusterRadius()

Mdouble BaseCluster::getMeanClusterRadius ( )

this returns meanClusterRadius (radius of an ideal perfectly spherical cluster, there's no setter).

this returns meanClusterRadius (radius of an ideal perfectly spherical cluster, there's no setter).

383  {
384  return meanClusterRadius_;
385 }

References meanClusterRadius_.

◆ getNumberOfInternalStructurePoints()

int BaseCluster::getNumberOfInternalStructurePoints ( ) const

This returns the value of the number of particles used to compute internal structure.

This returns the value of the length of the number of particles used to compute the internal structure.

209  {
211 }

References nInternalStructurePoints_.

Referenced by makeCdatFile().

◆ getNumberOfParticles()

int BaseCluster::getNumberOfParticles ( ) const

This returns the value of the number of particles in the cluster.

This returns the value of the number of particles in the cluster.

126  {
127  return nParticles_;
128 }

References nParticles_.

Referenced by makeCdatFile().

◆ getParticleSpecies()

LinearPlasticViscoelasticFrictionSpecies * BaseCluster::getParticleSpecies ( ) const

This returns the species of the particle.

This returns the species of the particle.

243  {
244  return particleSpecies_;
245 }

References particleSpecies_.

◆ getPosition()

Vec3D BaseCluster::getPosition ( ) const

This returns the value of position_, which is the position in which the cluster will be inserted.

This returns the value of position_, which is the position in which the cluster will be inserted (it is also the centre of mass of the cluster).

52  {
53  return position_;
54 }

References position_.

Referenced by applyCentralForce(), and makeDataAnalysis().

◆ getRadiusParticle()

Mdouble BaseCluster::getRadiusParticle ( ) const

This returns the value of particles' radius if there's no dispersity in size. In case of dispersity != 1, this is the radius from which all radii are computed (as a consequence in this case it is also the pseudo-averaged radius).

This returns the value of particles' radius if there's no dispersity in size. If the dispersity is not 1, this is the value on which all radii will be computed.

88  {
89  return radiusParticle_;
90 }

References radiusParticle_.

Referenced by makeCdatFile().

◆ getSizeDispersityParticle()

Mdouble BaseCluster::getSizeDispersityParticle ( ) const

This returns the value of particles' dispersity in size.

This returns the value of particles' dispersity in size.

109  {
111 }

References sizeDispersityParticle_.

Referenced by makeCdatFile().

◆ getVelocity()

Vec3D BaseCluster::getVelocity ( )

This gets the value of velocity after creation.

This returns the velocity of the cluster after creation.

257  {
258  return clusterVelocity_;
259 }

References clusterVelocity_.

Referenced by dampVelocities().

◆ getVelocityDampingModulus()

Mdouble BaseCluster::getVelocityDampingModulus ( ) const

This returns the value of the velocity damping modulus.

This returns the value of the velocity damping modulus.

192  {
194 }

References velocityDampingModulus_.

Referenced by makeCdatFile().

◆ increaseForce()

void BaseCluster::increaseForce ( )
private

This linearly increases the value of forceModulus (stage = 1).

This increases the value of forceModulus (stage = 1). ForceModulus varies from 0 to maximumForceModulus linearly with time.

References forceModulus_, forceTuningDuration_, DPMBase::getTime(), maximumForceModulus_, and t0_.

Referenced by actionsAfterTimeStep().

◆ insertParticles()

void BaseCluster::insertParticles ( )
private

Inserts particles inside the domain.

Inserts particles inside the domain with a while cycle.

1078 {
1079  int nParticlesInserted = 0;
1080 
1081  while (nParticlesInserted < nParticles_)
1082  {
1083  /* nParticleInserted corresponds to the index of the particle which is being inserted:
1084  * for example if no particle has been inserted yet nParticlesInserted=0 which is the
1085  * index of the first particle, and so on. For this reason this variable is the input
1086  * for particleInsertionSuccessful.
1087  */
1088  if (particleInsertionSuccessful(nParticlesInserted))
1089  {
1090  nParticlesInserted++;
1091  }
1092  else
1093  {
1094  logger(ERROR, "Cannot insert all particles, try to decrase the value of initialSolidFraction in "
1095  "BaseCluster::setDomainLimits();\n"
1096  "Inserted %/% particles.", nParticlesInserted, nParticles_);
1097  }
1098  }
1099  logger(VERBOSE, "PARTICLE INSERTION TERMINATED SUCCESSFULLY\n");
1100 }

References ERROR, logger, nParticles_, particleInsertionSuccessful(), and VERBOSE.

Referenced by setupInitialConditions().

◆ isAmatOutputOn()

bool BaseCluster::isAmatOutputOn ( ) const

This returns the bool variable that defines whether the cluster adjacency matrix output is written or not.

This returns the bool variable that defines whether the cluster adjacency matrix output is written or not.

299  {
300  return isAmatOutputOn_;
301 }

References isAmatOutputOn_.

Referenced by actionsAfterSolve().

◆ isCdatOutputOn()

bool BaseCluster::isCdatOutputOn ( ) const

This returns the bool variable that defines whether the cluster data output (which is NOT the mercury data output) is written or not.

This returns the bool variable that defines whether the cluster data output is written or not.

271  {
272  return isCdatOutputOn_;
273 }

References isCdatOutputOn_.

Referenced by actionsAfterSolve(), actionsAfterTimeStep(), actionsOnRestart(), and setupInitialConditions().

◆ isEneOutputOn()

bool BaseCluster::isEneOutputOn ( ) const

This returns the bool variable that defines whether the cluster ene output is written or not.

This returns the bool variable that defines whether the cluster ene output is written or not.

369  {
370  return isEneOutputOn_;
371 }

References isEneOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

◆ isFStatOutputOn()

bool BaseCluster::isFStatOutputOn ( ) const

This returns the bool variable that defines whether the cluster fStat output is written or not.

This returns the bool variable that defines whether the cluster fStat output is written or not.

355  {
356  return isFStatOutputOn_;
357 }

References isFStatOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

◆ isIntStrucOutputOn()

bool BaseCluster::isIntStrucOutputOn ( ) const

This returns the bool variable that defines whether the cluster internal structure output is written or not.

This returns the bool variable that defines whether the cluster internal structure output is written or not.

313  {
314  return isIntStrucOutputOn_;
315 }

References isIntStrucOutputOn_.

Referenced by actionsAfterSolve(), read(), and write().

◆ isOverlOutputOn()

bool BaseCluster::isOverlOutputOn ( ) const

This returns the bool variable that defines whether the cluster overlap output is written or not.

This returns the bool variable that defines whether the cluster overlap output is written or not.

285  {
286  return isOverlOutputOn_;
287 }

References isOverlOutputOn_.

Referenced by actionsAfterSolve(), actionsAfterTimeStep(), actionsOnRestart(), and setupInitialConditions().

◆ isRestartOutputOn()

bool BaseCluster::isRestartOutputOn ( ) const

This returns the bool variable that defines whether the cluster restart output is written or not.

This returns the bool variable that defines whether the cluster restart output is written or not.

341  {
342  return isRestartOutputOn_;
343 }

References isRestartOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

◆ isVtkOutputOn()

bool BaseCluster::isVtkOutputOn ( ) const

This returns the bool variable that defines whether the cluster vtk output is written or not.

This returns the bool variable that defines whether the cluster vtk output is written or not.

327  {
328  return isVtkOutputOn_;
329 }

References isVtkOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

◆ makeAmatFile()

void BaseCluster::makeAmatFile ( )
private

This creates the adjacency matrix file.

This creates the adjacency matrix file.

1563 {
1564  std::ostringstream amatName;
1565  amatName << getName() << ".amat";
1566 
1567  amatFile_.open(amatName.str(), std::ios::out);
1568  amatFile_ << "ADJACENCY MATRIX" << std::endl << std::endl;
1569 }

References amatFile_, and DPMBase::getName().

Referenced by actionsAfterSolve().

◆ makeCdatFile()

void BaseCluster::makeCdatFile ( )
private

Creates the cluster data output file.

Creates the cluster data output file. In the first lines of the file some important infos about the cluster are written. They are (in order): -Ratio between collision time and time step, -radiusParticle, -size dispersity of particles, -density of the particles -number of particles, -cluster ID (group ID), -safety factor of the cluster radius, -sliding friction coefficient, -rolling friction coefficient, -torsion friction coefficient, -loading stiffness, -unloading stiffness, -cohesion stiffness, -number of particles for computing internal structure (if needed), -energy ratio threshold, -velocity damping modulus, -restitution cohefficient.

After this the indentation of the file is written. The values that will be written are (in order): -elastic energy, -energy ratio threshold, -mean coordination number, -mean cluster radius, -solid fraction, -force modulus, -mean force on interaction, -minimum relative overlap, -mean relative overlap, -maximum realative overlap, -center of mass.

1137 {
1138  std::ostringstream cdatName;
1139  cdatName << getName() << ".cdat";
1140 
1141  cdatFile_.open(cdatName.str(), std::ios::out);
1142 
1143  cdatFile_ << "CLUSTER DATA AND INFORMATION" << std::endl << std::endl;
1144  cdatFile_ << "position: " << position_ << std::endl;
1145  cdatFile_ << "collisionTimeOverTimeStep: " << getCollisionTimeOverTimeStep() << std::endl;
1146  cdatFile_ << "radiusParticle: " << std:: scientific << std::setprecision(2) << getRadiusParticle() << std::endl;
1147  cdatFile_ << "sizeDispersityParticle: " << std::defaultfloat << getSizeDispersityParticle() << std::endl;
1148  cdatFile_ << "densityParticle: " << std:: scientific << particleSpecies_ -> getDensity() << std::endl;
1149  cdatFile_ << "nParticles: " << std::defaultfloat << getNumberOfParticles() << std::endl;
1150  cdatFile_ << "idCluster: " << getClusterId() << std::endl;
1151  cdatFile_ << "slidingFrictionCoeff: " << particleSpecies_ -> getSlidingFrictionCoefficient() << std::endl;
1152  cdatFile_ << "rollingFrictionCoeff: " << particleSpecies_ -> getRollingFrictionCoefficient() << std::endl;
1153  cdatFile_ << "torsionFrictionCoeff: " << particleSpecies_ -> getTorsionFrictionCoefficient() << std::endl;
1154  // If constantRestitution(true) loading, unloading, and cohesion stiffness are multiplied by the mass of a particle (massParticle_) whose radius is radiusParticle_*2/(1+sizeDispersityParticle_),
1155  // which is the mass that should be used to compute collision time.
1156  cdatFile_ << "loadingStiffness: " << std::scientific << particleSpecies_ -> getLoadingStiffness()
1157  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl;
1158  cdatFile_ << "unloadingStiffnessMax: " << particleSpecies_ -> getUnloadingStiffnessMax()
1159  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl;
1160  cdatFile_ << "cohesionStiffness: " << particleSpecies_ -> getCohesionStiffness()
1161  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl;
1162  cdatFile_ << "restitutionCoefficient: " << particleSpecies_ -> getRestitutionCoefficient(massParticle_) << std::endl;
1163  cdatFile_ << "collisionTime: " << std::scientific << std::setprecision(3) << particleSpecies_ -> getCollisionTime(massParticle_) << std::endl;
1165  cdatFile_ << "nInternalStructurePoints: " << getNumberOfInternalStructurePoints() << std::endl;
1166  cdatFile_ << "energyRatioTolerance: " << getEnergyRatioTolerance() << std::endl;
1167  cdatFile_ << "velocityDampingModulus: " << std::defaultfloat << getVelocityDampingModulus() << std::endl << std::endl;
1168 
1169  cdatFile_ << "progress" << std::setw(16) << "ElastEne" << std::setw(23) << "Ekin/ElastEne" << std::setw(18) << "coord_number" << std::setw(14) << "meanRadius"
1170  << std::setw(19) << "solidFraction" << std::setw(16) << "forceModulus" << std::setw(22) << "AveFOnOverl" << std::setw(15) << "dMin" << std::setw(17) << "dMean"
1171  << std::setw(14) << "dMax" << std::setw(24) << "Mass Centre" << std::endl;
1172 }

References cdatFile_, getClusterId(), getCollisionTimeOverTimeStep(), getEnergyRatioTolerance(), DPMBase::getName(), getNumberOfInternalStructurePoints(), getNumberOfParticles(), getRadiusParticle(), getSizeDispersityParticle(), getVelocityDampingModulus(), massParticle_, particleSpecies_, and position_.

Referenced by setupInitialConditions().

◆ makeDataAnalysis()

void BaseCluster::makeDataAnalysis ( )
private

This functions computes some important cluster information needed by the program.

This functions computes some important cluster information needed by the program. They are (in order): -mean coordination number, -center of mass, -mean cluster radius, -cluster radius used to compute solid fraction (different from mean cluster radius, see

below), -solid fraction, -mean force acting on interaction, -maximum overlap, -mean overlap, -minimum overlap.

1256 {
1257  // resetting counters and variables
1258  Mdouble solidVolumeInsideRadius = 0;
1259  Vec3D localMin;
1260  Vec3D localMax;
1261  localMin.setZero();
1262  localMax.setZero();
1264  //\brief vector in which it is saved the relative position of a particle from the center of mass
1265  Vec3D distanceFromCenterOfMass;
1266  //\brief distance from the center of mass of the furthest particle
1267  Mdouble furthestParticleDistance = 0;
1268  // number of particles whose distance d from the center of mass is d > furthestParticleDistance - radiusParticle_
1269  int counter = 0;
1270  Mdouble relativeOverlap = 0;
1271 
1272  meanClusterRadius_ = 0.0;
1274  maxRelativeOverlap_ = 0.0;
1275  meanRelativeOverlap_ = 0.0;
1277 
1278  // loops over each particle to compute mean coordination number and center of mass.
1279  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p) {
1280 
1281  meanCoordinationNumber_ += ((*p)->getInteractions()).size();
1282 
1283  centerOfMass_ += ((*p)->getVolume()) * ((*p)->getPosition());
1284  }
1285 
1288 
1289 
1290  // loops over each particle to compute the furthest particle from the center of mass.
1291  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p) {
1292 
1293  distanceFromCenterOfMass = (*p)->getPosition() - centerOfMass_;
1294 
1295  if (distanceFromCenterOfMass.getLength() > furthestParticleDistance)
1296  furthestParticleDistance = distanceFromCenterOfMass.getLength();
1297 
1298  }
1299 
1300  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p) {
1301 
1302  distanceFromCenterOfMass = (*p)->getPosition() - centerOfMass_;
1303 
1304  if (distanceFromCenterOfMass.getLength() > furthestParticleDistance - radiusParticle_) {
1305  meanClusterRadius_ += distanceFromCenterOfMass.getLength();
1306  counter++;
1307  }
1308 
1309  }
1310 
1311  meanClusterRadius_ /= counter;
1313 
1314 
1315  /*
1316  * \details This is the radius used to compute solid fraction: it is smaller than the meanClusterRadius.
1317  */
1319 
1320  /*
1321  * \details With a for cycle the volume of the particles inside radiusForSolidFraction is computed and after this the value of solid
1322  * fraction is calculated. This value is less precise as the maximum penetration depth increases and more precise as the
1323  * number of particle increases.
1324  */
1325  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p)
1326  {
1327  distanceFromCenterOfMass = (*p) -> getPosition() - centerOfMass_;
1328 
1329  if( distanceFromCenterOfMass.getLength() < radiusForSolidFraction_ )
1330  solidVolumeInsideRadius += (*p) -> getVolume();
1331  }
1332 
1333  solidFraction_ = 3 * solidVolumeInsideRadius / ( 4 * constants::pi * pow(radiusForSolidFraction_, 3) );
1334 
1335  // loops over every interaction to compute mean force acting on interaction, maximum, mean and minimum relative particle overlap.
1336  for (std::vector<BaseInteraction*>::const_iterator i = interactionHandler.begin(); i != interactionHandler.end(); ++i)
1337  {
1338 
1339  /*
1340  * \details the relative overlap is computed as an average of the relative overlap on the two particles.
1341  * rO = ( O/R1 + O/R2 ) / 2.
1342  */
1343  relativeOverlap = ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getP() -> getIndex()) -> getRadius()) +
1344  ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getI() -> getIndex()) -> getRadius());
1345  relativeOverlap /= 2;
1346  meanRelativeOverlap_ += relativeOverlap;
1347  if (relativeOverlap > maxRelativeOverlap_)
1348  maxRelativeOverlap_ = relativeOverlap;
1349 
1350  if (relativeOverlap < minRelativeOverlap_)
1351  minRelativeOverlap_ = relativeOverlap;
1352  }
1354 }

References BaseHandler< T >::begin(), centerOfMass_, BaseHandler< T >::end(), Vec3D::getLength(), BaseHandler< T >::getObject(), getPosition(), BaseHandler< T >::getSize(), constants::i, DPMBase::interactionHandler, maxRelativeOverlap_, meanClusterRadius_, meanCoordinationNumber_, meanRelativeOverlap_, minRelativeOverlap_, DPMBase::particleHandler, constants::pi, radiusForSolidFraction_, radiusParticle_, Vec3D::setZero(), sizeDispersityParticle_, solidFraction_, and totalParticleVolume_.

Referenced by actionsAfterSolve(), and actionsAfterTimeStep().

◆ makeGnuplotFile()

void BaseCluster::makeGnuplotFile ( )
private

This creates the gnuplot file needed for printing force vs overlaps values.

This creates the gnuplot file needed for printing force vs overlaps values. After setting output tipe, title, labels and grid, all columns needed for overlap printing are written after the plot command. Only overlaps present at the end of the process will be printed. Loading this file with gnuplot a jpeg image is obtained showing all forces vs overlaps.

1689 {
1690  std::ostringstream gnuplotname;
1691  gnuplotname << getName() << ".gnuplot";
1692 
1693  gnuplotFile_.open(gnuplotname.str(), std::ios::out);
1694  gnuplotFile_ << "set terminal jpeg" << std::endl;
1695  gnuplotFile_ << "set output \"" << getName() << "_overlaps" << ".jpeg\"" << std::endl;
1696  std::string titleLine=R"(set title "Overlap Vs Force")";// font ",14"
1697  std::string xLabel=R"(set xlabel "Overlap")";
1698  std::string yLabel=R"(set ylabel "Force")";
1699  gnuplotFile_ << titleLine << std::endl;
1700  gnuplotFile_ << xLabel << std::endl;
1701  gnuplotFile_ << yLabel << std::endl;
1702  gnuplotFile_ << "set grid" << std::endl;
1703  gnuplotFile_ << "plot ";
1704  for (int i = 0; i < interactionHandler.getSize(); ++i)
1705  {
1706  gnuplotFile_ << "\"" << getName() << ".overl" << "\"" << " using " << 2*i+4 << ":" << 2*i+3 << " title \"\" with lines lt 1 dashtype 2, ";
1707  }
1708 
1709  gnuplotFile_.close();
1710 
1711 }

References DPMBase::getName(), BaseHandler< T >::getSize(), gnuplotFile_, constants::i, and DPMBase::interactionHandler.

Referenced by actionsAfterSolve().

◆ makeIntenalStructureFile()

void BaseCluster::makeIntenalStructureFile ( )
private

This creates the file needed for writing down datas from computeInternalStructure().

This creates the file needed for writing down datas from computeInternalStructure(). In the first row nInternalStructurePoints is printed: this number is the total number of points tried to be inserted (and so is grater than the number of lines of the file, which corresponds to the number of points that gave interaction).

1720 {
1721  std::ostringstream intStructName;
1722  intStructName << getName() << ".struct";
1723 
1724  intStructFile_.open(intStructName.str(), std::ios::out);
1725  intStructFile_ << "Number of Montecarlo points: " << nInternalStructurePoints_ << std::endl;
1726 }

References DPMBase::getName(), intStructFile_, and nInternalStructurePoints_.

Referenced by computeInternalStructure().

◆ makeOverlFile()

void BaseCluster::makeOverlFile ( )
private

Creates the cluster overlap output file.

\detail Creates the cluster overlap output file. In this file forces vs overlaps will be written. Together with this a ".gnuplot" file is created, which reads from this, ready to be loaded (see BaseCluster::makeGnuplotFile() ).

1180 {
1181  std::ostringstream overlName;
1182  overlName << getName() << ".overl";
1183 
1184  overlFile_.open(overlName.str(), std::ios::out);
1185  overlFile_ << "Overlap Vs Normal Force" << std::endl;
1186 }

References DPMBase::getName(), and overlFile_.

Referenced by setupInitialConditions().

◆ particleInsertionSuccessful()

bool BaseCluster::particleInsertionSuccessful ( int  n)
private

This function tries to insert the n-th particle (returns true if it manage to do that). It is inside insertParticles().

Tries to insert a particle in a spherical area centered around the initial site of the cluster; With an insertion fail counter and a while cycle this function tries to insert a particle in the domain: in order to do this, after computing random spherical coordinates, checks for interaction. If no interaction is detected the particle is inserted and returns true, if it fails 1000 times returns false and the computation is over. The spherical coordinates are rescaled over the radius by a factor cbrt(rand(0,1) ) and also over vertical angle thanks to acos(rand (-1, 1) ): this has been done in order to ensure the most possible spherical shape to the cluster, which with classic spherical coordinates was not achieved.

Parameters
nindex of the particle being inserted.
Returns
bool: true if particle inserted, false if not.
1198  {
1199 
1200  int insertionFailCounter = 0;
1201  Mdouble rad, theta, phi;
1202  Vec3D particlePosition;
1203  SphericalParticle p0;
1204 
1205  // setup of particle properties and initial conditions (besides position)
1206  p0.setVelocity(Vec3D(0.0, 0.0, 0.0));
1207  p0.setRadius(radii_[n]);
1209  p0.setGroupId(idCluster_);
1210 
1211  while (insertionFailCounter < 1000)
1212  {
1213  theta = constants::pi * random.getRandomNumber(0, 2.0);
1214  phi = acos(random.getRandomNumber(-1.0, 1.0));
1215  rad = p0.getRadius() + cbrt( random.getRandomNumber( 0, 1 ) ) * ( 0.5 * boxSize_ - 2.01 * p0.getRadius() );
1216 
1217  particlePosition.X = position_.X + rad * sin(phi) * cos(theta);
1218  particlePosition.Y = position_.Y + rad * sin(phi) * sin(theta);
1219  particlePosition.Z = position_.Z + rad * cos(phi);
1220 
1221  p0.setPosition(particlePosition);
1222 
1224  {
1226  return true;
1227  }
1228 
1229  insertionFailCounter++;
1230  }
1231 
1232  return false;
1233 }

References boxSize_, MercuryBase::checkParticleForInteraction(), BaseHandler< T >::copyAndAddObject(), mathsFunc::cos(), BaseHandler< T >::getObject(), BaseParticle::getRadius(), RNG::getRandomNumber(), idCluster_, n, DPMBase::particleHandler, constants::pi, position_, radii_, DPMBase::random, BaseObject::setGroupId(), BaseInteractable::setPosition(), BaseParticle::setRadius(), BaseParticle::setSpecies(), BaseInteractable::setVelocity(), mathsFunc::sin(), DPMBase::speciesHandler, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by insertParticles().

◆ printTime()

void BaseCluster::printTime ( ) const
overridevirtual

Overrides DPMBase printTime(): this way variables of interest are shown.

Overrides DPMBase printTime(): this way stage and variables of interest are shown. They are (in order): -computation progress, -energy ratio, -mean coordination number, -mean cluster radius, -mass fraction, -force modulus, -minimum relative overlap, -mean relative overlap, -maximum realative overlap, -center of mass, -number of particles.

printTime output is set to VERBOSE in order not to have too much output. If the user needs it, it is enough to set it to INFO.

Reimplemented from DPMBase.

945 {
946  std::ostringstream printTime;
947  switch (stage_)
948  {
949  case 1: printTime << "Compression progress: " << std::setw(3) << int( ceil( 100 * (getTime() - t0_) / forceTuningDuration_ ) ) << "%, ";
950  break;
951 
952  case 2: printTime << "Decompression progress: " << std::setw(3) << int( ceil( 100 * (getTime() - t0_) / forceTuningDuration_ ) )<< "%, ";
953  break;
954 
955  case 3: printTime << "Dissipating energy: ";
956  break;
957 
958  default: printTime << "Final values: ";
959  break;
960  }
961  printTime <<
962  "E_ratio = " << std::scientific << std::setprecision(2) << std::setw(8) << getKineticEnergy()/getElasticEnergy() <<
963  ", cN = " << std::fixed << std::setw(5) << meanCoordinationNumber_ << ", rMean = " << std::scientific << meanClusterRadius_ <<
964  ", mF = " << std::fixed << std::setprecision(3) << solidFraction_ << ", Force Modulus = " << std::scientific << forceModulus_ <<
965  ", dMin = " << std::fixed << std::setw(7) << std::setprecision(5) << minRelativeOverlap_ << ", dMean = " << std::setw(7) << meanRelativeOverlap_ <<
966  ", dMax = " << maxRelativeOverlap_ << ", centerOfMass = " << std::scientific << std::setprecision(5) << std::setw(13) << centerOfMass_.X
967  << std::setw(14) << centerOfMass_.Y << std::setw(14) << centerOfMass_.Z <<
968  " nParticles: " << particleHandler.getSize();
969  logger(VERBOSE, printTime.str());
970 }

References centerOfMass_, forceModulus_, forceTuningDuration_, DPMBase::getElasticEnergy(), DPMBase::getKineticEnergy(), BaseHandler< T >::getSize(), DPMBase::getTime(), logger, maxRelativeOverlap_, meanClusterRadius_, meanCoordinationNumber_, meanRelativeOverlap_, minRelativeOverlap_, DPMBase::particleHandler, solidFraction_, stage_, t0_, VERBOSE, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by actionsAfterTimeStep().

◆ read()

void BaseCluster::read ( std::istream &  is,
ReadOptions  opt = ReadOptions::ReadAll 
)
overridevirtual

Overrides DPMBase read(): in this all variables needed by the program for restarting are read.

In this all variables needed by the program for restarting are read from a .restart file. As MercuryBase::write was included in ClusterDPM::write, here MercuryBase::read is included.

Reimplemented from DPMBase.

839 {
840  MercuryBase::read(is);
841 
842  std::stringstream line;
843  std::string dummy;
844 
846  line >> dummy >> position_
847  >> dummy >> stage_
848  >> dummy >> t0_;
850  line >> dummy >> idCluster_
851  >> dummy >> nParticles_
852  >> dummy >> radiusParticle_
853  >> dummy >> massParticle_
854  >> dummy >> sizeDispersityParticle_
855  >> dummy >> totalParticleVolume_;
857  line >> dummy >> maximumForceModulus_
858  >> dummy >> forceTuningInterval_
859  >> dummy >> forceTuningDuration_
860  >> dummy >> velocityDampingInterval_
861  >> dummy >> velocityDampingModulus_
862  >> dummy >> energyRatioTolerance_
863  >> dummy >> forceDampingModulus_
864  >> dummy >> forceModulus_;
866  line >> dummy >> isCdatOutputOn_
867  >> dummy >> isOverlOutputOn_
868  >> dummy >> isAmatOutputOn_
869  >> dummy >> isIntStrucOutputOn_;
870  if(isIntStrucOutputOn() )
871  {
873  line >> dummy >> nInternalStructurePoints_;
874  }
875  line >> dummy >> isRestartOutputOn_
876  >> dummy >> isFStatOutputOn_
877  >> dummy >> isEneOutputOn_;
878 }

References energyRatioTolerance_, forceDampingModulus_, forceModulus_, forceTuningDuration_, forceTuningInterval_, helpers::getLineFromStringStream(), idCluster_, isAmatOutputOn_, isCdatOutputOn_, isEneOutputOn_, isFStatOutputOn_, isIntStrucOutputOn(), isIntStrucOutputOn_, isOverlOutputOn_, isRestartOutputOn_, massParticle_, maximumForceModulus_, nInternalStructurePoints_, nParticles_, position_, radiusParticle_, MercuryBase::read(), sizeDispersityParticle_, stage_, t0_, totalParticleVolume_, velocityDampingInterval_, and velocityDampingModulus_.

◆ setClusterId()

void BaseCluster::setClusterId ( unsigned int  iC)

This sets the value of the cluster ID.

This sets the value of the cluster ID. In addition to that, it checks if the value is acceptable.

183  {
184  if (iC < 0)
185  logger(WARN, "idCluster = % is less than zero.", iC);
186  idCluster_ = iC;
187 }

References idCluster_, logger, and WARN.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ setCollisionTimeOverTimeStep()

void BaseCluster::setCollisionTimeOverTimeStep ( Mdouble  cTOTS)

This sets the collisionTimeOverTimeStep number (which is the ratio between collision time and time step).

This sets the collisionTimeOverTimeStep_ number. In addition to that, it checks if the value is acceptable.

76  {
77  if (cTOTS < 45 && cTOTS > 0)
78  logger(WARN, "collisionTimeOverTimeStep = % is too small: consider setting it greater or equal than 50.", cTOTS);
79  else if (cTOTS <= 0)
80  logger(ERROR, "collisionTimeOverTimeStep = % must be grater than zero.", cTOTS);
82 }

References collisionTimeOverTimeStep_, ERROR, logger, and WARN.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ setDomainLimits()

void BaseCluster::setDomainLimits ( )
private

Sets domain limits.

Sets domain limits of the simulation. Using spherical coordinates and the insertion process defined in particleInsertionSuccessful the final solid fraction obtained varies from 0.11 to 0.14 (empirically calculated, even for high size dispersity, which anyway shouldn't be contemplated in this field). For this reason the domain size (here called boxSize_) is computed as the cubic root of the total particle volume over 0.1.

1045 {
1046  Mdouble initialSolidFraction = 0.1;
1047  boxSize_ = cbrt(totalParticleVolume_/initialSolidFraction);
1048  std::ostringstream printDomainLimits;
1049  printDomainLimits << "Cubic size " << boxSize_ << std::endl;
1050  logger(VERBOSE, printDomainLimits.str());
1051 
1052  setDomain(-0.5*boxSize_*Vec3D(1,1,1) + position_, 0.5*boxSize_*Vec3D(1,1,1) + position_);
1053 }

References boxSize_, logger, position_, DPMBase::setDomain(), totalParticleVolume_, and VERBOSE.

Referenced by setupInitialConditions().

◆ setEnergyRatioTolerance()

void BaseCluster::setEnergyRatioTolerance ( Mdouble  eRT)

This sets the value of the value of the energy ratio threshold under which the process can be considered static, and so over.

This sets the value of the value of the energy ratio threshold under which the process can be considered static, and so over. In addition to that, it checks if the value is acceptable.

234  {
235  if (eRT <= 0)
236  logger(ERROR, "energyRatioTolerance must be grater than zero. energyRatioTolerance = %", eRT);
237  energyRatioTolerance_ = eRT;
238 }

References energyRatioTolerance_, ERROR, and logger.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ setNumberOfInternalStructurePoints()

void BaseCluster::setNumberOfInternalStructurePoints ( int  gL)

This sets the value of the number of particles used to compute the internal structure.

This sets the value of the length of the number of particles used to compute the internal structure. In addition to that, it checks if the value is acceptable.

217  {
218  if (gL <= 0)
219  logger(ERROR, "nInternalStructurePoints_ must be grater than zero. nInternalStructurePoints_ = %", gL);
221 }

References ERROR, logger, and nInternalStructurePoints_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep().

◆ setNumberOfParticles()

void BaseCluster::setNumberOfParticles ( int  nP)

This sets the value of the number of particles in the cluster.

This sets the value of the number of particles in the cluster. In addition to that, it checks if the value is acceptable.

134  {
135  if (nP < 0)
136  logger(ERROR, "nParticles must be grater than zero. nParticles = %", nP);
137  else {
138  nParticles_ = nP;
139  setNumberOfParticles_ = true;
140  }
141 }

References ERROR, logger, nParticles_, and setNumberOfParticles_.

Referenced by RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ setParticleSpecies()

void BaseCluster::setParticleSpecies ( LinearPlasticViscoelasticFrictionSpecies pS)

This sets the species of the particle.

This sets the species of the particle.

250  {
251  particleSpecies_ = pS;
252 }

References particleSpecies_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep().

◆ setPosition()

void BaseCluster::setPosition ( Vec3D  p)

This sets the value of position_, which is the position in which the cluster will be inserted.

This sets the value of position_, which is the position in which the cluster will be inserted (it is also the centre of mass of the cluster).

60  {
61  position_ = p;
62 }

References position_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep().

◆ setRadii()

void BaseCluster::setRadii ( )
private

Sets all radii according to particleRadius and sizeDispersityParticle.

Sets all radii according to particleRadius and sizeDispersityParticle_.

984 {
987  for (int i = 0; i < nParticles_; ++i)
988  {
989  // This is the actual radius of the i-th particle
991  // Computing totalParticleVolume (this is done because this value is needed before particle insertion).
992  totalParticleVolume_ += 4.0*constants::pi*pow(radii_[i],3.0)/3.0;
993  //computing the smallest radius (needed in computeTimeStep(), which is needed before particle insertion)
995  }
996 }

References RNG::getRandomNumber(), constants::i, constants::inf, nParticles_, constants::pi, radii_, radiusParticle_, DPMBase::random, sizeDispersityParticle_, smallestRadius_, and totalParticleVolume_.

Referenced by setupInitialConditions().

◆ setRadiusCluster()

void BaseCluster::setRadiusCluster ( Mdouble  rCR)

This sets the desired value of the cluster radius (there is no getter of this value, but there is a getter of the actual mean cluster radius obtained, getMeanClusterRadius)

This sets the value of the Radius of the cluster. A boolean (setRadiusCluster_) is also set to true: this is done because the user has to set exactly two among radiusCluster_, radiusCluster_ and radiusParticle_. In addition to that, it checks if the value is acceptable.

149  {
150  if (rCR <= 0)
151  logger(ERROR,
152  "relativeClusterRadius is smaller than 0. relativeClusterRadius = %",
153  rCR);
154  else
155  radiusCluster_ = rCR;
156 
157  setRadiusCluster_ = true;
158 }

References ERROR, logger, radiusCluster_, and setRadiusCluster_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep().

◆ setRadiusParticle()

void BaseCluster::setRadiusParticle ( Mdouble  rP)

This sets the value of particles' radius if there's no dispersity in size.

This sets the value of particles' radius if there's no dispersity in size. If the dispersity is not 1, this is the value on which all radii will be computed. In addition to that, it checks if the value is acceptable.

97  {
98  if (rP <= 0)
99  logger(ERROR, "radiusParticle must be greater than zero. radiusParticle = %", rP);
100  else {
101  radiusParticle_ = rP;
102  setRadiusParticle_ = true;
103  }
104 }

References ERROR, logger, radiusParticle_, and setRadiusParticle_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep().

◆ setSizeDispersityParticle()

void BaseCluster::setSizeDispersityParticle ( Mdouble  sDP)

This sets the value of particles' dispersity in size.

This sets the value of particles' dispersity in size. In addition to that, it checks if the value is acceptable.

117  {
118  if (sDP < 1)
119  logger(ERROR, "sizeDispersityParticle must be greater or equal than 1. sizeDispersityParticle = %", sDP);
120  else sizeDispersityParticle_ = sDP;
121 }

References ERROR, logger, and sizeDispersityParticle_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ setSpecies()

void BaseCluster::setSpecies ( )
private

Sets species of particles.

adds particlePureSpaces (set by the user or by default) to the species handler. After this, values of stiffnesses, restitution coefficient and collision time are printed.

1003 {
1004  if (particleSpecies_ == nullptr)
1005  {
1006  logger(ERROR, "Species not set.");
1007  }
1009  /*
1010  * \brief mass of the particle which has radius radiusParticle if constantRestitution(false) or
1011  * radiusParticle_*2/(1+sizeDispersityParticle_) otherwise.
1012  * It is set now and used various time in the code (for example for stiffnesses, collision time
1013  * and restitution coefficient below).
1014  */
1015  massParticle_ = particleSpecies_ -> getConstantRestitution()?
1016  speciesHandler.getObject(0) -> getMassFromRadius(radiusParticle_*2/(1+sizeDispersityParticle_))
1017  :
1018  speciesHandler.getObject(0) -> getMassFromRadius(radiusParticle_);
1019 
1020  std::ostringstream printSpecies;
1021  /*
1022  * If constantRestitution(true) loading, unloading, and cohesion stiffness are multiplied by the mass of a particle
1023  * whose radius is radiusParticle_*2/(1+sizeDispersityParticle_),
1024  * which is the mass that should be used to compute collision time.
1025  */
1026  printSpecies << "loadingStiffness: " << std::scientific << particleSpecies_ -> getLoadingStiffness()
1027  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl
1028  << "unloadingStiffnessMax: " << particleSpecies_ -> getUnloadingStiffnessMax()
1029  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl
1030  << "cohesionStiffness: " << particleSpecies_ -> getCohesionStiffness()
1031  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl
1032  << "restitutionCoefficient: " << std::fixed << particleSpecies_ -> getRestitutionCoefficient(massParticle_) << std::endl
1033  << "collisionTime: " << std::scientific << std::setprecision(3) << particleSpecies_ -> getCollisionTime(massParticle_) << std::endl;
1034  logger(VERBOSE, printSpecies.str());
1035 }

References BaseHandler< T >::copyAndAddObject(), ERROR, BaseHandler< T >::getObject(), logger, massParticle_, particleSpecies_, radiusParticle_, sizeDispersityParticle_, DPMBase::speciesHandler, and VERBOSE.

Referenced by setupInitialConditions().

◆ setupInitialConditions()

void BaseCluster::setupInitialConditions ( )
overridevirtual

Overrides DPMBase setupInitialConditions(): in this initial conditions for the problem are set.

Overrides DPMBase function setupInitialConditions(): in this initial conditions for the problem are set, and they are (in order): -checking that particleHandler and speciesHandler are empty, -defining cluster parameters starting from the user input, -all particles radii, -particle species, -domain limits, -time step, -particles initial positions (insertParticles), -initial time (t0), -maximum force applied on particles (maximumForceModulus), -time duration of applying (and releasing) force (forceTuningDuration) and dissipation time (dissipationDuration_), -time max, -output time for files and print time function (fileOutputTimeInterval), -time interval on which force is increased or decreased (forceTuningInterval), -value of forceDampingModulus_, -time interval on which velocity is damped (velocityTuningInterval), -xballs settings, -vtk settings, -standard mercury output data settings (dataFile, restartFile, fStatFile and eneFile), -name settings, -creation of cluster data file (if needed), -creation of overlap file (if needed), -stage of computation.

Reimplemented from DPMBase.

426 {
427  logger(VERBOSE, "CREATING CLUSTER");
428 
429  if (particleHandler.getSize()>0){
430  logger(WARN, "ParticleHandler was not empty");
432  }
433 
434  if (speciesHandler.getSize()>0){
435  logger(WARN, "speciesHandler was not empty");
437  }
438  // Defining cluster parameters starting from the user input.
439  // In order to use this class the user has to set exactly 2 values among radiusParticle,
440  // radiusCluster and numberOfParticles.
442  logger(ERROR, "Please set exactly two values among radiusParticle, radiusCluster and numberOfParticles."
443  " radiusParticle = %, radiusCluster = %, numberOfParticles = %.",
445 
446  // If the user sets the cluster radius and the radius of a single particle,
447  // the number of particles has to be computed:
450  logger(VERBOSE, "clusterRadius is small compared to the radius of a single particle:"
451  " consider setting clusterRadius >= 2 * radiusParticle."
452  "clusterRadius = %, radiusParticle = %.", radiusCluster_, radiusParticle_);
453  // relative cluster radius
455  // mass fraction of the cluster in the limit of phi = 0.
456  Mdouble eps0 = 0.58;
457  // The number of particles (N) per cluster given the relative cluster radius (hatR) and penetration depth max (phi)
458  // can be computed as: N = ( hatR / (1 - eps0*phi) )^3 * eps0.
459  // It is very important to notice that this formula is accurate only if sliding friction is set to 0.5 and relative
460  // tangential stiffness is set to 0.3 while creating the cluster. Different values do not guarantee accuracy.
461 
462  nParticles_ =
463  round (std::pow( hatR / (1.0 - eps0 * particleSpecies_->getPenetrationDepthMax() ), 3) * eps0);
464  logger(VERBOSE, "Number of particles: %.\n", nParticles_);
465  }
466 
467  // If the user sets the cluster radius and the number of particles,
468  // the radius of a single particle has to be computed:
470  // mass fraction of the cluster in the limit of phi = 0.
471  Mdouble eps0 = 0.58;
472  // The radius of a single particle (r) composig the cluster given the cluster radius (R), penetration depth max (phi)
473  // and the number of particles (N) can be obtained as: r = R / ( cbrt(N/eps0) * (1-eps0*phi) ).
474  // It is very important to notice that this formula is accurate only if sliding friction is set to 0.5 and relative
475  // tangential stiffness is set to 0.3 while creating the cluster. Different values do not guarantee accuracy.
476  radiusParticle_ = radiusCluster_ / (cbrt(nParticles_/eps0) * (1-eps0*particleSpecies_->getPenetrationDepthMax()));
477 
478  logger(VERBOSE, "radius particle: %.\n", radiusParticle_);
479  }
480 
481  logger(VERBOSE, "SETTING RADII");
482  setRadii();
483 
484  logger(VERBOSE, "SETTING SPECIES");
485  setSpecies();
486 
487  logger(VERBOSE, "SETTING DOMAIN LIMITS");
488  setDomainLimits();
489 
490  logger(VERBOSE, "COMPUTING TIME STEP");
492 
493  logger(VERBOSE, "PARTICLE INSERTION");
494  insertParticles();
495 
496  logger(VERBOSE, "Number of particles: %.", particleHandler.getSize());
497 
498  t0_ = getTime();
499 
500  // \details deltaStar
501  Mdouble deltaStar = particleSpecies_->getPenetrationDepthMax() * particleSpecies_->getUnloadingStiffnessMax()
502  / (particleSpecies_->getUnloadingStiffnessMax() - particleSpecies_->getLoadingStiffness());
503 
504  /*
505  * \brief maximum force modulus applied on particles (this value is then multiplied by the relative distance from
506  * force center d, which is d = D/r).
507  * It is the force necessary to get a overlap of deltaStar (computed above this description).
508  * If constant restitution is true then it is also multiplied by the mass of the biggest particle,
509  * or if MERCURY_USE_MPI it is the biggest possible mass computed taking into account particle dispersity,
510  * i.e. the mass of a particle having radius
511  * r = radiusParticle_ * 2 * sizeDispersityParticle_ / (1 + sizeDispersityParticle_).
512  * (In order to get the right value of loading stiffness it should be multiplied by the mass of the smallest
513  * particle; multiplying it for the biggest mass here, instead, is for safety).
514  */
515 
516 #ifdef MERCURY_USE_MPI
518  particleSpecies_->getLoadingStiffness()
519  * (particleSpecies_->getConstantRestitution() ?
521  :
522  1);
523 #else
525  particleSpecies_->getLoadingStiffness()
526  * (particleSpecies_->getConstantRestitution() ?
528  :
529  1);
530 #endif
531 
532  /*
533  * \details
534  * The time needed for a particle to cover a distance of x is sqrt(2 * x * m / F), when a constant force F is applied.
535  * In order to hit another particle, a single particle has to travel a distance of about boxSize/4 (boxSize is the domain length).
536  * As a value for x it is used boxSize_ (instead of boxSize_/4 as a safety factor).
537  * As a value for F it is used maximumForceModulus/50 which is half of maximumForceModulus/25 (in this way it is calculated
538  * a measure of the time needed with a force which linearly increases from 0 to maximumForceModulus/25, again dividing for 25
539  * is done for safety). As a value for m it is used the mass of the biggest particle, or if MERCURY_USE_MPI it is
540  * the mass computed taking into account size dispersity, so the mass
541  * of a particle having radius r = radiusParticle_ * 2 * sizeDispersityParticle_ / (1 + sizeDispersityParticle_), for safety.
542  * The factor 5* outside the sqrt is another safety factor empirically determined: with this values the computation is fast
543  * and the obtained results are very similar to the ones obtained if longer times would be set.
544  * All this safety factors are needed because this is not the exact value of time needed but a measure of it: the problem
545  * indeed is quite complicated given that particles can also rearrange during compression and so they will eventually
546  * move in a non radial direction and for this reason they will need more time to settle.
547  */
548 #ifdef MERCURY_USE_MPI
550  5 * sqrt(100 * boxSize_ * particleSpecies_->getMassFromRadius(radiusParticle_ * 2 * sizeDispersityParticle_ /
552 #else
555 #endif
556 
557  //\details Maximum possible time duration of dissipation (i.e. duration of dissipation if energy ration tollerance not reached).
559 
560  // Compression + Decompression + Dissipation = 2 * Compression + Dissipation
563 
565 
567 
569 
570  forceDampingModulus_ = 0.95;
571 
573 
574  setXBallsAdditionalArguments("-v0 -p 10");
575 
577 
578  dataFile.setFileType(FileType::ONE_FILE);
579 
580  restartFile.setFileType(isRestartOutputOn() ? FileType::ONE_FILE : FileType::NO_FILE);
581 
582  fStatFile.setFileType(isFStatOutputOn() ? FileType::ONE_FILE : FileType::NO_FILE);
583 
584  eneFile.setFileType(isEneOutputOn() ? FileType::ONE_FILE : FileType::NO_FILE);
585 
586  // Name setting
587  std::ostringstream name;
588  name << "Cluster_ID_" << idCluster_;
589  setName(name.str());
590 
591  if (isCdatOutputOn()) {
592  logger(VERBOSE, "CREATING .cdat FILE\n");
593  makeCdatFile();
594  }
595 
596  if (isOverlOutputOn()) {
597  logger(VERBOSE, "CREATING .overl FILE\n");
598  makeOverlFile();
599  }
600 
601  logger(VERBOSE, "ACTIVATING CENTRAL FORCES\n");
602 
603  /*
604  * \details
605  * Stage defines in which phase of the calculation the program is:
606  * stage = 1: compressing particles and increasing force
607  * stage = 2: releasing force
608  * stage = 3: waiting for the system to be static.
609  */
610  stage_ = 1;
611 }

References boxSize_, calculateTimeStep(), ParticleHandler::clear(), SpeciesHandler::clear(), clusterTimeMax_, DPMBase::dataFile, dissipationDuration_, DPMBase::eneFile, ERROR, fileOutputTimeInterval_, forceDampingModulus_, forceTuningDuration_, forceTuningInterval_, DPMBase::fStatFile, ParticleHandler::getLargestParticle(), BaseParticle::getMass(), BaseHandler< T >::getSize(), DPMBase::getTime(), DPMBase::getTimeStep(), idCluster_, insertParticles(), isCdatOutputOn(), isEneOutputOn(), isFStatOutputOn(), isOverlOutputOn(), isRestartOutputOn(), isVtkOutputOn(), logger, makeCdatFile(), makeOverlFile(), maximumForceModulus_, units::name, nParticles_, DPMBase::particleHandler, particleSpecies_, radiusCluster_, radiusParticle_, DPMBase::restartFile, helpers::round(), setDomainLimits(), File::setFileType(), DPMBase::setName(), setNumberOfParticles_, DPMBase::setParticlesWriteVTK(), setRadii(), setRadiusCluster_, setRadiusParticle_, DPMBase::setSaveCount(), setSpecies(), DPMBase::setTimeMax(), DPMBase::setXBallsAdditionalArguments(), sizeDispersityParticle_, DPMBase::speciesHandler, stage_, t0_, velocityDampingInterval_, VERBOSE, and WARN.

◆ setVelocity()

void BaseCluster::setVelocity ( Vec3D  v)

This sets the value of velocity after creation.

This sets the velocity of the cluster after creation.

264  {
265  clusterVelocity_ = v;
266 }

References clusterVelocity_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and dampVelocities().

◆ setVelocityDampingModulus()

void BaseCluster::setVelocityDampingModulus ( Mdouble  vDM)

This sets the value of the velocity damping modulus.

This sets the value of the velocity damping modulus. In addition to that, it checks if the value is acceptable.

200  {
201  if (vDM < 0 || vDM > 1)
202  logger(ERROR, "velocityDampingModulus must be grater than zero and less than 1. velocityDampingModulus = %", vDM);
204 }

References ERROR, logger, and velocityDampingModulus_.

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), and ClusterGenerator::ClusterGenerator().

◆ write()

void BaseCluster::write ( std::ostream &  os,
bool  writeAllParticles 
) const
overridevirtual

Overrides DPMBase write(): in this all variables needed by the program for restarting are written.

In this all variables needed by the program for restarting are written on a .restart file Most of the needed variables are already saved by MercuryBase::write, which for this reason is included.

Reimplemented from DPMBase.

792 {
793  writeAllParticles = true;
794  MercuryBase::write(os, writeAllParticles);
795 
796  os <<
797  "position " << position_ << " " <<
798  "stage " << stage_ << " " <<
799  "t0 " << t0_
800  << "\n" <<
801  "idCluster " << idCluster_ << " " <<
802  "nParticles " << nParticles_ << " " <<
803  "radiusParticle " << radiusParticle_ << " " <<
804  "massParticle " << massParticle_ << " " <<
805  "sizeDispersityParticle " << sizeDispersityParticle_ << " " <<
806  "totalParticleVolume " << totalParticleVolume_
807  << "\n" <<
808  "maximumForceModulus " << maximumForceModulus_ << " " <<
809  "forceTuningInterval " << forceTuningInterval_ << " " <<
810  "forceTuningDuration " << forceTuningDuration_ << " " <<
811  "velocityDampingInterval " << velocityDampingInterval_ << " " <<
812  "velocityDampingModulus " << velocityDampingModulus_ << " " <<
813  "energyRatioTolerance " << energyRatioTolerance_ << " " <<
814  "forceDampingModulus " << forceDampingModulus_ << " " <<
815  "forceModulus " << forceModulus_
816  << "\n" <<
817  "isCdatOutputON " << isCdatOutputOn_ << " " <<
818  "isOverlOutputOn " << isOverlOutputOn_ << " " <<
819  "isAmatOutputOn " << isAmatOutputOn_ << " " <<
820  "isIntStrucOutputOn " << isIntStrucOutputOn_
821  << "\n";
822  if (isIntStrucOutputOn())
823  {
824  os << "nInternalStructurePoints " << nInternalStructurePoints_ << "\n";
825  }
826 
827  os << "isRestartOutputOn " << isRestartOutputOn_ << " " << //This is obviously on because otherwise restart
828  // process would not take place.
829  //For now it is saved but could eventually be removed.
830  "isFStatOutputOn " << isFStatOutputOn_ << " " <<
831  "isEneOutputOn " << isEneOutputOn_ << std::endl;
832 }

References energyRatioTolerance_, forceDampingModulus_, forceModulus_, forceTuningDuration_, forceTuningInterval_, idCluster_, isAmatOutputOn_, isCdatOutputOn_, isEneOutputOn_, isFStatOutputOn_, isIntStrucOutputOn(), isIntStrucOutputOn_, isOverlOutputOn_, isRestartOutputOn_, massParticle_, maximumForceModulus_, nInternalStructurePoints_, nParticles_, position_, radiusParticle_, sizeDispersityParticle_, stage_, t0_, totalParticleVolume_, velocityDampingInterval_, velocityDampingModulus_, and MercuryBase::write().

◆ writeAmatFile()

void BaseCluster::writeAmatFile ( )
private

This writes on the adjacency matrix file.

This writes on the adjacency matrix file. With two nested for cycles adjacencyMatrix is written down. Finally number of intra-cluster bonds and mean coordination number are also written. After this the file is closed.

1577 {
1578  for(int i=0; i < particleHandler.getSize(); i++)
1579  {
1580  for(int j=0; j < particleHandler.getSize(); j++)
1581  {
1582  amatFile_ << adjacencyMatrix_[i][j] << " ";
1583  }
1584  amatFile_ << std::endl;
1585  }
1587  amatFile_ << std::endl;
1588  amatFile_ << "THE TOTAL NUMBER OF INTRACLUSTER BONDS IS: " << nIntraClusterBonds_ << std::endl;
1589  amatFile_ << "THE MEAN COORDINATION NUMBER IS: " << meanCoordinationNumber_ << std::endl;
1590 
1591  amatFile_.close();
1592 }

References adjacencyMatrix_, amatFile_, BaseHandler< T >::getSize(), constants::i, DPMBase::interactionHandler, meanCoordinationNumber_, nIntraClusterBonds_, and DPMBase::particleHandler.

Referenced by actionsAfterSolve().

◆ writeToCdatFile()

void BaseCluster::writeToCdatFile ( )
private

This writes on the cluster data output file.

This writes on the cluster data output file. Written values are (in order): -elastic energy, -energy ratio threshold, -mean coordination number, -mean cluster radius, -solid fraction, -force modulus, -mean force on interaction, -minimum relative overlap, -mean relative overlap, -maximum realative overlap, -center of mass.

1371 {
1372  switch (stage_)
1373  {
1374  case 1:
1375  cdatFile_ << "C, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1376  break;
1377 
1378  case 2:
1379  cdatFile_ << "D, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1380  break;
1381 
1382  case 3:
1383  cdatFile_ << "D-energy: ";
1384  break;
1385 
1386  default:
1387  cdatFile_ << "Final v: ";
1388  }
1389 
1390  cdatFile_ <<
1391  std::scientific <<
1392  std::setprecision(2)<<
1393  std::setw(14) <<
1394  getElasticEnergy() <<
1395  std::setw(18) <<
1397  std::fixed <<
1398  std::setprecision(2) <<
1399  std::setw(15) <<
1401  std::scientific <<
1402  std::setw(20) <<
1404  std::fixed <<
1405  std::setprecision(2) <<
1406  std::setw(13) <<
1407  solidFraction_ <<
1408  std::scientific <<
1409  std::setprecision(3) <<
1410  std::setw(24) <<
1411  forceModulus_ <<
1412  std::setw(22) <<
1413  std::fixed <<
1414  std::setprecision(5) <<
1415  std::setw(18) <<
1417  std::setw(16) <<
1419  std::setw(15) <<
1421  std::scientific <<
1422  std::setprecision(2) <<
1423  std::setw(19) <<
1424  centerOfMass_.X <<
1425  std::setw(12) <<
1426  centerOfMass_.Y <<
1427  std::setw(12) <<
1428  centerOfMass_.Z <<
1429  " " <<
1430  std::endl;
1431 }

References cdatFile_, centerOfMass_, forceModulus_, forceTuningDuration_, DPMBase::getElasticEnergy(), DPMBase::getKineticEnergy(), DPMBase::getTime(), maxRelativeOverlap_, meanClusterRadius_, meanCoordinationNumber_, meanRelativeOverlap_, minRelativeOverlap_, solidFraction_, stage_, t0_, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by actionsAfterSolve(), and actionsAfterTimeStep().

◆ writeToOverlFile()

void BaseCluster::writeToOverlFile ( )
private

This writes on the cluster overlap output file.

This writes on the cluster overlap output file. At each output time and for each interaction force vs overlap is written down.

1438 {
1439  //\brief force acting on overlap.
1440  Mdouble forceOnOverlap = 0;
1441  Mdouble relativeOverlap = 0;
1442  switch (stage_)
1443  {
1444  case 1:
1445  overlFile_ << "C, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1446  break;
1447 
1448  case 2:
1449  overlFile_ << "D, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1450  break;
1451 
1452  case 3:
1453  overlFile_ << "D energy: ";
1454  break;
1455 
1456  default:
1457  overlFile_ << "Final v: ";
1458  }
1459 
1460  for (std::vector<BaseInteraction*>::const_iterator i = interactionHandler.begin(); i != interactionHandler.end(); ++i)
1461  {
1462  forceOnOverlap = ((*i) -> getForce()).getLength();
1463  relativeOverlap = ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getP() -> getIndex()) -> getRadius()) +
1464  ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getI() -> getIndex()) -> getRadius());
1465  relativeOverlap = relativeOverlap / 2;
1466  overlFile_ << std::setprecision(2) << std::scientific << std::setw(18) << forceOnOverlap
1467  << std::defaultfloat << std::fixed << std::setprecision(4) << std::setw(9) << relativeOverlap;
1468  }
1469 
1470  overlFile_ << " " << std::endl;
1471 }

References BaseHandler< T >::begin(), BaseHandler< T >::end(), forceTuningDuration_, BaseHandler< T >::getObject(), DPMBase::getTime(), constants::i, DPMBase::interactionHandler, overlFile_, DPMBase::particleHandler, stage_, and t0_.

Referenced by actionsAfterSolve(), and actionsAfterTimeStep().

Member Data Documentation

◆ adjacencyMatrix_

std::vector< std::vector<int> > BaseCluster::adjacencyMatrix_
private

◆ amatFile_

std::ofstream BaseCluster::amatFile_
private

Referenced by makeAmatFile(), and writeAmatFile().

◆ boxSize_

Mdouble BaseCluster::boxSize_
private

◆ cdatFile_

std::ofstream BaseCluster::cdatFile_
private

◆ centerOfMass_

Vec3D BaseCluster::centerOfMass_
private

◆ clusterTimeMax_

Mdouble BaseCluster::clusterTimeMax_
private

Referenced by setupInitialConditions().

◆ clusterVelocity_

Vec3D BaseCluster::clusterVelocity_
private

◆ collisionTimeOverTimeStep_

Mdouble BaseCluster::collisionTimeOverTimeStep_
private

◆ dissipationDuration_

Mdouble BaseCluster::dissipationDuration_
private

◆ energyRatioTolerance_

Mdouble BaseCluster::energyRatioTolerance_
private

◆ fileOutputTimeInterval_

Mdouble BaseCluster::fileOutputTimeInterval_
private

◆ forceDampingModulus_

Mdouble BaseCluster::forceDampingModulus_
private

◆ forceModulus_

◆ forceTuningDuration_

◆ forceTuningInterval_

Mdouble BaseCluster::forceTuningInterval_
private

◆ gnuplotFile_

std::ofstream BaseCluster::gnuplotFile_
private

Referenced by makeGnuplotFile().

◆ idCluster_

◆ intStructFile_

std::ofstream BaseCluster::intStructFile_
private

◆ isAmatOutputOn_

bool BaseCluster::isAmatOutputOn_
private

◆ isCdatOutputOn_

bool BaseCluster::isCdatOutputOn_
private

◆ isEneOutputOn_

bool BaseCluster::isEneOutputOn_
private

◆ isFStatOutputOn_

bool BaseCluster::isFStatOutputOn_
private

◆ isIntStrucOutputOn_

bool BaseCluster::isIntStrucOutputOn_
private

◆ isOverlOutputOn_

bool BaseCluster::isOverlOutputOn_
private

◆ isRestartOutputOn_

bool BaseCluster::isRestartOutputOn_
private

◆ isVtkOutputOn_

bool BaseCluster::isVtkOutputOn_
private

Referenced by doVtkOutput(), and isVtkOutputOn().

◆ massParticle_

Mdouble BaseCluster::massParticle_
private

Referenced by makeCdatFile(), read(), setSpecies(), and write().

◆ maximumForceModulus_

Mdouble BaseCluster::maximumForceModulus_
private

◆ maxRelativeOverlap_

Mdouble BaseCluster::maxRelativeOverlap_
private

◆ meanClusterRadius_

Mdouble BaseCluster::meanClusterRadius_
private

◆ meanCoordinationNumber_

Mdouble BaseCluster::meanCoordinationNumber_
private

◆ meanRelativeOverlap_

Mdouble BaseCluster::meanRelativeOverlap_
private

◆ minRelativeOverlap_

Mdouble BaseCluster::minRelativeOverlap_
private

◆ nInternalStructurePoints_

◆ nIntraClusterBonds_

int BaseCluster::nIntraClusterBonds_
private

Referenced by writeAmatFile().

◆ nParticles_

◆ overlFile_

std::ofstream BaseCluster::overlFile_
private

◆ particleSpecies_

◆ position_

◆ radii_

std::vector<Mdouble> BaseCluster::radii_
private

◆ radiusCluster_

Mdouble BaseCluster::radiusCluster_
private

◆ radiusForSolidFraction_

Mdouble BaseCluster::radiusForSolidFraction_
private

◆ radiusParticle_

◆ setNumberOfParticles_

bool BaseCluster::setNumberOfParticles_ = false
private

◆ setRadiusCluster_

bool BaseCluster::setRadiusCluster_ = false
private

◆ setRadiusParticle_

bool BaseCluster::setRadiusParticle_ = false
private

◆ sizeDispersityParticle_

◆ smallestRadius_

Mdouble BaseCluster::smallestRadius_
private

Referenced by calculateTimeStep(), and setRadii().

◆ solidFraction_

Mdouble BaseCluster::solidFraction_
private

◆ solidFractionIntStruct_

Mdouble BaseCluster::solidFractionIntStruct_
private

◆ stage_

◆ t0_

◆ totalParticleVolume_

Mdouble BaseCluster::totalParticleVolume_
private

◆ velocityDampingInterval_

Mdouble BaseCluster::velocityDampingInterval_
private

◆ velocityDampingModulus_

Mdouble BaseCluster::velocityDampingModulus_
private

The documentation for this class was generated from the following files:
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::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
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
Vec3D::setZero
void setZero()
Sets all elements to zero.
Definition: Vector.cc:43
constants::pi
const Mdouble pi
Definition: ExtendedMath.h:45
BaseCluster::velocityDampingInterval_
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
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
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::makeAmatFile
void makeAmatFile()
This creates the adjacency matrix file.
Definition: BaseCluster.cc:1562
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::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
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::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
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
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
DPMBase::getTime
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
BaseCluster::overlFile_
std::ofstream overlFile_
Definition: BaseCluster.h:576
WARN
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
BaseCluster::solidFraction_
Mdouble solidFraction_
Definition: BaseCluster.h:590
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
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::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::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
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::isOverlOutputOn
bool isOverlOutputOn() const
This returns the bool variable that defines whether the cluster overlap output is written or not.
Definition: BaseCluster.cc:285
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::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::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
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
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::forceTuningInterval_
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
BaseParticle::getMass
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
BaseCluster::makeIntenalStructureFile
void makeIntenalStructureFile()
This creates the file needed for writing down datas from computeInternalStructure().
Definition: BaseCluster.cc:1719
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
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::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