MercuryDPM  Trunk
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 the MercuryBase to an output stream, for example 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< int > get1DParametersFromRunNumber (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< int > get2DParametersFromRunNumber (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< int > get3DParametersFromRunNumber (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)
 Inserts particles in the whole domain. More...
 
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 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...
 
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...
 
void writePythonFileForVTKVisualisation () const
 record when the simulation started More...
 

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...
 
- 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...
 
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...
 

Detailed Description

Definition at line 50 of file BaseCluster.h.

Constructor & Destructor Documentation

BaseCluster::BaseCluster ( )

Default constructor.

Default constructor.

Definition at line 31 of file BaseCluster.cc.

References DEBUG, and logger.

31  {
32  logger(DEBUG, "BaseCluster::BaseCluster() finished");
33 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
BaseCluster::~BaseCluster ( )
final

Default destructor.

Default destructor.

Definition at line 38 of file BaseCluster.cc.

References DEBUG, and logger.

38  {
39  logger(DEBUG, "BaseCluster::BaseClusterr() finished");
40 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")

Member Function Documentation

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.

Definition at line 733 of file BaseCluster.cc.

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().

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 }
void computeInternalStructure()
This computes the internal structure of the cluster.
void makeDataAnalysis()
This functions computes some important cluster information needed by the program. ...
void writeToCdatFile()
This writes on the cluster data output file.
void createAdjacencyMatrix()
This calculates the adjacency matrix of the cluster.
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
void writeToOverlFile()
This writes on the cluster overlap output file.
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Vec3D clusterVelocity_
Definition: BaseCluster.h:499
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
bool isIntStrucOutputOn() const
This returns the bool variable that defines whether the cluster internal structure output is written ...
Definition: BaseCluster.cc:313
bool isAmatOutputOn() const
This returns the bool variable that defines whether the cluster adjacency matrix output is written or...
Definition: BaseCluster.cc:299
void makeAmatFile()
This creates the adjacency matrix file.
bool isCdatOutputOn() const
This returns the bool variable that defines whether the cluster data output (which is NOT the mercury...
Definition: BaseCluster.cc:271
std::ofstream overlFile_
Definition: BaseCluster.h:576
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
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1490
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
void makeGnuplotFile()
This creates the gnuplot file needed for printing force vs overlaps values.
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1504
void writeAmatFile()
This writes on the adjacency matrix file.
Vec3D position_
Definition: BaseCluster.h:471
std::ofstream cdatFile_
Definition: BaseCluster.h:574
Vec3D centerOfMass_
Definition: BaseCluster.h:556
bool isOverlOutputOn() const
This returns the bool variable that defines whether the cluster overlap output is written or not...
Definition: BaseCluster.cc:285
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.

Definition at line 621 of file BaseCluster.cc.

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().

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 }
void makeDataAnalysis()
This functions computes some important cluster information needed by the program. ...
Mdouble t0_
Definition: BaseCluster.h:598
void writeToCdatFile()
This writes on the cluster data output file.
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:840
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
void writeToOverlFile()
This writes on the cluster overlap output file.
void decreaseForce()
This linearly decreases values of forceModulus (stage = 2).
void dampForce()
This damps values of forceModulus (stage = 3).
Mdouble dissipationDuration_
Definition: BaseCluster.h:615
void increaseForce()
This linearly increases the value of forceModulus (stage = 1).
bool isCdatOutputOn() const
This returns the bool variable that defines whether the cluster data output (which is NOT the mercury...
Definition: BaseCluster.cc:271
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1490
Mdouble fileOutputTimeInterval_
Definition: BaseCluster.h:584
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1504
void printTime() const override
Overrides DPMBase printTime(): this way variables of interest are shown.
Definition: BaseCluster.cc:942
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:398
Mdouble energyRatioTolerance_
Definition: BaseCluster.h:477
void dampVelocities()
This damps values of each particle velocity (stage = 1, stage = 2, stage = 3).
void applyCentralForce()
This applies force on each particle.
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1211
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
bool isOverlOutputOn() const
This returns the bool variable that defines whether the cluster overlap output is written or not...
Definition: BaseCluster.cc:285
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.

Definition at line 882 of file BaseCluster.cc.

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

883 {
884  readRestartFile();
885 
887 
889 
891 
893 
895 
896  setXBallsAdditionalArguments("-v0 -p 10");
897 
899 
901 
903 
905 
907 
908  if (isCdatOutputOn())
909  {
910  std::ostringstream cdatName;
911  cdatName << getName() << ".cdat";
912  cdatFile_.open(cdatName.str(), std::ios::app);
913  }
914 
915  if (isOverlOutputOn())
916  {
917  std::ostringstream overlName;
918  overlName << getName() << ".overl";
919  overlFile_.open(overlName.str(), std::ios::app);
920  }
921 
922  logger(VERBOSE, "CALCULATION RESTARTED\n");
923 }
bool isEneOutputOn() const
This returns the bool variable that defines whether the cluster ene output is written or not...
Definition: BaseCluster.cc:369
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:904
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:389
bool isVtkOutputOn() const
This returns the bool variable that defines whether the cluster vtk output is written or not...
Definition: BaseCluster.cc:327
Mdouble dissipationDuration_
Definition: BaseCluster.h:615
bool isCdatOutputOn() const
This returns the bool variable that defines whether the cluster data output (which is NOT the mercury...
Definition: BaseCluster.cc:271
std::ofstream overlFile_
Definition: BaseCluster.h:576
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1370
file will not be created/read
Mdouble fileOutputTimeInterval_
Definition: BaseCluster.h:584
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1375
all data will be written into/ read from a single file called name_
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:398
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1307
std::ofstream cdatFile_
Definition: BaseCluster.h:574
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:216
bool isRestartOutputOn() const
This returns the bool variable that defines whether the cluster restart output is written or not...
Definition: BaseCluster.cc:341
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1380
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1385
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1211
bool isFStatOutputOn() const
This returns the bool variable that defines whether the cluster fStat output is written or not...
Definition: BaseCluster.cc:355
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:2896
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
bool isOverlOutputOn() const
This returns the bool variable that defines whether the cluster overlap output is written or not...
Definition: BaseCluster.cc:285
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).

Definition at line 1477 of file BaseCluster.cc.

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

Referenced by actionsAfterTimeStep().

1478 {
1479  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p)
1480  {
1481  //\brief distance from the center of forces (which is position_).
1482  Vec3D distanceFromForceCenter = (*p) -> getPosition() - position_;
1483 
1484  //\brief norm of distanceFromForceCenter vector
1485  Mdouble norm = distanceFromForceCenter.getLength();
1486 
1487  (*p) -> addForce( -forceModulus_ * distanceFromForceCenter * (2*radiusParticle_ + norm) / (2*radiusParticle_*norm) );
1488 
1489  }
1490 }
Vec3D getPosition() const
This returns the value of position_, which is the position in which the cluster will be inserted...
Definition: BaseCluster.cc:52
double Mdouble
Definition: GeneralDefine.h:34
Mdouble radiusParticle_
Definition: BaseCluster.h:481
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
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
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
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
Vec3D position_
Definition: BaseCluster.h:471
Mdouble forceModulus_
Definition: BaseCluster.h:606
Definition: Vector.h:49
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.

Definition at line 1056 of file BaseCluster.cc.

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

Referenced by setupInitialConditions().

1057 {
1058  // if constantRestitution(true) mass for collision time will be automatically set to 1, otherwise the smallest particle's mass will be used
1060 
1061  // printing values of timeStep and ratio between collisionTime and timeStep
1062  std::ostringstream printTimeStep;
1063  printTimeStep << "timeStep: " << std::setprecision(4) << getTimeStep() << std::endl
1064  << "cT/tS, at least: " << std::fixed << std::setprecision(1)
1066  << std::endl;
1067  logger(VERBOSE, printTimeStep.str());
1068 }
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble getMassFromRadius(Mdouble radius) const
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
Mdouble collisionTimeOverTimeStep_
Definition: BaseCluster.h:475
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
Mdouble smallestRadius_
Definition: BaseCluster.h:546
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1195
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1211
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.

Definition at line 1599 of file BaseCluster.cc.

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().

1600 {
1601 
1602 
1603 
1604  Vec3D mcPoint;
1605  SphericalParticle p0;
1606  Mdouble fictitiousGridPointRadiusRatio = 1.0e-5;
1608  p0.setRadius(radiusParticle_*fictitiousGridPointRadiusRatio);
1609  p0.setVelocity(Vec3D(0.0, 0.0, 0.0));
1610  int nMonteCarloSamplingPoints = nInternalStructurePoints_;
1611  Mdouble nPointsInsideComponentsForMCTest = 0;
1612 
1614 
1615  for (int i = 0; i < nMonteCarloSamplingPoints; ++i)
1616  {
1617 
1618  Mdouble theta = constants::pi * random.getRandomNumber(0, 2.0);
1619  Mdouble phi = acos(random.getRandomNumber(-1.0, 1.0));
1620  Mdouble rad = radiusForSolidFraction_*cbrt( random.getRandomNumber( 0, 1 ) );
1621 
1622  mcPoint.X = rad * sin(phi) * cos(theta);
1623  mcPoint.Y = rad * sin(phi) * sin(theta);
1624  mcPoint.Z = rad * cos(phi);
1625  mcPoint += centerOfMass_;
1626 
1627  p0.setPosition(mcPoint);
1628 
1629  if (!checkParticleForInteraction(p0)) // collision -> the counter goes to the mass fraction
1630  {
1631  nPointsInsideComponentsForMCTest++;
1632  intStructFile_ << std::scientific << std::setprecision(5) << std::setw(12) << mcPoint.X
1633  << std::setw(13) << mcPoint.Y << std::setw(13) << mcPoint.Z << std::setw(6) << 0 << std::endl;
1634  }
1635 
1636  }
1637 
1638  // Solid fraction (accordance between theoretical values and penetration depth max).
1639  // It is very important to notice that this value is accurate only if sliding friction is set to 0.5 and relative
1640  // tangential stiffness is set to 0.3 while creating the cluster. Different values do not guarantee accuracy.
1641  solidFractionIntStruct_ = nPointsInsideComponentsForMCTest/nMonteCarloSamplingPoints;
1642  Mdouble theoVal = 0.58 + 3*pow(0.58,2)*particleSpecies_->getPenetrationDepthMax();
1643  Mdouble diff = fabs(theoVal-solidFractionIntStruct_);
1644  Mdouble accordance = (theoVal - diff)/theoVal;
1645  // Solid fraction (accordance between theoretical values and average overlap).
1646  // It is very important to notice that this value is accurate only if sliding friction is set to 0.5 and relative
1647  // tangential stiffness is set to 0.3 while creating the cluster. Different values do not guarantee accuracy.
1648  solidFractionIntStruct_ = nPointsInsideComponentsForMCTest/nMonteCarloSamplingPoints;
1649  Mdouble theoValAvOverl = 0.58 + 3*pow(0.58,2)*meanRelativeOverlap_;
1650  Mdouble diffAvOverl = fabs(theoValAvOverl-solidFractionIntStruct_);
1651  Mdouble accordanceAvOverl = (theoValAvOverl - diffAvOverl)/theoValAvOverl;
1652 
1653  intStructFile_ << "n_points_inside_boundary: " << std::scientific << nMonteCarloSamplingPoints << std::endl;
1654  intStructFile_ << "n_points_inside_components: " << nPointsInsideComponentsForMCTest << std::endl;
1655  intStructFile_ << "solidFractionIntStruct_: " << std::fixed << std::setprecision(6) << solidFractionIntStruct_
1656  << ", accordance with theoretical values: " << 100*accordance << "%." << std::endl
1657  << "Accordance with average overlap: " << 100*accordanceAvOverl << "%." << std::endl
1658  << "It is very important to notice that this formula is accurate only if sliding friction" << std::endl
1659  << "is set to 0.5 and relative tangential stiffness is set to 0.3 while creating the cluster." << std::endl
1660  << "Different values do not guarantee accuracy." << std::endl << std::endl;
1661 
1662  /*
1663  * computeInternalStructure output is set to VERBOSE in order not to have too much output. If the user needs it,
1664  * it is enough to set it to INFO.
1665  */
1666 
1667  std::ostringstream printResults;
1668  printResults << "n_points_inside_boundary: " << std::scientific << nMonteCarloSamplingPoints << std::endl;
1669  printResults << "n_points_inside_components: " << nPointsInsideComponentsForMCTest << std::endl;
1670  printResults << "solidFractionIntStruct_: " << std::fixed << std::setprecision(6) << solidFractionIntStruct_
1671  << ", accordance with theoretical values: " << 100*accordance << "%." << std::endl
1672  << "Accordance with average overlap: " << 100*accordanceAvOverl << "%." << std::endl
1673  << "It is very important to notice that this formula is accurate only if sliding friction" << std::endl
1674  << "is set to 0.5 and relative tangential stiffness is set to 0.3 while creating the cluster." << std::endl
1675  << "Different values do not guarantee accuracy." << std::endl << std::endl;
1676  logger(VERBOSE, printResults.str());
1677 }
Mdouble X
the vector components
Definition: Vector.h:65
A basic particle.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble radiusParticle_
Definition: BaseCluster.h:481
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble meanRelativeOverlap_
Definition: BaseCluster.h:566
void setSpecies(const ParticleSpecies *species)
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
bool checkParticleForInteraction(const BaseParticle &P) final
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
Definition: MercuryBase.cc:588
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
std::ofstream intStructFile_
Definition: BaseCluster.h:582
const Mdouble pi
Definition: ExtendedMath.h:45
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
Mdouble radiusForSolidFraction_
Definition: BaseCluster.h:588
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
Mdouble Y
Definition: Vector.h:65
RNG random
This is a random generator, often used for setting up the initial conditions etc...
Definition: DPMBase.h:1324
Mdouble solidFractionIntStruct_
Definition: BaseCluster.h:592
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Vec3D centerOfMass_
Definition: BaseCluster.h:556
void makeIntenalStructureFile()
This creates the file needed for writing down datas from computeInternalStructure().
int nInternalStructurePoints_
Definition: BaseCluster.h:509
Definition: Vector.h:49
Mdouble Z
Definition: Vector.h:65
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).

Definition at line 1536 of file BaseCluster.cc.

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

Referenced by actionsAfterSolve().

1537 {
1538  for (int i = 0; i < particleHandler.getSize(); i++)
1539  {
1540  std::vector<int> temporaryRowVector;
1541  temporaryRowVector.reserve(particleHandler.getSize());
1542 
1543  for (int j = 0; j < particleHandler.getSize(); j++)
1544  temporaryRowVector.push_back(0);
1545 
1546  adjacencyMatrix_.push_back(temporaryRowVector);
1547  }
1548 
1549  for (auto i = interactionHandler.begin(); i != interactionHandler.end(); ++i)
1550  {
1551  adjacencyMatrix_[(*i) -> getP() -> getIndex()][(*i) -> getI() -> getIndex()] = 1;
1552  adjacencyMatrix_[(*i) -> getI() -> getIndex()][(*i) -> getP() -> getIndex()] = 1;
1553  }
1554 }
std::vector< std::vector< int > > adjacencyMatrix_
Definition: BaseCluster.h:560
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
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
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
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1359
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_.

Definition at line 1526 of file BaseCluster.cc.

References forceDampingModulus_, and forceModulus_.

Referenced by actionsAfterTimeStep().

1527 {
1529 }
Mdouble forceDampingModulus_
Definition: BaseCluster.h:617
Mdouble forceModulus_
Definition: BaseCluster.h:606
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.

Definition at line 1505 of file BaseCluster.cc.

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

Referenced by actionsAfterTimeStep().

1506 {
1507  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p)
1508  {
1509  (*p) -> setVelocity(velocityDampingModulus_*( (*p) -> getVelocity() ));
1510  }
1511 }
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
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
void setVelocity(Vec3D v)
This sets the value of velocity after creation.
Definition: BaseCluster.cc:264
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
Vec3D getVelocity()
This gets the value of velocity after creation.
Definition: BaseCluster.cc:257
Mdouble velocityDampingModulus_
Definition: BaseCluster.h:505
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.

Definition at line 1518 of file BaseCluster.cc.

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

Referenced by actionsAfterTimeStep().

1519 {
1521 }
Mdouble t0_
Definition: BaseCluster.h:598
Mdouble maximumForceModulus_
Definition: BaseCluster.h:604
Mdouble forceModulus_
Definition: BaseCluster.h:606
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797
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.

Definition at line 306 of file BaseCluster.cc.

References isAmatOutputOn_.

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

306  {
307  isAmatOutputOn_ = iAOO;
308 }
bool isAmatOutputOn_
Definition: BaseCluster.h:522
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.

Definition at line 278 of file BaseCluster.cc.

References isCdatOutputOn_.

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

278  {
279  isCdatOutputOn_ = iCOO;
280 }
bool isCdatOutputOn_
Definition: BaseCluster.h:518
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.

Definition at line 376 of file BaseCluster.cc.

References isEneOutputOn_.

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

376  {
377  isEneOutputOn_ = e;
378 }
bool isEneOutputOn_
Definition: BaseCluster.h:532
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.

Definition at line 362 of file BaseCluster.cc.

References isFStatOutputOn_.

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

362  {
363  isFStatOutputOn_ = fS;
364 }
bool isFStatOutputOn_
Definition: BaseCluster.h:530
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.

Definition at line 320 of file BaseCluster.cc.

References isIntStrucOutputOn_.

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

320  {
321  isIntStrucOutputOn_ = iISOO;
322 }
bool isIntStrucOutputOn_
Definition: BaseCluster.h:524
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.

Definition at line 292 of file BaseCluster.cc.

References isOverlOutputOn_.

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

292  {
293  isOverlOutputOn_ = iOOO;
294 }
bool isOverlOutputOn_
Definition: BaseCluster.h:520
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.

Definition at line 348 of file BaseCluster.cc.

References isRestartOutputOn_.

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

348  {
349  isRestartOutputOn_ = r;
350 }
bool isRestartOutputOn_
Definition: BaseCluster.h:528
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.

Definition at line 334 of file BaseCluster.cc.

References isVtkOutputOn_.

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

334  {
335  isVtkOutputOn_ = iVOO;
336 }
bool isVtkOutputOn_
Definition: BaseCluster.h:526
Mdouble BaseCluster::getAverageOverlap ( )

this returns the average overlap.

this returns the average overlap.

Definition at line 390 of file BaseCluster.cc.

References meanRelativeOverlap_.

390  {
391  return meanRelativeOverlap_;
392 }
Mdouble meanRelativeOverlap_
Definition: BaseCluster.h:566
unsigned int BaseCluster::getClusterId ( ) const

This returns the value of the cluster ID.

This returns the value of the cluster ID.

Definition at line 175 of file BaseCluster.cc.

References idCluster_.

Referenced by makeCdatFile().

175  {
176  return idCluster_;
177 }
unsigned int idCluster_
Definition: BaseCluster.h:493
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

Definition at line 68 of file BaseCluster.cc.

References collisionTimeOverTimeStep_.

Referenced by makeCdatFile().

68  {
70 }
Mdouble collisionTimeOverTimeStep_
Definition: BaseCluster.h:475
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.

Definition at line 226 of file BaseCluster.cc.

References energyRatioTolerance_.

Referenced by makeCdatFile().

226  {
227  return energyRatioTolerance_;
228 }
Mdouble energyRatioTolerance_
Definition: BaseCluster.h:477
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_.

Definition at line 165 of file BaseCluster.cc.

References isIntStrucOutputOn_, solidFraction_, and solidFractionIntStruct_.

165  {
168  else
169  return solidFraction_;
170 }
bool isIntStrucOutputOn_
Definition: BaseCluster.h:524
Mdouble solidFraction_
Definition: BaseCluster.h:590
Mdouble solidFractionIntStruct_
Definition: BaseCluster.h:592
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).

Definition at line 383 of file BaseCluster.cc.

References meanClusterRadius_.

383  {
384  return meanClusterRadius_;
385 }
Mdouble meanClusterRadius_
Definition: BaseCluster.h:501
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.

Definition at line 209 of file BaseCluster.cc.

References nInternalStructurePoints_.

Referenced by makeCdatFile().

209  {
211 }
int nInternalStructurePoints_
Definition: BaseCluster.h:509
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.

Definition at line 126 of file BaseCluster.cc.

References nParticles_.

Referenced by makeCdatFile().

126  {
127  return nParticles_;
128 }
LinearPlasticViscoelasticFrictionSpecies * BaseCluster::getParticleSpecies ( ) const

This returns the species of the particle.

This returns the species of the particle.

Definition at line 243 of file BaseCluster.cc.

References particleSpecies_.

243  {
244  return particleSpecies_;
245 }
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
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).

Definition at line 52 of file BaseCluster.cc.

References position_.

Referenced by applyCentralForce(), and makeDataAnalysis().

52  {
53  return position_;
54 }
Vec3D position_
Definition: BaseCluster.h:471
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.

Definition at line 88 of file BaseCluster.cc.

References radiusParticle_.

Referenced by makeCdatFile().

88  {
89  return radiusParticle_;
90 }
Mdouble radiusParticle_
Definition: BaseCluster.h:481
Mdouble BaseCluster::getSizeDispersityParticle ( ) const

This returns the value of particles' dispersity in size.

This returns the value of particles' dispersity in size.

Definition at line 109 of file BaseCluster.cc.

References sizeDispersityParticle_.

Referenced by makeCdatFile().

109  {
111 }
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
Vec3D BaseCluster::getVelocity ( )

This gets the value of velocity after creation.

This returns the velocity of the cluster after creation.

Definition at line 257 of file BaseCluster.cc.

References clusterVelocity_.

Referenced by dampVelocities().

257  {
258  return clusterVelocity_;
259 }
Vec3D clusterVelocity_
Definition: BaseCluster.h:499
Mdouble BaseCluster::getVelocityDampingModulus ( ) const

This returns the value of the velocity damping modulus.

This returns the value of the velocity damping modulus.

Definition at line 192 of file BaseCluster.cc.

References velocityDampingModulus_.

Referenced by makeCdatFile().

192  {
194 }
Mdouble velocityDampingModulus_
Definition: BaseCluster.h:505
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.

Definition at line 1496 of file BaseCluster.cc.

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

Referenced by actionsAfterTimeStep().

1497 {
1499 }
Mdouble t0_
Definition: BaseCluster.h:598
Mdouble maximumForceModulus_
Definition: BaseCluster.h:604
Mdouble forceModulus_
Definition: BaseCluster.h:606
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797
void BaseCluster::insertParticles ( )
private

Inserts particles inside the domain.

Inserts particles inside the domain with a while cycle.

Definition at line 1074 of file BaseCluster.cc.

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

Referenced by setupInitialConditions().

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

Definition at line 299 of file BaseCluster.cc.

References isAmatOutputOn_.

Referenced by actionsAfterSolve().

299  {
300  return isAmatOutputOn_;
301 }
bool isAmatOutputOn_
Definition: BaseCluster.h:522
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.

Definition at line 271 of file BaseCluster.cc.

References isCdatOutputOn_.

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

271  {
272  return isCdatOutputOn_;
273 }
bool isCdatOutputOn_
Definition: BaseCluster.h:518
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.

Definition at line 369 of file BaseCluster.cc.

References isEneOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

369  {
370  return isEneOutputOn_;
371 }
bool isEneOutputOn_
Definition: BaseCluster.h:532
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.

Definition at line 355 of file BaseCluster.cc.

References isFStatOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

355  {
356  return isFStatOutputOn_;
357 }
bool isFStatOutputOn_
Definition: BaseCluster.h:530
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.

Definition at line 313 of file BaseCluster.cc.

References isIntStrucOutputOn_.

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

313  {
314  return isIntStrucOutputOn_;
315 }
bool isIntStrucOutputOn_
Definition: BaseCluster.h:524
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.

Definition at line 285 of file BaseCluster.cc.

References isOverlOutputOn_.

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

285  {
286  return isOverlOutputOn_;
287 }
bool isOverlOutputOn_
Definition: BaseCluster.h:520
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.

Definition at line 341 of file BaseCluster.cc.

References isRestartOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

341  {
342  return isRestartOutputOn_;
343 }
bool isRestartOutputOn_
Definition: BaseCluster.h:528
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.

Definition at line 327 of file BaseCluster.cc.

References isVtkOutputOn_.

Referenced by actionsOnRestart(), and setupInitialConditions().

327  {
328  return isVtkOutputOn_;
329 }
bool isVtkOutputOn_
Definition: BaseCluster.h:526
void BaseCluster::makeAmatFile ( )
private

This creates the adjacency matrix file.

This creates the adjacency matrix file.

Definition at line 1559 of file BaseCluster.cc.

References amatFile_, and DPMBase::getName().

Referenced by actionsAfterSolve().

1560 {
1561  std::ostringstream amatName;
1562  amatName << getName() << ".amat";
1563 
1564  amatFile_.open(amatName.str(), std::ios::out);
1565  amatFile_ << "ADJACENCY MATRIX" << std::endl << std::endl;
1566 }
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:389
std::ofstream amatFile_
Definition: BaseCluster.h:580
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.

Definition at line 1133 of file BaseCluster.cc.

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

Referenced by setupInitialConditions().

1134 {
1135  std::ostringstream cdatName;
1136  cdatName << getName() << ".cdat";
1137 
1138  cdatFile_.open(cdatName.str(), std::ios::out);
1139 
1140  cdatFile_ << "CLUSTER DATA AND INFORMATION" << std::endl << std::endl;
1141  cdatFile_ << "position: " << position_ << std::endl;
1142  cdatFile_ << "collisionTimeOverTimeStep: " << getCollisionTimeOverTimeStep() << std::endl;
1143  cdatFile_ << "radiusParticle: " << std:: scientific << std::setprecision(2) << getRadiusParticle() << std::endl;
1144  cdatFile_ << "sizeDispersityParticle: " << std::defaultfloat << getSizeDispersityParticle() << std::endl;
1145  cdatFile_ << "densityParticle: " << std:: scientific << particleSpecies_ -> getDensity() << std::endl;
1146  cdatFile_ << "nParticles: " << std::defaultfloat << getNumberOfParticles() << std::endl;
1147  cdatFile_ << "idCluster: " << getClusterId() << std::endl;
1148  cdatFile_ << "slidingFrictionCoeff: " << particleSpecies_ -> getSlidingFrictionCoefficient() << std::endl;
1149  cdatFile_ << "rollingFrictionCoeff: " << particleSpecies_ -> getRollingFrictionCoefficient() << std::endl;
1150  cdatFile_ << "torsionFrictionCoeff: " << particleSpecies_ -> getTorsionFrictionCoefficient() << std::endl;
1151  // If constantRestitution(true) loading, unloading, and cohesion stiffness are multiplied by the mass of a particle (massParticle_) whose radius is radiusParticle_*2/(1+sizeDispersityParticle_),
1152  // which is the mass that should be used to compute collision time.
1153  cdatFile_ << "loadingStiffness: " << std::scientific << particleSpecies_ -> getLoadingStiffness()
1154  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl;
1155  cdatFile_ << "unloadingStiffnessMax: " << particleSpecies_ -> getUnloadingStiffnessMax()
1156  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl;
1157  cdatFile_ << "cohesionStiffness: " << particleSpecies_ -> getCohesionStiffness()
1158  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl;
1159  cdatFile_ << "restitutionCoefficient: " << particleSpecies_ -> getRestitutionCoefficient(massParticle_) << std::endl;
1160  cdatFile_ << "collisionTime: " << std::scientific << std::setprecision(3) << particleSpecies_ -> getCollisionTime(massParticle_) << std::endl;
1162  cdatFile_ << "nInternalStructurePoints: " << getNumberOfInternalStructurePoints() << std::endl;
1163  cdatFile_ << "energyRatioTolerance: " << getEnergyRatioTolerance() << std::endl;
1164  cdatFile_ << "velocityDampingModulus: " << std::defaultfloat << getVelocityDampingModulus() << std::endl << std::endl;
1165 
1166  cdatFile_ << "progress" << std::setw(16) << "ElastEne" << std::setw(23) << "Ekin/ElastEne" << std::setw(18) << "coord_number" << std::setw(14) << "meanRadius"
1167  << std::setw(19) << "solidFraction" << std::setw(16) << "forceModulus" << std::setw(22) << "AveFOnOverl" << std::setw(15) << "dMin" << std::setw(17) << "dMean"
1168  << std::setw(14) << "dMax" << std::setw(24) << "Mass Centre" << std::endl;
1169 }
Mdouble getCollisionTimeOverTimeStep() const
This returns the value of the ratio between collision time and time step.
Definition: BaseCluster.cc:68
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
unsigned int getClusterId() const
This returns the value of the cluster ID.
Definition: BaseCluster.cc:175
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:389
int getNumberOfInternalStructurePoints() const
This returns the value of the number of particles used to compute internal structure.
Definition: BaseCluster.cc:209
Mdouble getSizeDispersityParticle() const
This returns the value of particles' dispersity in size.
Definition: BaseCluster.cc:109
Vec3D position_
Definition: BaseCluster.h:471
std::ofstream cdatFile_
Definition: BaseCluster.h:574
Mdouble massParticle_
Definition: BaseCluster.h:548
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
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
Mdouble getVelocityDampingModulus() const
This returns the value of the velocity damping modulus.
Definition: BaseCluster.cc:192
int getNumberOfParticles() const
This returns the value of the number of particles in the cluster.
Definition: BaseCluster.cc:126
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.

Definition at line 1252 of file BaseCluster.cc.

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().

1253 {
1254  // resetting counters and variables
1255  Mdouble solidVolumeInsideRadius = 0;
1256  Vec3D localMin;
1257  Vec3D localMax;
1258  localMin.setZero();
1259  localMax.setZero();
1261  //\brief vector in which it is saved the relative position of a particle from the center of mass
1262  Vec3D distanceFromCenterOfMass;
1263  //\brief distance from the center of mass of the furthest particle
1264  Mdouble furthestParticleDistance = 0;
1265  // number of particles whose distance d from the center of mass is d > furthestParticleDistance - radiusParticle_
1266  int counter = 0;
1267  Mdouble relativeOverlap = 0;
1268 
1269  meanClusterRadius_ = 0.0;
1271  maxRelativeOverlap_ = 0.0;
1272  meanRelativeOverlap_ = 0.0;
1274 
1275  // loops over each particle to compute mean coordination number and center of mass.
1276  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p) {
1277 
1278  meanCoordinationNumber_ += ((*p)->getInteractions()).size();
1279 
1280  centerOfMass_ += ((*p)->getVolume()) * ((*p)->getPosition());
1281  }
1282 
1285 
1286 
1287  // loops over each particle to compute the furthest particle from the center of mass.
1288  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p) {
1289 
1290  distanceFromCenterOfMass = (*p)->getPosition() - centerOfMass_;
1291 
1292  if (distanceFromCenterOfMass.getLength() > furthestParticleDistance)
1293  furthestParticleDistance = distanceFromCenterOfMass.getLength();
1294 
1295  }
1296 
1297  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p) {
1298 
1299  distanceFromCenterOfMass = (*p)->getPosition() - centerOfMass_;
1300 
1301  if (distanceFromCenterOfMass.getLength() > furthestParticleDistance - radiusParticle_) {
1302  meanClusterRadius_ += distanceFromCenterOfMass.getLength();
1303  counter++;
1304  }
1305 
1306  }
1307 
1308  meanClusterRadius_ /= counter;
1310 
1311 
1312  /*
1313  * \details This is the radius used to compute solid fraction: it is smaller than the meanClusterRadius.
1314  */
1316 
1317  /*
1318  * \details With a for cycle the volume of the particles inside radiusForSolidFraction is computed and after this the value of solid
1319  * fraction is calculated. This value is less precise as the maximum penetration depth increases and more precise as the
1320  * number of particle increases.
1321  */
1322  for (auto p = particleHandler.begin(); p != particleHandler.end(); ++p)
1323  {
1324  distanceFromCenterOfMass = (*p) -> getPosition() - centerOfMass_;
1325 
1326  if( distanceFromCenterOfMass.getLength() < radiusForSolidFraction_ )
1327  solidVolumeInsideRadius += (*p) -> getVolume();
1328  }
1329 
1330  solidFraction_ = 3 * solidVolumeInsideRadius / ( 4 * constants::pi * pow(radiusForSolidFraction_, 3) );
1331 
1332  // loops over every interaction to compute mean force acting on interaction, maximum, mean and minimum relative particle overlap.
1333  for (std::vector<BaseInteraction*>::const_iterator i = interactionHandler.begin(); i != interactionHandler.end(); ++i)
1334  {
1335 
1336  /*
1337  * \details the relative overlap is computed as an average of the relative overlap on the two particles.
1338  * rO = ( O/R1 + O/R2 ) / 2.
1339  */
1340  relativeOverlap = ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getP() -> getIndex()) -> getRadius()) +
1341  ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getI() -> getIndex()) -> getRadius());
1342  relativeOverlap /= 2;
1343  meanRelativeOverlap_ += relativeOverlap;
1344  if (relativeOverlap > maxRelativeOverlap_)
1345  maxRelativeOverlap_ = relativeOverlap;
1346 
1347  if (relativeOverlap < minRelativeOverlap_)
1348  minRelativeOverlap_ = relativeOverlap;
1349  }
1351 }
Vec3D getPosition() const
This returns the value of position_, which is the position in which the cluster will be inserted...
Definition: BaseCluster.cc:52
Mdouble minRelativeOverlap_
Definition: BaseCluster.h:568
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
double Mdouble
Definition: GeneralDefine.h:34
Mdouble radiusParticle_
Definition: BaseCluster.h:481
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble meanRelativeOverlap_
Definition: BaseCluster.h:566
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
void setZero()
Sets all elements to zero.
Definition: Vector.cc:43
Mdouble maxRelativeOverlap_
Definition: BaseCluster.h:564
static Mdouble getLength(const Vec3D &a)
Calculates the length of a Vec3D: .
Definition: Vector.cc:331
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
Mdouble meanCoordinationNumber_
Definition: BaseCluster.h:562
const Mdouble pi
Definition: ExtendedMath.h:45
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
Mdouble solidFraction_
Definition: BaseCluster.h:590
Mdouble radiusForSolidFraction_
Definition: BaseCluster.h:588
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1359
Mdouble totalParticleVolume_
Definition: BaseCluster.h:550
Vec3D centerOfMass_
Definition: BaseCluster.h:556
Mdouble meanClusterRadius_
Definition: BaseCluster.h:501
Definition: Vector.h:49
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.

Definition at line 1685 of file BaseCluster.cc.

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

Referenced by actionsAfterSolve().

1686 {
1687  std::ostringstream gnuplotname;
1688  gnuplotname << getName() << ".gnuplot";
1689 
1690  gnuplotFile_.open(gnuplotname.str(), std::ios::out);
1691  gnuplotFile_ << "set terminal jpeg" << std::endl;
1692  gnuplotFile_ << "set output \"" << getName() << "_overlaps" << ".jpeg\"" << std::endl;
1693  std::string titleLine=R"(set title "Overlap Vs Force")";// font ",14"
1694  std::string xLabel=R"(set xlabel "Overlap")";
1695  std::string yLabel=R"(set ylabel "Force")";
1696  gnuplotFile_ << titleLine << std::endl;
1697  gnuplotFile_ << xLabel << std::endl;
1698  gnuplotFile_ << yLabel << std::endl;
1699  gnuplotFile_ << "set grid" << std::endl;
1700  gnuplotFile_ << "plot ";
1701  for (int i = 0; i < interactionHandler.getSize(); ++i)
1702  {
1703  gnuplotFile_ << "\"" << getName() << ".overl" << "\"" << " using " << 2*i+4 << ":" << 2*i+3 << " title \"\" with lines lt 1 dashtype 2, ";
1704  }
1705 
1706  gnuplotFile_.close();
1707 
1708 }
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:389
std::ofstream gnuplotFile_
Definition: BaseCluster.h:578
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1359
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).

Definition at line 1716 of file BaseCluster.cc.

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

Referenced by computeInternalStructure().

1717 {
1718  std::ostringstream intStructName;
1719  intStructName << getName() << ".struct";
1720 
1721  intStructFile_.open(intStructName.str(), std::ios::out);
1722  intStructFile_ << "Number of Montecarlo points: " << nInternalStructurePoints_ << std::endl;
1723 }
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:389
std::ofstream intStructFile_
Definition: BaseCluster.h:582
int nInternalStructurePoints_
Definition: BaseCluster.h:509
void BaseCluster::makeOverlFile ( )
private

Creates the cluster overlap output file.

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() ).

Definition at line 1176 of file BaseCluster.cc.

References DPMBase::getName(), and overlFile_.

Referenced by setupInitialConditions().

1177 {
1178  std::ostringstream overlName;
1179  overlName << getName() << ".overl";
1180 
1181  overlFile_.open(overlName.str(), std::ios::out);
1182  overlFile_ << "Overlap Vs Normal Force" << std::endl;
1183 }
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:389
std::ofstream overlFile_
Definition: BaseCluster.h:576
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.

Definition at line 1195 of file BaseCluster.cc.

References boxSize_, MercuryBase::checkParticleForInteraction(), BaseHandler< T >::copyAndAddObject(), mathsFunc::cos(), BaseHandler< T >::getObject(), BaseParticle::getRadius(), RNG::getRandomNumber(), idCluster_, 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().

1195  {
1196 
1197  int insertionFailCounter = 0;
1198  Mdouble rad, theta, phi;
1199  Vec3D particlePosition;
1200  SphericalParticle p0;
1201 
1202  // setup of particle properties and initial conditions (besides position)
1203  p0.setVelocity(Vec3D(0.0, 0.0, 0.0));
1204  p0.setRadius(radii_[n]);
1206  p0.setGroupId(idCluster_);
1207 
1208  while (insertionFailCounter < 1000)
1209  {
1210  theta = constants::pi * random.getRandomNumber(0, 2.0);
1211  phi = acos(random.getRandomNumber(-1.0, 1.0));
1212  rad = p0.getRadius() + cbrt( random.getRandomNumber( 0, 1 ) ) * ( 0.5 * boxSize_ - 2.01 * p0.getRadius() );
1213 
1214  particlePosition.X = position_.X + rad * sin(phi) * cos(theta);
1215  particlePosition.Y = position_.Y + rad * sin(phi) * sin(theta);
1216  particlePosition.Z = position_.Z + rad * cos(phi);
1217 
1218  p0.setPosition(particlePosition);
1219 
1221  {
1223  return true;
1224  }
1225 
1226  insertionFailCounter++;
1227  }
1228 
1229  return false;
1230 }
Mdouble X
the vector components
Definition: Vector.h:65
A basic particle.
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
double Mdouble
Definition: GeneralDefine.h:34
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species) ...
Mdouble boxSize_
Definition: BaseCluster.h:554
void setSpecies(const ParticleSpecies *species)
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
Mdouble cos(Mdouble x)
Definition: ExtendedMath.cc:64
bool checkParticleForInteraction(const BaseParticle &P) final
Checks if given BaseParticle has an interaction with a BaseWall or other BaseParticle.
Definition: MercuryBase.cc:588
Mdouble sin(Mdouble x)
Definition: ExtendedMath.cc:44
unsigned int idCluster_
Definition: BaseCluster.h:493
const Mdouble pi
Definition: ExtendedMath.h:45
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
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
Vec3D position_
Definition: BaseCluster.h:471
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:345
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
Mdouble Y
Definition: Vector.h:65
RNG random
This is a random generator, often used for setting up the initial conditions etc...
Definition: DPMBase.h:1324
void setGroupId(unsigned groupId)
Definition: BaseObject.h:131
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: Vector.h:49
Mdouble Z
Definition: Vector.h:65
std::vector< Mdouble > radii_
Definition: BaseCluster.h:544
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.

Definition at line 942 of file BaseCluster.cc.

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().

943 {
944  std::ostringstream printTime;
945  switch (stage_)
946  {
947  case 1: printTime << "Compression progress: " << std::setw(3) << int( ceil( 100 * (getTime() - t0_) / forceTuningDuration_ ) ) << "%, ";
948  break;
949 
950  case 2: printTime << "Decompression progress: " << std::setw(3) << int( ceil( 100 * (getTime() - t0_) / forceTuningDuration_ ) )<< "%, ";
951  break;
952 
953  case 3: printTime << "Dissipating energy: ";
954  break;
955 
956  default: printTime << "Final values: ";
957  break;
958  }
959  printTime <<
960  "E_ratio = " << std::scientific << std::setprecision(2) << std::setw(8) << getKineticEnergy()/getElasticEnergy() <<
961  ", cN = " << std::fixed << std::setw(5) << meanCoordinationNumber_ << ", rMean = " << std::scientific << meanClusterRadius_ <<
962  ", mF = " << std::fixed << std::setprecision(3) << solidFraction_ << ", Force Modulus = " << std::scientific << forceModulus_ <<
963  ", dMin = " << std::fixed << std::setw(7) << std::setprecision(5) << minRelativeOverlap_ << ", dMean = " << std::setw(7) << meanRelativeOverlap_ <<
964  ", dMax = " << maxRelativeOverlap_ << ", centerOfMass = " << std::scientific << std::setprecision(5) << std::setw(13) << centerOfMass_.X
965  << std::setw(14) << centerOfMass_.Y << std::setw(14) << centerOfMass_.Z <<
966  " nParticles: " << particleHandler.getSize();
967  logger(VERBOSE, printTime.str());
968 }
Mdouble minRelativeOverlap_
Definition: BaseCluster.h:568
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble t0_
Definition: BaseCluster.h:598
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble meanRelativeOverlap_
Definition: BaseCluster.h:566
Mdouble maxRelativeOverlap_
Definition: BaseCluster.h:564
Mdouble meanCoordinationNumber_
Definition: BaseCluster.h:562
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1490
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1504
void printTime() const override
Overrides DPMBase printTime(): this way variables of interest are shown.
Definition: BaseCluster.cc:942
Mdouble solidFraction_
Definition: BaseCluster.h:590
Mdouble forceModulus_
Definition: BaseCluster.h:606
Mdouble Y
Definition: Vector.h:65
Vec3D centerOfMass_
Definition: BaseCluster.h:556
Mdouble meanClusterRadius_
Definition: BaseCluster.h:501
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
Mdouble Z
Definition: Vector.h:65
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797
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.

Definition at line 836 of file BaseCluster.cc.

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_.

837 {
838  MercuryBase::read(is);
839 
840  std::stringstream line;
841  std::string dummy;
842 
844  line >> dummy >> position_
845  >> dummy >> stage_
846  >> dummy >> t0_;
848  line >> dummy >> idCluster_
849  >> dummy >> nParticles_
850  >> dummy >> radiusParticle_
851  >> dummy >> massParticle_
852  >> dummy >> sizeDispersityParticle_
853  >> dummy >> totalParticleVolume_;
855  line >> dummy >> maximumForceModulus_
856  >> dummy >> forceTuningInterval_
857  >> dummy >> forceTuningDuration_
858  >> dummy >> velocityDampingInterval_
859  >> dummy >> velocityDampingModulus_
860  >> dummy >> energyRatioTolerance_
861  >> dummy >> forceDampingModulus_
862  >> dummy >> forceModulus_;
864  line >> dummy >> isCdatOutputOn_
865  >> dummy >> isOverlOutputOn_
866  >> dummy >> isAmatOutputOn_
867  >> dummy >> isIntStrucOutputOn_;
868  if(isIntStrucOutputOn() )
869  {
871  line >> dummy >> nInternalStructurePoints_;
872  }
873  line >> dummy >> isRestartOutputOn_
874  >> dummy >> isFStatOutputOn_
875  >> dummy >> isEneOutputOn_;
876 }
Mdouble t0_
Definition: BaseCluster.h:598
bool isCdatOutputOn_
Definition: BaseCluster.h:518
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
Mdouble radiusParticle_
Definition: BaseCluster.h:481
bool isIntStrucOutputOn_
Definition: BaseCluster.h:524
bool isIntStrucOutputOn() const
This returns the bool variable that defines whether the cluster internal structure output is written ...
Definition: BaseCluster.cc:313
bool isOverlOutputOn_
Definition: BaseCluster.h:520
bool isFStatOutputOn_
Definition: BaseCluster.h:530
Mdouble maximumForceModulus_
Definition: BaseCluster.h:604
unsigned int idCluster_
Definition: BaseCluster.h:493
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:424
Mdouble energyRatioTolerance_
Definition: BaseCluster.h:477
Vec3D position_
Definition: BaseCluster.h:471
Mdouble forceDampingModulus_
Definition: BaseCluster.h:617
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
Mdouble forceModulus_
Definition: BaseCluster.h:606
Mdouble totalParticleVolume_
Definition: BaseCluster.h:550
bool isAmatOutputOn_
Definition: BaseCluster.h:522
bool isEneOutputOn_
Definition: BaseCluster.h:532
Mdouble massParticle_
Definition: BaseCluster.h:548
Mdouble velocityDampingModulus_
Definition: BaseCluster.h:505
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
int nInternalStructurePoints_
Definition: BaseCluster.h:509
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
bool isRestartOutputOn_
Definition: BaseCluster.h:528
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
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.

Definition at line 183 of file BaseCluster.cc.

References idCluster_, logger, and WARN.

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

183  {
184  if (iC < 0)
185  logger(WARN, "idCluster = % is less than zero.", iC);
186  idCluster_ = iC;
187 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
unsigned int idCluster_
Definition: BaseCluster.h:493
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.

Definition at line 76 of file BaseCluster.cc.

References collisionTimeOverTimeStep_, ERROR, logger, and WARN.

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

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 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble collisionTimeOverTimeStep_
Definition: BaseCluster.h:475
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.

Definition at line 1041 of file BaseCluster.cc.

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

Referenced by setupInitialConditions().

1042 {
1043  Mdouble initialSolidFraction = 0.1;
1044  boxSize_ = cbrt(totalParticleVolume_/initialSolidFraction);
1045  std::ostringstream printDomainLimits;
1046  printDomainLimits << "Cubic size " << boxSize_ << std::endl;
1047  logger(VERBOSE, printDomainLimits.str());
1048 
1049  setDomain(-0.5*boxSize_*Vec3D(1,1,1) + position_, 0.5*boxSize_*Vec3D(1,1,1) + position_);
1050 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble boxSize_
Definition: BaseCluster.h:554
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1059
Vec3D position_
Definition: BaseCluster.h:471
Mdouble totalParticleVolume_
Definition: BaseCluster.h:550
Definition: Vector.h:49
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.

Definition at line 234 of file BaseCluster.cc.

References energyRatioTolerance_, ERROR, and logger.

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

234  {
235  if (eRT <= 0)
236  logger(ERROR, "energyRatioTolerance must be grater than zero. energyRatioTolerance = %", eRT);
237  energyRatioTolerance_ = eRT;
238 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble energyRatioTolerance_
Definition: BaseCluster.h:477
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.

Definition at line 217 of file BaseCluster.cc.

References ERROR, logger, and nInternalStructurePoints_.

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

217  {
218  if (gL <= 0)
219  logger(ERROR, "nInternalStructurePoints_ must be grater than zero. nInternalStructurePoints_ = %", gL);
221 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
int nInternalStructurePoints_
Definition: BaseCluster.h:509
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.

Definition at line 134 of file BaseCluster.cc.

References ERROR, logger, nParticles_, and setNumberOfParticles_.

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

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 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
bool setNumberOfParticles_
Definition: BaseCluster.h:489
void BaseCluster::setParticleSpecies ( LinearPlasticViscoelasticFrictionSpecies pS)

This sets the species of the particle.

This sets the species of the particle.

Definition at line 250 of file BaseCluster.cc.

References particleSpecies_.

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

250  {
251  particleSpecies_ = pS;
252 }
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
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).

Definition at line 60 of file BaseCluster.cc.

References position_.

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

60  {
61  position_ = p;
62 }
Vec3D position_
Definition: BaseCluster.h:471
void BaseCluster::setRadii ( )
private

Sets all radii according to particleRadius and sizeDispersityParticle.

Sets all radii according to particleRadius and sizeDispersityParticle_.

Definition at line 981 of file BaseCluster.cc.

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

Referenced by setupInitialConditions().

982 {
985  for (int i = 0; i < nParticles_; ++i)
986  {
987  // This is the actual radius of the i-th particle
989  // Computing totalParticleVolume (this is done because this value is needed before particle insertion).
990  totalParticleVolume_ += 4.0*constants::pi*pow(radii_[i],3.0)/3.0;
991  //computing the smallest radius (needed in computeTimeStep(), which is needed before particle insertion)
993  }
994 }
Mdouble radiusParticle_
Definition: BaseCluster.h:481
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
const Mdouble inf
Definition: GeneralDefine.h:44
const Mdouble pi
Definition: ExtendedMath.h:45
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
Mdouble totalParticleVolume_
Definition: BaseCluster.h:550
RNG random
This is a random generator, often used for setting up the initial conditions etc...
Definition: DPMBase.h:1324
Mdouble smallestRadius_
Definition: BaseCluster.h:546
std::vector< Mdouble > radii_
Definition: BaseCluster.h:544
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.

Definition at line 149 of file BaseCluster.cc.

References ERROR, logger, radiusCluster_, and setRadiusCluster_.

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

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 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble radiusCluster_
Definition: BaseCluster.h:495
bool setRadiusCluster_
Definition: BaseCluster.h:497
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.

Definition at line 97 of file BaseCluster.cc.

References ERROR, logger, radiusParticle_, and setRadiusParticle_.

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

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 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble radiusParticle_
Definition: BaseCluster.h:481
bool setRadiusParticle_
Definition: BaseCluster.h:483
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.

Definition at line 117 of file BaseCluster.cc.

References ERROR, logger, and sizeDispersityParticle_.

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

117  {
118  if (sDP < 1)
119  logger(ERROR, "sizeDispersityParticle must be greater or equal than 1. sizeDispersityParticle = %", sDP);
120  else sizeDispersityParticle_ = sDP;
121 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
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.

Definition at line 1000 of file BaseCluster.cc.

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

Referenced by setupInitialConditions().

1001 {
1002  if (particleSpecies_ == nullptr)
1003  logger(ERROR, "Species not set.");
1004 
1006  /*
1007  * \brief mass of the particle which has radius radiusParticle if constantRestitution(false) or
1008  * radiusParticle_*2/(1+sizeDispersityParticle_) otherwise.
1009  * It is set now and used various time in the code (for example for stiffnesses, collision time
1010  * and restitution coefficient below).
1011  */
1012  massParticle_ = particleSpecies_ -> getConstantRestitution()?
1013  speciesHandler.getObject(0) -> getMassFromRadius(radiusParticle_*2/(1+sizeDispersityParticle_))
1014  :
1015  speciesHandler.getObject(0) -> getMassFromRadius(radiusParticle_);
1016 
1017  std::ostringstream printSpecies;
1018  /*
1019  * If constantRestitution(true) loading, unloading, and cohesion stiffness are multiplied by the mass of a particle
1020  * whose radius is radiusParticle_*2/(1+sizeDispersityParticle_),
1021  * which is the mass that should be used to compute collision time.
1022  */
1023  printSpecies << "loadingStiffness: " << std::scientific << particleSpecies_ -> getLoadingStiffness()
1024  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl
1025  << "unloadingStiffnessMax: " << particleSpecies_ -> getUnloadingStiffnessMax()
1026  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl
1027  << "cohesionStiffness: " << particleSpecies_ -> getCohesionStiffness()
1028  * (particleSpecies_->getConstantRestitution()?massParticle_:1) << std::endl
1029  << "restitutionCoefficient: " << std::fixed << particleSpecies_ -> getRestitutionCoefficient(massParticle_) << std::endl
1030  << "collisionTime: " << std::scientific << std::setprecision(3) << particleSpecies_ -> getCollisionTime(massParticle_) << std::endl;
1031  logger(VERBOSE, printSpecies.str());
1032 }
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble radiusParticle_
Definition: BaseCluster.h:481
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
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
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
Mdouble massParticle_
Definition: BaseCluster.h:548
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.

Definition at line 425 of file BaseCluster.cc.

References boxSize_, calculateTimeStep(), SpeciesHandler::clear(), ParticleHandler::clear(), clusterTimeMax_, DPMBase::dataFile, dissipationDuration_, DPMBase::eneFile, ERROR, fileOutputTimeInterval_, forceDampingModulus_, forceTuningDuration_, forceTuningInterval_, DPMBase::fStatFile, ParticleHandler::getLargestParticle(), BaseParticle::getMass(), ParticleSpecies::getMassFromRadius(), BaseHandler< T >::getSize(), DPMBase::getTime(), DPMBase::getTimeStep(), idCluster_, insertParticles(), isCdatOutputOn(), isEneOutputOn(), isFStatOutputOn(), isOverlOutputOn(), isRestartOutputOn(), isVtkOutputOn(), logger, makeCdatFile(), makeOverlFile(), maximumForceModulus_, NO_FILE, nParticles_, ONE_FILE, 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.

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
552 #else
555 #endif
556 
557  //\details Maximum possible time duration of dissipation (i.e. duration of dissipation if energy ration tollerance not reached).
558  dissipationDuration_ = forceTuningDuration_/2;
559 
560  // Compression + Decompression + Dissipation = 2 * Compression + Dissipation
561  clusterTimeMax_ = 2 * forceTuningDuration_ + dissipationDuration_;
563 
564  fileOutputTimeInterval_ = forceTuningDuration_ / 100;
565 
567 
569 
570  forceDampingModulus_ = 0.95;
571 
573 
574  setXBallsAdditionalArguments("-v0 -p 10");
575 
577 
579 
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 }
void setSpecies()
Sets species of particles.
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
bool isEneOutputOn() const
This returns the bool variable that defines whether the cluster ene output is written or not...
Definition: BaseCluster.cc:369
Mdouble t0_
Definition: BaseCluster.h:598
LinearPlasticViscoelasticFrictionSpecies * particleSpecies_
Definition: BaseCluster.h:513
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:840
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
double Mdouble
Definition: GeneralDefine.h:34
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
void insertParticles()
Inserts particles inside the domain.
Mdouble radiusParticle_
Definition: BaseCluster.h:481
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:904
void setRadii()
Sets all radii according to particleRadius and sizeDispersityParticle.
Definition: BaseCluster.cc:981
Mdouble boxSize_
Definition: BaseCluster.h:554
bool isVtkOutputOn() const
This returns the bool variable that defines whether the cluster vtk output is written or not...
Definition: BaseCluster.cc:327
bool setNumberOfParticles_
Definition: BaseCluster.h:489
Mdouble dissipationDuration_
Definition: BaseCluster.h:615
Mdouble getMassFromRadius(Mdouble radius) const
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
bool isCdatOutputOn() const
This returns the bool variable that defines whether the cluster data output (which is NOT the mercury...
Definition: BaseCluster.cc:271
Mdouble radiusCluster_
Definition: BaseCluster.h:495
void setDomainLimits()
Sets domain limits.
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1370
Mdouble clusterTimeMax_
Definition: BaseCluster.h:600
file will not be created/read
void makeCdatFile()
Creates the cluster data output file.
Mdouble maximumForceModulus_
Definition: BaseCluster.h:604
bool setRadiusParticle_
Definition: BaseCluster.h:483
Mdouble fileOutputTimeInterval_
Definition: BaseCluster.h:584
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1375
unsigned int idCluster_
Definition: BaseCluster.h:493
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
void makeOverlFile()
Creates the cluster overlap output file.
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
all data will be written into/ read from a single file called name_
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:398
Mdouble forceDampingModulus_
Definition: BaseCluster.h:617
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0...
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1319
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1307
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:216
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:600
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:412
bool isRestartOutputOn() const
This returns the bool variable that defines whether the cluster restart output is written or not...
Definition: BaseCluster.cc:341
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1380
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1385
void calculateTimeStep()
Calculates the time step.
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1211
bool isFStatOutputOn() const
This returns the bool variable that defines whether the cluster fStat output is written or not...
Definition: BaseCluster.cc:355
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
bool isOverlOutputOn() const
This returns the bool variable that defines whether the cluster overlap output is written or not...
Definition: BaseCluster.cc:285
bool setRadiusCluster_
Definition: BaseCluster.h:497
void BaseCluster::setVelocity ( Vec3D  v)

This sets the value of velocity after creation.

This sets the velocity of the cluster after creation.

Definition at line 264 of file BaseCluster.cc.

References clusterVelocity_.

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

264  {
265  clusterVelocity_ = v;
266 }
Vec3D clusterVelocity_
Definition: BaseCluster.h:499
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.

Definition at line 200 of file BaseCluster.cc.

References ERROR, logger, and velocityDampingModulus_.

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

200  {
201  if (vDM < 0 || vDM > 1)
202  logger(ERROR, "velocityDampingModulus must be grater than zero and less than 1. velocityDampingModulus = %", vDM);
204 }
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Mdouble velocityDampingModulus_
Definition: BaseCluster.h:505
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.

Definition at line 791 of file BaseCluster.cc.

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().

792 {
793  writeAllParticles = true;
794  MercuryBase::write(os, writeAllParticles);
795 
796  os <<
797  "position " << position_ << " " <<
798  "stage " << stage_ << " " <<
799  "t0 " << t0_
800  << std::endl <<
801  "idCluster " << idCluster_ << " " <<
802  "nParticles " << nParticles_ << " " <<
803  "radiusParticle " << radiusParticle_ << " " <<
804  "massParticle " << massParticle_ << " " <<
805  "sizeDispersityParticle " << sizeDispersityParticle_ << " " <<
806  "totalParticleVolume " << totalParticleVolume_
807  << std::endl <<
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  << std::endl <<
817  "isCdatOutputON " << isCdatOutputOn_ << " " <<
818  "isOverlOutputOn " << isOverlOutputOn_ << " " <<
819  "isAmatOutputOn " << isAmatOutputOn_ << " " <<
820  "isIntStrucOutputOn " << isIntStrucOutputOn_
821  << std::endl;
822  if( isIntStrucOutputOn() )
823  os << "nInternalStructurePoints " << nInternalStructurePoints_ << std::endl;
824 
825  os << "isRestartOutputOn " << isRestartOutputOn_ << " " << //This is obviously on because otherwise restart
826  // process would not take place.
827  //For now it is saved but could eventually be removed.
828  "isFStatOutputOn " << isFStatOutputOn_ << " " <<
829  "isEneOutputOn " << isEneOutputOn_ << std::endl;
830 }
Mdouble t0_
Definition: BaseCluster.h:598
bool isCdatOutputOn_
Definition: BaseCluster.h:518
Mdouble velocityDampingInterval_
Definition: BaseCluster.h:610
Mdouble radiusParticle_
Definition: BaseCluster.h:481
bool isIntStrucOutputOn_
Definition: BaseCluster.h:524
bool isIntStrucOutputOn() const
This returns the bool variable that defines whether the cluster internal structure output is written ...
Definition: BaseCluster.cc:313
bool isOverlOutputOn_
Definition: BaseCluster.h:520
bool isFStatOutputOn_
Definition: BaseCluster.h:530
Mdouble maximumForceModulus_
Definition: BaseCluster.h:604
void write(std::ostream &os, bool writeAllParticles=true) const override
Writes the MercuryBase to an output stream, for example a restart file.
Definition: MercuryBase.cc:146
unsigned int idCluster_
Definition: BaseCluster.h:493
Mdouble energyRatioTolerance_
Definition: BaseCluster.h:477
Vec3D position_
Definition: BaseCluster.h:471
Mdouble forceDampingModulus_
Definition: BaseCluster.h:617
Mdouble sizeDispersityParticle_
Definition: BaseCluster.h:485
Mdouble forceModulus_
Definition: BaseCluster.h:606
Mdouble totalParticleVolume_
Definition: BaseCluster.h:550
bool isAmatOutputOn_
Definition: BaseCluster.h:522
bool isEneOutputOn_
Definition: BaseCluster.h:532
Mdouble massParticle_
Definition: BaseCluster.h:548
Mdouble velocityDampingModulus_
Definition: BaseCluster.h:505
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
int nInternalStructurePoints_
Definition: BaseCluster.h:509
bool isRestartOutputOn_
Definition: BaseCluster.h:528
Mdouble forceTuningInterval_
Definition: BaseCluster.h:608
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.

Definition at line 1573 of file BaseCluster.cc.

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

Referenced by actionsAfterSolve().

1574 {
1575  for(int i=0; i < particleHandler.getSize(); i++)
1576  {
1577  for(int j=0; j < particleHandler.getSize(); j++)
1578  {
1579  amatFile_ << adjacencyMatrix_[i][j] << " ";
1580  }
1581  amatFile_ << std::endl;
1582  }
1584  amatFile_ << std::endl;
1585  amatFile_ << "THE TOTAL NUMBER OF INTRACLUSTER BONDS IS: " << nIntraClusterBonds_ << std::endl;
1586  amatFile_ << "THE MEAN COORDINATION NUMBER IS: " << meanCoordinationNumber_ << std::endl;
1587 
1588  amatFile_.close();
1589 }
std::vector< std::vector< int > > adjacencyMatrix_
Definition: BaseCluster.h:560
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
Mdouble meanCoordinationNumber_
Definition: BaseCluster.h:562
std::ofstream amatFile_
Definition: BaseCluster.h:580
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1359
int nIntraClusterBonds_
Definition: BaseCluster.h:570
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.

Definition at line 1367 of file BaseCluster.cc.

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().

1368 {
1369  switch (stage_)
1370  {
1371  case 1:
1372  cdatFile_ << "C, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1373  break;
1374 
1375  case 2:
1376  cdatFile_ << "D, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1377  break;
1378 
1379  case 3:
1380  cdatFile_ << "D-energy: ";
1381  break;
1382 
1383  default:
1384  cdatFile_ << "Final v: ";
1385  }
1386 
1387  cdatFile_ <<
1388  std::scientific <<
1389  std::setprecision(2)<<
1390  std::setw(14) <<
1391  getElasticEnergy() <<
1392  std::setw(18) <<
1394  std::fixed <<
1395  std::setprecision(2) <<
1396  std::setw(15) <<
1398  std::scientific <<
1399  std::setw(20) <<
1401  std::fixed <<
1402  std::setprecision(2) <<
1403  std::setw(13) <<
1404  solidFraction_ <<
1405  std::scientific <<
1406  std::setprecision(3) <<
1407  std::setw(24) <<
1408  forceModulus_ <<
1409  std::setw(22) <<
1410  std::fixed <<
1411  std::setprecision(5) <<
1412  std::setw(18) <<
1414  std::setw(16) <<
1416  std::setw(15) <<
1418  std::scientific <<
1419  std::setprecision(2) <<
1420  std::setw(19) <<
1421  centerOfMass_.X <<
1422  std::setw(12) <<
1423  centerOfMass_.Y <<
1424  std::setw(12) <<
1425  centerOfMass_.Z <<
1426  " " <<
1427  std::endl;
1428 }
Mdouble minRelativeOverlap_
Definition: BaseCluster.h:568
Mdouble X
the vector components
Definition: Vector.h:65
Mdouble t0_
Definition: BaseCluster.h:598
Mdouble meanRelativeOverlap_
Definition: BaseCluster.h:566
Mdouble maxRelativeOverlap_
Definition: BaseCluster.h:564
Mdouble meanCoordinationNumber_
Definition: BaseCluster.h:562
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1490
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1504
Mdouble solidFraction_
Definition: BaseCluster.h:590
Mdouble forceModulus_
Definition: BaseCluster.h:606
std::ofstream cdatFile_
Definition: BaseCluster.h:574
Mdouble Y
Definition: Vector.h:65
Vec3D centerOfMass_
Definition: BaseCluster.h:556
Mdouble meanClusterRadius_
Definition: BaseCluster.h:501
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
Mdouble Z
Definition: Vector.h:65
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797
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.

Definition at line 1434 of file BaseCluster.cc.

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().

1435 {
1436  //\brief force acting on overlap.
1437  Mdouble forceOnOverlap = 0;
1438  Mdouble relativeOverlap = 0;
1439  switch (stage_)
1440  {
1441  case 1:
1442  overlFile_ << "C, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1443  break;
1444 
1445  case 2:
1446  overlFile_ << "D, " << std::fixed << std::setprecision(0) << std::setw(4) << 100 * (getTime() - t0_) / forceTuningDuration_ << "%: ";
1447  break;
1448 
1449  case 3:
1450  overlFile_ << "D energy: ";
1451  break;
1452 
1453  default:
1454  overlFile_ << "Final v: ";
1455  }
1456 
1457  for (std::vector<BaseInteraction*>::const_iterator i = interactionHandler.begin(); i != interactionHandler.end(); ++i)
1458  {
1459  forceOnOverlap = ((*i) -> getForce()).getLength();
1460  relativeOverlap = ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getP() -> getIndex()) -> getRadius()) +
1461  ((*i) -> getOverlap())/(particleHandler.getObject((*i) -> getI() -> getIndex()) -> getRadius());
1462  relativeOverlap = relativeOverlap / 2;
1463  overlFile_ << std::setprecision(2) << std::scientific << std::setw(18) << forceOnOverlap
1464  << std::defaultfloat << std::fixed << std::setprecision(4) << std::setw(9) << relativeOverlap;
1465  }
1466 
1467  overlFile_ << " " << std::endl;
1468 }
Mdouble t0_
Definition: BaseCluster.h:598
double Mdouble
Definition: GeneralDefine.h:34
const std::complex< Mdouble > i
Definition: ExtendedMath.h:50
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
std::ofstream overlFile_
Definition: BaseCluster.h:576
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
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
Definition: DPMBase.h:1329
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1359
Mdouble forceTuningDuration_
Definition: BaseCluster.h:612
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:797

Member Data Documentation

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

Definition at line 560 of file BaseCluster.h.

Referenced by createAdjacencyMatrix(), and writeAmatFile().

std::ofstream BaseCluster::amatFile_
private

Definition at line 580 of file BaseCluster.h.

Referenced by makeAmatFile(), and writeAmatFile().

Mdouble BaseCluster::boxSize_
private
std::ofstream BaseCluster::cdatFile_
private

Definition at line 574 of file BaseCluster.h.

Referenced by actionsAfterSolve(), actionsOnRestart(), makeCdatFile(), and writeToCdatFile().

Vec3D BaseCluster::centerOfMass_
private
Mdouble BaseCluster::clusterTimeMax_
private

Definition at line 600 of file BaseCluster.h.

Referenced by setupInitialConditions().

Vec3D BaseCluster::clusterVelocity_
private

Definition at line 499 of file BaseCluster.h.

Referenced by actionsAfterSolve(), getVelocity(), and setVelocity().

Mdouble BaseCluster::collisionTimeOverTimeStep_
private
Mdouble BaseCluster::dissipationDuration_
private

Definition at line 615 of file BaseCluster.h.

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

Mdouble BaseCluster::energyRatioTolerance_
private
Mdouble BaseCluster::fileOutputTimeInterval_
private

Definition at line 584 of file BaseCluster.h.

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

Mdouble BaseCluster::forceDampingModulus_
private

Definition at line 617 of file BaseCluster.h.

Referenced by dampForce(), read(), setupInitialConditions(), and write().

Mdouble BaseCluster::forceModulus_
private
Mdouble BaseCluster::forceTuningInterval_
private
std::ofstream BaseCluster::gnuplotFile_
private

Definition at line 578 of file BaseCluster.h.

Referenced by makeGnuplotFile().

unsigned int BaseCluster::idCluster_
private
std::ofstream BaseCluster::intStructFile_
private

Definition at line 582 of file BaseCluster.h.

Referenced by computeInternalStructure(), and makeIntenalStructureFile().

bool BaseCluster::isAmatOutputOn_
private

Definition at line 522 of file BaseCluster.h.

Referenced by doAmatOutput(), isAmatOutputOn(), read(), and write().

bool BaseCluster::isCdatOutputOn_
private

Definition at line 518 of file BaseCluster.h.

Referenced by doCdatOutput(), isCdatOutputOn(), read(), and write().

bool BaseCluster::isEneOutputOn_
private

Definition at line 532 of file BaseCluster.h.

Referenced by doEneOutput(), isEneOutputOn(), read(), and write().

bool BaseCluster::isFStatOutputOn_
private

Definition at line 530 of file BaseCluster.h.

Referenced by doFStatOutput(), isFStatOutputOn(), read(), and write().

bool BaseCluster::isIntStrucOutputOn_
private
bool BaseCluster::isOverlOutputOn_
private

Definition at line 520 of file BaseCluster.h.

Referenced by doOverlOutput(), isOverlOutputOn(), read(), and write().

bool BaseCluster::isRestartOutputOn_
private

Definition at line 528 of file BaseCluster.h.

Referenced by doRestartOutput(), isRestartOutputOn(), read(), and write().

bool BaseCluster::isVtkOutputOn_
private

Definition at line 526 of file BaseCluster.h.

Referenced by doVtkOutput(), and isVtkOutputOn().

Mdouble BaseCluster::massParticle_
private

Definition at line 548 of file BaseCluster.h.

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

Mdouble BaseCluster::maximumForceModulus_
private

Definition at line 604 of file BaseCluster.h.

Referenced by decreaseForce(), increaseForce(), read(), setupInitialConditions(), and write().

Mdouble BaseCluster::maxRelativeOverlap_
private

Definition at line 564 of file BaseCluster.h.

Referenced by makeDataAnalysis(), printTime(), and writeToCdatFile().

Mdouble BaseCluster::meanClusterRadius_
private

Definition at line 501 of file BaseCluster.h.

Referenced by getMeanClusterRadius(), makeDataAnalysis(), printTime(), and writeToCdatFile().

Mdouble BaseCluster::meanCoordinationNumber_
private

Definition at line 562 of file BaseCluster.h.

Referenced by makeDataAnalysis(), printTime(), writeAmatFile(), and writeToCdatFile().

Mdouble BaseCluster::meanRelativeOverlap_
private
Mdouble BaseCluster::minRelativeOverlap_
private

Definition at line 568 of file BaseCluster.h.

Referenced by makeDataAnalysis(), printTime(), and writeToCdatFile().

int BaseCluster::nInternalStructurePoints_
private
int BaseCluster::nIntraClusterBonds_
private

Definition at line 570 of file BaseCluster.h.

Referenced by writeAmatFile().

int BaseCluster::nParticles_
private
std::ofstream BaseCluster::overlFile_
private
std::vector<Mdouble> BaseCluster::radii_
private

Definition at line 544 of file BaseCluster.h.

Referenced by particleInsertionSuccessful(), and setRadii().

Mdouble BaseCluster::radiusCluster_
private

Definition at line 495 of file BaseCluster.h.

Referenced by setRadiusCluster(), and setupInitialConditions().

Mdouble BaseCluster::radiusForSolidFraction_
private

Definition at line 588 of file BaseCluster.h.

Referenced by computeInternalStructure(), and makeDataAnalysis().

bool BaseCluster::setNumberOfParticles_ = false
private

Definition at line 489 of file BaseCluster.h.

Referenced by setNumberOfParticles(), and setupInitialConditions().

bool BaseCluster::setRadiusCluster_ = false
private

Definition at line 497 of file BaseCluster.h.

Referenced by setRadiusCluster(), and setupInitialConditions().

bool BaseCluster::setRadiusParticle_ = false
private

Definition at line 483 of file BaseCluster.h.

Referenced by setRadiusParticle(), and setupInitialConditions().

Mdouble BaseCluster::sizeDispersityParticle_
private
Mdouble BaseCluster::smallestRadius_
private

Definition at line 546 of file BaseCluster.h.

Referenced by calculateTimeStep(), and setRadii().

Mdouble BaseCluster::solidFraction_
private

Definition at line 590 of file BaseCluster.h.

Referenced by getFinalMassFraction(), makeDataAnalysis(), printTime(), and writeToCdatFile().

Mdouble BaseCluster::solidFractionIntStruct_
private

Definition at line 592 of file BaseCluster.h.

Referenced by computeInternalStructure(), and getFinalMassFraction().

int BaseCluster::stage_
private
Mdouble BaseCluster::totalParticleVolume_
private

Definition at line 550 of file BaseCluster.h.

Referenced by makeDataAnalysis(), read(), setDomainLimits(), setRadii(), and write().

Mdouble BaseCluster::velocityDampingInterval_
private
Mdouble BaseCluster::velocityDampingModulus_
private

The documentation for this class was generated from the following files: