DPMBase Class Reference

The DPMBase header includes quite a few header files, defining all the handlers, which are essential. Moreover, it defines and solves a DPM problem. It is inherited from FilesAndRunNumber (public). More...

#include <DPMBase.h>

+ Inheritance diagram for DPMBase:

Public Types

enum class  ReadOptions : int { ReadAll , ReadNoInteractions , ReadNoParticlesAndInteractions }
 
enum class  DomainSplit {
  X , Y , Z , XY ,
  XZ , YZ , XYZ
}
 

Public Member Functions

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...
 
void initialiseSolve ()
 Beginning of the solve routine, before time stepping. More...
 
void finaliseSolve ()
 End of the solve routine, after time stepping. 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 setupInitialConditions ()
 This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here. More...
 
virtual void writeXBallsScript () const
 This writes a script which can be used to load the xballs problem to display the data just generated. More...
 
virtual Mdouble getInfo (const BaseParticle &P) const
 A virtual function that returns some user-specified information about a particle. More...
 
ParticleVtkWritergetVtkWriter () const
 
virtual void writeRestartFile ()
 Stores all the particle data for current save time step to a "restart" file, which is a file simply intended to store all the information necessary to "restart" a simulation from a given time step (see also MercuryDPM.org for more information on restart files). More...
 
void writeDataFile ()
 
void writeEneFile ()
 
void writeFStatFile ()
 
void fillDomainWithParticles (unsigned N=50)
 
bool readRestartFile (ReadOptions opt=ReadOptions::ReadAll)
 Reads all the particle data corresponding to a given, existing . restart file (for more details regarding restart files, refer to the training materials on the MercuryDPM website).Returns true if it is successful, false otherwise. More...
 
int readRestartFile (std::string fileName, ReadOptions opt=ReadOptions::ReadAll)
 The same as readRestartFile(bool), but also reads all the particle data corresponding to the current saved time step. More...
 
virtual void write (std::ostream &os, bool writeAllParticles=true) const
 
virtual void read (std::istream &is, ReadOptions opt=ReadOptions::ReadAll)
 Reads all data from a restart file, e.g. domain data and particle data. 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...
 
virtual bool readNextArgument (int &i, int argc, char *argv[])
 Interprets the i^th command-line argument. More...
 
virtual bool checkParticleForInteraction (const BaseParticle &P)
 Checks whether a particle P has any interaction with walls or other particles. More...
 
virtual bool checkParticleForInteractionLocal (const BaseParticle &P)
 Checks if a particle P has any interaction with walls or other particles in the local domain. 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...
 
MERCURYDPM_DEPRECATED FilegetDataFile ()
 The non const version. Allows one to edit the File::dataFile. More...
 
MERCURYDPM_DEPRECATED FilegetEneFile ()
 The non const version. Allows to edit the File::eneFile. More...
 
MERCURYDPM_DEPRECATED FilegetFStatFile ()
 The non const version. Allows to edit the File::fStatFile. More...
 
MERCURYDPM_DEPRECATED FilegetRestartFile ()
 The non const version. Allows to edit the File::restartFile. More...
 
MERCURYDPM_DEPRECATED FilegetStatFile ()
 The non const version. Allows to edit the File::statFile. More...
 
FilegetInteractionFile ()
 Return a reference to the file InteractionsFile. More...
 
MERCURYDPM_DEPRECATED const FilegetDataFile () const
 The const version. Does not allow for any editing of the File::dataFile. More...
 
MERCURYDPM_DEPRECATED const FilegetEneFile () const
 The const version. Does not allow for any editing of the File::eneFile. More...
 
MERCURYDPM_DEPRECATED const FilegetFStatFile () const
 The const version. Does not allow for any editing of the File::fStatFile. More...
 
MERCURYDPM_DEPRECATED const FilegetRestartFile () const
 The const version. Does not allow for any editing of the File::restartFile. More...
 
MERCURYDPM_DEPRECATED const FilegetStatFile () const
 The const version. Does not allow for any editing of the File::statFile. More...
 
const FilegetInteractionFile () const
 
const std::string & getName () const
 Returns the name of the file. Does not allow to change it though. More...
 
void setName (const std::string &name)
 Allows to set the name of all the files (ene, data, fstat, restart, stat) More...
 
void setName (const char *name)
 Calls setName(std::string) More...
 
void setSaveCount (unsigned int saveCount)
 Sets File::saveCount_ for all files (ene, data, fstat, restart, stat) More...
 
void setFileType (FileType fileType)
 Sets File::fileType_ for all files (ene, data, fstat, restart, stat) More...
 
void setOpenMode (std::fstream::openmode openMode)
 Sets File::openMode_ for all files (ene, data, fstat, restart, stat) More...
 
void resetFileCounter ()
 Resets the file counter for each file i.e. for ene, data, fstat, restart, stat) More...
 
void closeFiles ()
 Closes all files (ene, data, fstat, restart, stat) that were opened to read or write. More...
 
void setLastSavedTimeStep (unsigned int nextSavedTimeStep)
 Sets the next time step for all the files (ene, data, fstat, restart, stat) at which the data is to be written or saved. More...
 
Mdouble getTime () const
 Returns the current simulation time. More...
 
Mdouble getNextTime () const
 Returns the current simulation time. More...
 
unsigned int getNumberOfTimeSteps () const
 Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has undergone so far. More...
 
void setTime (Mdouble time)
 Sets a new value for the current simulation time. More...
 
void setTimeMax (Mdouble newTMax)
 Sets a new value for the maximum simulation duration. More...
 
Mdouble getTimeMax () const
 Returns the maximum simulation duration. More...
 
void setLogarithmicSaveCount (Mdouble logarithmicSaveCountBase)
 Sets File::logarithmicSaveCount_ for all files (ene, data, fstat, restart, stat) More...
 
void setNToWrite (int nToWrite)
 set the number of elements to write to the screen More...
 
int getNToWrite () const
 get the number of elements to write to the More...
 
void setRotation (bool rotation)
 Sets whether particle rotation is enabled or disabled. More...
 
bool getRotation () const
 Indicates whether particle rotation is enabled or disabled. More...
 
MERCURYDPM_DEPRECATED void setWallsWriteVTK (FileType writeWallsVTK)
 Sets whether walls are written into a VTK file. More...
 
MERCURYDPM_DEPRECATED void setWallsWriteVTK (bool)
 Sets whether walls are written into a VTK file. More...
 
MERCURYDPM_DEPRECATED 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)
 
MERCURYDPM_DEPRECATED 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...
 
Mdouble getXCenter () const
 
Mdouble getYCenter () const
 
Mdouble getZCenter () const
 
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 setBackgroundDrag (Mdouble backgroundDrag)
 Simple access function to turn on a background drag. The force of particleVelocity*drag is applied (note, it allowd to be negaitve i.e. create energy) More...
 
const Mdouble getBackgroundDrag () const
 Return the background drag. More...
 
void setDimension (unsigned int newDim)
 Sets both the system dimensions and the particle dimensionality. More...
 
void setSystemDimensions (unsigned int newDim)
 Sets the system dimensionality. More...
 
unsigned int getSystemDimensions () const
 Returns the system dimensionality. More...
 
void setParticleDimensions (unsigned int particleDimensions)
 Sets the particle dimensionality. More...
 
unsigned int getParticleDimensions () const
 Returns the particle dimensionality. More...
 
std::string getRestartVersion () const
 This is to take into account for different Mercury versions. Returns the version of the restart file. More...
 
void setRestartVersion (std::string newRV)
 Sets restart_version. More...
 
bool getRestarted () const
 Returns the flag denoting if the simulation was restarted or not. More...
 
void setRestarted (bool newRestartedFlag)
 Allows to set the flag stating if the simulation is to be restarted or not. More...
 
bool getAppend () const
 Returns whether the "append" option is on or off. More...
 
void setAppend (bool newAppendFlag)
 Sets whether the "append" option is on or off. More...
 
Mdouble getElasticEnergy () const
 Returns the global elastic energy within the system. More...
 
Mdouble getKineticEnergy () const
 Returns the global kinetic energy stored in the system. More...
 
Mdouble getGravitationalEnergy () const
 Returns the global gravitational potential energy stored in the system. More...
 
Mdouble getRotationalEnergy () const
 JMFT Returns the global rotational energy stored in the system. More...
 
Mdouble getTotalEnergy () const
 
Mdouble getTotalMass () const
 JMFT: Return the total mass of the system, excluding fixed particles. More...
 
Vec3D getCentreOfMass () const
 JMFT: Return the centre of mass of the system, excluding fixed particles. More...
 
Vec3D getTotalMomentum () const
 JMFT: Return the total momentum of the system, excluding fixed particles. More...
 
double getCPUTime ()
 
double getWallTime ()
 
virtual void hGridInsertParticle (BaseParticle *obj UNUSED)
 
virtual void hGridUpdateParticle (BaseParticle *obj UNUSED)
 
virtual void hGridRemoveParticle (BaseParticle *obj UNUSED)
 
virtual void hGridUpdateMove (BaseParticle *, Mdouble)
 
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< unsigned > getNumberOfDomains ()
 returns the number of domains More...
 
DomaingetCurrentDomain ()
 Function that returns a pointer to the domain corresponding to the processor. More...
 
void removeOldFiles () const
 
virtual void hGridGetInteractingParticleList (BaseParticle *obj, std::vector< BaseParticle * > &list)
 Creates a list of neighbour particles obtained from the hgrid. More...
 
virtual void computeWallForces (BaseWall *w)
 
virtual bool getHGridUpdateEachTimeStep () const
 
void setMeanVelocity (Vec3D V_mean_goal)
 This function will help you set a fixed kinetic energy and mean velocity in your system. More...
 
void setMeanVelocityAndKineticEnergy (Vec3D V_mean_goal, Mdouble Ek_goal)
 This function will help you set a fixed kinetic energy and mean velocity in your system. More...
 
Mdouble getTotalVolume () const
 Get the total volume of the cuboid system. More...
 
Matrix3D getKineticStress () const
 Calculate the kinetic stress tensor in the system averaged over the whole volume. More...
 
Matrix3D getStaticStress () const
 Calculate the static stress tensor in the system averaged over the whole volume. More...
 
Matrix3D getTotalStress () const
 Calculate the total stress tensor in the system averaged over the whole volume. More...
 
virtual void handleParticleRemoval (unsigned int id)
 Handles the removal of particles from the particleHandler. More...
 
virtual void handleParticleAddition (unsigned int id, BaseParticle *p)
 
void writePythonFileForVTKVisualisation () const
 
void setWritePythonFileForVTKVisualisation (bool forceWritePythonFileForVTKVisualisation)
 
bool getWritePythonFileForVTKVisualisation () const
 
WallVTKWritergetWallVTKWriter ()
 

Static Public Member Functions

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

SpeciesHandler speciesHandler
 A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc. More...
 
RNG random
 This is a random generator, often used for setting up the initial conditions etc... More...
 
ParticleHandler particleHandler
 An object of the class ParticleHandler, contains the pointers to all the particles created. More...
 
ParticleHandler paoloParticleHandler
 Fake particleHandler created by Paolo needed temporary by just Paolo. More...
 
WallHandler wallHandler
 An object of the class WallHandler. Contains pointers to all the walls created. More...
 
BoundaryHandler boundaryHandler
 An object of the class BoundaryHandler which concerns insertion and deletion of particles into or from regions. More...
 
PeriodicBoundaryHandler periodicBoundaryHandler
 Internal handler that deals with periodic boundaries, especially in a parallel build. More...
 
DomainHandler domainHandler
 An object of the class DomainHandler which deals with parallel code. More...
 
InteractionHandler interactionHandler
 An object of the class InteractionHandler. More...
 
CGHandler cgHandler
 Object of the class cgHandler. More...
 
File dataFile
 An instance of class File to handle in- and output into a .data file. More...
 
File fStatFile
 An instance of class File to handle in- and output into a .fstat file. More...
 
File eneFile
 An instance of class File to handle in- and output into a .ene file. More...
 
File restartFile
 An instance of class File to handle in- and output into a .restart file. More...
 
File statFile
 An instance of class File to handle in- and output into a .stat file. More...
 
File interactionFile
 File class to handle in- and output into .interactions file. This file hold information about interactions. More...
 
Time clock_
 record when the simulation started More...
 

Protected Member Functions

virtual void computeAllForces ()
 Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseInteractable::setTorque() More...
 
virtual void computeInternalForces (BaseParticle *)
 Computes the internal forces on particle i (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces) 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...
 
virtual void computeForcesDueToWalls (BaseParticle *, BaseWall *)
 Computes the forces on the particles due to the walls (normals are outward normals) More...
 
virtual void actionsOnRestart ()
 A virtual function where the users can add extra code which is executed only when the code is restarted. More...
 
virtual void actionsBeforeTimeLoop ()
 A virtual function. Allows one to carry out any operations before the start of the time loop. More...
 
virtual void hGridActionsBeforeTimeLoop ()
 A virtual function that allows one to carry out hGrid operations before the start of the time loop. More...
 
virtual void hGridActionsBeforeTimeStep ()
 A virtual function that allows one to set or execute hGrid parameters or operations before every simulation time step. More...
 
virtual void actionsBeforeTimeStep ()
 A virtual function which allows to define operations to be executed before the new time step. More...
 
virtual void computeAdditionalForces ()
 A virtual function which allows to define operations to be executed prior to the OMP force collect. More...
 
virtual void actionsAfterSolve ()
 A virtual function which allows to define operations to be executed after the solve(). More...
 
virtual void actionsAfterTimeStep ()
 A virtual function which allows to define operations to be executed after 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...
 
virtual void hGridActionsBeforeIntegration ()
 This function has to be called before integrateBeforeForceComputation. More...
 
virtual void hGridActionsAfterIntegration ()
 This function has to be called after integrateBeforeForceComputation. More...
 
void setFixedParticles (unsigned int n)
 Sets a number, n, of particles in the particleHandler as "fixed particles". More...
 
virtual void printTime () const
 Displays the current simulation time and the maximum simulation duration. More...
 
virtual bool continueSolve () const
 A virtual function for deciding whether to continue the simulation, based on a user-specified criterion. More...
 
void outputInteractionDetails () const
 Displays the interaction details corresponding to the pointer objects in the interaction handler. More...
 
bool isTimeEqualTo (Mdouble time) const
 Checks whether the input variable "time" is the current time in the simulation. More...
 
void removeDuplicatePeriodicParticles ()
 Removes periodic duplicate Particles. More...
 
void checkAndDuplicatePeriodicParticles ()
 For simulations using periodic boundaries, checks and adds particles when necessary into the particle handler. See DPMBase.cc and PeriodicBoundary.cc for more details. More...
 
void performGhostParticleUpdate ()
 When the Verlet scheme updates the positions and velocities of particles, ghost particles will need an update as wel. Their status will also be updated accordingly. More...
 
void deleteGhostParticles (std::set< BaseParticle * > &particlesToBeDeleted)
 
void synchroniseParticle (BaseParticle *, unsigned fromProcessor=0)
 
void performGhostVelocityUpdate ()
 updates the final time-step velocity of the ghost particles More...
 
void setSoftStop ()
 function for setting sigaction constructor. More...
 

Static Protected Member Functions

static void signalHandler (int signal)
 signal handler function. More...
 

Private Attributes

int numberOfOMPThreads_
 
unsigned int systemDimensions_
 The dimensions of the simulation i.e. 2D or 3D. More...
 
unsigned int particleDimensions_
 determines if 2D or 3D particle volume is used for mass calculations More...
 
Vec3D gravity_
 Gravity vector. More...
 
Mdouble backgroundDrag_
 This is a global background drag to help retard particles, or to do a simple fluid drag. The force particleVeclocity*backgroundDrag is applied. More...
 
std::vector< unsigned > numberOfDomains_
 Vector containing the number of domains in x-,y- and z-direction, required for parallel computations. More...
 
Vec3D min_
 These vectors are used for the XBalls domain, and occasionally people use it to add walls. More...
 
Vec3D max_
 
Mdouble time_
 Stores the current simulation time. More...
 
unsigned int numberOfTimeSteps_
 Stores the number of time steps. More...
 
Mdouble timeStep_
 Stores the simulation time step. More...
 
Mdouble timeMax_
 Stores the duration of the simulation. More...
 
std::string restartVersion_
 Previous versions of MercuryDPM had a different restart file format, the below member variable allows one to specify the version in order to choose between the available version support. More...
 
bool restarted_
 A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run and the fileCounters reset. More...
 
bool append_
 A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example. More...
 
bool rotation_
 A flag to turn on/off particle rotation. true will enable particle rotation. false will disable particle rotation. More...
 
bool writeParticlesVTK_
 A flag to turn on/off the vtk writer for particles. More...
 
bool writeSuperquadricParticlesVTK_
 
ParticleVtkWritervtkWriter_
 
WallVTKWriter wallVTKWriter_
 
InteractionVTKWriter interactionVTKWriter_
 
BoundaryVTKWriter boundaryVTKWriter_
 
WallDetailsVTKWriter wallDetailsVTKWriter_
 
int xBallsColourMode_
 XBalls is a package to view the particle data. As an alternative MercuryDPM also supports ParaView. The below variable is used to set the argument cmode in xballs script (see XBalls/xballs.txt) More...
 
Mdouble xBallsVectorScale_
 sets the xballs argument vscale (see XBalls/xballs.txt) More...
 
Mdouble xBallsScale_
 sets the xballs argument scale (see XBalls/xballs.txt) More...
 
std::string xBallsAdditionalArguments_
 A string of additional arguments for xballs can be specified (see XBalls/xballs.txt). e.g. "-solidf -v0". More...
 
int runNumber_
 This stores the run number for saving. More...
 
std::string name_
 the name of the problem, used, e.g., for the output files More...
 
bool readSpeciesFromDataFile_
 Determines if the last column of the data file is interpreted as the info parameter during restart. More...
 
int nToWrite_
 number of elements to write to a screen More...
 
bool forceWritePythonFileForVTKVisualisation_ { true }
 

Static Private Attributes

static volatile sig_atomic_t continueFlag_ = true
 

Detailed Description

The DPMBase header includes quite a few header files, defining all the handlers, which are essential. Moreover, it defines and solves a DPM problem. It is inherited from FilesAndRunNumber (public).

Bug:
When restarting the first time step is not saved, therefore there is a missing time step after a restart

Member Enumeration Documentation

◆ DomainSplit

enum DPMBase::DomainSplit
strong
Enumerator
XY 
XZ 
YZ 
XYZ 
976 {X, Y, Z, XY, XZ, YZ, XYZ};
@ XY
Definition: StatisticsVector.h:42
@ XZ
Definition: StatisticsVector.h:42
@ YZ
Definition: StatisticsVector.h:42
@ Y
Definition: StatisticsVector.h:42
@ X
Definition: StatisticsVector.h:42
@ Z
Definition: StatisticsVector.h:42
@ XYZ
Definition: StatisticsVector.h:42

◆ ReadOptions

enum DPMBase::ReadOptions : int
strong
Enumerator
ReadAll 
ReadNoInteractions 
ReadNoParticlesAndInteractions 
254  : int {
255  ReadAll,
256  ReadNoInteractions,
257  ReadNoParticlesAndInteractions
258  };

Constructor & Destructor Documentation

◆ DPMBase() [1/2]

DPMBase::DPMBase ( )

Constructor that calls the "void constructor()".

Constructor for the DPMBase class. Initialises a set of default parameters allowing a simulation to be created 'off the shelf'. For full details of the parameters initialised and their assigned values, see constructor()

196 {
197 constructor();
198 }
InteractionVTKWriter interactionVTKWriter_
Definition: DPMBase.h:1369
WallVTKWriter wallVTKWriter_
Definition: DPMBase.h:1367
WallDetailsVTKWriter wallDetailsVTKWriter_
Definition: DPMBase.h:1373
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1452
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1467
void constructor()
A function which initialises the member variables to default values, so that the problem can be solve...
Definition: DPMBase.cc:208
BoundaryVTKWriter boundaryVTKWriter_
Definition: DPMBase.h:1371

References constructor().

◆ DPMBase() [2/2]

DPMBase::DPMBase ( const DPMBase other)

Copy constructor type-2.

A copy constructor which takes a "DPMBase"-type object and creates a "copy" - i.e. creates a new instance of a class possessing the same properties as the original.
The argument "other" is the "original", i.e. the instance to be copied from.

The first set of actions performed, which follow the general form:
[variable] = other.[variable])
simply copy the relevant variables (i.e. information such as particle details, system details, simulation details...) from the original ("other").

The various handlers belonging to the original instance, however, are not directly copied, as this may cause problems (i.e. the handlers would still "point" to the original object, not the copy).
Rather, new handlers are created (e.g. boundaryHandler.setDPMBase(this);), and the contents of the handlers is then passed over (e.g. boundaryHandler = other.boundaryHandler;). For each handler class, the assignment operator = has been overrided to copy the contents, not just the pointer.

Parameters
[in]other
126 {
127  setName(other.getName());
128  runNumber_ = other.runNumber_;
131  gravity_ = other.gravity_;
133 /* xMin_ = other.xMin_;
134  xMax_ = other.xMax_;
135  yMin_ = other.yMin_;
136  yMax_ = other.yMax_;
137  zMin_ = other.zMin_;
138  zMax_ = other.zMax_;*/
139  min_ = other.min_;
140  max_ = other.max_;
142  time_ = other.time_;
143  timeStep_ = other.timeStep_;
145  timeMax_ = other.timeMax_;
146  restartVersion_ = other.restartVersion_; //to read new and old restart data
147  restarted_ = other.restarted_; //to see if it was restarted or not
148  append_ = other.append_;
149  rotation_ = other.rotation_;
150  xBallsColourMode_ = other.xBallsColourMode_; // sets the xballs argument cmode (see xballs.txt)
151  xBallsVectorScale_ = other.xBallsVectorScale_; // sets the xballs argument vscale (see xballs.txt)
152  xBallsScale_ = other.xBallsScale_; // sets the xballs argument scale (see xballs.txt)
153  xBallsAdditionalArguments_ = other.xBallsAdditionalArguments_; // std::string where additional xballs argument can be specified (see xballs.txt)
156 
157 //effectively saying "if there exists a CONTACT_LIST_HGRID, copy it, if not, ignore.
158 #ifdef CONTACT_LIST_HGRID
159 possibleContactList=other.possibleContactList;
160 #endif
161  random = other.random;
162 
167  wallHandler.setDPMBase(this);
170  //Initialise the handlers
173 
174  //setting contents equal to the other handlers!
177  cgHandler = other.cgHandler;
178  //cgHandler = other.cgHandler.copy(); //todo
179  //cgHandler.setDPMBase(this);
180  wallHandler = other.wallHandler;
183  vtkWriter_ = other.vtkWriter_;
187 }
void setDPMBase(DPMBase *DPMBase)
Sets the problem that is solved using this handler.
Definition: BaseHandler.h:718
ParticleVtkWriter * vtkWriter_
Definition: DPMBase.h:1365
Vec3D max_
Definition: DPMBase.h:1311
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
Vec3D min_
These vectors are used for the XBalls domain, and occasionally people use it to add walls.
Definition: DPMBase.h:1310
int xBallsColourMode_
XBalls is a package to view the particle data. As an alternative MercuryDPM also supports ParaView....
Definition: DPMBase.h:1381
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
unsigned int systemDimensions_
The dimensions of the simulation i.e. 2D or 3D.
Definition: DPMBase.h:1284
std::vector< unsigned > numberOfDomains_
Vector containing the number of domains in x-,y- and z-direction, required for parallel computations.
Definition: DPMBase.h:1305
PeriodicBoundaryHandler periodicBoundaryHandler
Internal handler that deals with periodic boundaries, especially in a parallel build.
Definition: DPMBase.h:1457
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
int numberOfOMPThreads_
Definition: DPMBase.h:1279
Mdouble timeMax_
Stores the duration of the simulation.
Definition: DPMBase.h:1331
int runNumber_
This stores the run number for saving.
Definition: DPMBase.h:1401
bool restarted_
A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run an...
Definition: DPMBase.h:1343
Mdouble xBallsScale_
sets the xballs argument scale (see XBalls/xballs.txt)
Definition: DPMBase.h:1391
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
Mdouble backgroundDrag_
This is a global background drag to help retard particles, or to do a simple fluid drag....
Definition: DPMBase.h:1300
Mdouble xBallsVectorScale_
sets the xballs argument vscale (see XBalls/xballs.txt)
Definition: DPMBase.h:1386
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
std::string restartVersion_
Previous versions of MercuryDPM had a different restart file format, the below member variable allows...
Definition: DPMBase.h:1338
bool writeParticlesVTK_
A flag to turn on/off the vtk writer for particles.
Definition: DPMBase.h:1361
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
bool rotation_
A flag to turn on/off particle rotation. true will enable particle rotation. false will disable parti...
Definition: DPMBase.h:1356
DomainHandler domainHandler
An object of the class DomainHandler which deals with parallel code.
Definition: DPMBase.h:1462
bool readSpeciesFromDataFile_
Determines if the last column of the data file is interpreted as the info parameter during restart.
Definition: DPMBase.h:1416
bool writeSuperquadricParticlesVTK_
Definition: DPMBase.h:1363
std::string xBallsAdditionalArguments_
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt)....
Definition: DPMBase.h:1396
bool append_
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example.
Definition: DPMBase.h:1349
Mdouble timeStep_
Stores the simulation time step.
Definition: DPMBase.h:1326
Vec3D gravity_
Gravity vector.
Definition: DPMBase.h:1294
unsigned int numberOfTimeSteps_
Stores the number of time steps.
Definition: DPMBase.h:1321
unsigned int particleDimensions_
determines if 2D or 3D particle volume is used for mass calculations
Definition: DPMBase.h:1289
Mdouble time_
Stores the current simulation time.
Definition: DPMBase.h:1316
void initialise()
Definition: DomainHandler.cc:434
void initialise()
Initialises the communication list vectors as they can not be determined on compile time.
Definition: PeriodicBoundaryHandler.cc:1787

References append_, backgroundDrag_, boundaryHandler, cgHandler, domainHandler, getName(), gravity_, DomainHandler::initialise(), PeriodicBoundaryHandler::initialise(), interactionHandler, max_, min_, numberOfDomains_, numberOfOMPThreads_, numberOfTimeSteps_, particleDimensions_, particleHandler, periodicBoundaryHandler, random, readSpeciesFromDataFile_, restarted_, restartVersion_, rotation_, runNumber_, BaseHandler< T >::setDPMBase(), setName(), speciesHandler, systemDimensions_, time_, timeMax_, timeStep_, vtkWriter_, wallHandler, writeParticlesVTK_, writeSuperquadricParticlesVTK_, xBallsAdditionalArguments_, xBallsColourMode_, xBallsScale_, and xBallsVectorScale_.

◆ ~DPMBase()

DPMBase::~DPMBase ( )
virtual

virtual destructor

A simple destructor for "DPMBase"-type objects, used to free-up memory when an object is no longer necessary.

298 {
299 delete vtkWriter_;
300 }

References vtkWriter_.

Member Function Documentation

◆ actionsAfterSolve()

void DPMBase::actionsAfterSolve ( )
protectedvirtual

◆ actionsAfterTimeStep()

◆ actionsBeforeTimeLoop()

void DPMBase::actionsBeforeTimeLoop ( )
protectedvirtual

A virtual function. Allows one to carry out any operations before the start of the time loop.

no implementation but can be overriden in its derived classes.

Reimplemented in SphericalIndenter, Slide, statistics_while_running< T >, ParameterStudy3DDemo, ParameterStudy2DDemo, ParameterStudy1DDemo, GranularJet, and GranularJet.

1670 {
1671 }

Referenced by initialiseSolve().

◆ actionsBeforeTimeStep()

◆ actionsOnRestart()

void DPMBase::actionsOnRestart ( )
protectedvirtual

A virtual function where the users can add extra code which is executed only when the code is restarted.

no implementation but can be overidden in its derived classes.

Reimplemented in BaseCluster, FreeFall, DrumRot, Chutebelt, ChuteRestartDemo, and AirySavageHutter.

1684 {
1685 }

Referenced by initialiseSolve().

◆ areInContact()

bool DPMBase::areInContact ( const BaseParticle pI,
const BaseParticle pJ 
)
static

Checks if two particle are in contact or is there any positive overlap.

Determines whether two particles are distinct and in contact by comparing the separation of their centres to their (interaction) radii.

Firstly, checks if the two particles are different (if pI == pJ, the result is "false"). Secondly, if the two particles are distinct, finds the distance between the two particles' centres (getDistanceSquared(pI->getPosition(), pJ->getPosition()))) and tests whether the separation of the particles is less than the sum of their radii (pI->getInteractionRadius() + pJ->getInteractionRadius()). If so, the bool returns "true", i.e. the particles are in contact.

Parameters
[in]pIA pointer to a particle
[in]pJA pointer to a second particle
Returns
bool (True or False) - lets the user know whether two particles are in contact
1662 {
1663  return (pI != pJ && pI->isInContactWith(pJ));
1664 }
virtual bool isInContactWith(const BaseParticle *P) const
Get whether or not this particle is in contact with the given particle.
Definition: BaseParticle.cc:865

References BaseParticle::isInContactWith().

Referenced by Mercury2D::hGridFindParticleContacts(), Mercury3D::hGridFindParticleContacts(), Mercury3D::hGridHasContactsInTargetCell(), and Mercury2D::hGridHasContactsInTargetCell().

◆ autoNumber()

void DPMBase::autoNumber ( )

The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incrementRunNumberInFile().

Using the three functions named above, the autoNumber() function acts to:

1) Use the readRunNumberFromFile() function toead the current run number from the file COUNTER_DONOTDEL created by any script which utilises auto-numbering.

2) Set the runNumber_ counter to the value obtained from the above using the setRunNumber() function.

3) Increment the value stored in the COUNTER_DONOTDEL file by one once the current value has been read using the incrementRunNumberInFile() function.

540 {
542 
543 if (!getRestarted())
544 {
546 }
547 }
static void incrementRunNumberInFile()
Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store...
Definition: DPMBase.cc:628
bool getRestarted() const
Returns the flag denoting if the simulation was restarted or not.
Definition: DPMBase.cc:1493
void setRunNumber(int runNumber)
This sets the counter/Run number, overriding the defaults.
Definition: DPMBase.cc:606
static int readRunNumberFromFile()
Read the run number or the counter from the counter file (COUNTER_DONOTDEL)
Definition: DPMBase.cc:553

References getRestarted(), incrementRunNumberInFile(), readRunNumberFromFile(), and setRunNumber().

Referenced by main(), readNextArgument(), and ChutePeriodic::setup().

◆ checkAndDuplicatePeriodicParticles()

void DPMBase::checkAndDuplicatePeriodicParticles ( )
protected

For simulations using periodic boundaries, checks and adds particles when necessary into the particle handler. See DPMBase.cc and PeriodicBoundary.cc for more details.

For all particles in the system, checks their proximity to all periodic boundaries. If a particle is found to be near a periodic boundary, creates and adds a periodic ("ghost") particle.

5030 {
5031  //Looping over all boundaries in the boundaryHandler
5032  for (BaseBoundary* boundary : boundaryHandler)
5033  {
5034  //Calls the createPeriodicParticles() function which checks if a particle is adequately
5035  //close to a periodic particle that a periodic (ghost) particle should be created and,
5036  //if so, creates one and adds it to the system (hence the necessity to keep "N" variable).
5037  //
5038  // (The loop is over all boundaries, but if a boundary is not a PeriodicBoundary, then
5039  // this does nothing.)
5040  boundary->createPeriodicParticles(particleHandler);
5041  }
5042 
5043  // OMP parallelism
5044  /*#pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
5045  for (int k = 0; k < boundaryHandler.getNumberOfObjects(); k++)
5046  {
5047  //Calls the createPeriodicParticles() function which checks if a particle is adequately
5048  //close to a periodic particle that a periodic (ghost) particle should be created and,
5049  //if so, creates one and adds it to the system (hence the necessity to keep "N" variable).
5050  //
5051  // (The loop is over all boundaries, but if a boundary is not a PeriodicBoundary, then
5052  // this does nothing.)
5053 
5054  BaseBoundary* boundary = boundaryHandler.getObject(k);
5055  #pragma omp critical
5056  boundary->createPeriodicParticles(particleHandler);
5057  }*/
5058 }
Definition: BaseBoundary.h:49

References boundaryHandler, and particleHandler.

Referenced by SilbertPeriodic::add_flow_particles(), computeOneTimeStep(), and initialiseSolve().

◆ checkInteractionWithBoundaries()

void DPMBase::checkInteractionWithBoundaries ( )
protectedvirtual

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.

For each boundary, checks whether each particle in the system has "passed" it and performs an action according to the type of boundary involved.

For instance, if the boundary is a periodic boundary, the periodic boundary version of "checkBoundaryAfterParticleMoved" will be called ( PeriodicBoundary::checkBoundaryAfterParticleMoved()) and in turn apply the shiftPosition() function to the particle. If the boundary is a deletion boundary ( DeletionBoundary::checkBoundaryAfterParticleMoved ()), any particle passing the boundary will be deleted. Further details can be seen in the in-code comments below.

3264 {
3265 
3266  //Cycling over all boundaries within the system...
3267  for (BaseBoundary* b : boundaryHandler)
3268  {
3269  //check all boundaries...
3270  b->checkBoundaryAfterParticlesMove(particleHandler);
3271 
3272 
3273 #ifdef MERCURYDPM_USE_MPI
3274  //When ghost particles are deleted by deletion boundaries they need to be removed
3275  //from their communication lists to avoid segfaults
3276  if (NUMBER_OF_PROCESSORS > 1)
3277  {
3278  //Flush deleted particles from mpi communication zones
3279  getCurrentDomain()->flushParticles(b->getParticlesToBeDeleted());
3281  periodicBoundaryHandler.flushParticles(b->getParticlesToBeDeleted());
3283  }
3284 
3285  //Delete particles that were in communication zone
3286  for (auto p_it = b->getParticlesToBeDeleted().begin(); p_it != b->getParticlesToBeDeleted().end(); p_it++)
3287  {
3288  particleHandler.removeGhostObject((*p_it)->getIndex());
3289  }
3290 #endif
3291  }
3292 }
#define NUMBER_OF_PROCESSORS
For the MPI communication routines this quantity is often required. defining this macro makes the cod...
Definition: GeneralDefine.h:62
Domain * getCurrentDomain()
Function that returns a pointer to the domain corresponding to the processor.
Definition: DPMBase.cc:5289
void cleanCommunicationLists()
Removes nullptrs from boundaryParticleList_ and boundaryParticleListNeighbour_.
Definition: Domain.cc:1742
void flushParticles(std::set< BaseParticle * > &toBeDeletedList)
Particles that are going to be deleted from the simulation are flushed out of the communication bound...
Definition: Domain.cc:1698
void removeGhostObject(unsigned int index)
Removes a BaseParticle from the ParticleHandler without a global check, this is only to be done for m...
Definition: ParticleHandler.cc:422
void cleanCommunicationLists()
Definition: PeriodicBoundaryHandler.cc:1772
void flushParticles(std::set< BaseParticle * > &particlesToBeFlushed)
Removes particles from the periodiocParticleList_ and periociGhostList_.
Definition: PeriodicBoundaryHandler.cc:1705

References boundaryHandler, Domain::cleanCommunicationLists(), PeriodicBoundaryHandler::cleanCommunicationLists(), PeriodicBoundaryHandler::flushParticles(), Domain::flushParticles(), getCurrentDomain(), NUMBER_OF_PROCESSORS, particleHandler, periodicBoundaryHandler, and ParticleHandler::removeGhostObject().

Referenced by computeOneTimeStep().

◆ checkParticleForInteraction()

bool DPMBase::checkParticleForInteraction ( const BaseParticle p)
virtual

Checks whether a particle P has any interaction with walls or other particles.

A very useful feature. For example, when one wants to have an initial condition with particles free of interactions with other particles or walls, one could use this to see if a particle about to be inserted would have interactions. If yes, then the particle would not be considered for insertion.

However can prove expensive if the number of particles is large.

Parameters
[in]pThe particle for which one wants to detect collisions (or the lack thereof).
Returns
true if and only if there are no interactions with other particles or walls.

Reimplemented in MercuryBase.

4806 {
4807 #ifdef MERCURYDPM_USE_MPI
4808  if (NUMBER_OF_PROCESSORS == 1)
4809  {
4811  }
4812 
4813  int localInteraction = checkParticleForInteractionLocal(p);
4814  //The root gathers all values and computes the global value
4815  int *interactionList = nullptr;
4816  if (PROCESSOR_ID == 0)
4817  {
4818  interactionList = new int [NUMBER_OF_PROCESSORS];
4819  }
4820 
4821  //Gather all local values
4822  MPIContainer::Instance().gather(localInteraction,interactionList);
4823 
4824  //Compute the global value
4825  int globalInteraction = 1;
4826  if (PROCESSOR_ID == 0)
4827  {
4828  for (int i = 0; i < NUMBER_OF_PROCESSORS; i++)
4829  {
4830  if (interactionList[i] == 0)
4831  {
4832  globalInteraction = 0;
4833  break;
4834  }
4835  }
4836  }
4837  //The root now tells the other processors what the global value for the interaction is
4838  MPIContainer::Instance().broadcast(globalInteraction);
4839 
4840  //Convert the result back to bool
4841  bool interaction = globalInteraction;
4842 #else
4843  bool interaction = checkParticleForInteractionLocalPeriodic(p);
4844 #endif
4845  return interaction;
4846 }
#define PROCESSOR_ID
Definition: GeneralDefine.h:63
virtual bool checkParticleForInteractionLocal(const BaseParticle &P)
Checks if a particle P has any interaction with walls or other particles in the local domain.
Definition: DPMBase.cc:4904
bool checkParticleForInteractionLocalPeriodic(const BaseParticle &P)
Definition: DPMBase.cc:4854
std::enable_if< std::is_scalar< T >::value, void >::type broadcast(T &t, int fromProcessor=0)
Broadcasts a scalar from the root to all other processors.
Definition: MpiContainer.h:441
void gather(T &send_t, T *receive_t)
Gathers a scaler from all processors to a vector of scalars on the root.
Definition: MpiContainer.h:428
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51

References MPIContainer::broadcast(), checkParticleForInteractionLocal(), checkParticleForInteractionLocalPeriodic(), MPIContainer::gather(), constants::i, MPIContainer::Instance(), NUMBER_OF_PROCESSORS, and PROCESSOR_ID.

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

◆ checkParticleForInteractionLocal()

bool DPMBase::checkParticleForInteractionLocal ( const BaseParticle p)
virtual

Checks if a particle P has any interaction with walls or other particles in the local domain.

A very useful feature. For example, when one wants to have an initial condition with particles free of interactions with other particles or walls, one could use this method and whether particles are interacting. If yes, then it would not consider this particle for insertion and continue onto the next particle. However can prove expensive if the number of particles is large.

Returns true if and only if there are no interactions with other particles in the local domain or walls.

Parameters
[in]pThe particle for which one wants to detect collisions (or the lack thereof).
Returns
bool - true if particle P has no interactions, false if P has one or more interactions with other particles or walls.
Todo:
tw check against periodic copies (see ShearCell3DInitialConditions.cpp)

Reimplemented in MercuryBase.

4905 {
4906  Mdouble distance;
4907  Vec3D normal;
4908 
4909  //Check if it has no collision with walls
4910  for (BaseWall* w : wallHandler)
4911  {
4912  //returns false if the function getDistanceAndNormal returns true,
4913  //i.e. if there exists an interaction between wall and particle
4914  //\todo TW getDistanceAndNormal(p,distance,normal) should ideally be replaced by a inContact(p) function, as it doesn't require distance and normal for anything (and walls now can have multiple contacts, soon particles can have it too.)
4915  if (w->getDistanceAndNormal(p, distance, normal))
4916  {
4917  //std::cout<<"failure: Collision with wall: "<<**it<<std::endl;
4918  return false;
4919  }
4920  else
4921  {
4922  //std::cout<<"No collision with wall: "<<**it<<std::endl;
4923  }
4924  }
4925 
4926  //Check if it has no collision with other particles
4927  for (BaseParticle* q : particleHandler)
4928  {
4929  //returns false if the particle separation is less than the relevant sum of interaction radii
4930  //(i.e. another particle is in contact with P)
4931  if (Vec3D::getDistanceSquared(q->getPosition(), p.getPosition())
4933  {
4934  //std::cout<<"failure: Collision with particle "<<**it<<std::endl;
4935  return false;
4936  }
4937  else
4938  {
4939  //std::cout<<"No collision with particle "<<**it<<std::endl;
4940  }
4941  }
4942  return true;
4944 }
double Mdouble
Definition: GeneralDefine.h:34
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Definition: BaseParticle.h:54
Mdouble getSumOfInteractionRadii(const BaseParticle *particle) const
returns the sum of the radii plus the interactionDistance
Definition: BaseParticle.h:379
Basic class for walls.
Definition: BaseWall.h:49
Definition: Vector.h:51
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Definition: Vector.h:311
T square(const T val)
squares a number
Definition: ExtendedMath.h:106

References Vec3D::getDistanceSquared(), BaseInteractable::getPosition(), BaseParticle::getSumOfInteractionRadii(), particleHandler, mathsFunc::square(), and wallHandler.

Referenced by checkParticleForInteraction(), and checkParticleForInteractionLocalPeriodic().

◆ checkParticleForInteractionLocalPeriodic()

bool DPMBase::checkParticleForInteractionLocalPeriodic ( const BaseParticle p)

Extends the capability of detecting intersecting particles to periodic systems

Todo:
TW the implementation of this function is not very efficient and should be improved
Parameters
p
Returns
4855 {
4856  //A vector of ghost particles of the particle that is to be inserted (empty if no periodic boundaries are present)
4857  std::vector<Vec3D> pPeriodic;
4858  for (BaseBoundary* b : boundaryHandler)
4859  {
4860  PeriodicBoundary* pb = dynamic_cast<PeriodicBoundary*>(b);
4861  if (pb && particleHandler.getNumberOfObjects() > 0 )
4862  {
4864  for (int i = pPeriodic.size() - 1; i >= 0; --i)
4865  {
4866  if (pb->getDistance(pPeriodic[i]) < maxDistance)
4867  {
4868  pPeriodic.push_back(pPeriodic[i]);
4869  pb->shiftPosition(pPeriodic.back());
4870  }
4871  }
4872  if (pb->getDistance(p) < maxDistance)
4873  {
4874  pPeriodic.push_back(p.getPosition());
4875  pb->shiftPosition(pPeriodic.back());
4876  }
4877  }
4878  }
4879  //check the particle AND the ghost particles for intersection problems
4880  bool insertable = checkParticleForInteractionLocal(p);
4881  if (!pPeriodic.empty()) {
4882  BaseParticle* q = p.copy();
4883  for (const Vec3D& pos : pPeriodic) {
4884  q->setPosition(pos);
4885  insertable &= checkParticleForInteractionLocal(*q);
4886  }
4887  delete q;
4888  }
4889  return insertable;
4890 }
virtual void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
unsigned int getNumberOfObjects() const override
Returns the number of objects in the container. In parallel code this practice is forbidden to avoid ...
Definition: ParticleHandler.cc:1325
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
Definition: ParticleHandler.cc:534
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:41
Mdouble getDistance(const BaseParticle &p) const override
Returns the distance of the edge to the particle.
Definition: PeriodicBoundary.cc:197
virtual void shiftPosition(BaseParticle *p) const override
shifts the particle
Definition: PeriodicBoundary.cc:219

References boundaryHandler, checkParticleForInteractionLocal(), BaseParticle::copy(), PeriodicBoundary::getDistance(), ParticleHandler::getLargestParticle(), BaseParticle::getMaxInteractionRadius(), ParticleHandler::getNumberOfObjects(), BaseInteractable::getPosition(), constants::i, particleHandler, BaseInteractable::setPosition(), and PeriodicBoundary::shiftPosition().

Referenced by checkParticleForInteraction(), and MercuryBase::checkParticleForInteraction().

◆ checkSettings()

void DPMBase::checkSettings ( )

Checks if the essentials are set properly to go ahead with solving the problem.

  1. Checks if at least one species exists in the SpeciesHandler.
  2. Checks if the time step is set or not.

    If any of the above checks fail, gives an error message to the user and terminates the program.
4000 {
4001  //check if name is set
4002  logger.assert_always(getName() != "",
4003  "File name not set: use setName()");
4004  //check if time step is set
4005  logger.assert_always(getTimeStep() != 0,
4006  "Time step undefined: use setTimeStep()");
4007  //check if domain is set
4008  logger.assert_always(getXMax() > getXMin(),
4009  "Domain size not set: use setXMin() and setXMax()");
4010  logger.assert_always(getYMax() > getYMin(),
4011  "Domain size not set: use setYMin() and setYMax()");
4012  logger.assert_always(systemDimensions_ == 3 ? (getZMax() > getZMin()) : (getZMax() >= getZMin()),
4013  "Domain size not set: use setZMin() and setZMax()", systemDimensions_);
4014 
4015  //check for species parameters
4016  logger.assert_always(speciesHandler.getNumberOfObjects() > 0,
4017  "No species defined: use speciesHandler.copyAndAddObject()");
4018  for (BaseParticle* p : particleHandler)
4019  {
4020  logger.assert_always(p->getSpecies() != nullptr, "particle % has no species", p->getId());
4021  }
4022  for (BaseWall* w : wallHandler)
4023  {
4024  logger.assert_always(w->getSpecies() != nullptr, "% with index % has no species", w->getName(), w->getId());
4025  }
4026 }
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:648
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644

References getName(), BaseHandler< T >::getNumberOfObjects(), getTimeStep(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), logger, particleHandler, speciesHandler, systemDimensions_, and wallHandler.

Referenced by initialiseSolve().

◆ closeFiles()

void DPMBase::closeFiles ( )

Closes all files (ene, data, fstat, restart, stat) that were opened to read or write.

504 {
505 dataFile.close();
506 fStatFile.close();
508 statFile.close();
509 eneFile.close();
511 }
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
File interactionFile
File class to handle in- and output into .interactions file. This file hold information about interac...
Definition: DPMBase.h:1504
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
File statFile
An instance of class File to handle in- and output into a .stat file.
Definition: DPMBase.h:1498
void close()
Closes the file by calling fstream_.close()
Definition: File.cc:407

References File::close(), dataFile, eneFile, fStatFile, interactionFile, restartFile, and statFile.

Referenced by finaliseSolve(), and Mercury3DRestart::writeOutputFiles().

◆ computeAdditionalForces()

virtual void DPMBase::computeAdditionalForces ( )
inlineprotectedvirtual

A virtual function which allows to define operations to be executed prior to the OMP force collect.

no implementation but can be overidden in its derived classes. This function is called by DPMBase::computeAllForces. It may be used to add additional user defined forces to any MercuryObject. Within this function, OMP parallelization may be used, as it is called prior to sumForceTorqueOMP.

Reimplemented in MembraneSelfTest, and MembraneDemo.

1107 {}

Referenced by computeAllForces().

◆ computeAllForces()

void DPMBase::computeAllForces ( )
protectedvirtual

Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseInteractable::setTorque()

Initially, resets all forces to zero for all particles and all walls. For each particle in turn, the function searches for particle interactions, and computes the relevant internal forces, followed by the relevant external forces (e.g. gravity).

Now loop over all particles contacts computing force contributions

Reimplemented in DPM, and Mercury3Dclump.

3389 {
3390  //Resetting all forces on both particles and walls to zero
3391  #pragma omp parallel num_threads(getNumberOfOMPThreads())
3392  {
3393  #pragma omp for
3394  for (int k = 0; k < particleHandler.getSize(); ++k) {
3396  }
3397  #pragma omp for
3398  for (int k = 0; k < wallHandler.getSize(); k++) {
3400  }
3401  }
3402  logger(DEBUG,"All forces set to zero");
3403 
3404  // for omp simulations, reset the newObjects_ variable (used for reduction)
3406 
3407  // compute all internal and external forces; for omp simulations, this can be done in parallel
3408  #pragma omp parallel num_threads(getNumberOfOMPThreads())
3409  {
3410  //logger(INFO, "Number of omp threads = %", getNumberOfOMPThreads());
3412  #pragma omp for schedule(dynamic)
3413  for (int k = 0; k < particleHandler.getSize(); ++k) {
3415  //computing both internal forces (e.g. due to collisions)
3416  //and external forces (e.g. gravity)
3417  //(compute internal forces compares the current particle p
3418  //with all others in the handler!)
3420  // body forces
3422  }
3423 
3424  // wall-forces
3425  #pragma omp for schedule(dynamic)
3426  for (int k = 0; k < wallHandler.getSize(); k++) {
3427  BaseWall *w = wallHandler.getObject(k);
3428  computeWallForces(w);
3429  w->computeWear();
3430  }
3431 
3432  }
3433 
3434  #ifdef MERCURYDPM_TRIANGLE_WALL_CORRECTION
3435  // This statement deals with interactions of a particle with a group of walls:
3436  // If there are multiple contact forces between the particle and the group of walls, we assume that these contacts share a concave edge or a vertex. Thus, we multiply each force by a weight $w_{\alpha\gamma}=|\vec{f}_{\alpha\gamma}^{\text{w}}|/\sum_\gamma|\vec{f}_{\alpha\gamma}^{\text{w}}|$. Note that these weights add up to 1, thus, the total contact force between the particle and the group of walls will be a weighted average of the individual contact forces.
3437  // A second modification is done in #BaseWall::getInteractionWith
3439  for (BaseParticle *p : particleHandler) {
3440  // find all current interactions between this particle and a TriangleWall
3441  std::vector<BaseInteraction *> wallInters;
3442  double overlapSum = 0.0;
3443  for (const auto i : p->getInteractions()) {
3444  if (i->getI()->getName() == "TriangleWall" && i->getTimeStamp() > getNumberOfTimeSteps()) {
3445  wallInters.push_back(i);
3446  overlapSum += i->getOverlap();
3447  }
3448  }
3449  // if more than one interactions are detected, we have a concave wall interaction problem.
3450  if (wallInters.size() > 1) {
3452  // get the multiple contact points to define the new contact plane, normal, and overlap
3453  for (BaseInteraction *i : wallInters) {
3454  auto q = i->getI();
3455  // undo the force/torque computation from multiple TriangleWalls
3456  p->addForce(-i->getForce());
3457  q->addForce(i->getForce());
3458  if (getRotation()) {
3459  p->addTorque(-i->getTorque() + Vec3D::cross(p->getPosition() - i->getContactPoint(), i->getForce()));
3460  q->addTorque( i->getTorque() - Vec3D::cross(q->getPosition() - i->getContactPoint(), i->getForce()));
3461  }
3462  // reset the forces
3463  double w = i->getOverlap() / overlapSum;
3464  i->setContactPoint(p->getPosition() - (p->getRadius() - 0.5 * i->getOverlap()) * w * i->getNormal());
3465  i->setForce(i->getForce() * w);
3466  i->setTorque(i->getTorque() * w);
3467  // applies the reset forces to the particle and the wall
3468  p->addForce(i->getForce());
3469  q->addForce(-i->getForce());
3470  if (getRotation()) {
3471  p->addTorque( i->getTorque() - Vec3D::cross(p->getPosition() - i->getContactPoint(), i->getForce()));
3472  q->addTorque(-i->getTorque() + Vec3D::cross(q->getPosition() - i->getContactPoint(), i->getForce()));
3473  }
3474  }
3475  }
3476  }
3477  #endif
3478 
3479 #ifdef CONTACT_LIST_HGRID
3480  PossibleContact* Curr=possibleContactList.getFirstPossibleContact();
3481  while(Curr)
3482  {
3483  computeInternalForces(Curr->getP1(),Curr->getP2());
3484  Curr=Curr->getNext();
3485  }
3486 #endif
3487 
3488  // Check wall forces
3489  #pragma omp for schedule(dynamic)
3490  for (int k = 0; k < wallHandler.getNumberOfObjects(); k++) {
3491  BaseWall *w = wallHandler.getObject(k);
3493  }
3494 
3496 
3497  // for omp simulations, sum up all forces and add all newObjects_ (needed since both are using reduction)
3498  #ifdef MERCURYDPM_USE_OMP
3499  if (getNumberOfOMPThreads()>1) {
3501  }
3502  //Resetting all forces on both particles and walls to zero
3503  #pragma omp parallel num_threads(getNumberOfOMPThreads())
3504  {
3505  #pragma omp for
3506  for (int k = 0; k < particleHandler.getSize(); k++) {
3508  }
3509  #pragma omp for
3510  for (int k = 0; k < wallHandler.getSize(); k++) {
3512  } //end reset forces loop
3513  }
3514  #endif
3515 
3516  //end outer loop over contacts.
3517 }
@ DEBUG
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
void sumForceTorqueOMP()
Definition: BaseInteractable.cc:162
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
Definition: BaseInteractable.cc:132
virtual void resetForceTorque(int numberOfOMPthreads)
Definition: BaseInteractable.cc:141
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
Definition: BaseInteractable.h:277
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
Definition: BaseInteractable.cc:116
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
virtual void checkInteractions(InteractionHandler *interactionHandler, unsigned int timeStamp)
Check if all interactions are valid.
Definition: BaseWall.h:220
virtual void computeWear()
Definition: BaseWall.h:248
int getNumberOfOMPThreads() const
Definition: DPMBase.cc:1286
virtual void computeWallForces(BaseWall *w)
Definition: DPMBase.cc:5427
unsigned int getNumberOfTimeSteps() const
Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has unde...
Definition: DPMBase.cc:824
virtual void computeInternalForces(BaseParticle *)
Computes the internal forces on particle i (internal in the sense that the sum over all these forces ...
Definition: DPMBase.cc:3525
virtual void computeAdditionalForces()
A virtual function which allows to define operations to be executed prior to the OMP force collect.
Definition: DPMBase.h:1107
virtual void computeExternalForces(BaseParticle *)
Computes the external forces, such as gravity, acting on particles.
Definition: DPMBase.cc:3159
bool getRotation() const
Indicates whether particle rotation is enabled or disabled.
Definition: DPMBase.h:570
void resetNewObjectsOMP()
Definition: InteractionHandler.cc:122
void addNewObjectsOMP()
Definition: InteractionHandler.cc:129
Class that describes a possible contact between two BaseParticle.
Definition: PossibleContact.h:42
BaseParticle * getP2()
Gets a pointer to the second BaseParticle in this PossibleContact.
Definition: PossibleContact.h:139
PossibleContact * getNext()
Gets the next PossibleContact in the general linked list of PossibleContact.
Definition: PossibleContact.h:167
BaseParticle * getP1()
Gets a pointer to the first BaseParticle in this PossibleContact.
Definition: PossibleContact.h:130
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163

References InteractionHandler::addNewObjectsOMP(), BaseWall::checkInteractions(), computeAdditionalForces(), computeExternalForces(), computeInternalForces(), computeWallForces(), BaseWall::computeWear(), Vec3D::cross(), DEBUG, PossibleContact::getNext(), BaseHandler< T >::getNumberOfObjects(), getNumberOfOMPThreads(), getNumberOfTimeSteps(), BaseHandler< T >::getObject(), PossibleContact::getP1(), PossibleContact::getP2(), getRotation(), BaseHandler< T >::getSize(), constants::i, interactionHandler, logger, particleHandler, BaseInteractable::resetForceTorque(), InteractionHandler::resetNewObjectsOMP(), BaseInteractable::sumForceTorqueOMP(), and wallHandler.

Referenced by DPM::computeAllForces(), computeOneTimeStep(), initialiseSolve(), and ExtremeOverlapVolumeUnitTest::setupInitialConditions().

◆ computeExternalForces()

void DPMBase::computeExternalForces ( BaseParticle CI)
protectedvirtual

Computes the external forces, such as gravity, acting on particles.

By default we have gravity and background drag as the external forces

Parameters
[in]CIThe BaseParticle object to which the relevant external forces are applied.

Reimplemented in ScaleCoupling< Mercury3D, SolidProblem< ScaleCoupledElement< ELEMENT > > >, AngledPeriodicBoundarySecondUnitTest, SphericalIndenter, my_problem, my_problem, PeriodicWalls, and Contact.

3160 {
3161  //Checks that the current particle is not "fixed"
3162  //and hence infinitely massive!
3163  if ((!CI->isFixed()) && (!CI->isPebble()))
3164  {
3165  // Applying the force due to gravity (F = m.g) Do not apply gravity to slave particles
3166  CI->addForce(getGravity() * CI->getMass()-getBackgroundDrag()*CI->getVelocity());
3167  // Still calls this in compute External Forces.
3168  // computeForcesDueToWalls(CI);
3169  }
3170 }
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:329
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
bool isPebble() const
Checks if particle is a pebble (belongs to a clump)
Definition: BaseParticle.h:673
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
const Mdouble getBackgroundDrag() const
Return the background drag.
Definition: DPMBase.h:812
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1391

References BaseInteractable::addForce(), getBackgroundDrag(), getGravity(), BaseParticle::getMass(), BaseInteractable::getVelocity(), BaseParticle::isFixed(), and BaseParticle::isPebble().

Referenced by computeAllForces(), Mercury3Dclump::computeAllForces(), DPM::computeAllForcesNoHGrid(), Contact::computeExternalForces(), and SphericalIndenter::computeExternalForces().

◆ computeForcesDueToWalls()

void DPMBase::computeForcesDueToWalls ( BaseParticle pI,
BaseWall w 
)
protectedvirtual

Computes the forces on the particles due to the walls (normals are outward normals)

Checks if a particle pI is currently in contact - i.e. interacting - with any of the walls within the system using the BaseParticle::getInteractionWith() function. If an interaction is detected, computes the force acting between particle and wall and applies the relevant torques and forces to both particle and wall(s).

Parameters
[in]pIThe BaseParticle object to which the wall forces are applied.
Todo:
TW: I think this torque has the wrong sign

Reimplemented in Mercury3Dclump.

3180 {
3181 
3182  //No need to compute interactions between periodic particle images and walls
3183  if (pI->getPeriodicFromParticle() != nullptr)
3184  return;
3185 
3186  //Checks if the particle is interacting with the current wall
3189  if (i!=nullptr) {
3190  //...calculates the forces between the two objects...
3191  i->computeForce();
3192 
3193  //...and applies them to each of the two objects (wall and particle).
3194  pI->addForce(i->getForce());
3195  w->addForce(-i->getForce());
3196 
3197  //If the rotation flag is on, also applies the relevant torques
3198  //(getRotation() returns a boolean).
3199  if (getRotation()) // getRotation() returns a boolean.
3200  {
3201  pI->addTorque(i->getTorque() - Vec3D::cross(pI->getPosition() - i->getContactPoint(), i->getForce()));
3203  w->addTorque(-i->getTorque() + Vec3D::cross(w->getPosition() - i->getContactPoint(), i->getForce()));
3204  }
3205  }
3206 }
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Returns the interaction between this wall and a given particle, nullptr if there is no interaction.
Definition: BaseWall.cc:367

References BaseInteractable::addForce(), BaseInteractable::addTorque(), Vec3D::cross(), BaseWall::getInteractionWith(), getNumberOfTimeSteps(), BaseParticle::getPeriodicFromParticle(), BaseInteractable::getPosition(), getRotation(), constants::i, and interactionHandler.

Referenced by DPM::computeAllForcesNoHGrid(), computeWallForces(), Mercury3D::computeWallForces(), and ArcWallUnitTest::setupInitialConditions().

◆ computeInternalForce()

void DPMBase::computeInternalForce ( BaseParticle P1,
BaseParticle P2 
)
protectedvirtual

Computes the forces between two particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces)

Firstly, checks the types of particles involved in order to ensure that only viable interactions are counted.

Secondly, if the particle combination is viable, checks if the particles are interacting.

Finally, if the particles are found to be interacting, calculates the relevant forces (as well as torques, if the "rotation" flag is turned "on") acting between the particles, and applies them to each particle.

Parameters
[in]P1
[in]P2

Reimplemented in Mercury3Dclump.

3105 {
3106  //Does not compute forces if particles are fixed
3107  //this is necessary because the rough bottom allows overlapping fixed particles
3108  if (P1->isFixed() && P2->isFixed())
3109  {
3110  return;
3111  }
3112 //Ensures that interactions between the "ghost" particles used to implement periodic behaviour
3113  //are not included in calculations
3114  //i.e. ends the function if both particles are "ghosts".
3115  if ((P1->getPeriodicFromParticle() != nullptr) && (P2->getPeriodicFromParticle() != nullptr))
3116  {
3117  return;
3118  }
3119 //if statement below ensures that the PI has the lower id than PJ
3120  BaseParticle* PI, * PJ;
3121  if (P1->getId() > P2->getId())
3122  {
3123  PI = P2;
3124  PJ = P1;
3125  }
3126  else
3127  {
3128  PI = P1;
3129  PJ = P2;
3130  }
3131  //checks if the two particles are interacting
3132  //("getInteractionWith" returns the relevant pointer if PI and PJ are interacting,
3133  //zero if not)
3134  //if statement above ensures that the PI has the lower id than PJ
3137  if (i!= nullptr) {
3138  //calculates the force corresponding to the interaction
3139  i->computeForce();
3140 
3141  //Applies the relevant calculated forces to PI and PJ
3142  PI->addForce(i->getForce());
3143  PJ->addForce(-i->getForce());
3144 
3145  //checks if particle rotation is turned on...
3146  if (getRotation()) {
3147  //...and, if so, performs equivalent calculations for the torque as were
3148  //performed for the force.
3149  PI->addTorque(i->getTorque() - Vec3D::cross(PI->getPosition() - i->getContactPoint(), i->getForce()));
3150  PJ->addTorque(-i->getTorque() + Vec3D::cross(PJ->getPosition() - i->getContactPoint(), i->getForce()));
3151  }
3152  }
3153 }
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
BaseInteraction * getInteractionWith(BaseParticle *P, unsigned timeStamp, InteractionHandler *interactionHandler) override
Checks if particle is in interaction with given particle P, and if so, returns vector of pointer to t...
Definition: BaseParticle.cc:690

References BaseInteractable::addForce(), BaseInteractable::addTorque(), Vec3D::cross(), BaseObject::getId(), BaseParticle::getInteractionWith(), getNumberOfTimeSteps(), BaseParticle::getPeriodicFromParticle(), BaseInteractable::getPosition(), getRotation(), constants::i, interactionHandler, and BaseParticle::isFixed().

Referenced by DPM::computeAllForcesNoHGrid(), SphericalIndenter::computeExternalForces(), computeInternalForces(), Mercury3D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithinTargetCell(), Mercury3D::hGridFindContactsWithTargetCell(), and Mercury2D::hGridFindContactsWithTargetCell().

◆ computeInternalForces()

void DPMBase::computeInternalForces ( BaseParticle i)
protectedvirtual

Computes the internal forces on particle i (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces)

Taking a single BaseParticle object as an argument, passes it to the broadPhase() function which then loops over all other particles in the particleHandler and computes the relevant forces for any particle pairing found to be in contact.

Parameters
[in]iA BaseParticle object for which we want to calculate the internal forces.

Reimplemented in Mercury3D, Mercury2D, my_problem_HGRID, and my_problem.

3526 {
3527  for (auto it = particleHandler.begin(); (*it) != i; ++it)
3528  {
3529  computeInternalForce(i, *it);
3530  }
3531 }
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
virtual void computeInternalForce(BaseParticle *, BaseParticle *)
Computes the forces between two particles (internal in the sense that the sum over all these forces i...
Definition: DPMBase.cc:3104

References BaseHandler< T >::begin(), computeInternalForce(), constants::i, and particleHandler.

Referenced by computeAllForces().

◆ computeOneTimeStep()

void DPMBase::computeOneTimeStep ( )
virtual

Performs everything needed for one time step, used in the time-loop of solve().

Todo:
IFCD @AT, TW: please check what should be in here, and whether it should be virtual or not.

Performs one time step in the time loop, including updating the time. It is made public, since this makes coupling multiple DPM simulations easier in the future.

Todo:
MX: this is not true anymore. all boundaries are handled here. particles have received a position update, so here the deletion boundary deletes particles \TODO add particles need a periodic check
Bug:
{In chute particles are added in actions_before_time_set(), however they are not written to the xballs data yet, but can have a collision and be written to the fstat data}
4306 {
4307  logger(DEBUG, "starting computeOneTimeStep()");
4308 
4309  logger(DEBUG, "about to call writeOutputFiles()");
4310  writeOutputFiles(); //everything is written at the beginning of the time step!
4311 
4312  logger(DEBUG, "about to call hGridActionsBeforeIntegration()");
4314 
4315  //Computes the half-time step velocity and full time step position and updates the particles accordingly
4316  logger(DEBUG, "about to call integrateBeforeForceComputation()");
4317 
4319  //New positions require the MPI and parallel periodic boundaries to do things
4320  logger(DEBUG, "about to call performGhostParticleUpdate()");
4322  // Some walls need to be aware of the new positions
4324 
4328 
4329  logger(DEBUG, "about to call checkInteractionWithBoundaries()");
4330  checkInteractionWithBoundaries(); // INSERTION boundaries handled
4331 
4332  logger(DEBUG, "about to call hGridActionsAfterIntegration()");
4334 
4335  // Compute forces
4337  // INSERTION/DELETION boundary flag change
4338  for (BaseBoundary* b : boundaryHandler)
4339  {
4340  b->checkBoundaryBeforeTimeStep(this);
4341  }
4342 
4343  logger(DEBUG, "about to call actionsBeforeTimeStep()");
4345 
4346  logger(DEBUG, "about to call checkAndDuplicatePeriodicParticles()");
4348 
4349  logger(DEBUG, "about to call hGridActionsBeforeTimeStep()");
4351 
4352  //Creates and updates interactions and computes forces based on these
4353  logger(DEBUG, "about to call computeAllForces()");
4354  computeAllForces();
4355 
4356  logger(DEBUG, "about to call removeDuplicatePeriodicParticles()");
4358 
4359  logger(DEBUG, "about to call actionsAfterTimeStep()");
4361 
4362  //Computes new velocities and updates the particles accordingly
4363  logger(DEBUG, "about to call integrateAfterForceComputation()");
4365 
4366  //erase interactions that have not been used during the last time step
4367  //logger(DEBUG, "about to call interactionHandler.eraseOldInteractions(getNumberOfTimeSteps())");
4369  logger(DEBUG, "about to call interactionHandler.actionsAfterTimeStep()");
4372 
4373  time_ += timeStep_;
4375 
4376  logger(DEBUG, "finished computeOneTimeStep()");
4377 }
virtual void writeOutputFiles()
Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and ....
Definition: DPMBase.cc:4049
virtual void integrateAfterForceComputation()
Update particles' and walls' positions and velocities after force computation.
Definition: DPMBase.cc:3305
void removeDuplicatePeriodicParticles()
Removes periodic duplicate Particles.
Definition: DPMBase.cc:4986
virtual void hGridActionsBeforeIntegration()
This function has to be called before integrateBeforeForceComputation.
Definition: DPMBase.cc:1940
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: DPMBase.cc:1864
virtual void checkInteractionWithBoundaries()
There are a range of boundaries one could implement depending on ones' problem. This methods checks f...
Definition: DPMBase.cc:3263
virtual void computeAllForces()
Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseIntera...
Definition: DPMBase.cc:3388
virtual void hGridActionsAfterIntegration()
This function has to be called after integrateBeforeForceComputation.
Definition: DPMBase.cc:1947
void checkAndDuplicatePeriodicParticles()
For simulations using periodic boundaries, checks and adds particles when necessary into the particle...
Definition: DPMBase.cc:5029
virtual void integrateBeforeForceComputation()
Update particles' and walls' positions and velocities before force computation.
Definition: DPMBase.cc:3219
void performGhostParticleUpdate()
When the Verlet scheme updates the positions and velocities of particles, ghost particles will need a...
Definition: DPMBase.cc:5063
virtual void hGridActionsBeforeTimeStep()
A virtual function that allows one to set or execute hGrid parameters or operations before every simu...
Definition: DPMBase.cc:1690
virtual void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
Definition: DPMBase.cc:1878
void actionsAfterTimeStep()
Definition: InteractionHandler.cc:395
void eraseOldInteractions(unsigned)
erases interactions which have an old timestamp.
Definition: InteractionHandler.cc:377
void actionsAfterTimeStep()
Definition: ParticleHandler.cc:1372
void actionsAfterParticleGhostUpdate()
Calls the method actionsAfterParticleGhostUpdate of every wall in the handler.
Definition: WallHandler.cc:458

References WallHandler::actionsAfterParticleGhostUpdate(), actionsAfterTimeStep(), InteractionHandler::actionsAfterTimeStep(), ParticleHandler::actionsAfterTimeStep(), actionsBeforeTimeStep(), boundaryHandler, checkAndDuplicatePeriodicParticles(), checkInteractionWithBoundaries(), computeAllForces(), DEBUG, InteractionHandler::eraseOldInteractions(), getNumberOfTimeSteps(), hGridActionsAfterIntegration(), hGridActionsBeforeIntegration(), hGridActionsBeforeTimeStep(), integrateAfterForceComputation(), integrateBeforeForceComputation(), interactionHandler, logger, numberOfTimeSteps_, particleHandler, performGhostParticleUpdate(), removeDuplicatePeriodicParticles(), time_, timeStep_, wallHandler, and writeOutputFiles().

Referenced by solve().

◆ computeWallForces()

void DPMBase::computeWallForces ( BaseWall w)
virtual

Reimplemented in Mercury3D.

5428 {
5429  //compute forces for all particles that are neither fixed or ghosts
5430  for (auto p : particleHandler)
5431  {
5432  if (!p->isFixed() && p->getPeriodicFromParticle() == nullptr)
5433  {
5434  //w->computeForces(p);
5436  }
5437  }
5438 }
virtual void computeForcesDueToWalls(BaseParticle *, BaseWall *)
Computes the forces on the particles due to the walls (normals are outward normals)
Definition: DPMBase.cc:3179

References computeForcesDueToWalls(), and particleHandler.

Referenced by computeAllForces(), and Mercury3D::computeWallForces().

◆ constructor()

void DPMBase::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().

A simple vector of vectors for collecting and ordering interactions in the OpenMP parallel environment

Provides all the necessary default values for the DPMBase() constructor. When called, will initialise a two-dimensional simulation (setSystemDimensions(2), setParticleDimensions(2)) with "normal" vertical gravity (gravity_ = Vec3D(0.0, -9.8, 0.0);) as well as defining an arbitrary length (1s) and XBalls viewing domain (0.01 x 0.01) and other relevant viewing parameters (e.g. colourscheme, scale...). The first block of text creates the necessary handlers and sets their content according to the current ("this") instance of the DPMBase superclass.

209 {
210  // sofStop function
211  setSoftStop();
212  //constructor();
213  dataFile.getFstream().precision(10);
214  fStatFile.getFstream().precision(10);
215  eneFile.getFstream().precision(10);
216  restartFile.getFstream().precision(
217  std::numeric_limits<double>::digits10); //highly accurate, so the overlap is accurate
218  statFile.getFstream().precision(10);
219  statFile.getFstream().setf(std::ios::left);
220  interactionFile.getFstream().precision(10);
221  name_ = ""; // needs to be user-specified, otherwise checkSettings throws error
222  //by default, the fileType of all files is ONE_FILE. However, by default we don't want an interaction file since it
223  // is very large.
225 
226  runNumber_ = 0;
227 
228  //Decomposition direction for MPI
229  numberOfDomains_ = {1, 1, 1};
230 
231  //Check if MPI is already initialised
232  initialiseMPI();
233 
234  //This sets the maximum number of particles
239  cgHandler.setDPMBase(this);
241  wallHandler.setDPMBase(this);
247 
248  //set defaults for DPMBase parameters
251  setRestarted(false);
252  setGravity(Vec3D(0, 0, 0));
253  setBackgroundDrag(0.0);
254 
255  //This is the parameter of the numerical part
256  setTime(0);
257  numberOfTimeSteps_ = 0;
258  setTimeMax(0);
259  timeStep_ = 0; // needs to be user-specified, otherwise checkSettings throws error
260  setSaveCount(20);
261 
262  //This sets the default xballs domain
263  min_ = Vec3D(0, 0, 0);
264  max_ = Vec3D(0, 0, 0); // needs to be user-specified, otherwise checkSettings throws error
265 
266  //sets the default write particles data in VTK format flag to false
267  writeParticlesVTK_ = false;
269  vtkWriter_ = nullptr;
270 
271  setName(""); // needs to be user-specified, otherwise checkSettings throws error
272 
273  //Default mode is energy with no scale of the vectors
274  xBallsColourMode_ = 0;
275  xBallsVectorScale_ = -1;
276  xBallsScale_ = -1;
278  setAppend(false);
279 
280  //The default random seed is 0
282 
283  logger(DEBUG, "DPMBase problem constructor finished");
284 
285  readSpeciesFromDataFile_ = false;
286 
288 
289  //Set number of elements to write to the screen if a user wants to output write information to the terminal
290  nToWrite_ = 4;
291 }
@ NO_FILE
file will not be created/read
void initialiseMPI()
Inialises the MPI library.
Definition: MpiContainer.cc:137
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
void setBackgroundDrag(Mdouble backgroundDrag)
Simple access function to turn on a background drag. The force of particleVelocity*drag is applied (n...
Definition: DPMBase.h:806
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1448
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
void setSoftStop()
function for setting sigaction constructor.
Definition: DPMBase.cc:5167
std::string name_
the name of the problem, used, e.g., for the output files
Definition: DPMBase.h:1406
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
void setTime(Mdouble time)
Sets a new value for the current simulation time.
Definition: DPMBase.cc:836
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1522
int nToWrite_
number of elements to write to a screen
Definition: DPMBase.h:1421
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
Definition: File.cc:153
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
void setRandomSeed(unsigned long int new_seed)
This is the seed for the random number generator (note the call to seed_LFG is only required really i...
Definition: RNG.cc:53

References boundaryHandler, cgHandler, dataFile, DEBUG, domainHandler, eneFile, fStatFile, File::getFstream(), DomainHandler::initialise(), PeriodicBoundaryHandler::initialise(), initialiseMPI(), interactionFile, interactionHandler, logger, max_, min_, name_, NO_FILE, nToWrite_, numberOfDomains_, numberOfOMPThreads_, numberOfTimeSteps_, particleHandler, periodicBoundaryHandler, random, readSpeciesFromDataFile_, restartFile, runNumber_, setAppend(), setBackgroundDrag(), BaseHandler< T >::setDPMBase(), File::setFileType(), setGravity(), setName(), setParticleDimensions(), RNG::setRandomSeed(), setRestarted(), setSaveCount(), setSoftStop(), setSystemDimensions(), setTime(), setTimeMax(), speciesHandler, statFile, timeStep_, vtkWriter_, wallHandler, writeParticlesVTK_, writeSuperquadricParticlesVTK_, xBallsAdditionalArguments_, xBallsColourMode_, xBallsScale_, and xBallsVectorScale_.

Referenced by DPMBase().

◆ continueSolve()

bool DPMBase::continueSolve ( ) const
protectedvirtual

A virtual function for deciding whether to continue the simulation, based on a user-specified criterion.

Used within the main loop of the 'solve()' routine to let the code know whether or not the time step should continue to be advanced, i.e. whether the simulation should be continued. By default this is always true but the user may redefine it to return false under certain desired circumstances.

Returns
bool (True or False)

Reimplemented in protectiveWall, ScalingTestInitialConditionsRelax, ScalingTestInitialConditionsRelax, DPM, InitialConditions< SpeciesType >, SilbertHstop, SilbertHstop, SilbertHstop, SilbertHstop, SilbertHstop, CSCWalls, CSCInit, ClosedCSCWalls, and T_protectiveWall.

1991 {
1992  return continueFlag_ != 0;
1993 }
static volatile sig_atomic_t continueFlag_
Definition: DPMBase.h:1276

References continueFlag_.

Referenced by solve().

◆ decompose()

void DPMBase::decompose ( )
virtual

Sends particles from processorId to the root processor.

Decomposes the simulation domain in a structured cube mesh of domains for parallel processing

This function takes the simulation domain boundaries and decomposes it into sub domains ready for parallel computations

4089 {
4090 #ifdef MERCURYDPM_USE_MPI
4091 
4092  //If running in parallel build, but just running with one core - no domain decomposition required
4093  int numberOfRequiredProcessors = numberOfDomains_[Direction::XAXIS]*
4096  if (NUMBER_OF_PROCESSORS != numberOfRequiredProcessors)
4097  {
4098  logger(ERROR,"The domain decompositions expects % processors, but only % are requested.\n"
4099  "Either run your process using \"mpirun -np % [executable]\", "
4100  "or change the domain decomposition to e.g. setNumberOfDomains({%,1,1}).", numberOfRequiredProcessors, NUMBER_OF_PROCESSORS, numberOfRequiredProcessors, NUMBER_OF_PROCESSORS);
4101  }
4102 
4103  if (NUMBER_OF_PROCESSORS == 1) {return;}
4104 
4105  //Check if the simulation domain has been set
4106  logger.assert_always(getXMax() - getXMin() > 0,"Please set your simulation domain (setXMax(),setXmin()) before calling solve()");
4107  logger.assert_always(getYMax() - getYMin() > 0,"Please set your simulation domain (setYMax(),setYmin()) before calling solve()");
4108  logger.assert_always(getZMax() - getZMin() > 0,"Please set your simulation domain (setZMax(),setZmin()) before calling solve()");
4109 
4110  //Grab simulation domains
4111  std::vector<Mdouble> simulationMin{getXMin(), getYMin(), getZMin()};
4112  std::vector<Mdouble> simulationMax{getXMax(), getYMax(), getZMax()};
4113 
4114  //Check if the user input decomposition is correct
4115  logger.assert_always(numberOfDomains_[Direction::XAXIS] > 0,"Number of domain in x-direction incorrect: %",numberOfDomains_[Direction::XAXIS]);
4116  logger.assert_always(numberOfDomains_[Direction::YAXIS] > 0,"Number of domain in y-direction incorrect: %",numberOfDomains_[Direction::YAXIS]);
4117  logger.assert_always(numberOfDomains_[Direction::ZAXIS] > 0,"Number of domain in z-direction incorrect: %",numberOfDomains_[Direction::ZAXIS]);
4118 
4119  //Open domain decomposition, closed is not implemented
4120  bool open = true;
4121 
4122  //Check if the number of domains is equal to the number of processors
4124  "Number of Processors is not equal to number of domains. Processors %, domains, %",
4127 
4128  //Create all processor domains
4129 
4130  domainHandler.setDPMBase(this);
4131  domainHandler.createMesh(simulationMin, simulationMax, numberOfDomains_, open);
4132  logger(VERBOSE,"Number of domains: % | Number of processors: %",domainHandler.getNumberOfObjects(), NUMBER_OF_PROCESSORS);
4133  //logger.assert_always(domainHandler.getNumberOfObjects() == numberOfProcessors, "Invalid decomposition: Number of domains and processors are different");
4134 
4135  //Tell the current processor to which domain it belongs
4136  for (Domain* domain : domainHandler)
4137  {
4138  if (domain->getRank() == PROCESSOR_ID)
4139  {
4140  logger(VERBOSE,"processor: %, domain index: %",PROCESSOR_ID, domain->getIndex());
4141  domainHandler.setCurrentDomainIndex(domain->getIndex());
4142  }
4143  }
4144 
4145  //Define the mpi transfer types, which requires a definition of the species already
4147  logger.assert_always(speciesHandler.getNumberOfObjects() > 0, "Please create a particle species before calling solve()");
4149 
4150  //Make sure all processors are done with decomposition before proceeding
4151  logger(VERBOSE,"processor %: #real particles: %, #total particles: %", PROCESSOR_ID, particleHandler.getNumberOfRealObjects(), particleHandler.getSize());
4153 #endif
4154 }
@ YAXIS
Definition: GeneralDefine.h:78
@ XAXIS
Definition: GeneralDefine.h:78
@ ZAXIS
Definition: GeneralDefine.h:78
@ ERROR
@ VERBOSE
void setCurrentDomainIndex(unsigned int index)
This sets a domain to the processor.
Definition: DomainHandler.cc:240
void createMesh(std::vector< Mdouble > &simulationMin, std::vector< Mdouble > &simulationMax, std::vector< unsigned > &numberOfDomains, bool open)
Creates a Cartesian square mesh in 3D.
Definition: DomainHandler.cc:93
The simulation can be subdivided into Domain's used in parallel code.
Definition: Domain.h:64
void initialiseMercuryMPITypes(const SpeciesHandler &speciesHandler)
Creates the MPI types required for communication of Mercury data through the MPI interface.
Definition: MpiContainer.cc:74
void sync()
Process all pending asynchronous communication requests before continuing.
Definition: MpiContainer.h:152
unsigned int getNumberOfRealObjects() const
Returns the number of real objects (on all processors)
Definition: ParticleHandler.cc:1304

References DomainHandler::createMesh(), domainHandler, ERROR, BaseHandler< T >::getNumberOfObjects(), ParticleHandler::getNumberOfRealObjects(), BaseHandler< T >::getSize(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), MPIContainer::initialiseMercuryMPITypes(), MPIContainer::Instance(), logger, NUMBER_OF_PROCESSORS, numberOfDomains_, particleHandler, PROCESSOR_ID, DomainHandler::setCurrentDomainIndex(), BaseHandler< T >::setDPMBase(), speciesHandler, MPIContainer::sync(), VERBOSE, XAXIS, YAXIS, and ZAXIS.

Referenced by initialiseSolve(), and read().

◆ deleteGhostParticles()

void DPMBase::deleteGhostParticles ( std::set< BaseParticle * > &  particlesToBeDeleted)
protected
Todo:
: doc
5087 {
5088  //Flush mixed particles from lists (MP particles are located in both structures)
5089  if (periodicBoundaryHandler.getSize() > 0)
5090  {
5091  //Flush particles from boundaries
5092  domainHandler.getCurrentDomain()->flushParticles(particlesToBeDeleted);
5093  periodicBoundaryHandler.flushParticles(particlesToBeDeleted);
5094  }
5095 
5096  //Clean communication lists
5099 
5100  //Delete the particles
5101  for (auto particle_it : particlesToBeDeleted)
5102  {
5103  particleHandler.removeGhostObject(particle_it->getIndex());
5104  }
5105 }
Domain * getCurrentDomain()
Gets the domain assigned to the processor.
Definition: DomainHandler.cc:250

References Domain::cleanCommunicationLists(), PeriodicBoundaryHandler::cleanCommunicationLists(), domainHandler, PeriodicBoundaryHandler::flushParticles(), Domain::flushParticles(), DomainHandler::getCurrentDomain(), BaseHandler< T >::getSize(), particleHandler, periodicBoundaryHandler, and ParticleHandler::removeGhostObject().

Referenced by performGhostParticleUpdate().

◆ fillDomainWithParticles()

void DPMBase::fillDomainWithParticles ( unsigned  N = 50)

Inserts particles in the whole domain. THis is useful if you want to check whether the wall visualisation or wall computation is correct: First insert the walls, then the particles, then check in paraview if the walls and particles overlap

Parameters
N
2987  {
2988  logger.assert_always(speciesHandler.getSize()>0,"There needs to be at least one species");
2990  SphericalParticle p(s);
2992  b.set(p, 100, getMin(), getMax(), {0, 0, 0}, {0, 0, 0});
2993  b.insertParticles(this);
2994  logger(INFO,"Inserted % particles",particleHandler.getSize());
2995 }
@ INFO
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
It's an insertion boundary which has cuboidal shape (yes, 'CuboidalInsertionBoundary' would have been...
Definition: CubeInsertionBoundary.h:42
void set(BaseParticle *particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, Vec3D velMin={0, 0, 0}, Vec3D velMax={0, 0, 0})
Sets the properties of the InsertionBoundary for mutliple different particle types.
Definition: CubeInsertionBoundary.cc:107
Vec3D getMax() const
Definition: DPMBase.h:670
Vec3D getMin() const
Definition: DPMBase.h:664
void insertParticles(DPMBase *md)
Fill a certain domain with particles.
Definition: InsertionBoundary.cc:328
Definition: ParticleSpecies.h:37
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37

References BaseHandler< T >::getLastObject(), getMax(), getMin(), BaseHandler< T >::getSize(), INFO, InsertionBoundary::insertParticles(), logger, particleHandler, CubeInsertionBoundary::set(), and speciesHandler.

◆ finaliseSolve()

void DPMBase::finaliseSolve ( )

End of the solve routine, after time stepping.

4287  {
4288 
4289  //force writing of the last time step
4291 
4292  //end loop over interaction count
4294 
4295  //To make sure getTime gets the correct time for outputting statistics
4296  finishStatistics();
4297 
4298  closeFiles();
4299 }
void closeFiles()
Closes all files (ene, data, fstat, restart, stat) that were opened to read or write.
Definition: DPMBase.cc:503
void forceWriteOutputFiles()
Writes output files immediately, even if the current time step was not meant to be written....
Definition: DPMBase.cc:4028
virtual void finishStatistics()
Definition: DPMBase.cc:1925
virtual void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
Definition: DPMBase.cc:1871

References actionsAfterSolve(), closeFiles(), finishStatistics(), and forceWriteOutputFiles().

Referenced by solve().

◆ findNextExistingDataFile()

bool DPMBase::findNextExistingDataFile ( Mdouble  tMin,
bool  verbose = true 
)

Finds and opens the next data file, if such a file exists.

First, checks to see if the file type is MULTIPLE_FILES or MULTIPLE_FILES_PADDED and, if so, whether the file contains data (ending the function if not). Then, checks if the time corresponding to the current file exceeds the minimum value entered (tMin). If not, keeps looking through subsequent data files. When a data file that satisfies t > tMin is found and successfully opened, the function returns true.

Useful when fileType is chosen as MULTIPLE_FILES or MULTIPLE_FILES_PADDED, which write data corresponding to each time step as a separate, consecutively numbered file (see FileType).

Parameters
[in]tMinCompared with the t value belonging to the file being checked to see if it is viable.
[in]verboseAllows the function to give output to the screen if desired.
Returns
bool - true if the next file is found, false if not.
2655 {
2657  {
2658  while (true)// This true corresponds to the if s
2659  {
2660  dataFile.open();
2661  //check if file exists and contains data
2662  int N;
2663  dataFile.getFstream() >> N;
2664  if (dataFile.getFstream().eof() || dataFile.getFstream().peek() == -1)
2665  {
2666  logger(WARN, "file % not found", dataFile.getName());
2667  return false;
2668  }
2669  //check if tmin condition is satisfied
2670  Mdouble t;
2671  dataFile.getFstream() >> t;
2672  if (t > tMin)
2673  {
2674  //set_file_counter(get_file_counter()-1);
2675  return true;
2676  }
2677  if (verbose)
2678  logger(VERBOSE, "Jumping file counter: %", dataFile.getCounter());
2679  }
2680  }
2681  return true;
2682 }
@ MULTIPLE_FILES
each time-step will be written into/read from separate files numbered consecutively: name_....
@ MULTIPLE_FILES_PADDED
each time-step will be written into/read from separate files numbered consecutively,...
@ WARN
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
Definition: File.cc:165
bool open()
Checks if the file stream fstream_ has any issues while opening. Alongside, it also increments the ne...
Definition: File.cc:347
unsigned int getCounter() const
In case of multiple files, File::getCounter() returns the the number (FILE::Counter_) of the next fil...
Definition: File.cc:223
FileType getFileType() const
Gets the file type e.g. NOFILE, ONEFILE and MULTIPLE FILES. File::fileType_.
Definition: File.cc:207
bool verbose
Definition: statXZ.cpp:28

References dataFile, File::getCounter(), File::getFileType(), File::getFstream(), File::getName(), logger, MULTIPLE_FILES, MULTIPLE_FILES_PADDED, File::open(), verbose, VERBOSE, and WARN.

◆ finishStatistics()

void DPMBase::finishStatistics ( )
protectedvirtual

This function is overridden by StatisticsVector

Reimplemented in statistics_while_running< T >, StatisticsVector< T >, StatisticsVector< O >, StatisticsVector< XZ >, and statistics_while_running< T >.

1926 {
1927  cgHandler.finish();
1928 }
void finish()
Contains the code executed after the last time step.
Definition: CGHandler.cc:113

References cgHandler, and CGHandler::finish().

Referenced by finaliseSolve(), and Mercury3DRestart::writeOutputFiles().

◆ forceWriteOutputFiles()

void DPMBase::forceWriteOutputFiles ( )

Writes output files immediately, even if the current time step was not meant to be written. Also resets the last saved time step.

4029 {
4031  writeOutputFiles();
4032 }
const unsigned NEVER
Definition: File.h:35
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 b...
Definition: DPMBase.cc:519

References NEVER, setLastSavedTimeStep(), and writeOutputFiles().

Referenced by finaliseSolve(), main(), and FileReader::read().

◆ gatherContactStatistics() [1/2]

void DPMBase::gatherContactStatistics ( )
protected
1899 {
1901  {
1902  c->gatherContactStatistics();
1903  }
1904 }

References interactionHandler.

Referenced by ChuteWithPeriodicInflow::computeInternalForces().

◆ gatherContactStatistics() [2/2]

void DPMBase::gatherContactStatistics ( unsigned int index1  UNUSED,
int index2  UNUSED,
Vec3D Contact  UNUSED,
Mdouble delta  UNUSED,
Mdouble ctheta  UNUSED,
Mdouble fdotn  UNUSED,
Mdouble fdott  UNUSED,
Vec3D P1_P2_normal_  UNUSED,
Vec3D P1_P2_tangential  UNUSED 
)
virtual

//Not unsigned index because of possible wall collisions.

no implementation but can be overidden in its derived classes.

Reimplemented in StatisticsVector< T >, StatisticsVector< O >, and StatisticsVector< XZ >.

1912 {
1913 }

Referenced by BaseInteraction::gatherContactStatistics().

◆ get1DParametersFromRunNumber()

std::vector< int > DPMBase::get1DParametersFromRunNumber ( int  sizeX) 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)

Let's say sizeX = 5, counter stored in COUNTER_DONOTDEL = 1. Substituting these values into the algorithm below implies that studyNum = 0 or 1. Everytime the code is executed the counter gets incremented and the values of studyNum and i are updated, which is returned as std::vector<int>

Parameters
[in]sizeXThe (integer) number of values to be tested in 1D parameter space.
Returns
std::vector<int> The current study numbers.
671 {
672 // Declare a vector of integers capable of storing 2 values
673 std::vector<int> temp(2);
674 
675 // Declare and initialise for the current simulation run number
676 int counter = getRunNumber();
677 
678 // Give studyNum value 0 if study is incomplete, otherwise value > 0
679 int studyNum = (counter-1)/sizeX;
680 counter = counter - sizeX*studyNum;
681 
682 int i = ((counter - 1) % sizeX) + 1;
683 logger(INFO,"StudyNum: % \t Counter: % \t i: %", studyNum, counter, i);
684 temp[0] = studyNum;
685 temp[1] = i;
686 
687 return temp;
688 }
int getRunNumber() const
This returns the current value of the counter (runNumber_)
Definition: DPMBase.cc:617

References getRunNumber(), constants::i, INFO, and logger.

Referenced by ParameterStudy1DDemo::getCurrentStudyNum().

◆ get2DParametersFromRunNumber()

std::vector< int > DPMBase::get2DParametersFromRunNumber ( int  sizeX,
int  sizeY 
) 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)

Let's say sizeX = 2 and sizeY = 5, counter stored in COUNTER_DONOTDEL =1. The studySize = 10. Substituting these values into the below algorithm implies that studyNum = 0 or 1, everytime the code is executed the counter gets incremented and hence determined the values of studyNum, i and j which is returned as a std::vector<int>

Parameters
[in]sizeXThe (integer) number of values to be tested for one of the 2 parameters forming the 2D parameter space.
[in]sizeYThe (integer) number of values to be tested for the other of the 2 parameters forming the 2D parameter space.
Returns
std::vector<int>
699 {
700 //declares a vector of integers capable of storing 3 values,
701 std::vector<int> temp(3);
702 //declares and initialises an integer variable named "counter"
703 //with the current counter number, runNumber_
704 int counter = getRunNumber();
705 //calculates the total size of the study, i.e. the number of points
706 //in the 2D parameter space explored
707 int studySize = sizeX * sizeY;
708 //(counter - 1) / studySize gives a fraction comparing the number of runs conducted so far
709 //to the total size of the study, i.e. the total number of runs that need to be performed.
710 //since studyNum is an integer, will declare zero until an adequate number of runs has been performed,
711 //at which point it will equal 1
712 int studyNum = (counter - 1) / studySize;
713 
714 counter = counter - studySize * studyNum;
715 int i = ((counter - 1) % sizeX) + 1;
716 int j = ((counter - i) / sizeX) + 1;
717 logger(INFO,"StudyNum: % \t Counter: % \t i: % \t j: %", studyNum, counter, i, j);
718 
719 temp[0] = studyNum;
720 temp[1] = i;
721 temp[2] = j;
722 
723 return (temp);
724 }

References getRunNumber(), constants::i, INFO, and logger.

Referenced by ParameterStudy2DDemo::getCurrentStudyNum().

◆ get3DParametersFromRunNumber()

std::vector< int > DPMBase::get3DParametersFromRunNumber ( int  sizeX,
int  sizeY,
int  sizeZ 
) 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)

Let's say sizeX = 2, sizeY = 5 and sizeZ = 3, counter stored in COUNTER_DONOTDEL =1. The studySize = 30. Substituting these values into the below algorithm implies that studyNum = 0 or 1, everytime the code is executed the counter gets incremented and hence determined the values of studyNum, i,j and k which is returned as a std::vector<int>

Parameters
[in]sizeXThe (integer) number of values to be tested for one of the 3 parameters forming the 3D parameter space.
[in]sizeYThe (integer) number of values to be tested for one of the 3 parameters forming the 3D parameter space.
[in]sizeZThe (integer) number of values to be tested for one of the 3 parameters forming the 3D parameter space.
Returns
std::vector<int>
736 {
737 //declares a vector of integers capable of storing 4 values,
738 std::vector<int> temp(4);
739 //declares and initialises an integer variable named "counter"
740 //with the current counter number, runNumber_
741 int counter = getRunNumber();
742 //calculates the total size of the study, i.e. the number of points
743 //in the 3D parameter space explored
744 int studySize = sizeX * sizeY * sizeZ;
745 //(counter - 1) / studySize gives a fraction comparing the number of runs conducted so far
746 //to the total size of the study, i.e. the total number of runs that need to be performed.
747 //since studyNum is an integer, will declare zero until an adequate number of runs has been performed,
748 //at which point it will equal 1
749 int studyNum = (counter - 1) / studySize;
750 
751 counter = counter - studySize * studyNum;
752 int i = ((counter-1) % sizeX) + 1;
753 int j = static_cast<int>(std::floor((counter-1)/sizeX)) % sizeY + 1;
754 int k = static_cast<int>(std::floor((counter-1)/(sizeX*sizeY))) % sizeZ + 1;
755 logger(INFO,"StudyNum: % \t Counter: % \t i: % \t j: % \t k: %", studyNum, counter, i, j, k);
756 
757 temp[0] = studyNum;
758 temp[1] = i;
759 temp[2] = j;
760 temp[3] = k;
761 
762 return (temp);
763 }

References getRunNumber(), constants::i, INFO, and logger.

Referenced by ParameterStudy3DDemo::getCurrentStudyNum().

◆ getAppend()

bool DPMBase::getAppend ( ) const

Returns whether the "append" option is on or off.

Returns
true if the "append" option is on; false if the "append" option is off.
1511 {
1512  return append_;
1513 }

References append_.

Referenced by initialiseSolve(), and writeEneHeader().

◆ getBackgroundDrag()

const Mdouble DPMBase::getBackgroundDrag ( ) const
inline

Return the background drag.

Returns
double which is the background drag. Positive number removes energy, negative gains.
812 {return backgroundDrag_;}

References backgroundDrag_.

Referenced by computeExternalForces(), and write().

◆ getCentreOfMass()

Vec3D DPMBase::getCentreOfMass ( ) const

JMFT: Return the centre of mass of the system, excluding fixed particles.

Returns the centre of mass of particles, excluding fixed particles.

1615 {
1617 }
Vec3D getCentreOfMass() const
Definition: ParticleHandler.cc:654

References ParticleHandler::getCentreOfMass(), and particleHandler.

Referenced by GranuHeap::actionsAfterTimeStep(), GranuDrum::printTime(), GranuHeap::printTime(), VerticalMixer::printTime(), and GranuDrum::writeResults().

◆ getCPUTime()

double DPMBase::getCPUTime ( )
inline
910 { return clock_.getCPUTime(); }
Time clock_
record when the simulation started
Definition: DPMBase.h:1509
Mdouble getCPUTime() const
Definition: MercuryTime.h:80

References clock_, and Time::getCPUTime().

◆ getCurrentDomain()

Domain * DPMBase::getCurrentDomain ( )

Function that returns a pointer to the domain corresponding to the processor.

Function that returns a pointer to the domain correseponding to the processor.

Returns
Pointer to a domain corresponding to the processor
5290 {
5292 }

References domainHandler, and DomainHandler::getCurrentDomain().

Referenced by checkInteractionWithBoundaries(), and PeriodicBoundaryHandler::clearCommunicationLists().

◆ getDataFile() [1/2]

File & DPMBase::getDataFile ( )

The non const version. Allows one to edit the File::dataFile.

Deprecated:
dataFile is now protected, so it can be used by all applications. Please don't use getDataFile() anymore.
Returns
File& (A reference of object type File i.e. File& dataFile)
306 {
307 return dataFile;
308 }

References dataFile.

◆ getDataFile() [2/2]

const File & DPMBase::getDataFile ( ) const

The const version. Does not allow for any editing of the File::dataFile.

Deprecated:
dataFile is now protected, so it can be used by all applications. Please don't use getDataFile() anymore.
Returns
const File& (A const reference of object type File i.e. const File& dataFile)
355 {
356 return dataFile;
357 }

References dataFile.

◆ getElasticEnergy()

Mdouble DPMBase::getElasticEnergy ( ) const

Returns the global elastic energy within the system.

Returns
elasticEnergy The total elastic energy of all current particle interactions.
1531 {
1532  Mdouble elasticEnergy = 0.0;
1533  // JMFT: Note that we do count the elastic energy of fixed particles here.
1534  for (const BaseInteraction* c : interactionHandler)
1535  {
1536  elasticEnergy += c->getElasticEnergy();
1537  }
1538  return elasticEnergy;
1539 }

References interactionHandler.

Referenced by SilbertHstop::actionAfterTimeStep(), BaseCluster::actionsAfterSolve(), GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), T_protectiveWall::continueSolve(), ClosedCSCWalls::continueSolve(), CSCInit::continueSolve(), CSCWalls::continueSolve(), InitialConditions< SpeciesType >::continueSolve(), DPM::continueSolve(), protectiveWall::continueSolve(), getTotalEnergy(), main(), GranuHeap::printTime(), ShearStage::printTime(), ClosedCSCRestart::printTime(), ClosedCSCRun::printTime(), ClosedCSCStats::printTime(), ClosedCSCWalls::printTime(), CSCInit::printTime(), CSCRestart::printTime(), CSCRun::printTime(), CSCStats::printTime(), CSCWalls::printTime(), HorizontalMixer::printTime(), VerticalMixer::printTime(), ParticleInclusion::printTime(), vibratedBed::printTime(), InitialConditions< SpeciesType >::printTime(), SphericalIndenter::printTime(), DPM::printTime(), regimeForceUnitTest::printTime(), TangentialSpringEnergyConservationUnitTest::printTime(), BaseCluster::printTime(), writeEneTimeStep(), LawinenBox::writeEneTimeStep(), and BaseCluster::writeToCdatFile().

◆ getEneFile() [1/2]

File & DPMBase::getEneFile ( )

The non const version. Allows to edit the File::eneFile.

Deprecated:
eneFile is now protected, so it can be used by all applications. Please don't use getEneFile() anymore.
Returns
File& (A reference of object type File i.e. File& eneFile)
314 {
315 return eneFile;
316 }

References eneFile.

◆ getEneFile() [2/2]

const File & DPMBase::getEneFile ( ) const

The const version. Does not allow for any editing of the File::eneFile.

Deprecated:
eneFile is now protected, so it can be used by all applications. Please don't use getEneFile() anymore.
Returns
const File& (A const reference of object type File i.e. const File& eneFile)
363 {
364 return eneFile;
365 }

References eneFile.

◆ getFStatFile() [1/2]

File & DPMBase::getFStatFile ( )

The non const version. Allows to edit the File::fStatFile.

Deprecated:
fStatFile is now protected, so it can be used by all applications. Please don't use getFStatFile() anymore.
Returns
File& (A reference of object type File i.e. File& fStatFile)
322 {
323 return fStatFile;
324 }

References fStatFile.

◆ getFStatFile() [2/2]

const File & DPMBase::getFStatFile ( ) const

The const version. Does not allow for any editing of the File::fStatFile.

Deprecated:
fStatFile is now protected, so it can be used by all applications. Please don't use getFStatFile() anymore.
Returns
const File& (A const reference of object type File i.e. const File& fStatFile)
371 {
372 return fStatFile;
373 }

References fStatFile.

◆ getGravitationalEnergy()

Mdouble DPMBase::getGravitationalEnergy ( ) const

Returns the global gravitational potential energy stored in the system.

Returns
gravitationalEnergy The total gravitational potential energy of all particles (relative to the origin).
1562 {
1563  Mdouble gravitationalEnergy = 0;
1564  for (const BaseParticle* const p : particleHandler)
1565  {
1566  // Don't consider fixed particles. 'Fixed' particles aren't necessarily
1567  // stationary; it just means their position is prescribed.
1568  if (!(p->isFixed()))
1569  {
1570  gravitationalEnergy += p->getMass() * Vec3D::dot((-getGravity()), p->getPosition());
1571  }
1572  }
1573  return gravitationalEnergy;
1574 }
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:76

References Vec3D::dot(), getGravity(), and particleHandler.

Referenced by getTotalEnergy().

◆ getGravity()

◆ getHGridUpdateEachTimeStep()

bool DPMBase::getHGridUpdateEachTimeStep ( ) const
virtual
Returns
bool (True or False)

Reimplemented in MercuryBase.

1719 {
1720  return true;
1721 }

Referenced by BaseParticle::integrateBeforeForceComputation(), and ClumpParticle::integrateBeforeForceComputation().

◆ getInfo()

Mdouble DPMBase::getInfo ( const BaseParticle p) const
virtual

A virtual function that returns some user-specified information about a particle.

Returns
double

Reimplemented in WallSpecies, SegregationPeriodic, SegregationPeriodic, SegregationPeriodic, and ChuteWithPeriodicInflow.

1643 {
1644 // return p.getSpecies()->getId(); // was getIndex()
1645  return p.getInfo();
1646 }
virtual Mdouble getInfo() const
Returns some user-defined information about this object (by default, species ID).
Definition: BaseParticle.cc:358

References BaseParticle::getInfo().

◆ getInteractionFile() [1/2]

File & DPMBase::getInteractionFile ( )

Return a reference to the file InteractionsFile.

Returns
A reference of object type File i.e. File* interactionFile_
346 {
347 return interactionFile;
348 }

References interactionFile.

Referenced by initialiseSolve(), main(), setName(), and BaseInteraction::~BaseInteraction().

◆ getInteractionFile() [2/2]

const File & DPMBase::getInteractionFile ( ) const

\bief Returns a constant reference to an Interactions file

Returns
const File& (A const reference of object type std::string i.e. const std::string& name_)
Bug:
The InteractionFile does not work across multifiles.
395 {
396 return interactionFile;
397 }

References interactionFile.

◆ getKineticEnergy()

Mdouble DPMBase::getKineticEnergy ( ) const

Returns the global kinetic energy stored in the system.

Returns
kineticEnergy The total kinetic energy of all particles.
1545 {
1546  Mdouble kineticEnergy = 0;
1547  for (const BaseParticle* const p : particleHandler)
1548  {
1549  if (!(p->isFixed()))
1550  {
1551  kineticEnergy += .5 * p->getMass() * p->getVelocity().getLengthSquared();
1552  }
1553  }
1554  return kineticEnergy;
1555 }

References particleHandler.

Referenced by SilbertHstop::actionAfterTimeStep(), BaseCluster::actionsAfterSolve(), GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), DrumRot::actionsBeforeTimeStep(), RotatingDrum::actionsBeforeTimeStep(), T_protectiveWall::continueSolve(), ClosedCSCWalls::continueSolve(), CSCInit::continueSolve(), CSCWalls::continueSolve(), InitialConditions< SpeciesType >::continueSolve(), DPM::continueSolve(), protectiveWall::continueSolve(), getTotalEnergy(), main(), GranuHeap::printTime(), ShearStage::printTime(), ClosedCSCRestart::printTime(), ClosedCSCRun::printTime(), ClosedCSCStats::printTime(), ClosedCSCWalls::printTime(), CSCInit::printTime(), CSCRestart::printTime(), CSCRun::printTime(), CSCStats::printTime(), CSCWalls::printTime(), HorizontalMixer::printTime(), VerticalMixer::printTime(), ParticleInclusion::printTime(), vibratedBed::printTime(), InitialConditions< SpeciesType >::printTime(), SphericalIndenter::printTime(), DPM::printTime(), regimeForceUnitTest::printTime(), BaseCluster::printTime(), setMeanVelocityAndKineticEnergy(), and BaseCluster::writeToCdatFile().

◆ getKineticStress()

Matrix3D DPMBase::getKineticStress ( ) const

Calculate the kinetic stress tensor in the system averaged over the whole volume.

The function calculate the kinetic stress tensor based on particle fluctuation velocity.

Returns
The kinetic stress of the whole system (all particles).
5380 {
5381  Matrix3D F; //set the kinetic energy tensor, this is in terms of Sum(m*v^2)
5382  Vec3D J; //set the momentum tensor
5383 
5384  //calculate stress for kinetic part
5385  for (const auto& p : particleHandler)
5386  {
5387  F += Matrix3D::dyadic(p->getVelocity(), p->getVelocity()) * p->getMass();
5388  J += p->getVelocity() * p->getMass();
5389  }
5390 
5391  Matrix3D stressKinetic = F - Matrix3D::dyadic(J, J) / getTotalMass();
5392  stressKinetic /= getTotalVolume();
5393  return stressKinetic;
5394 }
Mdouble getTotalVolume() const
Get the total volume of the cuboid system.
Definition: DPMBase.cc:5370
Mdouble getTotalMass() const
JMFT: Return the total mass of the system, excluding fixed particles.
Definition: DPMBase.cc:1598
Implementation of a 3D matrix.
Definition: Matrix.h:38
static Matrix3D dyadic(const Vec3D &a, const Vec3D &b)
Calculates the dyadic product of a two Vec3D: .
Definition: Matrix.cc:323

References Matrix3D::dyadic(), getTotalMass(), getTotalVolume(), and particleHandler.

Referenced by getTotalStress().

◆ getMax()

Vec3D DPMBase::getMax ( ) const
inline
671  { return max_; }

References max_.

Referenced by BaseWall::addParticlesAtWall(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), ClosedCSCWalls::ClosedCSCWalls(), commandLineCG(), InfiniteWall::createVTK(), CSCWalls::CSCWalls(), SubcriticalMaserBoundaryTEST::extendBottom(), fillDomainWithParticles(), MembraneDemo::fixMembraneEdges(), MembraneSelfTest::fixMembraneEdges(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), main(), FileReader::read(), Slide::set_Walls(), Domain::setBounds(), Domain::setRange(), ClosedCSCWalls::setupInitialConditions(), Drum::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), StressStrainControl::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Penetration::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), Packing::setupInitialConditions(), Packing::test(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), AxisymmetricIntersectionOfWalls::writeVTK(), HorizontalBaseScrew::writeVTK(), IntersectionOfWalls::writeVTK(), ScrewsymmetricIntersectionOfWalls::writeVTK(), and WallHandler::writeWallDetailsVTKBoundingBox().

◆ getMin()

Vec3D DPMBase::getMin ( ) const
inline
665  { return min_; }

References min_.

Referenced by BaseWall::addParticlesAtWall(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), ClosedCSCWalls::ClosedCSCWalls(), commandLineCG(), InfiniteWall::createVTK(), CSCWalls::CSCWalls(), SubcriticalMaserBoundaryTEST::extendBottom(), fillDomainWithParticles(), MembraneDemo::fixMembraneEdges(), MembraneSelfTest::fixMembraneEdges(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), main(), FileReader::read(), Domain::setBounds(), Domain::setRange(), Drum::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), InsertionBoundaryMPI2Test::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), StressStrainControl::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Penetration::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), FreeFallInteractionSelfTest::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), Packing::setupInitialConditions(), Packing::test(), AxisymmetricIntersectionOfWalls::writeVTK(), HorizontalBaseScrew::writeVTK(), IntersectionOfWalls::writeVTK(), ScrewsymmetricIntersectionOfWalls::writeVTK(), and WallHandler::writeWallDetailsVTKBoundingBox().

◆ getName()

◆ getNextTime()

Mdouble DPMBase::getNextTime ( ) const

Returns the current simulation time.

Returns
time_
817 {
818 return time_ + timeStep_;
819 }

References time_, and timeStep_.

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

◆ getNToWrite()

int DPMBase::getNToWrite ( ) const

get the number of elements to write to the

Gets nToWrite. If a user wants to output e.g. particle information to the screen we limit the number of outputs to nToWrite elements to not get an overflow of information in the terminal.

Parameters
[out]nToWrite_Number of elements to write to the screen
865 {
866 return nToWrite_;
867 }

References nToWrite_.

Referenced by write().

◆ getNumberOfDomains()

std::vector< unsigned > DPMBase::getNumberOfDomains ( )

returns the number of domains

number of domains in parallel code in terms of domains in x,y,z direction

Returns
Returns the number of domains in cartesian cooridates of the parallel mesh
5281 {
5282  return numberOfDomains_;
5283 }

References numberOfDomains_.

Referenced by RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), and DomainHandler::getParticleDomainGlobalIndex().

◆ getNumberOfOMPThreads()

int DPMBase::getNumberOfOMPThreads ( ) const
1287 {
1288  //logger.assert_debug(numberOfOMPThreads_,"You need to set the number of OMP threads");
1289  return numberOfOMPThreads_;
1290 }

References numberOfOMPThreads_.

Referenced by SphericalIndenter::actionsBeforeTimeStep(), computeAllForces(), Mercury3Dclump::computeAllForces(), setNumberOfOMPThreads(), and write().

◆ getNumberOfTimeSteps()

◆ getParticleDimensions()

unsigned int DPMBase::getParticleDimensions ( ) const

Returns the particle dimensionality.

Returns
particleDimensions_ The dimensionality of the particles. (Note that the system may possess a different dimensionality).
1468 {
1469  return particleDimensions_;
1470 }

References particleDimensions_.

Referenced by BaseParticle::getParticleDimensions(), ParticleSpecies::getVolumeFromRadius(), and write().

◆ getParticlesWriteVTK()

bool DPMBase::getParticlesWriteVTK ( ) const

Returns whether particles are written in a VTK file.

The VTK format is used for visualisation in Paraview.

Todo:
Move this (and the set) to ParticleHandler.
Returns
bool
986 {
987 return writeParticlesVTK_;
988 }

References writeParticlesVTK_.

Referenced by writePythonFileForVTKVisualisation(), and writeVTKFiles().

◆ getRestarted()

bool DPMBase::getRestarted ( ) const

Returns the flag denoting if the simulation was restarted or not.

Returns
restarted_
1494 {
1495  return restarted_;
1496 }

References restarted_.

Referenced by autoNumber(), initialiseSolve(), and writeOutputFiles().

◆ getRestartFile() [1/2]

File & DPMBase::getRestartFile ( )

The non const version. Allows to edit the File::restartFile.

Deprecated:
restartFile is now protected, so it can be used by all applications. Please don't use getRestartFile() anymore.
Returns
File& (A reference of object type File i.e. File& restartFile)
330 {
331 return restartFile;
332 }

References restartFile.

◆ getRestartFile() [2/2]

const File & DPMBase::getRestartFile ( ) const

The const version. Does not allow for any editing of the File::restartFile.

Deprecated:
restartFile is now protected, so it can be used by all applications. Please don't use getRestartFile() anymore.
Returns
const File& (A const reference of object type File i.e. const File& restartFile)
379 {
380 return restartFile;
381 }

References restartFile.

◆ getRestartVersion()

std::string DPMBase::getRestartVersion ( ) const

This is to take into account for different Mercury versions. Returns the version of the restart file.

Returns
restartVersion_
1476 {
1477  return restartVersion_;
1478 }

References restartVersion_.

Referenced by Chute::read().

◆ getRotation()

bool DPMBase::getRotation ( ) const
inline

Indicates whether particle rotation is enabled or disabled.

Returns
true if particle rotation is enabled; false if particle rotation is disabled.
571  { return rotation_; }

References rotation_.

Referenced by computeAllForces(), computeForcesDueToWalls(), Mercury3Dclump::computeForcesDueToWalls(), computeInternalForce(), Mercury3Dclump::computeInternalForce(), BaseParticle::integrateBeforeForceComputation(), and SphericalParticleVtkWriter::writeVTKAngularVelocity().

◆ getRotationalEnergy()

Mdouble DPMBase::getRotationalEnergy ( ) const

JMFT Returns the global rotational energy stored in the system.

Todo:
TW why is the ene_rot commented out
1578 {
1579  Mdouble ene_rot = 0;
1580  for (std::vector<BaseParticle*>::const_iterator it = particleHandler.begin(); it != particleHandler.end(); ++it)
1581  {
1582  // See above.
1583  if (!(*it)->isFixed())
1584  {
1585  // ene_rot += .5 * (*it)->getInertia() * (*it)->getAngularVelocity().getLengthSquared();
1586  }
1587  }
1588  return ene_rot;
1589 }
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

References BaseHandler< T >::begin(), BaseHandler< T >::end(), and particleHandler.

Referenced by getTotalEnergy(), and TangentialSpringEnergyConservationUnitTest::printTime().

◆ getRunNumber()

int DPMBase::getRunNumber ( ) const

This returns the current value of the counter (runNumber_)

A simple "get function" which allows the user to retrieve the current value corresponding to the run number counter, runNumber_

Returns
runNumber_ - the stored value of the current run number, i.e. the number of files corresponding to a given Mercury script that have been produced in a given directory.
618 {
619 return runNumber_;
620 }

References runNumber_.

Referenced by get1DParametersFromRunNumber(), get2DParametersFromRunNumber(), get3DParametersFromRunNumber(), and initialiseSolve().

◆ getStatFile() [1/2]

File & DPMBase::getStatFile ( )

The non const version. Allows to edit the File::statFile.

Deprecated:
statFile is now protected, so it can be used by all applications. Please don't use getStatFile() anymore.
Returns
File& (A reference of object type File i.e. File& statFile)
338 {
339 return statFile;
340 }

References statFile.

◆ getStatFile() [2/2]

const File & DPMBase::getStatFile ( ) const

The const version. Does not allow for any editing of the File::statFile.

Deprecated:
statFile is now protected, so it can be used by all applications. Please don't use getStatFile() anymore.
Returns
const File& (A const reference of object type File i.e. const File& statFile)
387 {
388 return statFile;
389 }

References statFile.

◆ getStaticStress()

Matrix3D DPMBase::getStaticStress ( ) const

Calculate the static stress tensor in the system averaged over the whole volume.

The function calculate the static stress tensor based on particle contact force and contact normal branch vector.

Returns
The static stress of the whole system (all interactions).
5402 {
5403  //stress components calculation variables
5404  Matrix3D stressStatic;
5405 
5406  //calculate the static stress tensor based on all the interactions
5407  for (const auto i : interactionHandler)
5408  {
5409  stressStatic += Matrix3D::dyadic(i->getForce(), i->getNormal()) * i->getDistance();
5410  }
5411 
5412  stressStatic /= getTotalVolume();
5413  return stressStatic;
5414 }

References Matrix3D::dyadic(), getTotalVolume(), constants::i, and interactionHandler.

Referenced by getTotalStress(), and DPM::printTime().

◆ getSuperquadricParticlesWriteVTK()

bool DPMBase::getSuperquadricParticlesWriteVTK ( ) const
Returns
bool
994 {
996 }

References writeSuperquadricParticlesVTK_.

Referenced by writeVTKFiles().

◆ getSystemDimensions()

unsigned int DPMBase::getSystemDimensions ( ) const

Returns the system dimensionality.

Returns
systemDimensions_ The dimensionality of the system. (Note that particles may possess a different dimensionality.)
1431 {
1432  return systemDimensions_;
1433 }

References systemDimensions_.

Referenced by HGridOptimiser::initialise(), outputXBallsData(), readNextDataFile(), StatisticsVector< T >::setNZ(), write(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getTime()

Mdouble DPMBase::getTime ( ) const

Returns the current simulation time.

Returns
time_
809 {
810 return time_;
811 }

References time_.

Referenced by SilbertHstop::actionAfterTimeStep(), GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), multiParticleT1::actionsAfterTimeStep(), MaserRepeatedOutInMPI2Test::actionsAfterTimeStep(), FreeCooling2DinWallsDemo::actionsAfterTimeStep(), FreeCooling3DDemoProblem::actionsAfterTimeStep(), FreeCooling3DinWallsDemo::actionsAfterTimeStep(), FreeCoolingDemoProblem::actionsAfterTimeStep(), HourGlass::actionsAfterTimeStep(), MinimalExampleDrum::actionsAfterTimeStep(), Chutebelt::actionsAfterTimeStep(), BoundariesSelfTest::actionsAfterTimeStep(), FluxAndPeriodicBoundarySelfTest::actionsAfterTimeStep(), FluxBoundarySelfTest::actionsAfterTimeStep(), DPM::actionsAfterTimeStep(), SphericalIndenter::actionsAfterTimeStep(), BouncingSuperQuadric::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), SphericalSuperQuadricCollision::actionsAfterTimeStep(), ContactDetectionNormalSpheresTest::actionsAfterTimeStep(), ContactDetectionRotatedSpheresTest::actionsAfterTimeStep(), Tutorial11::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), LawinenBox::actionsBeforeTimeStep(), DPM::actionsBeforeTimeStep(), SmoothChute::actionsBeforeTimeStep(), Binary::actionsBeforeTimeStep(), AngleOfRepose::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), Chutebelt::actionsBeforeTimeStep(), ConstantRestitutionSelfTest::actionsBeforeTimeStep(), CoilSelfTest::actionsBeforeTimeStep(), DrumRot::actionsBeforeTimeStep(), RotatingDrum::actionsBeforeTimeStep(), QuaternionWallUnitTest::actionsBeforeTimeStep(), PeriodicWallsWithSlidingFrictionUnitTest::actionsBeforeTimeStep(), SaveCountUnitTest::actionsBeforeTimeStep(), AirySavageHutter::actionsOnRestart(), StatisticsVector< T >::check_current_time_for_statistics(), TimeDependentPeriodicBoundary::checkBoundaryAfterParticlesMove(), ClosedCSCStats::ClosedCSCStats(), commandLineCG(), ChuteWithPeriodicInflow::computeInternalForces(), SilbertHstop::continueSolve(), TimeDependentPeriodicBoundary::createGhostParticle(), CSCStats::CSCStats(), BaseCluster::decreaseForce(), CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), LeesEdwardsBoundary::getCurrentShift(), LeesEdwardsBoundary::getCurrentVelocity(), HorizontalBaseScrew::getDistanceAndNormal(), vibratedBed::getPrescribedVelocity(), BaseCluster::increaseForce(), integrateAfterForceComputation(), integrateBeforeForceComputation(), isTimeEqualTo(), loadingTest(), main(), normalAndTangentialLoadingTest(), objectivenessTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), inflowFromPeriodic::printTime(), printTime(), T_protectiveWall::printTime(), LawinenBox::printTime(), GranuDrum::printTime(), ShearStage::printTime(), ClosedCSCRestart::printTime(), ClosedCSCRun::printTime(), ClosedCSCStats::printTime(), ClosedCSCWalls::printTime(), CSCInit::printTime(), CSCRestart::printTime(), CSCRun::printTime(), CSCStats::printTime(), CSCWalls::printTime(), ChuteWithPeriodicInflow::printTime(), HorizontalMixer::printTime(), NozzleDemo::printTime(), Drum::printTime(), RotatingDrumWet::printTime(), VerticalMixer::printTime(), ForceLawsMPI2Test::printTime(), ParticleInclusion::printTime(), ParticleBeam::printTime(), SilbertPeriodic::printTime(), CLiveStatistics< T >::printTime(), statistics_while_running< T >::printTime(), vibratedBed::printTime(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::printTime(), ConstantMassFlowMaserSelfTest::printTime(), CubeDeletionBoundarySelfTest::printTime(), DeletionBoundarySelfTest::printTime(), DistributionSelfTest::printTime(), DistributionToPSDSelfTest::printTime(), InsertionBoundarySelfTest::printTime(), MultiplePSDSelfTest::printTime(), NozzleSelfTest::printTime(), PolydisperseInsertionBoundarySelfTest::printTime(), PSDManualInsertionSelfTest::printTime(), PSDSelfTest::printTime(), LiquidMigrationSelfTest::printTime(), TwoParticleElasticCollisionInteraction::printTime(), InitialConditions< SpeciesType >::printTime(), SinterPair::printTime(), SphericalIndenter::printTime(), DPM::printTime(), protectiveWall::printTime(), EvaporationAndHeatTest::printTime(), RandomClusterInsertionBoundarySelfTest::printTime(), viscoElasticUnitTest::printTime(), MultiParticlesInsertion::printTime(), regimeForceUnitTest::printTime(), BaseCluster::printTime(), Chute::printTime(), FileReader::read(), BaseWall::renderWall(), CGHandler::restart(), statistics_while_running< T >::run(), NozzleDemo::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), BaseCluster::setupInitialConditions(), ShearBoxBoundary::shiftHorizontalPosition(), LeesEdwardsBoundary::shiftVerticalPosition(), solve(), statistics_while_running< T >::statistics_while_running(), Domain::updateParticles(), LeesEdwardsBoundary::write(), write(), writeEneTimeStep(), LawinenBox::writeEneTimeStep(), Drum::writeEneTimeStep(), Penetration::writeEneTimeStep(), Silo::writeEneTimeStep(), SingleParticle< SpeciesType >::writeEneTimeStep(), Sintering::writeEneTimeStep(), SphericalIndenter::writeEneTimeStep(), SlidingFrictionUnitTest::writeEneTimeStep(), writeFstatHeader(), protectiveWall::writeFstatHeader(), BaseInteraction::writeInteraction(), ClosedCSCRestart::writeOutputFiles(), CSCRestart::writeOutputFiles(), BaseCluster::writeToCdatFile(), BaseCluster::writeToOverlFile(), HorizontalBaseScrew::writeVTK(), and writeVTKFiles().

◆ getTimeMax()

Mdouble DPMBase::getTimeMax ( ) const

Returns the maximum simulation duration.

Returns
timeMax_
889 {
890 return timeMax_;
891 }

References timeMax_.

Referenced by AngleOfRepose::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), AirySavageHutter::actionsOnRestart(), ChutePeriodicDemo::ChutePeriodicDemo(), ForceLawsMPI2Test::ForceLawsMPI2Test(), StatisticsVector< T >::getTimeMaxStat(), GranuDrum::GranuDrum(), loadingTest(), main(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleBeam::ParticleBeam(), printTime(), T_protectiveWall::printTime(), LawinenBox::printTime(), GranuDrum::printTime(), HorizontalMixer::printTime(), NozzleDemo::printTime(), Drum::printTime(), RotatingDrumWet::printTime(), ParticleBeam::printTime(), SilbertPeriodic::printTime(), CLiveStatistics< T >::printTime(), statistics_while_running< T >::printTime(), vibratedBed::printTime(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::printTime(), ConstantMassFlowMaserSelfTest::printTime(), DistributionSelfTest::printTime(), DistributionToPSDSelfTest::printTime(), InsertionBoundarySelfTest::printTime(), MultiplePSDSelfTest::printTime(), NozzleSelfTest::printTime(), PolydisperseInsertionBoundarySelfTest::printTime(), PSDManualInsertionSelfTest::printTime(), PSDSelfTest::printTime(), SinterPair::printTime(), protectiveWall::printTime(), RandomClusterInsertionBoundarySelfTest::printTime(), MultiParticlesInsertion::printTime(), regimeForceUnitTest::printTime(), Chute::printTime(), readNextArgument(), Mercury3DRestart::readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), save(), ChutePeriodic::setup(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), MarbleRun::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), Slide::Slide(), solve(), statistics_while_running< T >::statistics_while_running(), write(), and protectiveWall::writeFstatHeader().

◆ getTimeStep()

Mdouble DPMBase::getTimeStep ( ) const

Returns the simulation time step.

Returns
timeStep_ The current (Mdouble) value of the simulation time step.
1251 {
1252 return timeStep_;
1253 }

References timeStep_.

Referenced by ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), ClosedCSCWalls::actionsAfterTimeStep(), HorizontalMixer::actionsAfterTimeStep(), CubicCell::actionsAfterTimeStep(), FreeCooling2DinWallsDemo::actionsAfterTimeStep(), FreeCooling3DDemoProblem::actionsAfterTimeStep(), FreeCooling3DinWallsDemo::actionsAfterTimeStep(), FreeCoolingDemoProblem::actionsAfterTimeStep(), HourGlass::actionsAfterTimeStep(), MarbleRun::actionsAfterTimeStep(), SphericalIndenter::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), SlidingSpheresUnitTest::actionsAfterTimeStep(), SphericalSuperQuadricCollision::actionsAfterTimeStep(), ContactDetectionNormalSpheresTest::actionsAfterTimeStep(), ContactDetectionRotatedSpheresTest::actionsAfterTimeStep(), Tutorial11::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), HeatFluidCoupledSpecies< NormalForceSpecies >::actionsAfterTimeStep(), LawinenBox::actionsBeforeTimeStep(), DPM::actionsBeforeTimeStep(), SmoothChute::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), Chutebelt::actionsBeforeTimeStep(), CoilSelfTest::actionsBeforeTimeStep(), BaseCluster::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), BaseCluster::calculateTimeStep(), StatisticsVector< T >::check_current_time_for_statistics(), HeaterBoundary::checkBoundaryAfterParticleMoved(), DropletBoundary::checkBoundaryAfterParticlesMove(), checkSettings(), ChutePeriodicDemo::ChutePeriodicDemo(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), ChuteWithPeriodicInflow::computeInternalForces(), SinterInteraction::computeNormalForce(), SinterLinInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), SlidingFrictionInteraction::computeSlidingSpring(), SlidingFrictionInteraction::computeSlidingSpringSuperQuadric(), WearableNurbsWall::computeWear(), WearableTriangleMeshWall::computeWear(), WearableTriangulatedWall::computeWear(), SilbertHstop::continueSolve(), CSCWalls::CSCWalls(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), ForceLawsMPI2Test::ForceLawsMPI2Test(), ChuteWithHopper::getTimeStepRatio(), GranuDrum::GranuDrum(), integrateAfterForceComputation(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), integrateBeforeForceComputation(), inflowFromPeriodic::integrateBeforeForceComputation(), isTimeEqualTo(), LeesEdwardsDemo::LeesEdwardsDemo(), main(), ChuteBottom::makeRoughBottom(), ParticleBeam::ParticleBeam(), ParticleCreation::ParticleCreation(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), BaseWall::renderWall(), Screw::rotate(), save(), Cstatic2d::set_particle_properties(), Cstatic3D::set_particle_properties(), SilbertPeriodic::set_study(), Calibration::setSpecies(), Material::setSpecies(), ChutePeriodic::setup(), ChuteWithContraction::setup_particles_initial_conditions(), CSCRun::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MarbleRun::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), InitialConditions< SpeciesType >::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SilbertHstop::SilbertHstop(), Slide::Slide(), statistics_while_running< T >::statistics_while_running(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), StressStrainControlBoundary::updateDomainSize(), and write().

◆ getTotalEnergy()

Mdouble DPMBase::getTotalEnergy ( ) const
1591  {
1593 }
Mdouble getRotationalEnergy() const
JMFT Returns the global rotational energy stored in the system.
Definition: DPMBase.cc:1577
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1544
Mdouble getGravitationalEnergy() const
Returns the global gravitational potential energy stored in the system.
Definition: DPMBase.cc:1561
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1530

References getElasticEnergy(), getGravitationalEnergy(), getKineticEnergy(), and getRotationalEnergy().

◆ getTotalMass()

Mdouble DPMBase::getTotalMass ( ) const

JMFT: Return the total mass of the system, excluding fixed particles.

Returns
double
1599 {
1600  /*
1601  double mass_sum = 0;
1602  for (std::vector<BaseParticle*>::const_iterator it = particleHandler.begin(); it != particleHandler.end(); ++it)
1603  if (!(*it)->isFixed())
1604  mass_sum += (*it)->getMass();
1605  return mass_sum;
1606  */
1607  return particleHandler.getMass();
1608 }
Mdouble getMass() const
Definition: ParticleHandler.cc:611

References ParticleHandler::getMass(), and particleHandler.

Referenced by ShearStage::actionsAfterTimeStep(), getKineticStress(), ShearStage::printTime(), setMeanVelocity(), and setMeanVelocityAndKineticEnergy().

◆ getTotalMomentum()

Vec3D DPMBase::getTotalMomentum ( ) const

JMFT: Return the total momentum of the system, excluding fixed particles.

Returns the total momentum in the system, excluding fixed particles (which will usually, but not always, have velocity 0)

Returns
Vec3D
1625 {
1626  return particleHandler.getMomentum();
1627  /*
1628  Vec3D total_momentum = Vec3D(0,0,0);
1629  for (std::vector<BaseParticle*>::const_iterator it = particleHandler.begin(); it != particleHandler.end(); ++it)
1630  if (!(*it)->isFixed())
1631  total_momentum += (*it)->getMass() * (*it)->getVelocity();
1632  return total_momentum;
1633  */
1634 }
Vec3D getMomentum() const
Definition: ParticleHandler.cc:666

References ParticleHandler::getMomentum(), and particleHandler.

Referenced by setMeanVelocity(), and setMeanVelocityAndKineticEnergy().

◆ getTotalStress()

Matrix3D DPMBase::getTotalStress ( ) const

Calculate the total stress tensor in the system averaged over the whole volume.

The function calculate the total stress tensor which is the sum of kinetic and static stress tensors.

Returns
The total stress of the whole system (all particles and all interactions).
5422 {
5423  return getKineticStress() + getStaticStress();
5424 }
Matrix3D getKineticStress() const
Calculate the kinetic stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5379
Matrix3D getStaticStress() const
Calculate the static stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5401

References getKineticStress(), and getStaticStress().

Referenced by ShearStage::actionsAfterTimeStep(), StressStrainControlBoundary::computeStrainRate(), StressStrainControlBoundary::computeStressError(), and ShearStage::printTime().

◆ getTotalVolume()

Mdouble DPMBase::getTotalVolume ( ) const

Get the total volume of the cuboid system.

Returns
The total volume of the domain.
5371 {
5372  return (getXMax() - getXMin()) * (getYMax() - getYMin()) * (getZMax() - getZMin());
5373 }

References getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), and getZMin().

Referenced by ShearStage::actionsAfterTimeStep(), getKineticStress(), getStaticStress(), GranuHeap::GranuHeap(), and ShearStage::printTime().

◆ getVtkWriter()

ParticleVtkWriter * DPMBase::getVtkWriter ( ) const
5295 {
5296  return vtkWriter_;
5297 }

References vtkWriter_.

◆ getWallsWriteVTK()

FileType DPMBase::getWallsWriteVTK ( ) const

Returns whether walls are written in a VTK file.

Deprecated:
Use wallHandler.getWriteVTK() instead (since 21-07-2021)

The VTK file is used for visualisation in Paraview.

Todo:
Move this (and the set) to WallHandler.
Returns
bool
974 {
975  logger(WARN, "DPMBase.getWallsWriteVTK() is deprecated! Use wallHandler.getWriteVTK() instead.");
976  return wallHandler.getWriteVTK();
977 }
FileType getWriteVTK() const
Returns whether walls are written in a VTK file.
Definition: WallHandler.cc:477

References WallHandler::getWriteVTK(), logger, wallHandler, and WARN.

◆ getWallTime()

double DPMBase::getWallTime ( )
inline
915 { return clock_.getWallTime(); }
Mdouble getWallTime()
Definition: MercuryTime.h:88

References clock_, and Time::getWallTime().

◆ getWallVTKWriter()

WallVTKWriter & DPMBase::getWallVTKWriter ( )

◆ getWritePythonFileForVTKVisualisation()

bool DPMBase::getWritePythonFileForVTKVisualisation ( ) const
5501 {
5503 }
bool forceWritePythonFileForVTKVisualisation_
Definition: DPMBase.h:1519

References forceWritePythonFileForVTKVisualisation_.

◆ getXBallsAdditionalArguments()

std::string DPMBase::getXBallsAdditionalArguments ( ) const

Returns the additional arguments for xballs.

Returns
xBallsAdditionalArguments_
1356 {
1358 }

References xBallsAdditionalArguments_.

Referenced by write(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getXBallsColourMode()

int DPMBase::getXBallsColourMode ( ) const

Get the xballs colour mode (CMode).

Returns the integer value corresponding to the colour scheme used by the XBalls visualisation software. See also setXBallsColourMode and the Visualising data in xballs

Returns
int xBallsColourMode_ The integer value corresponding to the colour scheme used by the XBalls visualisation software.
1311 {
1312  return xBallsColourMode_;
1313 }

References xBallsColourMode_.

Referenced by inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getXBallsScale()

double DPMBase::getXBallsScale ( ) const

Returns the scale of the view in xballs.

Returns
double xBallsScale_ The scaling or "zoom" - corresponds tol the XBalls "-s" flag. Values > 1 mean a "zoomed out" view, values < 1 give a "zoomed in" view.
1373 {
1374  return xBallsScale_;
1375 }

References xBallsScale_.

Referenced by inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getXBallsVectorScale()

double DPMBase::getXBallsVectorScale ( ) const

Returns the scale of vectors used in xballs.

Returns the length of the vectors which represent particle velocities in XBalls visualisations (see also setXBallsVectorScale and the Visualising data in xballs).

Returns
double xBallsVectorScale_ The value of the vector length used in XBalls visualisations. A value of 100 sets the length to 1 particle radius, 1000 sets it to 10 particle radii etc.
1331 {
1332  return xBallsVectorScale_;
1333 }

References xBallsVectorScale_.

Referenced by inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getXCenter()

Mdouble DPMBase::getXCenter ( ) const
inline
654  { return 0.5*(max_.X+min_.X); }
Mdouble X
the vector components
Definition: Vector.h:66

References max_, min_, and Vec3D::X.

Referenced by main().

◆ getXMax()

Mdouble DPMBase::getXMax ( ) const
inline

If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.

627  { return max_.x(); }
Mdouble & x()
RW reference to X.
Definition: Vector.h:360

References max_, and Vec3D::x().

Referenced by LeesEdwardsDemo::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), Chutebelt::actionsAfterTimeStep(), Chutebelt::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), ChuteWithPeriodicInflow::AddContinuingBottom(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), Funnel::check_funnel(), checkSettings(), ChutePeriodicDemo::ChutePeriodicDemo(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ChuteWithPeriodicInflow::cleanChute(), ChuteWithContraction::cleanChute(), Chute::cleanChute(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), LawinenBox::create_inflow_particle(), ChutePeriodic::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), Chute::createBottom(), Chute::createFlowParticle(), CSCWalls::CSCWalls(), decompose(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), Chute::getChuteLength(), ChuteWithHopper::getChuteLength(), ChuteWithHopper::getMaximumVelocityInducedByGravity(), DomainHandler::getParticleDomainGlobalIndex(), getTotalVolume(), StatisticsVector< T >::getXMaxStat(), MarbleRun::includeInDomain(), Indenter::Indenter(), inflowFromPeriodic::inflowFromPeriodic(), InitialConditions< SpeciesType >::InitialConditions(), HGridOptimiser::initialise(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LawinenBox::LawinenBox(), ChuteWithPeriodicInflow::loadPeriodicBox(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), ChuteWithHopper::setHopperShift(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), multiParticleT1::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), LiquidMigrationMPI2Test::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), LeesEdwardsDemo::setupInitialConditions(), MarbleRun::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), TimeDependentPeriodicBoundaryTest::setupInitialConditions(), Cstatic2d::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), SquarePacking::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), FreeFallInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), MercuryProblem::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial1::setupInitialConditions(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), Tutorial9::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), setXMin(), Siegen::Siegen(), FlowFrontChute::stretch(), T_protectiveWall::T_protectiveWall(), StressStrainControlBoundary::updateDomainSize(), viscoElasticUnitTest::viscoElasticUnitTest(), write(), writeFstatHeader(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getXMin()

Mdouble DPMBase::getXMin ( ) const
inline

If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.

620  { return min_.x(); }

References min_, and Vec3D::x().

Referenced by LeesEdwardsDemo::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), Chutebelt::actionsAfterTimeStep(), Chutebelt::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), Funnel::check_funnel(), checkSettings(), ChutePeriodicDemo::ChutePeriodicDemo(), Chute::cleanChute(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), MercuryLogo::constructTextAsParticles(), LawinenBox::create_inflow_particle(), ChutePeriodic::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), ChuteWithVerticalHopper::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), Chute::createBottom(), Chute::createFlowParticle(), CSCWalls::CSCWalls(), decompose(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), DomainHandler::getParticleDomainGlobalIndex(), getTotalVolume(), StatisticsVector< T >::getXMinStat(), MarbleRun::includeInDomain(), Indenter::Indenter(), InitialConditions< SpeciesType >::InitialConditions(), HGridOptimiser::initialise(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), multiParticleT1::setupInitialConditions(), my_problem::setupInitialConditions(), Binary::setupInitialConditions(), ForceLawsMPI2Test::setupInitialConditions(), LiquidMigrationMPI2Test::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), LeesEdwardsDemo::setupInitialConditions(), MarbleRun::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), TimeDependentPeriodicBoundaryTest::setupInitialConditions(), Cstatic2d::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), SquarePacking::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), MercuryProblem::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial6::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), setXMax(), FlowFrontChute::stretch(), T_protectiveWall::T_protectiveWall(), StressStrainControlBoundary::updateDomainSize(), write(), writeFstatHeader(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getYCenter()

Mdouble DPMBase::getYCenter ( ) const
inline
657  { return 0.5*(max_.Y+min_.Y); }
Mdouble Y
Definition: Vector.h:66

References max_, min_, and Vec3D::Y.

Referenced by main().

◆ getYMax()

Mdouble DPMBase::getYMax ( ) const
inline

If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.

639  { return max_.y(); }
Mdouble & y()
RW reference to Y.
Definition: Vector.h:372

References max_, and Vec3D::y().

Referenced by T_protectiveWall::actionsAfterTimeStep(), LeesEdwardsDemo::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), protectiveWall::actionsAfterTimeStep(), SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), ChuteWithHopper::addHopper(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), Funnel::check_funnel(), checkSettings(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), MercuryLogo::constructTextAsParticles(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), LawinenBox::create_inflow_particle(), ChutePeriodic::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), ChuteWithVerticalHopper::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), SegregationWithHopper::create_inflow_particle(), Funnel::create_walls(), Chute::createBottom(), Chute::createFlowParticle(), CSCWalls::CSCWalls(), decompose(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), ChuteWithPeriodicInflow::ExtendInWidth(), Chute::getChuteWidth(), DomainHandler::getParticleDomainGlobalIndex(), getTotalVolume(), StatisticsVector< T >::getYMaxStat(), MarbleRun::includeInDomain(), Indenter::Indenter(), InitialConditions< SpeciesType >::InitialConditions(), HGridOptimiser::initialise(), HorizontalMixer::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LawinenBox::LawinenBox(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass::setupInitialConditions(), LeesEdwardsDemo::setupInitialConditions(), MarbleRun::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), TimeDependentPeriodicBoundaryTest::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), SquarePacking::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), FreeFallInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), MercuryProblem::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial1::setupInitialConditions(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), Tutorial9::setupInitialConditions(), MD_demo::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), setYMin(), T_protectiveWall::T_protectiveWall(), StressStrainControlBoundary::updateDomainSize(), viscoElasticUnitTest::viscoElasticUnitTest(), write(), writeFstatHeader(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getYMin()

Mdouble DPMBase::getYMin ( ) const
inline

If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.

633  { return min_.y(); }

References min_, and Vec3D::y().

Referenced by LeesEdwardsDemo::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), ChuteWithHopper::addHopper(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), Funnel::check_funnel(), checkSettings(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), LawinenBox::create_inflow_particle(), ChutePeriodic::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), ChuteWithVerticalHopper::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), SegregationWithHopper::create_inflow_particle(), Funnel::create_walls(), Chute::createBottom(), Chute::createFlowParticle(), CSCWalls::CSCWalls(), decompose(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), ChuteWithPeriodicInflow::ExtendInWidth(), DomainHandler::getParticleDomainGlobalIndex(), getTotalVolume(), StatisticsVector< T >::getYMinStat(), MarbleRun::includeInDomain(), Indenter::Indenter(), InitialConditions< SpeciesType >::InitialConditions(), HGridOptimiser::initialise(), HorizontalMixer::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), readParAndIniFiles(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), my_problem::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Binary::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass::setupInitialConditions(), LeesEdwardsDemo::setupInitialConditions(), MarbleRun::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), TimeDependentPeriodicBoundaryTest::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), SquarePacking::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), MercuryProblem::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), setYMax(), StressStrainControlBoundary::updateDomainSize(), write(), writeFstatHeader(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getZCenter()

Mdouble DPMBase::getZCenter ( ) const
inline
660  { return 0.5*(max_.Z+min_.Z); }
Mdouble Z
Definition: Vector.h:66

References max_, min_, and Vec3D::Z.

◆ getZMax()

Mdouble DPMBase::getZMax ( ) const
inline

If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.

651  { return max_.z(); }
Mdouble & z()
RW reference to Z.
Definition: Vector.h:384

References max_, and Vec3D::z().

Referenced by SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), checkSettings(), ClosedCSCWalls::ClosedCSCWalls(), MercuryLogo::constructTextAsParticles(), Funnel::create_funnel(), LawinenBox::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), ChuteWithVerticalHopper::create_inflow_particle(), CSCWalls::CSCWalls(), decompose(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), DomainHandler::getParticleDomainGlobalIndex(), getTotalVolume(), StatisticsVector< T >::getZMaxStat(), MarbleRun::includeInDomain(), HGridOptimiser::initialise(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), LawinenBox::LawinenBox(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), NozzleDemo::setupInitialConditions(), Binary::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), MarbleRun::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DPM::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial1::setupInitialConditions(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), FreeFall::setupInitialConditions(), MD_demo::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), setZMin(), Siegen::Siegen(), SilbertHstop::solve_analytic(), T_protectiveWall::T_protectiveWall(), StressStrainControlBoundary::updateDomainSize(), viscoElasticUnitTest::viscoElasticUnitTest(), write(), writeFstatHeader(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getZMin()

Mdouble DPMBase::getZMin ( ) const
inline

If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.

645  { return min_.z(); }

References min_, and Vec3D::z().

Referenced by HourGlass2D::actionsAfterTimeStep(), HourGlass::actionsAfterTimeStep(), Tutorial11::actionsAfterTimeStep(), SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), SilbertPeriodic::add_flow_particles(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), checkSettings(), Funnel::cleanChute(), inflowFromPeriodic::cleanChute(), ClosedCSCWalls::ClosedCSCWalls(), LawinenBox::create_inflow_particle(), ChutePeriodic::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), ChuteWithVerticalHopper::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), Chute::createBottom(), Chute::createFlowParticle(), CSCWalls::CSCWalls(), decompose(), StressStrainControlBoundary::determineStressControlledShearBoundaries(), SphericalIndenter::getBedHeight(), DomainHandler::getParticleDomainGlobalIndex(), getTotalVolume(), StatisticsVector< T >::getZMinStat(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), HGridOptimiser::initialise(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), readParAndIniFiles(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), HorizontalMixer::setOuterWalls(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), NozzleDemo::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), Chain::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), MarbleRun::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DPM::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial9::setupInitialConditions(), MD_demo::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), WallSpecies::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), setZMax(), StressStrainControlBoundary::updateDomainSize(), write(), writeFstatHeader(), inflowFromPeriodic::writeXBallsScript(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ handleParticleAddition()

void DPMBase::handleParticleAddition ( unsigned int  id,
BaseParticle p 
)
virtual

\briefHandles the addition of particles to the particleHandler

This function is called by ParticleHandler::addObject and ParticleHandler::addGhostObject to broadcast the addition of a particle from the handler. It passes the information on to the walls in the wallHandler.

Parameters
[in]idThe id of the removed particle.
[in]pA pointer to the particle.
5478 {
5479  for (auto w: wallHandler)
5480  {
5481  w->handleParticleAddition(id, p);
5482  }
5483 }

References wallHandler.

Referenced by ParticleHandler::addGhostObject(), and ParticleHandler::addObject().

◆ handleParticleRemoval()

void DPMBase::handleParticleRemoval ( unsigned int  id)
virtual

Handles the removal of particles from the particleHandler.

This function is called by ParticleHandler::removeObject and ParticleHandler::removeGhostObject to broadcast the removal of a particle from the handler. It passes the information on to the walls in the wallHandler.

Parameters
[in]idThe id of the removed particle.
5463 {
5464  for (auto w: wallHandler)
5465  {
5466  w->handleParticleRemoval(id);
5467  }
5468 }

References wallHandler.

Referenced by ParticleHandler::clear(), ParticleHandler::removeGhostObject(), ParticleHandler::removeLastObject(), and ParticleHandler::removeObject().

◆ hGridActionsAfterIntegration()

void DPMBase::hGridActionsAfterIntegration ( )
protectedvirtual

This function has to be called after integrateBeforeForceComputation.

no implementation but can be overidden in its derived classes.

Reimplemented in MercuryBase.

1948 {
1949 }

Referenced by computeOneTimeStep().

◆ hGridActionsBeforeIntegration()

void DPMBase::hGridActionsBeforeIntegration ( )
protectedvirtual

This function has to be called before integrateBeforeForceComputation.

no implementation but can be overidden in its derived classes.

Reimplemented in MercuryBase.

1941 {
1942 }

Referenced by computeOneTimeStep().

◆ hGridActionsBeforeTimeLoop()

void DPMBase::hGridActionsBeforeTimeLoop ( )
protectedvirtual

A virtual function that allows one to carry out hGrid operations before the start of the time loop.

no implementation but can be overidden in its derived classes.

Reimplemented in MercuryBase.

1677 {
1678 }

Referenced by initialiseSolve().

◆ hGridActionsBeforeTimeStep()

void DPMBase::hGridActionsBeforeTimeStep ( )
protectedvirtual

A virtual function that allows one to set or execute hGrid parameters or operations before every simulation time step.

no implementation but can be overidden in its derived classes.

Reimplemented in MercuryBase.

1691 {
1692 }

Referenced by computeOneTimeStep(), and initialiseSolve().

◆ hGridGetInteractingParticleList()

virtual void DPMBase::hGridGetInteractingParticleList ( BaseParticle obj,
std::vector< BaseParticle * > &  list 
)
inlinevirtual

Creates a list of neighbour particles obtained from the hgrid.

Reimplemented in Mercury3D, and Mercury2D.

1001  {};

Referenced by PeriodicBoundaryHandler::processLocalInteractionData(), PeriodicBoundaryHandler::processReceivedInteractionData(), and Domain::processReceivedInteractionData().

◆ hGridInsertParticle()

void DPMBase::hGridInsertParticle ( BaseParticle *obj  UNUSED)
virtual
Bug:
Why are the hGRID actions public, this seems wrong. Someone please comment [Ant].

no implementation but can be overidden in its derived classes.

1698 {
1699 }

Referenced by ParticleHandler::addExistingObject(), ParticleHandler::addGhostObject(), and ParticleHandler::addObject().

◆ hGridRemoveParticle()

void DPMBase::hGridRemoveParticle ( BaseParticle *obj  UNUSED)
virtual

no implementation but can be overidden in its derived classes.

1712 {
1713 }

Referenced by ParticleHandler::removeGhostObject(), ParticleHandler::removeLastObject(), and ParticleHandler::removeObject().

◆ hGridUpdateMove()

void DPMBase::hGridUpdateMove ( BaseParticle ,
Mdouble   
)
virtual

◆ hGridUpdateParticle()

void DPMBase::hGridUpdateParticle ( BaseParticle *obj  UNUSED)
virtual

◆ importParticlesAs()

void DPMBase::importParticlesAs ( ParticleHandler particleH,
InteractionHandler interactionH,
const ParticleSpecies species 
)

Copies particles, interactions assigning species from a local simulation to a global one. Useful for the creation of a cluster.

Copies particles, interactions assigning species from a local simulation to a global one; useful for the creation of a cluster.

Parameters
[in]particleHthe particle handler from wich particles are copied,
[in]particleHthe interaction handler from wich interactions are copied,
[in]speciesthe species that will be assigned to the particle.
4955 {
4956  size_t nParticlesPreviouslyIn = particleHandler.getSize();
4957  for (auto k = particleH.begin(); k != particleH.end(); ++k) {
4958  auto p = particleHandler.copyAndAddObject( *k );
4959  p->setSpecies(species);
4960  }
4961 
4962  for (std::vector<BaseInteraction*>::const_iterator i = interactionH.begin(); i != interactionH.end(); ++i) {
4963  if ( (*i)->getP()->getInvMass() != 0.0 && (*i)->getI()->getInvMass() != 0.0 ) {
4965  j->importP(particleHandler.getObject(nParticlesPreviouslyIn + j->getP()->getIndex()));
4966  j->importI(particleHandler.getObject(nParticlesPreviouslyIn + j->getI()->getIndex()));
4967  j->setTimeStamp(getNumberOfTimeSteps());
4968  }
4969  }
4970 }
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

References BaseHandler< T >::begin(), BaseHandler< T >::copyAndAddObject(), BaseHandler< T >::end(), getNumberOfTimeSteps(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), constants::i, interactionHandler, and particleHandler.

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

◆ incrementRunNumberInFile()

void DPMBase::incrementRunNumberInFile ( )
static

Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store the new value in the counter file.

In order to increment the counter stored in COUNTER_DONOTDEL, we initialise two fstream objects counter_file, counter_file2 and an integer type temp_counter. First we open the file COUNTER_DONOTDEL, check if everything went fine with the opening. If yes, we extract the runNumber (counter) into the temp_counter. Increment the temp_counter and then write it into COUNTER_DONOTDEL. This is how we increment the counter in the file.

629 {
630 //opening two filestreams - counter_file and counter_file2
631 std::fstream counter_file, counter_file2;
632 //declares an integer, temp_counter
633 int temp_counter;
634 //attempts to open the COUNTER_DONOTDEL text file
635 counter_file.open("COUNTER_DONOTDEL", std::ios::in);
636 //gives error message if file could not be successfully opened and ends the program
637 if (counter_file.fail())
638 {
639 fprintf(stderr, "\n\n\tERROR :: Counter File NOT found, please re-create\n\n");
640 counter_file.close();
641 exit(0);
642 }
643 // if opened successfully, reads in the counter corresponding to the current run number
644 //and stored it in the "temp_counter" variable
645 counter_file >> temp_counter;
646 counter_file.close();
647 //Increments the temp_counter
648 temp_counter++;
649 //opens an output stream to the COUNTER_DONOTDEL file
650 counter_file2.open("COUNTER_DONOTDEL", std::ios::out);
651 if (counter_file2.fail())
652 {
653 fprintf(stderr, "\n\n\tERROR :: Counter File NOT found, please re-create2\n\n");
654 counter_file2.close();
655 exit(0);
656 }
657 //writes the new valuer of the counter to COUNTER_DONOTDEL
658 counter_file2 << temp_counter;
659 
660 counter_file2.close();
661 }

Referenced by autoNumber().

◆ initialiseSolve()

void DPMBase::initialiseSolve ( )

Beginning of the solve routine, before time stepping.

  • Initialises the time, sets up the initial conditions for the simulation by calling the setupInitialConditions() and resets the counter using setNExtSavedTimeStep().
    • HGrid operations which is the contact detection algorithm.
    • Checks if the basic essentials are set for carrying out the simulations using checkSettings()
    • And many more vital operations.

Further details are included in the body of the code, below.

Todo:
Is it necessary to reset initial conditions here and in setTimeStepByParticle (i.e. should it be in constructor) Thomas: I agree, setTimeStepByParticle should be rewritten to work without calling setupInitialConditions

Initialise the time and sets up the initial conditions for the simulation

Todo:
Is it necessary to reset initial conditions here and in setTimeStepByParticle (i.e. should it be in constructor)? Thomas: I agree, setTimeStepByParticle should be rewritten to work without calling setupInitialConditions
Todo:
MX: Why does the mass get computed here? if a particle is assigned a radius, it automatically also computes its mass. IFCD: commenting out this line does not make any test fail on my system.
4171  {
4172  logger(DEBUG, "Entered solve");
4173 #ifdef CONTACT_LIST_HGRID
4174  logger(INFO,"Using CONTACT_LIST_HGRID");
4175 #endif
4176 
4181  if (!getRestarted()) {
4182  // If the simulation is "new" (i.e. not restarted):
4183  // - set time, nTimeSteps to zero
4184  // - reset the file counter etc.
4185  // - decompose the domain based on XMin, XMax, ....
4186  // - run user-defined setupInitialConditions
4187  numberOfTimeSteps_ = 0;
4188  setTime(0.0);
4189  resetFileCounter();
4190  decompose();
4191  //\todo tw there was a function combining the next two lines, why is it back to the old version?
4192  //setLastSavedTimeStep(NEVER); //reset the counter
4193  //this is to ensure that the interaction time stamps agree with the resetting of the time value
4194  for (auto &i: interactionHandler)
4195  i->setTimeStamp(0);
4197  logger(DEBUG, "Have created the particles initial conditions");
4198  } else {
4199  // If the simulation is "restarted" (i.e. not restarted):
4200 
4201  // - run wall-defined actionsOnRestart
4202  for (auto w: wallHandler) {
4203  w->actionsOnRestart();
4204  }
4205 
4206  // - run user-defined actionsOnRestart
4207  actionsOnRestart();
4208  }
4209 
4210  // Check that the code has been correctly set up,
4211  // i.e. system dimensions, particles and time steps are sensibly implemented
4212  checkSettings();
4213 
4214  // If the simulation is "new" and the runNumber is used, append the run number to the problem name
4215  if (getRunNumber() > 0 && !getRestarted()) {
4216  std::stringstream name;
4217  name << getName() << "." << getRunNumber();
4218  setName(name.str());
4219  }
4220 
4221  //If append is true, files are appended, not overwritten
4222  if (getAppend()) {
4223  setOpenMode(std::fstream::out | std::fstream::app);
4224  //Restart files should always be overwritten.
4225  restartFile.setOpenMode(std::fstream::out);
4226  } else {
4227  setOpenMode(std::fstream::out);
4228  }
4229 
4230  //sets the hgrid, writes headers to the .stat output file
4232 
4233  if (getInteractionFile().getFileType() == FileType::ONE_FILE) {
4234  logger(WARN, "Warning: interaction file will take up a lot of disk space!");
4236  }
4237 
4238  // Sets the mass of all particle.
4242 
4243  // Other initialisations
4244  //max_radius = getLargestParticle()->getRadius();
4245 
4249 
4250  // Performs a first force computation
4252 
4253 #ifdef MERCURYDPM_USE_MPI
4254  if (NUMBER_OF_PROCESSORS > 1)
4255  {
4256  //Find new mpi particles
4258  //Periodic particles in parallel
4260  }
4261 #endif
4262 
4264  computeAllForces();
4267  logger(DEBUG, "Have computed the initial values for the forces ");
4268 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
void boundaryActionsBeforeTimeLoop()
Definition: BoundaryHandler.cc:261
bool getAppend() const
Returns whether the "append" option is on or off.
Definition: DPMBase.cc:1510
void checkSettings()
Checks if the essentials are set properly to go ahead with solving the problem.
Definition: DPMBase.cc:3999
virtual void initialiseStatistics()
Definition: DPMBase.cc:1885
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DPMBase.cc:1998
void setOpenMode(std::fstream::openmode openMode)
Sets File::openMode_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:490
virtual void hGridActionsBeforeTimeLoop()
A virtual function that allows one to carry out hGrid operations before the start of the time loop.
Definition: DPMBase.cc:1676
File & getInteractionFile()
Return a reference to the file InteractionsFile.
Definition: DPMBase.cc:345
virtual void actionsOnRestart()
A virtual function where the users can add extra code which is executed only when the code is restart...
Definition: DPMBase.cc:1683
void resetFileCounter()
Resets the file counter for each file i.e. for ene, data, fstat, restart, stat)
Definition: DPMBase.cc:471
virtual void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop.
Definition: DPMBase.cc:1669
virtual void decompose()
Sends particles from processorId to the root processor.
Definition: DPMBase.cc:4088
void addNewParticles()
Definition: DomainHandler.cc:429
void setOpenMode(std::fstream::openmode openMode)
Allows the user to Sets File::openMode_.
Definition: File.cc:247
void computeAllMasses(unsigned int indSpecies)
Computes the mass for all BaseParticle of the given species in this ParticleHandler.
Definition: ParticleHandler.cc:1215
void addNewParticles()
Adds new particles to the periodic particle lists.
Definition: PeriodicBoundaryHandler.cc:300
std::string name
Definition: MercuryProb.h:48

References InteractionHandler::actionsAfterTimeStep(), actionsBeforeTimeLoop(), actionsOnRestart(), DomainHandler::addNewParticles(), PeriodicBoundaryHandler::addNewParticles(), BoundaryHandler::boundaryActionsBeforeTimeLoop(), boundaryHandler, checkAndDuplicatePeriodicParticles(), checkSettings(), computeAllForces(), ParticleHandler::computeAllMasses(), DEBUG, decompose(), domainHandler, getAppend(), getInteractionFile(), getName(), getRestarted(), getRunNumber(), hGridActionsBeforeTimeLoop(), hGridActionsBeforeTimeStep(), constants::i, INFO, initialiseStatistics(), interactionHandler, logger, units::name, NUMBER_OF_PROCESSORS, numberOfTimeSteps_, ONE_FILE, File::open(), particleHandler, periodicBoundaryHandler, removeDuplicatePeriodicParticles(), resetFileCounter(), restartFile, setName(), setOpenMode(), File::setOpenMode(), setTime(), setupInitialConditions(), wallHandler, and WARN.

Referenced by solve().

◆ initialiseStatistics()

void DPMBase::initialiseStatistics ( )
protectedvirtual

This function is overridden by StatisticsVector

Reimplemented in statistics_while_running< T >, StatisticsVector< T >, StatisticsVector< O >, StatisticsVector< XZ >, and statistics_while_running< T >.

1886 {
1888 }
void initialise()
Contains the code executed before the first time step.
Definition: CGHandler.cc:90

References cgHandler, and CGHandler::initialise().

Referenced by initialiseSolve().

◆ insertGhostParticle()

void DPMBase::insertGhostParticle ( BaseParticle particle)

This function inserts a particle in the mpi communication boundaries.

Parameters
[in]particlePointer to a base particle that needs to be inserted in the communication boundaries
1812 {
1813 #ifdef MERCURYDPM_USE_MPI
1814  //mpi particles only exist when there is more than one domain
1815  if (domainHandler.getSize() > 0)
1816  {
1817  //Add the particle to the mpi domain
1819  }
1820 
1821  //If periodic boundaries are present..
1822  if (periodicBoundaryHandler.getSize() > 0)
1823  {
1825  }
1826 #endif
1827 }
void addParticle(BaseParticle *particle)
Initialises a single particle which is added during the simulation.
Definition: Domain.cc:1610
void addNewParticle(BaseParticle *particle)
Adds a new particle to the periodic list.
Definition: PeriodicBoundaryHandler.cc:333

References PeriodicBoundaryHandler::addNewParticle(), Domain::addParticle(), domainHandler, DomainHandler::getCurrentDomain(), BaseHandler< T >::getSize(), and periodicBoundaryHandler.

Referenced by ParticleHandler::addObject().

◆ integrateAfterForceComputation()

void DPMBase::integrateAfterForceComputation ( )
protectedvirtual

Update particles' and walls' positions and velocities after force computation.

Performs integration - i.e. updating particle's positions, velocities and accelerations - for all particles and walls within the system (i.e. in the particleHandler and wallHandler). Integration is performed using the BaseParticle::integrateBeforeForceComputation() function.

The velocity Verlet algorithm requires us to integrate twice each time step: both before and after the force computation. This method is therefore used in conjunction with DPMBase::integrateAfterForceComputation(). See http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet for details.

3306 {
3307  //cycling through all particles, p, in the particleHandler
3308  //for_each(particleHandler.begin(), particleHandler.end(), [this](BaseParticle* p){
3309  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3310  for (int k = 0; k < particleHandler.getSize(); ++k) {
3312 #ifdef MERCURYDPM_USE_MPI
3313  //MPI particles do not require integration - they are updated by the communication step
3314  if (!(p->isMPIParticle() || p->isPeriodicGhostParticle()))
3315  {
3317  }
3318 #else
3319  //using the particle p's internal "integrateAfterForceComputation" function
3320  //to update the relevant parameters concerning the particle's position and motion
3322 #endif
3323  }
3324  //});
3325  //cycling through all walls, w, in the wallHandler
3326  //for_each(wallHandler.begin(), wallHandler.end(), [this](BaseWall* w){
3327  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3328  for (int k = 0; k < wallHandler.getSize(); k++) {
3329  BaseWall *w = wallHandler.getObject(k);
3330  //using the wall's internal "integrateAfterForceComputation" function
3331  //to update the relevant parameters concerning its position and motion
3333  }
3334  //});
3335 }
void integrateAfterForceComputation(double time, double timeStep)
This is part of the integration routine for objects with infinite mass.
Definition: BaseInteractable.cc:611
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Definition: BaseParticle.cc:297
bool isMPIParticle() const
Indicates if this particle is a ghost in the MPI domain.
Definition: BaseParticle.cc:181
virtual void integrateAfterForceComputation(double time, double timeStep)
Second step of Velocity Verlet integration.
Definition: BaseParticle.cc:762
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808

References BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getTime(), getTimeStep(), BaseInteractable::integrateAfterForceComputation(), BaseParticle::integrateAfterForceComputation(), BaseParticle::isMPIParticle(), BaseParticle::isPeriodicGhostParticle(), particleHandler, and wallHandler.

Referenced by computeOneTimeStep().

◆ integrateBeforeForceComputation()

void DPMBase::integrateBeforeForceComputation ( )
protectedvirtual

Update particles' and walls' positions and velocities before force computation.

This is where the integration is done, at the moment it is velocity Verlet integration and is done before the forces are computed. See http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet

Performs integration - i.e. updating particle's positions, velocities and accelerations - for all particles and walls within the system (i.e. in the particleHandler and wallHandler). Integration is performed using the BaseParticle::integrateBeforeForceComputation() function.

The velocity Verlet algorithm requires us to integrate twice each time step: both before and after the force computation. This method is therefore used in conjunction with DPMBase::integrateAfterForceComputation(). See http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet for details.

Reimplemented in ChuteWithPeriodicInflow.

3220 {
3221  //cycling through all particles, p, in the particleHandler
3222  //for_each(particleHandler.begin(), particleHandler.end(), [this](BaseParticle* p)
3223  //for (BaseParticle* p : particleHandler) {
3224 
3225  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3226  for (int k = 0; k < particleHandler.getSize(); ++k) {
3228 #ifdef MERCURYDPM_USE_MPI
3229  //MPI particles are not integrated, they are purely ghost particles and get their new velocity and position from an MPI update
3230  if (!(p->isMPIParticle() || p->isPeriodicGhostParticle()))
3231  {
3233  }
3234 #else
3235  //using the particle p's internal "integrateBeforeForceComputation" function
3236  //to update the relevant parameters concerning the particle's position and motion
3238 #endif
3239  }
3240  //});
3241  //cycling through all walls, w, in the wallHandler
3242  //for_each(wallHandler.begin(), wallHandler.end(), [this](BaseWall* w)
3243  //for (BaseWall* w : wallHandler) {
3244  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3245  for (int k = 0; k < wallHandler.getSize(); k++) {
3246  BaseWall *w = wallHandler.getObject(k);
3247  //using the wall's internal "integrateBeforeForceComputation" function
3248  //to update the relevant parameters concerning its position and motion
3250  }
3251  //});
3252 }
void integrateBeforeForceComputation(double time, double timeStep)
This is part of integrate routine for objects with infinite mass.
Definition: BaseInteractable.cc:538
virtual void integrateBeforeForceComputation(double time, double timeStep)
First step of Velocity Verlet integration.
Definition: BaseParticle.cc:720

References BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getTime(), getTimeStep(), BaseInteractable::integrateBeforeForceComputation(), BaseParticle::integrateBeforeForceComputation(), BaseParticle::isMPIParticle(), BaseParticle::isPeriodicGhostParticle(), particleHandler, and wallHandler.

Referenced by computeOneTimeStep().

◆ isTimeEqualTo()

bool DPMBase::isTimeEqualTo ( Mdouble  time) const
protected

Checks whether the input variable "time" is the current time in the simulation.

Returns true if and only if the "time" argument passed to the function is equal to the current simulation time i.e. if "time" is either exactly equal to the current simulation time (getTime() ) or at least lies between this time step and the next increment (this nicely avoids rounding errors!)

Returns
true if "time" and getTime() are equal, otherwise false.
5204 {
5205  return getTime() <= time && getTime() + getTimeStep() > time;
5206 }

References getTime(), and getTimeStep().

◆ launchNewRun()

int DPMBase::launchNewRun ( const char name,
bool quick  UNUSED = false 
)

This launches a code from within this code. Please pass the name of the code to run.

Reads in the name of the command (code) to be launched. This name is then converted to a string stream and appended with " &" (such that command is run in the background), before being converted back to a C string and then fed to the system() command which will execute the named code from within the running Mercury program.

Parameters
[in]nameThe name of the code to be launched
[in]quick
Returns
int
776 {
777 //defines an (empty) stringstream named "com"
778 std::stringstream com("");
779 //adds the name of the code to run (fed in as an argument)
780 //to the "com" string and appends the string with " &"
781 com << name << " &";
782 //converts the stringstream "com" to a standard string, and then
783 //converts this string to a C string
784 //the string is then fed to the "system" function, which will run the named command
785 return system(com.str().c_str());
786 }

References units::name.

Referenced by ParameterStudy1DDemo::actionsAfterSolve(), ParameterStudy2DDemo::actionsAfterSolve(), ParameterStudy3DDemo::actionsAfterSolve(), ParameterStudy1DDemo::actionsBeforeTimeLoop(), ParameterStudy2DDemo::actionsBeforeTimeLoop(), ParameterStudy3DDemo::actionsBeforeTimeLoop(), and FlowRule::launch().

◆ mpiInsertParticleCheck()

bool DPMBase::mpiInsertParticleCheck ( BaseParticle P)

Function that checks if the mpi particle should really be inserted by the current domain.

When adding a particle, all domains "add" the particle to enable communication between processors However not very domain should add the particle, only the domain that actually contains the particle There is one exception, if an MPI Particle is added (which is not physically in the current domain), this has already been approved by the domain and hence it should return true.

Parameters
[in]PPointer to a baseParticle that requires an insertion check
Returns
Returns if the baseParticle should be inserted or not
1733 {
1734 #ifdef MERCURYDPM_USE_MPI
1735  //If only one core is used (i.e. domainHandler is empty) then the result is always true
1736  if (domainHandler.getSize() == 0)
1737  {
1738  return true;
1739  }
1740  //Get the current domain
1742 
1743  //Check if the particle is in the current domain
1744  if(domain->containsParticle(P))
1745  {
1746  //When adding a particle inside the domain, this should always be true
1747  return true;
1748  }
1749  else
1750  {
1751  //MPI particles that are inserted in the communication zone should still be inserted
1752  return (P->isMPIParticle());
1753  }
1754 #else
1755  return false;
1756 #endif
1757 }
bool containsParticle(BaseParticle *particle, Mdouble offset=0.0)
Check to see if a given particle is within the current domain.
Definition: Domain.cc:400
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73

References Domain::containsParticle(), domainHandler, DomainHandler::getCurrentDomain(), BaseHandler< T >::getSize(), and Global_Physical_Variables::P.

Referenced by ParticleHandler::addObject().

◆ mpiIsInCommunicationZone()

bool DPMBase::mpiIsInCommunicationZone ( BaseParticle particle)

Checks if the position of the particle is in an mpi communication zone or not.

Parameters
[in]particlePointer to a base particle
Returns
Returns if the particle is in the communication zone (true) or not (false)
1765 {
1766 
1767  bool insideCommunicationZone = false;
1768 #ifdef MERCURYDPM_USE_MPI
1769  MPIContainer& communicator = MPIContainer::Instance();
1770 
1771  //Check for the current domain if the particle is within the communication domain
1772  int val = domainHandler.getCurrentDomain()->isInCommunicationZone(particle);
1773 
1774  //The root gathers all results
1775  int *list = nullptr;
1776  if (PROCESSOR_ID == 0)
1777  {
1778  list = new int [NUMBER_OF_PROCESSORS];
1779  }
1780  communicator.gather(val,list);
1781 
1782  //Compute the global value
1783  //if on any processor the val is true, we have to do the communcation step
1785  int result = 0;
1786  if (PROCESSOR_ID == 0)
1787  {
1788  for (int i = 0; i< NUMBER_OF_PROCESSORS; i++)
1789  {
1790  if (list[i] == 1)
1791  {
1792  result = 1;
1793  break;
1794  }
1795  }
1796  }
1797 
1798  //The root now tells the other processors what the global value for the interaction is
1799  communicator.broadcast(result);
1800 
1801  //Convert the result back to bool
1802  insideCommunicationZone = result;
1803 #endif
1804  return insideCommunicationZone;
1805 }
bool isInCommunicationZone(BaseParticle *particle)
Check if the particle is in the communication zone of the current domain.
Definition: Domain.cc:441
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:130

References MPIContainer::broadcast(), domainHandler, MPIContainer::gather(), DomainHandler::getCurrentDomain(), constants::i, MPIContainer::Instance(), Domain::isInCommunicationZone(), NUMBER_OF_PROCESSORS, and PROCESSOR_ID.

◆ outputInteractionDetails()

void DPMBase::outputInteractionDetails ( ) const
protected

Displays the interaction details corresponding to the pointer objects in the interaction handler.

Skims through all the object pointers of type BaseInteraction in the interaction handler. Outputs the type of interaction between two particles P and I.

5184 {
5185  logger(INFO, "Interactions currently in the handler:\n", Flusher::NO_FLUSH);
5186  //looping over all individual objects in the interactionHandler
5188  {
5189  p->write(std::cout);
5190  logger(INFO, "\nInteraction % % between % and %",
5191  p->getName(), p->getId(), p->getP()->getId(), p->getI()->getId());
5192  }
5193 }

References INFO, interactionHandler, logger, and NO_FLUSH.

◆ outputStatistics()

void DPMBase::outputStatistics ( )
protectedvirtual

This function is overridden by StatisticsVector

Reimplemented in StatisticsVector< T >, StatisticsVector< O >, and StatisticsVector< XZ >.

1894 {
1895  //cgHandler.evaluate();
1896 }

◆ outputXBallsData()

void DPMBase::outputXBallsData ( std::ostream &  os) const
protectedvirtual

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.

Parameters
[in]os

Reimplemented in SphericalIndenter, LiquidMigrationSelfTest, and LiquidMigrationMPI2Test.

2360 {
2361 
2362 
2363  //Set the correct formation based of dimension if the formation is not specified by the user
2364 
2365  unsigned int format;
2366  switch (getSystemDimensions())
2367  {
2368  case 2:
2369  format = 8;
2370  break;
2371  case 3:
2372  format = 14;
2373  break;
2374  default:
2375  logger(ERROR, "Unknown system dimension");
2376  }
2377 
2378  unsigned int numberOfParticles = particleHandler.getNumberOfRealObjectsLocal();
2379 
2380  // This outputs the location of walls and how many particles there are to file this is required by the xballs plotting
2381  if (format != 14) // dim = 1 or 2
2382  {
2383  os << numberOfParticles
2384  << " " << getTime()
2385  << " " << getXMin()
2386  << " " << getYMin()
2387  << " " << getXMax()
2388  << " " << getYMax()
2389  << " " << std::endl;
2390  }
2391  else
2392  {
2393  //dim==3
2394  os << numberOfParticles
2395  << " " << getTime()
2396  << " " << getXMin()
2397  << " " << getYMin()
2398  << " " << getZMin()
2399  << " " << getXMax()
2400  << " " << getYMax()
2401  << " " << getZMax()
2402  << " " << std::endl;
2403  }
2404 
2405  // This outputs the particle data
2406  for (unsigned int i = 0; i < particleHandler.getSize(); i++)
2407  {
2408 #ifdef MERCURYDPM_USE_MPI
2410  {
2411  outputXBallsDataParticle(i, format, os);
2412  }
2413 #else
2414  outputXBallsDataParticle(i, format, os);
2415 #endif
2416  }
2417 #ifdef DEBUG_OUTPUT
2418  logger(DEBUG, "Have output the properties of the problem to disk ");
2419 #endif
2420 }
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 ...
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1430
unsigned int getNumberOfRealObjectsLocal() const
Returns the number of real objects on a local domain. MPI particles and periodic particles are neglec...
Definition: ParticleHandler.cc:1283

References DEBUG, ERROR, ParticleHandler::getNumberOfRealObjectsLocal(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getSystemDimensions(), getTime(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), constants::i, BaseParticle::isMPIParticle(), BaseParticle::isPeriodicGhostParticle(), logger, outputXBallsDataParticle(), and particleHandler.

Referenced by CSCInit::save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), and writeDataFile().

◆ outputXBallsDataParticle()

virtual void DPMBase::outputXBallsDataParticle ( unsigned int  i,
unsigned int  format,
std::ostream &  os 
) const
protectedvirtual

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.

Referenced by outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), and SphericalIndenter::outputXBallsData().

◆ performGhostParticleUpdate()

void DPMBase::performGhostParticleUpdate ( )
protected

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.

Todo:
MX: Under construction
5064 {
5065 #ifdef MERCURYDPM_USE_MPI
5066  //MPIContainer& communicator = MPIContainer::Instance();
5067  if (NUMBER_OF_PROCESSORS == 1) {return;}
5068 
5069  //Update the postion and velocity data of ghosts and perform some bookkeeping
5070  std::set<BaseParticle*> particlesToBeDeleted;
5071  domainHandler.updateStatus(particlesToBeDeleted);
5072  periodicBoundaryHandler.updateStatus(particlesToBeDeleted);
5073 
5074  //Delete particles
5075  deleteGhostParticles(particlesToBeDeleted);
5076 
5077  //Add new particles
5080 #endif
5081 }
void deleteGhostParticles(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DPMBase.cc:5086
void updateStatus(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DomainHandler.cc:419
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates the positions/velocity of ghost particles and accordingly the status of these particles.
Definition: PeriodicBoundaryHandler.cc:151

References DomainHandler::addNewParticles(), PeriodicBoundaryHandler::addNewParticles(), deleteGhostParticles(), domainHandler, NUMBER_OF_PROCESSORS, periodicBoundaryHandler, PeriodicBoundaryHandler::updateStatus(), and DomainHandler::updateStatus().

Referenced by computeOneTimeStep().

◆ performGhostVelocityUpdate()

void DPMBase::performGhostVelocityUpdate ( )
protected

updates the final time-step velocity of the ghost particles

5129 {
5130 #ifdef MERCURYDPM_USE_MPI
5131  if (NUMBER_OF_PROCESSORS == 1) {return;}
5132  //TODO If required, I can implement this for periodic particles, first discuss with Thomas if it is actually requiredf
5133  //periodicDomainHandler.updateVelocity()
5134  //domainHandler.updateVelocity();
5135 #endif
5136 }

References NUMBER_OF_PROCESSORS.

◆ printTime()

void DPMBase::printTime ( ) const
protectedvirtual

Displays the current simulation time and the maximum simulation duration.

Gets and prints the current simulation time (getTime()) and the currently set maximum simulation time (getTimeMax()) .

Reimplemented in Chute, BaseCluster, TangentialSpringEnergyConservationUnitTest, SpeciesTest, regimeForceUnitTest, RandomClusterInsertionBoundarySelfTest, PeriodicWallsWithSlidingFrictionUnitTest, MultiParticlesInsertion, LiquidMigrationPeriodicBoundaryInteraction, viscoElasticUnitTest, LongHertzianSinterForceUnitTest, RandomClusterInsertionBoundarySelfTest, EvaporationAndHeatTest, protectiveWall, DPM, SphericalIndenter, SinterPair, Sintering, InitialConditions< SpeciesType >, SingleParticle< SpeciesType >, TwoParticleElasticCollisionInteraction, LiquidMigrationSelfTest, PSDSelfTest, PSDManualInsertionSelfTest, PolydisperseInsertionBoundarySelfTest, NozzleSelfTest, MultiplePSDSelfTest, InsertionBoundarySelfTest, DistributionToPSDSelfTest, DistributionSelfTest, DeletionBoundarySelfTest, CubeDeletionBoundarySelfTest, ConstantMassFlowMaserSelfTest, ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest, Silo, Penetration, Drum, vibratedBed, statistics_while_running< T >, SilbertPeriodic, CLiveStatistics< T >, SilbertPeriodic, SilbertPeriodic, statistics_while_running< T >, statistics_while_running< T >, ParticleBeam, ParticleInclusion, LiquidMigrationMPI2Test, ForceLawsMPI2Test, VerticalMixer, RotatingDrumWet, Drum, NozzleDemo, HorizontalMixer, ChuteWithPeriodicInflow, RandomClusterInsertionBoundarySelfTest, Vreman, Vreman, Vreman, VariableBottom, ChutePeriodic, VariableBottom, ChutePeriodic, CSCWalls, CSCStats, CSCRun, CSCRestart, CSCInit, ClosedCSCWalls, ClosedCSCStats, ClosedCSCRun, ClosedCSCRestart, ShearStage, GranuHeap, GranuDrum, LawinenBox, LawinenBox, LawinenBox, and T_protectiveWall.

1971 {
1972 #ifdef MERCURYDPM_USE_MPI
1973  MPIContainer& communicator = MPIContainer::Instance();
1974  if (communicator.getProcessorID() == 0)
1975  {
1976 #endif
1977  logger(INFO, "t=%3.6, tmax=%3.6", getTime(), getTimeMax());
1978 #ifdef MERCURYDPM_USE_MPI
1979  }
1980 #endif
1981 }
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
std::size_t getProcessorID()
Reduces a scalar on all processors to one scalar on a target processor.
Definition: MpiContainer.cc:113

References MPIContainer::getProcessorID(), getTime(), getTimeMax(), INFO, MPIContainer::Instance(), and logger.

Referenced by LongHertzianSinterForceUnitTest::printTime(), TangentialSpringEnergyConservationUnitTest::printTime(), Mercury3DRestart::readNextArgument(), and writeOutputFiles().

◆ processStatistics()

void DPMBase::processStatistics ( bool  )
protectedvirtual

This function is overridden by StatisticsVector

Reimplemented in StatisticsVector< T >, StatisticsVector< O >, and StatisticsVector< XZ >.

1919 {
1920 }

◆ read()

void DPMBase::read ( std::istream &  is,
ReadOptions  opt = ReadOptions::ReadAll 
)
virtual

Reads all data from a restart file, e.g. domain data and particle data.

Todo:
warning: hides non-virtual function from the class 'Files'.

Reads in an existing .restart file line-by-line and passes all relevant parameters to the current instance of DPMBase. The data stream corresponding to the desired input file is passed as an argument.

Parameters
[in]isThe data stream from which the particle data will be read.

\TODO: Bound checking

\TODO: Same order as other file format, please?

todo{Do we want to calculate the mass?}

Reimplemented in MercuryBase, ChuteWithHopper, Chute, BaseCluster, Funnel, MembraneSelfTest, and MembraneDemo.

3680 {
3681 #ifdef MERCURYDPM_USE_MPI
3682  int previousNumberOfProcessors;
3683 #endif
3684  //Declares...
3685  std::string dummy;
3686  //...and reads in a dummy variable from the start of the stream "is"
3687  is >> dummy;
3688  //compare the string read in to the phrase "restart_version" to see if the stream corresponds
3689  //to a restart file (all restart files begin with this phrase)
3690  //if both strings match, strcmp(dummy.c_str(), "restart_version") returns 0 (here read as "false")
3691  if (dummy != "restart_version" && dummy != "MercuryDPM")
3692  {
3693  //If the strings do not match, if statement is fulfilled and the error logged
3694  //Note: only very old files did not have a restart_version
3695  logger(FATAL, "Error in DPMBase::read(is): this is not a valid restart file");
3696  }
3697  else
3698  {
3699  //reads in the restart version (earlier versions of Mercury possess different file formats!)
3700  is >> restartVersion_;
3701  //checking which version the current data file corresponds to, and reads the data in
3702  //accordingly
3703  if (restartVersion_ == "1.0" || restartVersion_ == "0.14")
3704  {
3705  //reads in and saves the relevant values from the data file to the current instance of DPMBase
3706  std::stringstream line;
3707 
3708  // Store path (if restart file is nonlocal)
3709  auto slash = restartFile.getName().rfind('/');
3710  std::string path;
3711  if (slash != std::string::npos)
3712  {
3713  path = restartFile.getName().substr(0, slash + 1);
3714  }
3715  if (!path.empty())
3716  {
3717  logger(INFO, "Adding path information (%) to file names", path);
3718  }
3719 
3720  //line 1
3722  //discards the whitespace (ws) at the start of the stream
3723  line >> std::ws;
3724  //uses the "peek" function to access the stream's first
3725  //non-whitespace character, and check if it is an "r"
3726  if (line.peek() == 'r')
3727  //if so, reads in the current run number
3728  line >> dummy >> runNumber_;
3729  //In either case, then uses the "Files" version of the read function
3730  //to read in the rest of the relevant information.
3731  line >> dummy >> name_;
3732  setName(name_);
3733 
3734  //Read line 2-7 (definition of i/o files)
3736  line >> dummy >> dataFile;
3738  line >> dummy >> fStatFile;
3740  line >> dummy >> eneFile;
3742  line >> dummy >> restartFile;
3744  line >> dummy >> statFile;
3745 
3746  // Add the file path from the restart file to the file names
3747  dataFile.setName(path + dataFile.getName());
3748  fStatFile.setName(path + fStatFile.getName());
3749  eneFile.setName(path + eneFile.getName());
3751  statFile.setName(path + statFile.getName());
3752 
3753  // Get current position
3754  //check if the next line starts with 'interactionFile'; otherwise, skip interaction
3755  if (helpers::compare(is, "interactionFile"))
3756  {
3758  line >> interactionFile;
3760  }
3761 
3763  line >> dummy >> min_.x()
3764  >> dummy >> max_.x()
3765  >> dummy >> min_.y()
3766  >> dummy >> max_.y()
3767  >> dummy >> min_.z()
3768  >> dummy >> max_.z();
3769 
3771  line >> dummy >> timeStep_
3772  >> dummy >> time_
3773  >> dummy >> numberOfTimeSteps_
3774  >> dummy >> timeMax_;
3775 
3777  line >> dummy >> systemDimensions_
3778  >> dummy >> particleDimensions_
3779  >> dummy >> gravity_
3780  >> dummy >> backgroundDrag_;
3781  line >> dummy;
3782  if (!dummy.compare("writeVTK"))
3783  {
3784  FileType writeInteractionsVTK = FileType::NO_FILE, writeWallsVTK;
3785  unsigned particlesCounter, wallCounter, interactionCounter, boundaryCounter;
3786  bool writeBoundaryVTK, writeParticlesVTK;
3787  line >> writeParticlesVTK >> writeWallsVTK >> writeInteractionsVTK >> writeBoundaryVTK >> particlesCounter >> wallCounter >> interactionCounter >> boundaryCounter;
3788  line.clear();//because the number of arguments in writeVTK has changed
3789  line >> dummy;
3790  setParticlesWriteVTK(writeParticlesVTK);
3791  wallHandler.setWriteVTK(writeWallsVTK);
3792  interactionHandler.setWriteVTK(writeInteractionsVTK);
3793  boundaryHandler.setWriteVTK(writeBoundaryVTK);
3794  vtkWriter_->setFileCounter(particlesCounter);
3795  wallVTKWriter_.setFileCounter(wallCounter);
3796  interactionVTKWriter_.setFileCounter(interactionCounter);
3797  boundaryVTKWriter_.setFileCounter(boundaryCounter);
3798  }
3799 
3800  if (!dummy.compare("writeWallDetailsVTK"))
3801  {
3802  // Example input: writeWallDetailsVTK 3 4 NO_FILE 12 ONE_FILE 25 MULTIPLE_FILES 101
3803  // Number of options is 3, each option having a enum value and file type (4 NO_FILE), (12 ONE_FILE) and
3804  // (25 MULTIPLE_FILES). At the end the file counter (101).
3805  unsigned numberOfOptions, fileCounter, enumType;
3806  FileType fileType;
3807  line >> numberOfOptions;
3808  for (unsigned i = 0; i < numberOfOptions; i++)
3809  {
3810  line >> enumType >> fileType;
3811  wallHandler.setWriteDetailsVTK(static_cast<WallHandler::DetailsVTKOptions>(enumType), fileType);
3812  }
3813  line >> fileCounter;
3815  line.clear();
3816  line >> dummy;
3817  }
3818 
3819  if (!dummy.compare("random"))
3820  {
3821  random.read(line);
3822  line >> dummy;
3823  }
3824 
3825 #ifdef MERCURYDPM_USE_OMP
3826  //Read the number of OMP threads
3827  if (!dummy.compare("numberOfOMPThreads")) {
3828  int numberOfOMPThreads;
3829  line >> numberOfOMPThreads;
3830  setNumberOfOMPThreads(numberOfOMPThreads);
3831  //logger(INFO," Check the number of OMP threads = % ", getNumberOfOMPThreads());
3832  }
3833 #endif
3834 #ifdef MERCURYDPM_USE_MPI
3835  if (!dummy.compare("numberOfProcessors"))
3836  {
3837  line >> previousNumberOfProcessors
3838  >> dummy >> numberOfDomains_[Direction::XAXIS]
3841  }
3842  else
3843  {
3844  logger(INFO,"Reading a serial restart file");
3845  //numberOfDomains_ = {1,1,1};
3846  }
3847 #endif
3848  if (!dummy.compare("xBallsArguments")) {
3850  setXBallsAdditionalArguments(line.str());
3851  }
3852 
3853  speciesHandler.read(is);
3854 
3855 #ifdef MERCURYDPM_USE_MPI
3856  //Initialise MPI structures and perform domain decomposition
3857  decompose();
3858 #endif
3859 
3860  //reading in the various relevant handlers
3861  unsigned int N;
3862  is >> dummy >> N;
3863  if (dummy.compare("Walls"))
3864  logger(ERROR, "DPMBase::read(is): Error during restart: 'Walls' argument could not be found.");
3865  wallHandler.clear();
3868  for (unsigned int i = 0; i < N; i++)
3869  {
3872  }
3873 
3874  is >> dummy >> N;
3877  if (dummy.compare("Boundaries"))
3878  logger(ERROR, "DPMBase::read(is): Error during restart: 'Boundaries' argument could not be found.");
3880  for (unsigned int i = 0; i < N; i++)
3881  {
3884  }
3885 
3887 
3888  is >> dummy >> N;
3889  is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
3890  //display a message if a large amount o fparticles is read
3891  if (N>2.5e5) logger(INFO, "Reading % particles (may take a while)",N);
3892  logger.assert_always(dummy.compare("Particles")==0, "DPMBase::read(is): Error during restart: 'Particles' argument could not be found. %",dummy);
3895  for (unsigned int i = 0; i < N; i++)
3896  {
3897  //ParticleHandler::readAndCreateObject reads line-by-line
3899  //skip the remaining data in line
3900  is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
3902  //particleHandler.getLastObject()->computeMass();
3903  }
3904 #ifdef MERCURYDPM_USE_MPI
3905  //Interaction distances of the domainHandler and periodicBoundaryHandler need to be set
3906  Mdouble interactionRadius = particleHandler.getLargestInteractionRadius();
3907  domainHandler.setInteractionDistance(2.0*interactionRadius);
3908  periodicBoundaryHandler.setInteractionDistance(2.0*interactionRadius);
3909 
3910  if (NUMBER_OF_PROCESSORS > 1)
3911  {
3912  //Create ghost particles
3915  }
3916 #endif
3917  //Add interactions to particles and ghost particles
3918  if (opt==ReadOptions::ReadNoInteractions) return;
3920  }
3921  //reading in for older versions of the Mercury restart file.
3922  else if (!restartVersion_.compare("3"))
3923  {
3924  logger(INFO, "DPMBase::read(is): restarting from an old restart file (restart_version %).",
3925  restartVersion_);
3926  readOld(is);
3927  }
3928  //returning an error if there is no restart file to read in due to the use of outdated files.
3929  else
3930  {
3931  //only very old files did not have a restart_version
3932  logger(FATAL,
3933  "Error in DPMBase::read(is): restart_version % cannot be read; use an older version of Mercury to upgrade the file",
3934  restartVersion_);
3935  }
3936  }
3937 }
FileType
With FileType options, one is able to choose if data is to be read/written from/into no or single or ...
Definition: File.h:41
@ FATAL
void read(std::istream &is)
Reads all objects from restart data.
Definition: BaseHandler.h:543
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
void setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:669
void setFileCounter(unsigned fileCounter)
Definition: BaseVTKWriter.h:61
void readAndAddObject(std::istream &is) final
Reads BaseBoundary into the BoundaryHandler from restart data.
Definition: BoundaryHandler.cc:209
void setWriteVTK(bool writeVTK)
Definition: BoundaryHandler.h:88
virtual void readOld(std::istream &is)
Reads all data from a restart file, e.g. domain data and particle data; old version.
Definition: DPMBase.cc:3942
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
void setNumberOfOMPThreads(int numberOfOMPThreads)
Definition: DPMBase.cc:1257
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance of the domain handler.
Definition: DomainHandler.cc:299
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:198
void read(std::istream &is)
Definition: InteractionHandler.cc:454
void setWriteVTK(FileType f)
Definition: InteractionHandler.cc:549
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:977
void readAndAddObject(std::istream &is) override
Definition: ParticleHandler.cc:1094
Mdouble getLargestInteractionRadius() const
Returns the largest interaction radius.
Definition: ParticleHandler.cc:772
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance.
Definition: PeriodicBoundaryHandler.cc:128
void read(std::istream &is)
Definition: RNG.cc:59
void setWriteDetailsVTK(DetailsVTKOptions, FileType)
Definition: WallHandler.cc:482
void readAndAddObject(std::istream &is) final
Create a new wall in the WallHandler, based on the information provided in a restart file.
Definition: WallHandler.cc:299
DetailsVTKOptions
Definition: WallHandler.h:118
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:467
bool compare(std::istream &is, std::string s)
Checks if the next argument in the input stream is a certain string.
Definition: StringHelpers.cc:90
void getLineFromStringStream(std::istream &in, std::stringstream &out)
Reads a line from one stringstream into another, and prepares the latter for reading in.
Definition: StringHelpers.cc:62

References DomainHandler::addNewParticles(), PeriodicBoundaryHandler::addNewParticles(), backgroundDrag_, boundaryHandler, boundaryVTKWriter_, BaseHandler< T >::clear(), ParticleHandler::clear(), helpers::compare(), dataFile, decompose(), domainHandler, eneFile, ERROR, FATAL, fStatFile, ParticleHandler::getLargestInteractionRadius(), helpers::getLineFromStringStream(), File::getName(), gravity_, constants::i, INFO, interactionFile, interactionHandler, interactionVTKWriter_, logger, max_, min_, name_, NO_FILE, NUMBER_OF_PROCESSORS, numberOfDomains_, numberOfTimeSteps_, particleDimensions_, particleHandler, periodicBoundaryHandler, random, BaseHandler< T >::read(), InteractionHandler::read(), RNG::read(), BoundaryHandler::readAndAddObject(), WallHandler::readAndAddObject(), ParticleHandler::readAndAddObject(), ReadNoInteractions, ReadNoParticlesAndInteractions, readOld(), restartFile, restartVersion_, runNumber_, BaseVTKWriter< H >::setFileCounter(), DomainHandler::setInteractionDistance(), PeriodicBoundaryHandler::setInteractionDistance(), setName(), File::setName(), setNumberOfOMPThreads(), setParticlesWriteVTK(), BaseHandler< T >::setStorageCapacity(), WallHandler::setWriteDetailsVTK(), BoundaryHandler::setWriteVTK(), InteractionHandler::setWriteVTK(), WallHandler::setWriteVTK(), setXBallsAdditionalArguments(), speciesHandler, statFile, systemDimensions_, time_, timeMax_, timeStep_, vtkWriter_, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, Vec3D::x(), XAXIS, Vec3D::y(), YAXIS, Vec3D::z(), and ZAXIS.

Referenced by MercuryBase::read(), readRestartFile(), and readSpeciesFromDataFile().

◆ readArguments()

bool DPMBase::readArguments ( int  argc,
char argv[] 
)

Can interpret main function input arguments that are passed by the driver codes.

Interprets commands passed in the command line (e.g. -tmin 0 -tmax 100 ...).

argc gives the number of commands passed, while argv stores the commands themselves (as strings).

Outputs the name and value of each flag passed, then calls the readNextArgument() function to actually interpret and implement the relevant arguments. Will raise an error if an unknown flag is passed.

Parameters
[in]argc"Argument count" - number of individual elements that argv will possess
[in]*argv[]An array of length argc - specifically an array of strings (or, in C terminology, a character array)
4392 {
4393  bool isRead = true;
4394  // Cycles over every second element. (Most flags will contain both name labels and actual data.
4395  // Those that don't will have to do i--; some examples in readNextArgument.)
4396  for (int i = 1; i < argc; i += 2)
4397  {
4398  logger(INFO, "interpreting input argument %\n", argv[i], Flusher::NO_FLUSH);
4399  for (int j = i + 1; j < argc; j++)
4400  {
4401  //looks for the next string that starts with a minus sign
4402  //i.e. the next flag, as each flag may take 0, 1 , 2, 3... arguments
4403  //and we need to make sure all are read in!
4404  if (argv[j][0] == '-')
4405  break;
4406  logger(INFO, " %\n", argv[j], Flusher::NO_FLUSH);
4407  }
4408  logger(INFO, "");
4409  //if "isRead"is true and "readNextArgument" is also true...
4410  //(i.e. checking if any argument is false)
4411  isRead &= readNextArgument(i, argc, argv);
4412 
4413  // If the read was unsuccessful, raise an error and quit. (JMFT: Used to just be a warning.)
4414  if (!isRead)
4415  {
4416  logger(ERROR, "Warning: not all arguments read correctly!");
4417  }
4418  }
4419  return isRead;
4420 }
virtual bool readNextArgument(int &i, int argc, char *argv[])
Interprets the i^th command-line argument.
Definition: DPMBase.cc:4516

References ERROR, constants::i, INFO, logger, NO_FLUSH, and readNextArgument().

Referenced by main(), FlowRule::run(), vibratedBed::run(), solve(), and statistics_while_running< T >::statistics_while_running().

◆ readDataFile()

bool DPMBase::readDataFile ( std::string  fileName = "",
unsigned int  format = 0 
)

This allows particle data to be reloaded from data files.

This function reads a .data file, which contains info about each particle's position, velocity, angular velocity, radius ...info. See also MD::readRestartFile For XBalls: Can read in format_ 14 - 8 or format_ 7 data format. This code saves in format_ 8 for 2D and format_ 14 for 3D. So if no extra parameters are specified it will assume many parameters, like density cannot be set using the data file. use of string instead of string& b/c this function is often used with a string literal

Parameters
[in]fileName
[in]format(format for specifying if its for 2D or 3D data)
Returns
bool (True or False)
2438 {
2439  //default value: dataFile.getFullName()
2440  if (!fileName.compare(""))
2441  fileName = dataFile.getFullName();
2442 
2443  std::string oldFileName = dataFile.getName();
2444  unsigned oldCounter = dataFile.getCounter();
2445  //Updates the name of the data file to the user-input from the argument.
2446  dataFile.setName(fileName);
2447  //opens a filestream of the input type
2448  dataFile.open(std::fstream::in);
2449  //Checks if the file has been successfully opened...
2450  if (!dataFile.getFstream().is_open() || dataFile.getFstream().bad())
2451  {
2452  //...and if not, ends the function and returns "false"
2453  logger(WARN, "Loading data file % failed.", fileName);
2454  return false;
2455  }
2456 
2457  //retrieves and saves the "FileType" of the file
2458  FileType fileTypeData = dataFile.getFileType();
2460  readNextDataFile(format);
2461  dataFile.setFileType(fileTypeData);
2462  dataFile.close();
2463  dataFile.setName(oldFileName);
2464  dataFile.setCounter(oldCounter);
2465  return true;
2466 }
bool readNextDataFile(unsigned int format=0)
Reads the next data file with default format=0. However, one can modify the format based on whether t...
Definition: DPMBase.cc:2691
const std::string getFullName() const
Also allows to access the file name, however with additional information which is the file counter,...
Definition: File.cc:170
void setCounter(unsigned int counter)
Allows the user to set the file counter according to his need. Sets File::counter_.
Definition: File.cc:231

References File::close(), dataFile, File::getCounter(), File::getFileType(), File::getFstream(), File::getFullName(), File::getName(), logger, ONE_FILE, File::open(), readNextDataFile(), File::setCounter(), File::setFileType(), File::setName(), and WARN.

Referenced by VariableBottom::add_particles(), VariableBottom::createBottom(), LawinenBox::LawinenBox(), main(), readNextArgument(), my_problem::setupInitialConditions(), free_cooling::setupInitialConditions(), restart::setupInitialConditions(), and DPM::setupInitialConditions().

◆ readNextArgument()

bool DPMBase::readNextArgument ( int &  i,
int  argc,
char argv[] 
)
virtual

Interprets the i^th command-line argument.

Reads, recognises and applies all valid flags passed when starting or restarting a Mercury simulation.

For all of the N = argc (argument count) command line arguments passed when starting/restarting a code (e.g. -tmax, -tmin ...), compares them to the "known" arguments understood by Mercury (note that further recognised arguments can be added in derived classes). If a match is found, the relevant parameter is set to the corresponding value(s) following the flag and true is returned. Otherwise, false is returned.

For instance, if the flag -xmin 0 is passed, the code's second if statement will recognise the flag, convert the subsequent string in argv to a double, and then call the setXMin() function to implement the new value (0) of XMin.

For developers: note the use of strcmp here. This cannot be replaced with a simpler ==, as we are comparing c-style strings (char*), instead of std::string. Thus, == would return equality of the pointers instead of the contents of the string. strcmp returns 0 if the strings are the same, and another number if they are different. This is then implicitly cast to a bool, where 0->false and other numbers will give true. Finally, the !-operator makes sure that the expression in the if-statements are true if the strings are the same, and false otherwise.

Parameters
[in]ithe position of the element that will be read, note that the count starts at 1, as element 0 is the name of the executable
[in]argcnumber of arguments the user has given
[in]*argv[]the command-line arguments the user has given when calling the executable
Returns
true if the argument is successfully read, and false otherwise.

-gravity_ requires three arguments

-restart or -r loads a restart file. By default, it loads <name>.restart. If an argument "arg" is given it loads the file "arg", or "arg".restart (if the ending is not given).

Reimplemented in MercuryBase, Mercury3DRestart, ChuteWithHopper, Chute, SilbertPeriodic, SilbertPeriodic, FlowRule, Funnel, GranularJet, and AxisymmetricHopper.

4517 {
4518  // The argument argv[i] identifies the label of the flag, and subsequent arguments (usually 1)
4519  // contain the content.
4520  //
4521  // For example...
4522  // Checks if the "-name" flag has been passed
4523  // The strcmp returns 0 if "argv[i]" is "-name" (i.e. !strcmp(argv[i], "-name") --> 1)
4524  // In this case, the setName function is run with the relevant input (i.e. the value which
4525  // immediately follows the "-name" flag
4526  if (!strcmp(argv[i], "-name"))
4527  {
4528  setName(argv[i + 1]);
4529  }
4530  // The above process is repeated for all viable flags.
4531  else if (!strcmp(argv[i], "-xmin"))
4532  {
4533  setXMin(atof(argv[i + 1]));
4534  }
4535  else if (!strcmp(argv[i], "-ymin"))
4536  {
4537  setYMin(atof(argv[i + 1]));
4538  }
4539  else if (!strcmp(argv[i], "-zmin"))
4540  {
4541  setZMin(atof(argv[i + 1]));
4542  }
4543  else if (!strcmp(argv[i], "-xmax"))
4544  {
4545  setXMax(atof(argv[i + 1]));
4546  }
4547  else if (!strcmp(argv[i], "-ymax"))
4548  {
4549  setYMax(atof(argv[i + 1]));
4550  }
4551  else if (!strcmp(argv[i], "-zmax"))
4552  {
4553  setZMax(atof(argv[i + 1]));
4554  //} else if (!strcmp(argv[i],"-svn")) {
4555  // std::cout << "svn version " << SVN_VERSION << std::endl;
4556  // i--;
4557  }
4558  else if (!strcmp(argv[i], "-dt"))
4559  {
4560  Mdouble old = getTimeStep();
4561  setTimeStep(atof(argv[i + 1]));
4562  logger(INFO, " reset dt from % to %", old, getTimeStep());
4563  }
4564 // else if (!strcmp(argv[i], "-Hertz"))
4565 // {
4566 // speciesHandler.getObject(0)->setForceType(ForceType::HERTZ);
4567 // i--;
4568 // }
4569  else if (!strcmp(argv[i], "-tmax"))
4570  {
4571  Mdouble old = getTimeMax();
4572  setTimeMax(atof(argv[i + 1]));
4573  logger(INFO, " reset timeMax from % to %", old, getTimeMax());
4574  }
4575  else if (!strcmp(argv[i], "-saveCount"))
4576  {
4577  Mdouble old = dataFile.getSaveCount();
4578  setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4579  logger(INFO, " reset saveCount from & to %", old, dataFile.getSaveCount());
4580  }
4581  else if (!strcmp(argv[i], "-saveCountData"))
4582  {
4583  dataFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4584  }
4585  else if (!strcmp(argv[i], "-saveCountFStat"))
4586  {
4587  fStatFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4588  }
4589  else if (!strcmp(argv[i], "-saveCountStat"))
4590  {
4591  statFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4592  }
4593  else if (!strcmp(argv[i], "-saveCountEne"))
4594  {
4595  eneFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4596  }
4597  else if (!strcmp(argv[i], "-saveCountRestart"))
4598  {
4599  restartFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4600  }
4601  else if (!strcmp(argv[i], "-dim"))
4602  {
4603  setSystemDimensions(static_cast<unsigned int>(atoi(argv[i + 1])));
4604  }
4605  else if (!strcmp(argv[i], "-gravity"))
4606  {
4608  setGravity(Vec3D(atof(argv[i + 1]), atof(argv[i + 2]), atof(argv[i + 3])));
4609  i += 2;
4610  }
4611  else if (!strcmp(argv[i], "-fileType"))
4612  { //uses int input
4613  setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4614  }
4615  else if (!strcmp(argv[i], "-fileTypeFStat"))
4616  { //uses int input
4617  fStatFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4618  }
4619  else if (!strcmp(argv[i], "-fileTypeRestart"))
4620  {
4621  restartFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4622  }
4623  else if (!strcmp(argv[i], "-fileTypeData"))
4624  {
4625  dataFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4626  }
4627  else if (!strcmp(argv[i], "-fileTypeStat"))
4628  {
4629  statFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4630  }
4631  else if (!strcmp(argv[i], "-fileTypeEne"))
4632  {
4633  eneFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4634  }
4635  else if (!strcmp(argv[i], "-auto_number"))
4636  {
4637  autoNumber();
4638  i--;
4639  }
4640 // else if (!strcmp(argv[i], "-number_of_saves"))
4641 // {
4642 // set_number_of_saves_all(atof(argv[i + 1]));
4643 // }
4644  else if (!strcmp(argv[i], "-restart") || !strcmp(argv[i], "-r"))
4645  {
4649  std::string filename;
4650 
4651  //use default filename if no argument is given
4652  if (i + 1 >= argc || argv[i + 1][0] == '-')
4653  {
4654  i--;
4655  filename = getName();
4656  logger(INFO, "%", getName());
4657  }
4658  else
4659  {
4660  filename = argv[i + 1];
4661  }
4662 
4663  //add ".restart" if necessary
4664  if (filename.find(".restart") == std::string::npos)
4665  {
4666  filename = filename + ".restart";
4667  }
4668 
4669  readRestartFile(filename);
4670  }
4671  else if (!strcmp(argv[i], "-clean") || !strcmp(argv[i], "-c"))
4672  {
4673  logger(INFO, "Remove old %.* files", getName());
4674  removeOldFiles();
4675  i--;
4676  }
4677  else if (!strcmp(argv[i], "-data"))
4678  {
4679  std::string filename = argv[i + 1];
4680  readDataFile(filename);
4681  }
4682  else if (!strcmp(argv[i], "-readSpeciesFromDataFile"))
4683  {
4684  readSpeciesFromDataFile_ = true;
4685  i--;
4686  logger(INFO, "Last column of data file will be interpreted as species index");
4687  }
4688 // else if (!strcmp(argv[i], "-k"))
4689 // {
4690 // Mdouble old = getSpecies(0)->getStiffness();
4691 // getSpecies(0)->setStiffness(atof(argv[i + 1]));
4692 // std::cout << " reset k from " << old << " to " << getSpecies(0)->getStiffness() << std::endl;
4693 // }
4694 // else if (!strcmp(argv[i], "-dissipation") || !strcmp(argv[i], "-disp"))
4695 // {
4696 // Mdouble old = getSpecies(0)->getDissipation();
4697 // getSpecies(0)->setDissipation(atof(argv[i + 1]));
4698 // std::cout << " reset getDissipation() from " << old << " to " << getSpecies(0)->getDissipation() << std::endl;
4699 // }
4700 // else if (!strcmp(argv[i], "-kt"))
4701 // {
4702 // Mdouble old = getSpecies(0)->getSlidingStiffness();
4703 // getSpecies(0)->setSlidingStiffness(atof(argv[i + 1]));
4704 // std::cout << " reset kt from " << old << " to " << getSpecies(0)->getSlidingStiffness() << std::endl;
4705 // }
4706 // else if (!strcmp(argv[i], "-dispt"))
4707 // {
4708 // Mdouble old = getSpecies(0)->getSlidingDissipation();
4709 // getSpecies(0)->setSlidingDissipation(atof(argv[i + 1]));
4710 // std::cout << " reset dispt from " << old << " to " << getSpecies(0)->getSlidingDissipation() << std::endl;
4711 // }
4712 // else if (!strcmp(argv[i], "-krolling"))
4713 // {
4714 // Mdouble old = getSpecies(0)->getRollingStiffness();
4715 // getSpecies(0)->setRollingStiffness(atof(argv[i + 1]));
4716 // std::cout << " reset krolling from " << old << " to " << getSpecies(0)->getRollingStiffness() << std::endl;
4717 // }
4718 // else if (!strcmp(argv[i], "-disprolling"))
4719 // {
4720 // Mdouble old = getSpecies(0)->getRollingDissipation();
4721 // getSpecies(0)->setRollingDissipation(atof(argv[i + 1]));
4722 // std::cout << " reset disprolling from " << old << " to " << getSpecies(0)->getRollingDissipation() << std::endl;
4723 // }
4724 // else if (!strcmp(argv[i], "-mu"))
4725 // {
4726 // Mdouble old = getSpecies(0)->getSlidingFrictionCoefficient();
4727 // getSpecies(0)->setSlidingFrictionCoefficient(atof(argv[i + 1]));
4728 // std::cout << " reset mu from " << old << " to " << getSpecies(0)->getSlidingFrictionCoefficient() << std::endl;
4729 // }
4730 // else if (!strcmp(argv[i], "-murolling"))
4731 // {
4732 // Mdouble old = getSpecies(0)->getRollingFrictionCoefficient();
4733 // getSpecies(0)->setRollingFrictionCoefficient(atof(argv[i + 1]));
4734 // std::cout << " reset murolling from " << old << " to " << getSpecies(0)->getRollingFrictionCoefficient() << std::endl;
4735 // }
4736  else if (!strcmp(argv[i], "-randomise") || !strcmp(argv[i], "-randomize"))
4737  {
4738  random.randomise();
4739  i--;
4740  }
4741 // else if (!strcmp(argv[i], "-k0"))
4742 // {
4743 // Mdouble old = speciesHandler.getObject(0)->getAdhesionStiffness();
4744 // speciesHandler.getObject(0)->setAdhesionStiffness(atof(argv[i + 1]));
4745 // std::cout << " reset k0 from " << old << " to " << speciesHandler.getObject(0)->getAdhesionStiffness() << std::endl;
4746 // }
4747 // else if (!strcmp(argv[i], "-f0"))
4748 // {
4749 // Mdouble old = speciesHandler.getObject(0)->getBondForceMax();
4750 // speciesHandler.getObject(0)->setBondForceMax(atof(argv[i + 1]));
4751 // std::cout << " reset f0 from " << old << " to " << speciesHandler.getObject(0)->getBondForceMax() << std::endl;
4752 // }
4753 // else if (!strcmp(argv[i], "-AdhesionForceType"))
4754 // {
4755 // AdhesionForceType old = speciesHandler.getObject(0)->getAdhesionForceType();
4756 // speciesHandler.getObject(0)->setAdhesionForceType(argv[i + 1]);
4757 // std::cout << " reset AdhesionForceType from "
4758 // << static_cast<signed char>(old) << " to "
4759 // << static_cast<signed char>(speciesHandler.getObject(0)->getAdhesionForceType()) << std::endl;
4760 // }
4761  else if (!strcmp(argv[i], "-append"))
4762  {
4763  setAppend(true);
4764  i--;
4765  }
4766  else if (!strcmp(argv[i], "-fixedParticles"))
4767  {
4768  setFixedParticles(static_cast<unsigned int>(atoi(argv[i + 1])));
4769  }
4770 // else if (!strcmp(argv[i], "-rho"))
4771 // {
4772 // Mdouble old = speciesHandler.getObject(0)->getDensity();
4773 // speciesHandler.getObject(0)->setDensity(atof(argv[i + 1]));
4774 // std::cout << " reset rho from " << old << " to " << speciesHandler.getObject(0)->getDensity() << std::endl;
4775 // }
4776 // else if (!strcmp(argv[i], "-dim_particle"))
4777 // {
4778 // setParticleDimensions(atoi(argv[i + 1]));
4779 // }
4780  else if (!strcmp(argv[i], "-counter"))
4781  {
4782  setRunNumber(atoi(argv[i + 1]));
4783  }
4784  else
4785  {
4786  //returns false if the flag passed does not match any of the currently used flags.
4787  return false;
4788  }
4789  //returns true if argv is found
4790  return true;
4791 }
void removeOldFiles() const
Definition: DPMBase.cc:4422
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
void setFixedParticles(unsigned int n)
Sets a number, n, of particles in the particleHandler as "fixed particles".
Definition: DPMBase.cc:1960
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:539
bool readDataFile(std::string fileName="", unsigned int format=0)
This allows particle data to be reloaded from data files.
Definition: DPMBase.cc:2437
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
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:3006
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:273
unsigned int getSaveCount() const
Gets File::saveCount_.
Definition: File.cc:255
void randomise()
sets the random variables such that they differ for each run
Definition: RNG.cc:98

References autoNumber(), dataFile, eneFile, fStatFile, getName(), File::getSaveCount(), getTimeMax(), getTimeStep(), constants::i, INFO, logger, random, RNG::randomise(), readDataFile(), readRestartFile(), readSpeciesFromDataFile_, removeOldFiles(), restartFile, setAppend(), setFileType(), File::setFileType(), setFixedParticles(), setGravity(), setName(), setRunNumber(), setSaveCount(), File::setSaveCount(), setSystemDimensions(), setTimeMax(), setTimeStep(), setXMax(), setXMin(), setYMax(), setYMin(), setZMax(), setZMin(), and statFile.

Referenced by readArguments(), and MercuryBase::readNextArgument().

◆ readNextDataFile()

bool DPMBase::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.

Used to load data from existing .data files (particle positions, velocities, sizes etc.) when restarting a simulation. The 'format' to choose depends on the formatting of the data files to be read in which varies, for instance, if the code is 2D (format 8) or 3D (format 14).

Parameters
[in]format

todo make systemDimensions enum (2 or 3)

2692 {
2693  dataFile.open(std::fstream::in);
2694  //logger(INFO,"Reading %",dataFile.getFullName());
2695  //fStatFile.open();
2696  //Set the correct format based of dimension if the format is not explicitly specified by the user
2697  if (format == 0)
2698  {
2699  //checking the dimensionality of the system
2701  switch (getSystemDimensions())
2702  {
2703  case 1:
2704  //if 2D, sets format 8 (data file has 8 columns for 2D)
2705  case 2:
2706  format = 8;
2707  break;
2708  case 3:
2709  //if 3D, sets format 14 (data file has 14 columns for 3D)
2710  format = 14;
2711  break;
2712  }
2713  //end case
2714  }
2715  //end if
2716 
2717  // read in the particle number (as a double)
2718  double doubleN = -1;
2719  dataFile.getFstream() >> doubleN;
2720 
2721  // If N cannot be read, we reached the end of the file
2722  if (doubleN == -1) return false;
2723 
2724  // converting N to an integer; skipping the line if there is a problem (this happens when there is a corrupt data file)
2725  unsigned N = doubleN;
2726  while (doubleN != N) {
2727  std::string dummy;
2728  getline(dataFile.getFstream(),dummy,'\n');
2729  logger(WARN,"Skipping bad line in data file: % %",doubleN, dummy);
2730  dataFile.getFstream() >> doubleN;
2731  N = doubleN;
2732  }
2733  //store the parameters you want to preserve:
2734  const size_t nHistory = std::min(N,particleHandler.getSize());
2735  std::vector<const ParticleSpecies*> species(nHistory);
2736  std::vector<bool> fix(nHistory);
2737  for (size_t i=0; i<nHistory; ++i) {
2739  species[i] = p->getSpecies();
2740  fix[i] = p->isFixed();
2741  //store from reading the restart file which particles are fixed and which species each particle has
2742  }
2743 
2744  BaseParticle* p;
2745  if (particleHandler.getSize() == 0) {
2746  logger.assert_always(speciesHandler.getSize()>0,"readData: species needs to be set first");
2748  p->unfix();
2749  } else {
2750  p = particleHandler.getObject(0)->copy();
2751  }
2752 
2753  //empty the particle handler
2756 
2757  //now fill it again with the read-in particles
2758  std::stringstream line;
2760  Mdouble radius;
2761  Vec3D position, velocity, angle, angularVelocity;
2762  size_t indSpecies;
2763  //read all other data available for the time step
2764  if (format==7) {
2765  line >> time_ >> min_.x() >> min_.y() >> min_.z() >> max_.x() >> max_.y() >> max_.z();
2766  for (size_t i = 0; i < N; ++i) {
2768  line >> position.X >> position.Z >> position.Y >> velocity.X >> velocity.Z
2769  >> velocity.Y >> radius
2770  >> indSpecies;
2771  p->setPosition(position);
2772  p->setVelocity(velocity);
2773  p->setOrientation({1, 0, 0, 0});
2774  p->setAngularVelocity({0.0, 0.0, 0.0});
2775  p->setRadius(radius);
2777  p->setSpecies(speciesHandler.getObject(indSpecies));
2778  else if (i < nHistory)
2779  p->setSpecies(species[i]);
2780  if (i < nHistory && fix[i])
2781  p->fixParticle();
2783  p->unfix();
2784  }
2785  } else if (format==8) {
2786  line >> time_ >> min_.x() >> min_.y() >> max_.x() >> max_.y();
2787  min_.z() = 0.0; max_.z() = 0.0;//For 2d functions we define Z to be of no interest
2788  for (size_t i = 0; i < N; ++i) {
2790  line >> position.X >> position.Y >> velocity.X >> velocity.Y >> radius >> angle.Z >> angularVelocity.Z >> indSpecies;
2791  Quaternion q;
2792  q.setAngleZ(angle.Z);
2793  p->setPosition(position);
2794  p->setVelocity(velocity);
2795  p->setOrientation(q);
2796  p->setAngularVelocity(-angularVelocity);
2797  p->setRadius(radius);
2799  else if (i < nHistory) p->setSpecies(species[i]);
2800  if (i < nHistory && fix[i]) p->fixParticle();
2802  p->unfix();
2803  } //end for all particles
2804  } else if (format==14) {
2805  //This is a 3D format_
2806  //@TODO: Check bounds or get rid of this function
2807  line >> time_ >> min_.x() >> min_.y() >> min_.z() >> max_.x() >> max_.y() >> max_.z();
2808  for (size_t i = 0; i < N; ++i) {
2810  line >> position >> velocity >> radius >> angle >> angularVelocity >> indSpecies;
2811 #ifdef MERCURYDPM_USE_MPI
2812  //This is required for the CG tool. When reading the data file it is neseccary to know if a particle is an MPIParticle or not
2813  bool isMPIParticle = false;
2814  bool isPeriodicGhostParticle = false;
2815  if (NUMBER_OF_PROCESSORS > 1)
2816  {
2818  line >> isMPIParticle >> isPeriodicGhostParticle;
2819  }
2820 #endif
2821  p->setPosition(position);
2822  p->setVelocity(velocity);
2823  p->setOrientationViaEuler(angle);
2824  p->setAngularVelocity(angularVelocity);
2825  p->setRadius(radius);
2827  if (indSpecies<speciesHandler.getSize()) {
2828  p->setSpecies(speciesHandler.getObject(indSpecies));
2829  } else {
2830  logger(WARN, "Read in bad species data; species is not set");
2831  }
2832  } else if (i < nHistory)
2833  p->setSpecies(species[i]);
2834  if (i < nHistory && fix[i])
2835  p->fixParticle();
2836 #ifdef MERCURYDPM_USE_MPI
2838  {
2839  p->setMPIParticle(isMPIParticle);
2840  p->setPeriodicGhostParticle(isPeriodicGhostParticle);
2841  }
2842 #endif
2844  p->unfix();
2845  } //end read into existing particles logger(INFO, "read % particles", particleHandler.getNumberOfObjects());
2846  } else if (format==15) {
2847  line >> time_ >> min_.x() >> min_.y() >> min_.z() >> max_.z() >> max_.y() >> max_.z();
2848  for (size_t i = 0; i < N; ++i) {
2850  line >> position >> velocity >> radius >> angle >> angularVelocity >> indSpecies >> indSpecies;
2851  Quaternion q;
2852  q.setEuler(angle);
2853  p->setPosition(position);
2854  p->setVelocity(velocity);
2855  p->setOrientation(q);
2856  p->setAngularVelocity(angularVelocity);
2857  p->setRadius(radius);
2859  else if (i < nHistory) p->setSpecies(species[i]);
2860  if (i < nHistory && fix[i]) p->fixParticle();
2862  } //end for all particles
2863  } //end if format
2864 
2866  return true;
2867 }
virtual void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
Definition: BaseInteractable.h:260
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
void setOrientationViaEuler(Vec3D eulerAngle)
Sets the orientation of this BaseInteractable by defining the euler angles.
Definition: BaseInteractable.cc:204
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
Definition: BaseInteractable.h:108
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:167
void setMPIParticle(bool flag)
Flags the mpi particle status.
Definition: BaseParticle.cc:191
void unfix()
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by c...
Definition: BaseParticle.cc:322
void setPeriodicGhostParticle(bool flag)
Flags the status of the particle to be a ghost in periodic boundary or not.
Definition: BaseParticle.cc:302
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:553
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:818
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Quaternion.h:63
void setEuler(const Vec3D &e)
Convert Euler angles to a quaternion. See Wikipedia for details.
Definition: Quaternion.cc:473
void setAngleZ(Mdouble psi)
Converts the rotation angle in the XY plane into a quaternion (for Mercury2D). See Wikipedia for deta...
Definition: Quaternion.cc:492

References ParticleHandler::clear(), ParticleHandler::computeAllMasses(), BaseParticle::copy(), BaseHandler< T >::copyAndAddObject(), dataFile, BaseParticle::fixParticle(), File::getFstream(), helpers::getLineFromStringStream(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), BaseInteractable::getSpecies(), getSystemDimensions(), constants::i, BaseParticle::isFixed(), logger, max_, min_, NUMBER_OF_PROCESSORS, File::open(), particleHandler, readSpeciesFromDataFile_, Quaternion::setAngleZ(), BaseInteractable::setAngularVelocity(), Quaternion::setEuler(), BaseParticle::setMPIParticle(), BaseInteractable::setOrientation(), BaseInteractable::setOrientationViaEuler(), BaseParticle::setPeriodicGhostParticle(), BaseInteractable::setPosition(), BaseParticle::setRadius(), BaseParticle::setSpecies(), BaseHandler< T >::setStorageCapacity(), BaseInteractable::setVelocity(), speciesHandler, time_, BaseParticle::unfix(), WARN, Vec3D::X, Vec3D::x(), Vec3D::Y, Vec3D::y(), Vec3D::Z, and Vec3D::z().

Referenced by CGHandler::evaluateDataFiles(), and readDataFile().

◆ readNextFStatFile()

void DPMBase::readNextFStatFile ( )

Reads the next fstat file.

2870 {
2871  fStatFile.open(std::fstream::in);
2872  std::string line;
2873  std::fstream& in = fStatFile.getFstream();
2874  // read the first three lines
2875  getline(in, line);
2876  getline(in, line);
2877  getline(in, line);
2878  Mdouble time;
2879  unsigned int indexP;
2880  int indexI; //could be negative
2882  while ((in.peek() != -1) && (in.peek() != '#'))
2883  {
2884  /* # 1: time
2885  # 2: particle Number i
2886  # 3: contact partner j (particles >= 0, walls < 0)
2887  # 4: x-position \
2888  # 5: y-position > of the contact point (I hope)
2889  # 6: z-position /
2890  # 7: delta = overlap at the contact
2891  # 8: ctheta = length of the tangential spring
2892  # 9: P1_P2_normal force |f^n|
2893  # 10: remaining (tangential) force |f^t|=|f-f^n|
2894  # 11-13: P1_P2_normal unit vector nx, ny, nz
2895  # 14-16: tangential unit vector tx, ty, tz
2896  */
2897  in >> time >> indexP >> indexI;
2899  BaseInteraction* C;
2900  if (indexI >= 0)
2901  {
2902  BaseParticle* I = particleHandler.getObject(static_cast<const unsigned int>(indexI));
2903  //read only one of the two fstat lines reported
2904  if (indexI >= indexP or I->isFixed())
2905  {
2906  // particle pair contact
2908  C->setFStatData(in, P, I);
2909  // skip next line
2910  //in.ignore(256, '\n');
2911  }
2912  }
2913  else
2914  {
2915  // wall-particle contact
2916  while (wallHandler.getNumberOfObjects() <= -indexI - 1)
2917  {
2919  logger(WARN, "Added new wall because .fstat file indicates contact with wall % that doesn't exist",
2920  -indexI - 1);
2921  }
2922  BaseWall* I = wallHandler.getObject(static_cast<const unsigned int>(-indexI - 1));
2924  C->setFStatData(in, P, I);
2925  }
2926  //skip the rest of the line, to allow additional output and to ignore the second time a particle-particle contact is printed
2927  in.ignore(256, '\n');
2928  }
2929  //logger(INFO,"read % contacts at t = % (N=%)",counter,timeStamp,interactionHandler.getNumberOfObjects());
2930  //interactionHandler.write(std::cout);
2931  //logger(INFO,"normal % %",interactionHandler.getObject(0)->getNormal(),interactionHandler.getObject(0)->getContactPoint());
2932  //logger(INFO,"normal % %",interactionHandler.getLastObject()->getNormal(),interactionHandler.getLastObject()->getContactPoint());
2933 }
void setFStatData(std::fstream &fstat, BaseParticle *P, BaseWall *I)
Definition: BaseInteraction.cc:994
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
BaseInteraction * addInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Definition: InteractionHandler.cc:114

References InteractionHandler::addInteraction(), BaseHandler< T >::clear(), BaseHandler< T >::copyAndAddObject(), fStatFile, File::getFstream(), BaseHandler< T >::getLastObject(), BaseHandler< T >::getNumberOfObjects(), getNumberOfTimeSteps(), BaseHandler< T >::getObject(), interactionHandler, BaseParticle::isFixed(), logger, File::open(), Global_Physical_Variables::P, particleHandler, BaseInteraction::setFStatData(), speciesHandler, wallHandler, and WARN.

Referenced by CGHandler::evaluateDataFiles().

◆ readOld()

void DPMBase::readOld ( std::istream &  is)
virtual

Reads all data from a restart file, e.g. domain data and particle data; old version.

Deprecated:
Use read or the new magic driver instead
Parameters
[in]is
3943 {
3944  std::string dummy;
3945  is >> dummy >> dummy;
3946  setName(dummy);
3947 
3948  unsigned int saveCountData, saveCountEne, saveCountStat, saveCountFStat;
3949  unsigned int fileTypeFstat, fileTypeData, fileTypeEne, fileTypeRestart;
3950  is >> dummy >> min_.x()
3951  >> dummy >> max_.x()
3952  >> dummy >> min_.y()
3953  >> dummy >> max_.y()
3954  >> dummy >> min_.z()
3955  >> dummy >> max_.z()
3956  >> dummy >> timeStep_
3957  >> dummy >> time_
3958  >> dummy >> timeMax_
3959  >> dummy >> saveCountData
3960  >> dummy >> saveCountEne
3961  >> dummy >> saveCountStat
3962  >> dummy >> saveCountFStat
3963  >> dummy >> systemDimensions_
3964  >> dummy >> gravity_
3965  >> dummy >> fileTypeFstat
3966  >> dummy >> fileTypeData
3967  >> dummy >> fileTypeEne;
3968  dataFile.setSaveCount(saveCountData);
3969  eneFile.setSaveCount(saveCountEne);
3970  statFile.setSaveCount(saveCountStat);
3971  fStatFile.setSaveCount(saveCountFStat);
3972 
3973  fStatFile.setFileType(static_cast<FileType>(fileTypeFstat));
3974  dataFile.setFileType(static_cast<FileType>(fileTypeData));
3975  eneFile.setFileType(static_cast<FileType>(fileTypeEne));
3976 
3977  //this is optional to allow restart files with and without restartFile.getFileType()
3978  is >> dummy;
3979  if (!strcmp(dummy.c_str(), "options_restart"))
3980  {
3981  is >> fileTypeRestart;
3982  restartFile.setFileType(static_cast<FileType>(fileTypeRestart));
3983  }
3984 
3985  speciesHandler.read(is);
3986  wallHandler.read(is);
3987  boundaryHandler.read(is);
3988  particleHandler.read(is);
3989  setRestarted(true);
3990 }

References boundaryHandler, dataFile, eneFile, fStatFile, gravity_, max_, min_, particleHandler, BaseHandler< T >::read(), restartFile, File::setFileType(), setName(), setRestarted(), File::setSaveCount(), speciesHandler, statFile, systemDimensions_, time_, timeMax_, timeStep_, wallHandler, Vec3D::x(), Vec3D::y(), and Vec3D::z().

Referenced by read().

◆ readParAndIniFiles()

bool DPMBase::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)

use of string instead of string& b/c this function is often used with a string literal

Parameters
[in]fileName
Returns
bool (True or False)
2474 {
2475  //Opens the par.ini file
2476  std::fstream file;
2477  file.open(fileName, std::fstream::in);
2478  if (!file.is_open() || file.bad())
2479  {
2480  //std::cout << "Loading par.ini file " << filename << " failed" << std::endl;
2481  return false;
2482  }
2483 
2484  Mdouble doubleValue;
2485  int integerValue;
2486 
2487  // inputfile par.ini
2488  // line 1 =============================================================
2489  // Example: 1 1 0
2490  // 1: integer (0|1) switches from non-periodic to periodic
2491  // integer (5|6) does 2D integration only (y-coordinates fixed)
2492  // and switches from non-periodic to periodic
2493  // integer (11) uses a quarter system with circular b.c.
2494  file >> integerValue;
2495  //~ std::cout << "11" << integerValue << std::endl;
2496  if (integerValue == 0)
2497  {
2498  InfiniteWall w0;
2500  w0.set(Vec3D(-1, 0, 0), Vec3D(getXMin(), 0, 0));
2502  w0.set(Vec3D(1, 0, 0), Vec3D(getXMax(), 0, 0));
2504  w0.set(Vec3D(0, -1, 0), Vec3D(0, getYMin(), 0));
2506  w0.set(Vec3D(0, 1, 0), Vec3D(0, getYMax(), 0));
2508  w0.set(Vec3D(0, 0, -1), Vec3D(0, 0, getZMin()));
2510  w0.set(Vec3D(0, 0, 1), Vec3D(0, 0, getZMax()));
2512  }
2513  else if (integerValue == 1)
2514  {
2515  PeriodicBoundary b0;
2516  b0.set(Vec3D(1, 0, 0), getXMin(), getXMax());
2518  b0.set(Vec3D(0, 1, 0), getYMin(), getYMax());
2520  b0.set(Vec3D(0, 0, 1), getZMin(), getZMax());
2522  }
2523  else if (integerValue == 5)
2524  {
2525  InfiniteWall w0;
2527  w0.set(Vec3D(-1, 0, 0), Vec3D(-getXMin(), 0, 0));
2529  w0.set(Vec3D(1, 0, 0), Vec3D(getXMax(), 0, 0));
2531  w0.set(Vec3D(0, -1, 0), Vec3D(0, -getYMin(), 0));
2533  w0.set(Vec3D(0, 1, 0), Vec3D(0, getYMax(), 0));
2535 
2536  }
2537  else if (integerValue == 6)
2538  {
2539  PeriodicBoundary b0;
2540  b0.set(Vec3D(1, 0, 0), getXMin(), getXMax());
2542  b0.set(Vec3D(0, 1, 0), getYMin(), getYMax());
2544  b0.set(Vec3D(0, 0, 1), getZMin(), getZMax());
2546  }
2547  else
2548  {
2549  logger(ERROR, "Error in par.ini: line 1, value 1 is %", integerValue);
2550  }
2551 
2552  // 2: integer (0|1) dont use | use the search pattern for linked cells
2553  file >> integerValue; //ignore
2554 
2555  // 3: real - gravity in z direction: positive points upwards
2556  file >> doubleValue;
2557  setGravity(Vec3D(0.0, 0.0, doubleValue));
2558 
2559  // line 2 =============================================================
2560  // Example: -10000 .5e-2
2561  // 1: time end of simulation - (negative resets start time to zero
2562  // and uses -time as end-time)
2563  file >> doubleValue;
2564  if (doubleValue < 0)
2565  setTime(0);
2566  setTimeMax(fabs(doubleValue));
2567 
2568  // 2: time-step of simulation
2569  file >> doubleValue;
2570  setTimeStep(doubleValue);
2571 
2572  // line 3 =============================================================
2573  // Example: 1e-1 100
2574  file >> doubleValue;
2575  if (doubleValue >= 0)
2576  {
2577  // 1: time-step for output on time-series protocoll file -> "ene"
2578  unsigned int savecount = static_cast<unsigned int>(round(doubleValue / getTimeStep()));
2579  setSaveCount(savecount);
2580 
2581  // 2: time-step for output on film (coordinate) file -> "c3d"
2582  // (fstat-output is coupled to c3d-output time-step)
2583  file >> doubleValue;
2584  savecount = static_cast<unsigned int>(round(doubleValue / getTimeStep()));
2585  dataFile.setSaveCount(savecount);
2586  fStatFile.setSaveCount(savecount);
2587  }
2588  else
2589  {
2590  // or: ---------------------------------------------------------------
2591  // 1: negative number is multiplied to the previous log-output-time
2592  // 2: requires initial log-output time
2593  // 3: negative number is multiplied to the previous film-output-time
2594  // 4: requires initial film-output time
2595  logger(ERROR, "Error in par.ini: line 3, value 1 is %", doubleValue);
2596  }
2597 
2598  // line 4 =============================================================
2599  // Example: 2000 1e5 1e3 1e2
2600  // 1: particle density (mass=4/3*constants::pi*density*rad^3)
2601  file >> doubleValue;
2602 
2603  //clear species handler
2607 
2609  S->setDensity(doubleValue);
2610 
2611  // 2: linear spring constant
2612  file >> doubleValue;
2613  S->setStiffness(doubleValue);
2614 
2615  // 3: linear dashpot constant
2616  file >> doubleValue;
2617  S->setDissipation(doubleValue);
2618 
2619  // 4: background damping dashpot constant
2620  file >> doubleValue;
2621  if (doubleValue != 0.0)
2622  logger(WARN, "Warning in par.ini: ignored background damping %", doubleValue);
2623 
2624  // line 5 =============================================================
2625  // Example: 0 0
2626  // 1: growth rate: d(radius) = xgrow * dt
2627  file >> doubleValue;
2628  if (doubleValue != 0.0)
2629  logger(WARN, "Warning in par.ini: ignored growth rate %", doubleValue);
2630 
2631  // 2: target volume_fraction
2632  file >> doubleValue;
2633  if (doubleValue != 0.0)
2634  logger(WARN, "Warning in par.ini: ignored target volume_fraction %", doubleValue);
2635 
2636  file.close();
2637  //std::cout << "Loaded par.ini file " << filename << std::endl;
2638  return true;
2639 }
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:34
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:169
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a PeriodicBoundary by its normal and positions.
Definition: PeriodicBoundary.cc:84
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: SpeciesHandler.h:54
void addObject(ParticleSpecies *S) override
Adds a new ParticleSpecies to the SpeciesHandler.
Definition: SpeciesHandler.cc:890
Mdouble round(Mdouble value, unsigned int precision)
rounds a floating point number with a given precision
Definition: MathHelpers.cc:28

References SpeciesHandler::addObject(), boundaryHandler, SpeciesHandler::clear(), BaseHandler< T >::copyAndAddObject(), dataFile, ERROR, fStatFile, BaseHandler< T >::getObject(), getTimeStep(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), logger, helpers::round(), PeriodicBoundary::set(), InfiniteWall::set(), setGravity(), setParticleDimensions(), setSaveCount(), File::setSaveCount(), BaseWall::setSpecies(), setTime(), setTimeMax(), setTimeStep(), speciesHandler, wallHandler, and WARN.

◆ readRestartFile() [1/2]

bool DPMBase::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.

Opens a file input stream corresponding to the restart file to be opened. If the file can be successfully opened, uses the read() function to extract all data from the restart file. Once the read-in has been successfully completed, sets the "restarted_" flag to true such that, where necessary, other functions will know that the file has been restarted.

Returns
int
3007 {
3008  //Assuming a filename corresponding to "restartFile" has already been established,
3009  //opens an input filestream to the relevant file
3010  if (restartFile.open(std::fstream::in))
3011  {
3012  //reads the input stream line-by-line
3013  read(restartFile.getFstream(), opt);
3014  logger(INFO, "Loaded restart file %", restartFile.getFullName());
3015  restartFile.close();
3016  //sets the flag such that other functions can tell that the file has been restarted
3017  //e.g. does not run "setUpInitialConditions" or add headers to the .ene files etc.
3018  setRestarted(true);
3019  return true;
3020  }
3021  else /* if the file could not be opened */
3022  {
3023  logger(INFO, "% could not be loaded.", restartFile.getFullName());
3024  return false;
3025  }
3026 }
virtual void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll)
Reads all data from a restart file, e.g. domain data and particle data.
Definition: DPMBase.cc:3679

References File::close(), File::getFstream(), File::getFullName(), INFO, logger, File::open(), read(), restartFile, and setRestarted().

Referenced by BaseCluster::actionsOnRestart(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCStats::ClosedCSCStats(), CSCInit::CSCInit(), CSCRestart::CSCRestart(), CSCStats::CSCStats(), CGHandler::evaluateRestartFiles(), CLiveStatistics< T >::getLiveStatistics(), Indenter::Indenter(), LawinenBox::LawinenBox(), ChuteWithPeriodicInflow::loadPeriodicBox(), ChuteWithContraction::loadPeriodicBox(), main(), readNextArgument(), Mercury3DRestart::readNextArgument(), readRestartFile(), CGHandler::restart(), statistics_while_running< T >::run(), CSCRun::setupInitialConditions(), Cstatic3D::setupInitialConditions(), ShearStage::ShearStage(), SingleParticleIndenter::SingleParticleIndenter(), Sintering::Sintering(), statistics_while_running< T >::statistics_while_running(), and StressStrainControl::StressStrainControl().

◆ readRestartFile() [2/2]

int DPMBase::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.

Reads in the name of a (.restart) file and then opens and reads in the data corresponding to this file using the argument-less readRestartFile() function. Note that this function should be called before setupInitialConditions().

Parameters
[in]fileNameThe name of the (.restart) file to be read in.
Returns
int
3036 {
3037  //add ".restart" if necessary
3038  if (fileName.find(".restart") == std::string::npos)
3039  {
3040  fileName.append(".restart");
3041  }
3042 
3043  //If padded or numbered files are used, we need to extract the counter and remove it from the filename
3044  //First find the last point in the restart name
3045  unsigned int pos = fileName.find('.');
3046  while (fileName.find('.', pos + 1) != std::string::npos)
3047  {
3048  pos = fileName.find('.', pos + 1);
3049  }
3050  //If the next char after the last . is a digit we are using numbered files
3051  std::string counter;
3052  if (isdigit(fileName[pos + 1]))
3053  {
3054  for (int i = pos + 1; i < fileName.length(); i++)
3055  {
3056  counter.push_back(fileName[i]);
3057  }
3058  //Set counter in restart file
3059  restartFile.setCounter(std::stoi(counter));
3060  logger(INFO, "Counter: %", std::stoi(counter));
3061  }
3062 
3063 #ifdef MERCURYDPM_USE_MPI
3064  //Correct for the processor number
3065  if (NUMBER_OF_PROCESSORS > 1 && !helpers::fileExists(fileName))
3066  {
3067  //Modify file name
3068  const unsigned int length = fileName.length();
3069  if (isdigit(fileName[pos + 1]))
3070  {
3071  for (int i = pos + 1; i < length + 1; i++)
3072  {
3073  fileName.pop_back();
3074  }
3075  }
3076  fileName.append(std::to_string(PROCESSOR_ID));
3077  if (counter.size() > 0)
3078  {
3079  fileName.append(".");
3080  fileName.append(counter);
3081  }
3082  }
3083 #endif
3084 
3085  restartFile.setName(fileName);
3086 
3087  logger(INFO, "Restarting from %", fileName);
3088  return readRestartFile(opt);
3089 }
bool fileExists(std::string strFilename)
Function to check if a file exists, is used to check if a run has already need done.
Definition: FileIOHelpers.cc:107

References helpers::fileExists(), constants::i, INFO, logger, NUMBER_OF_PROCESSORS, PROCESSOR_ID, readRestartFile(), restartFile, File::setCounter(), and File::setName().

◆ readRunNumberFromFile()

int DPMBase::readRunNumberFromFile ( )
static

Read the run number or the counter from the counter file (COUNTER_DONOTDEL)

Reads in the current counter in from the COUNTER_DONOTDEL file stored on the disk. If a COUNTER_DONOTDEL file does not already exist, creates one and initialises it with a value "1"

554 {
555 int counter;
556 
557 FILE* counter_file;
558 //checking if there exists already a file named "COUNTER_DONOTDEL" which can be opened for
559 //input and output (returns "true" if no such file exists).
560 if ((counter_file = fopen("COUNTER_DONOTDEL", "r+")) == nullptr)
561 {
562 //if a file does not already exist, checks whether a new file can be created
563 //retutns "true" if a new file CANNOT be created
564 if ((counter_file = fopen("COUNTER_DONOTDEL", "w")) == nullptr)
565 {
566  //If true, outputs an error message and ends the program
567  fprintf(stderr, "\n\n\tERROR :: Counter File NOT found, please re-create\n\n");
568  fclose(counter_file);
569  exit(-1);
570 }
571  //alternatively, if a new file CAN be created...
572 else
573 {
574  //starts the new counter file, writing to it the value "1"
575  fprintf(counter_file, "1");
576  fprintf(stderr, "Counter File created\n");
577  fclose(counter_file);
578  return 1;
579 }
580 }
581 //alternatively, if a counter file DOES already exist...
582 else
583 {
584 //...checks if there exists only 1 value in the file (as would be expected from a COUNTER_DONOTDEL file...
585 if (fscanf(counter_file, "%d", &counter) != 1)
586 {
587  //...and if not, returns an error.
588  fprintf(stderr, "\n\n\tERROR :: Counter File found, but something went wrong with reading it\n\n");
589  fclose(counter_file);
590  exit(-1);
591 }
592 else
593 {
594  //...otherwise, if all has been successful, returns the current value of the file!
595  fclose(counter_file);
596  return counter;
597 }
598 }
599 
600 }

Referenced by autoNumber().

◆ readSpeciesFromDataFile()

void DPMBase::readSpeciesFromDataFile ( bool  read = true)
inline

◆ readUserDefinedWall()

virtual BaseWall* DPMBase::readUserDefinedWall ( const std::string &  type) const
inlinevirtual

Allows you to read in a wall defined in a Driver directory; see USER/Luca/ScrewFiller.

294  { return nullptr; }

Referenced by WallHandler::readAndCreateObject().

◆ removeDuplicatePeriodicParticles()

void DPMBase::removeDuplicatePeriodicParticles ( )
protected

Removes periodic duplicate Particles.

Removes particles created by checkAndDuplicatePeriodicParticles().

Loops (from back to front) through the particle handler, removing particles marked as 'periodic' (i.e. BaseParticle::getPeriodicFromParticle() returns a real value, as opposed to a null pointer).

Since the duplicated particles will be stored at the 'back' of the particle handler, the function ceases when the first non-duplicated particle is found.

Note that between these two functions it is not allowed to create additional functions.

4987 {
4988 #ifdef MERCURYDPM_USE_MPI
4990  if (NUMBER_OF_PROCESSORS == 1)
4991  {
4992 #endif
4993  //Looping from the *back* of the particle handler, where all the periodic or "ghost" particles are stored.
4994  //The loop ends when there exist no more periodic particles (i.e. "getPeriodicFromParticle()" returns a null pointer)
4995  for (unsigned int i = particleHandler.getSize();
4996  i >= 1 && particleHandler.getObject(i - 1)->getPeriodicFromParticle() != nullptr; i--)
4997  {
4998  while (!particleHandler.getObject(i - 1)->getInteractions().empty())
4999  {
5001  particleHandler.getObject(i - 1)->getInteractions().front()->getIndex());
5002  }
5004  }
5005 
5006  // OMP parallelism
5007  /*#pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
5008  for (unsigned int i = particleHandler.getSize(); i >= 1 ; i--)
5009  {
5010  if (particleHandler.getObject(i - 1)->getPeriodicFromParticle() != nullptr) {
5011  while (!particleHandler.getObject(i - 1)->getInteractions().empty()) {
5012  interactionHandler.removeObjectKeepingPeriodics(
5013  particleHandler.getObject(i - 1)->getInteractions().front()->getIndex());
5014  }
5015  particleHandler.removeObject(i - 1);
5016  }
5017  }*/
5018 
5019 #ifdef MERCURYDPM_USE_MPI
5020  }
5021 #endif
5022 }
void removeObjectKeepingPeriodics(unsigned int id)
Removes interactions of periodic particles when the periodic particles get deleted (see DPMBase::remo...
Definition: InteractionHandler.cc:316
void removeObject(unsigned int index) override
Removes a BaseParticle from the ParticleHandler.
Definition: ParticleHandler.cc:394

References BaseInteractable::getInteractions(), BaseHandler< T >::getObject(), BaseParticle::getPeriodicFromParticle(), BaseHandler< T >::getSize(), constants::i, interactionHandler, NUMBER_OF_PROCESSORS, particleHandler, ParticleHandler::removeObject(), and InteractionHandler::removeObjectKeepingPeriodics().

Referenced by computeOneTimeStep(), and initialiseSolve().

◆ removeOldFiles()

void DPMBase::removeOldFiles ( ) const
4423 {
4424  //logger(INFO,"ID %",PROCESSOR_ID);
4425  //if (PROCESSOR_ID!=0) return;
4426 
4427  logger(INFO,"Removing old files named %.*",getName());
4428  std::ostringstream filename;
4429 
4430  // add processor id to file extension for mpi jobs
4431  std::string p = (NUMBER_OF_PROCESSORS > 1)?std::to_string(PROCESSOR_ID):"";
4432  // all the file extensions that should be deleted
4433  std::vector<std::string> ext{".restart"+p, ".stat"+p, ".fstat"+p, ".data"+p, ".ene"+p, ".xballs"};
4434  for (const auto& j : ext)
4435  {
4436  // remove files with given extension for FileType::ONE_FILE
4437  filename.str("");
4438  filename << getName() << j;
4439  if (!remove(filename.str().c_str()))
4440  {
4441  logger(INFO," File % successfully deleted",filename.str());
4442  }
4443  // remove files with given extension for FileType::MULTIPLE_FILES
4444  unsigned k = 0;
4445  filename.str("");
4446  filename << getName() << j << '.' << k;
4447  while (!remove(filename.str().c_str()))
4448  {
4449  if (k<3) logger(INFO," File % successfully deleted",filename.str());
4450  filename.clear();
4451  filename << getName() << j << '.' << ++k;
4452  }
4453  // remove files with given extension for FileType::MULTIPLE_FILES_PADDED
4454  k = 0;
4455  filename.str("");
4456  filename << getName() << j << '.' << to_string_padded(k);
4457  while (!remove(filename.str().c_str()))
4458  {
4459  if (k<3) logger(INFO," File % successfully deleted",filename.str());
4460  filename.clear();
4461  filename << getName() << j << '.' << to_string_padded(++k);
4462  }
4463  }
4464  // remove vtk files
4465  // add processor id to file extension for mpi jobs
4466  std::string q = (NUMBER_OF_PROCESSORS > 1)?("Processor_"+std::to_string(PROCESSOR_ID)+"_"):"";
4467  // all the file extensions that should be deleted
4468  ext = {"Wall_", q+"Particle_", q+"Interaction_", q+"Boundary_"};
4469  for (const auto& j : ext)
4470  {
4471  // remove files with given extension for FileType::ONE_FILE
4472  filename.str("");
4473  filename << getName() << j << ".vtu";
4474  if (!remove(filename.str().c_str()))
4475  {
4476  logger(INFO," File % successfully deleted",filename.str());
4477  }
4478  // remove files with given extension for FileType::MULTIPLE_FILES
4479  unsigned k = 0;
4480  filename.str("");
4481  filename << getName() << j << k << ".vtu";
4482  while (!remove(filename.str().c_str()))
4483  {
4484  if (k<3) logger(INFO," File % successfully deleted",filename.str());
4485  filename.str("");
4486  filename << getName() << j << ++k << ".vtu";
4487  }
4488  //std::cout << " File " << filename.str() << " not found" << std::endl;
4489  }
4490 }
std::string to_string_padded(unsigned int value)
Pads the number This function tries to pad the number to 4 digits, which is used when you create mult...
Definition: File.cc:44

References getName(), INFO, logger, NUMBER_OF_PROCESSORS, PROCESSOR_ID, and to_string_padded().

Referenced by GranuDrum::GranuDrum(), main(), readNextArgument(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MarbleRun::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), and AreaVTK::setupInitialConditions().

◆ resetFileCounter()

void DPMBase::resetFileCounter ( )

Resets the file counter for each file i.e. for ene, data, fstat, restart, stat)

This implicitly calls the setCounter() function defined in File.h

References boundaryVTKWriter_, dataFile, eneFile, fStatFile, interactionFile, interactionVTKWriter_, NEVER, restartFile, File::setCounter(), BaseVTKWriter< H >::setFileCounter(), setLastSavedTimeStep(), statFile, vtkWriter_, wallDetailsVTKWriter_, and wallVTKWriter_.

Referenced by initialiseSolve().

◆ setAppend()

void DPMBase::setAppend ( bool  newAppendFlag)

Sets whether the "append" option is on or off.

Used when a code is restarted. If set to true, existing files (other than restart files, which are always overwritten) will be appended, rather than new files being created and/or old files being overwritten. If false, files will simply be overwritten.

Parameters
[in]newAppendFlag
1523 {
1524  append_ = newAppendFlag;
1525 }

References append_.

Referenced by ClosedCSCRestart::ClosedCSCRestart(), commandLineCG(), constructor(), CSCRestart::CSCRestart(), LawinenBox::LawinenBox(), main(), readNextArgument(), and Mercury3DRestart::readNextArgument().

◆ setBackgroundDrag()

void DPMBase::setBackgroundDrag ( Mdouble  backgroundDrag)
inline

Simple access function to turn on a background drag. The force of particleVelocity*drag is applied (note, it allowd to be negaitve i.e. create energy)

806 {backgroundDrag_=backgroundDrag;}

References backgroundDrag_.

Referenced by constructor().

◆ setDimension()

void DPMBase::setDimension ( unsigned int  newDim)

Sets both the system dimensions and the particle dimensionality.

Note: In MercuryDPM, it is possible to simulate, for example, 3D particles in a 2D system by setting "setSystemDimensions(newDim)" and "setParticleDimensions(newDim)" individually.

The relevant sanity checks exist within the "setSystemDimensions(newDim)" and "setParticleDimensions(newDim)" functions.

Parameters
[in]newDimThe desired dimensionality of the system and the particles: 1 → 1D, 2 → 2D, 3 → 3D.
1404 {
1405  setSystemDimensions(newDim);
1406  setParticleDimensions(newDim);
1407 }

References setParticleDimensions(), and setSystemDimensions().

Referenced by main(), Contact::setupInitialConditions(), and EnergyUnitTest::setupInitialConditions().

◆ setDomain()

void DPMBase::setDomain ( const Vec3D min,
const Vec3D max 
)

Sets the minimum coordinates of the problem domain.

1099 {
1100 
1101 logger.assert_debug(min.X <= max.X, "lower x-bound (%) is larger than upper x-bound (%)", min.X, max.X);
1102 logger.assert_debug(min.Y <= max.Y, "lower x-bound (%) is larger than upper x-bound (%)", min.Y, max.Y);
1103 logger.assert_debug(min.Z <= max.Z, "lower x-bound (%) is larger than upper x-bound (%)", min.Z, max.Z);
1104 min_ = min;
1105 max_ = max;
1106 }

References logger, max_, min_, Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), DPM::DPM(), Hertzian2DUnitTest::Hertzian2DUnitTest(), main(), ParticleBeam::ParticleBeam(), CGHandler::restart(), BaseCluster::setDomainLimits(), NautaMixer::setupInitialConditions(), MarbleRun::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SquarePacking::setupInitialConditions(), Wall::setupInitialConditions(), Packing::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), and CoupledProblem::setupMercury().

◆ setFileType()

void DPMBase::setFileType ( FileType  fileType)

Sets File::fileType_ for all files (ene, data, fstat, restart, stat)

Calls the setFileType() function from the File.h, which basically sets the File::fileType_. Note, this does not affect the interactionFile.

Parameters
[in]fileType(an object of enum class FileType)
460 {
461 dataFile.setFileType(fileType);
462 fStatFile.setFileType(fileType);
463 restartFile.setFileType(fileType);
464 statFile.setFileType(fileType);
465 eneFile.setFileType(fileType);
466 }

References dataFile, eneFile, fStatFile, restartFile, File::setFileType(), and statFile.

Referenced by ClosedCSCRun::ClosedCSCRun(), ClosedCSCStats::ClosedCSCStats(), Contact::Contact(), CSCStats::CSCStats(), loadingTest(), main(), normalAndTangentialLoadingTest(), objectivenessTest(), readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), Calibration::setOutput(), CSCRun::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), AreaVTK::setupInitialConditions(), Tutorial11::Tutorial11(), viscoElasticUnitTest::viscoElasticUnitTest(), and Wall::Wall().

◆ setFixedParticles()

void DPMBase::setFixedParticles ( unsigned int  n)
protected

Sets a number, n, of particles in the particleHandler as "fixed particles".

That is to say that the first n particles in the handler will have their masses and inertiae set to infinity and their velocities set to zero, making them effectively immobile and immovable (see also BaseParticle::fixParticle() ). If n exceeds the number of particles in the handler, then all particles will be "fixed".

Parameters
[in]nThe number of particles to "fix".
Todo:
Question: can this function be called during the run of the program? i.e. can particles be made to suddenly "become fixed"?
1961 {
1962  for (unsigned int i = 0; i < std::min(particleHandler.getSize(), n); i++)
1964 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32

References BaseParticle::fixParticle(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), constants::i, n, and particleHandler.

Referenced by readNextArgument().

◆ setGravity()

void DPMBase::setGravity ( Vec3D  newGravity)

Sets a new value for the gravitational acceleration.

Allows the user to set the value of the gravitational acceleration (g) to which their simulated system is exposed. The gravity is passed to the function as a (Vec3D) vector value, thus providing all three components of g and hence allowing both its direction and strength to be altered.

Parameters
[in]newGravityThe desired new value of the gravitational acceleration as a Vec3D vector.
1384 {
1385  gravity_ = newGravity;
1386 }

References gravity_.

Referenced by BoundariesSelfTest::BoundariesSelfTest(), CGBasicSelfTest::CGBasicSelfTest(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), constructor(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), InitialConditions< SpeciesType >::InitialConditions(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), load(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), ParticleInclusion::ParticleInclusion(), ParticleParticleCollision::ParticleParticleCollision(), protectiveWall::protectiveWall(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), SingleParticle< SpeciesType >::scaleMass(), InitialConditions< SpeciesType >::scaleMass(), Cstatic2d::set_particle_properties(), Cstatic3D::set_particle_properties(), Chute::setChuteAngleAndMagnitudeOfGravity(), CurvyChute::setChuteAngleAndMagnitudeOfGravity(), ExtremeOverlapUnitTest::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), NautaMixer::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), Chain::setupInitialConditions(), StressStrainControl::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), FiveParticles::setupInitialConditions(), Drum::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), SimpleOpt::setupInitialConditions(), InitialConditions< SpeciesType >::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FreeFall::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), MovingWallTangential::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), SinterPair::SinterPair(), Slide::Slide(), statistics_while_running< T >::statistics_while_running(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), Tutorial11::Tutorial11(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setInteractionsWriteVTK()

void DPMBase::setInteractionsWriteVTK ( bool  writeVTK)

Sets whether interactions are written into a VTK file.

Deprecated:
Use interactionHandler.setWriteVTK(bool) instead (since 21-07-2021)
931 {
932  logger(WARN, "DPMBase.setInteractionsWriteVTK(bool) is deprecated! Use interactionHandler.setWriteVTK(bool) instead.");
934 }

References interactionHandler, logger, InteractionHandler::setWriteVTK(), and WARN.

◆ setLastSavedTimeStep()

void DPMBase::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.

Sets the time step when the files will next be saved, except for the interaction file. Note, that the interaction file is independent of time steps, and just writes when an interaction starts or ends.

Parameters
[in]nextSavedTimeStep
520 {
521 dataFile.setLastSavedTimeStep(nextSavedTimeStep);
522 fStatFile.setLastSavedTimeStep(nextSavedTimeStep);
523 restartFile.setLastSavedTimeStep(nextSavedTimeStep);
524 //statFile.setLastSavedTimeStep(nextSavedTimeStep); //this one is not force-written
525 eneFile.setLastSavedTimeStep(nextSavedTimeStep);
526 }
void setLastSavedTimeStep(unsigned int lastSavedTimeStep)
Sets File::nextSavedTimeStep_.
Definition: File.cc:302

References dataFile, eneFile, fStatFile, restartFile, and File::setLastSavedTimeStep().

Referenced by forceWriteOutputFiles(), main(), and resetFileCounter().

◆ setLogarithmicSaveCount()

void DPMBase::setLogarithmicSaveCount ( Mdouble  logarithmicSaveCountBase)

Sets File::logarithmicSaveCount_ for all files (ene, data, fstat, restart, stat)

sets the number of time steps skipped between each save for ALL data files, except for the interaction file. And the increament of this number of time steps is based on a user input logarithmicSaveCountBase, e.g. if you put 10 as your input, the saving point will be at 10, 10^1, 10^2, 10^3, which results equal distance on a log scale. Note, that the interaction file is independent of time steps, and just writes when an interaction starts or ends.

Parameters
[in]logarithmicSaveCountBase
5448 {
5449  dataFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5450  fStatFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5451  restartFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5452  statFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5453  eneFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5454 }
void setlogarithmicSaveCount(const Mdouble logarithmicSaveCountBase)
the function to set the user input base of logarithmic saving count
Definition: File.cc:283

References dataFile, eneFile, fStatFile, restartFile, File::setlogarithmicSaveCount(), and statFile.

◆ setMax() [1/2]

void DPMBase::setMax ( const Vec3D newMax)

Sets the maximum coordinates of the problem domain.

This specifies one corner of the problem's cuboidal bounding box. These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

A sanity check is performed to verify that each of the maximum coordinates are greater than the corresponding minimum coordinates. It raises a (logged) warning if not.

Parameters
[in]newMax
1083 {
1084 if (min_.x() > newMax.x() ||
1085 min_.y() > newMax.y() ||
1086 min_.z() > newMax.z())
1087 {
1088 logger(WARN, "Warning in setMax: upper bound is smaller"
1089  " than lower bound. (%,%,%) > (%,%,%)",
1090  min_.x(), min_.y(), min_.z(), newMax.x(), newMax.y(), newMax.z());
1091 }
1092 else
1093 {
1094 max_ = newMax;
1095 }
1096 }

References logger, max_, min_, WARN, Vec3D::x(), Vec3D::y(), and Vec3D::z().

Referenced by ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), InsertionBoundarySelfTest::InsertionBoundarySelfTest(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), loadingTest(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), multiParticleT1::multiParticleT1(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleInclusion::ParticleInclusion(), FileReader::read(), runFreeFall(), setMax(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), VisualisationTest::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), MovingWalls::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), AreaVTK::setupInitialConditions(), SinterPair::SinterPair(), StressStrainControl::StressStrainControl(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), and TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test().

◆ setMax() [2/2]

void DPMBase::setMax ( Mdouble  xMax,
Mdouble  yMax,
Mdouble  zMax 
)

Sets the maximum coordinates of the problem domain.

As in setMax but the coordinates are passed as three Mdouble, not a Vec3D.

1148 {
1149 setMax(Vec3D(xMax, yMax, zMax));
1150 }
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1082

References setMax().

◆ setMeanVelocity()

void DPMBase::setMeanVelocity ( Vec3D  V_mean_goal)

This function will help you set a fixed kinetic energy and mean velocity in your system.

The function first generates random velocities for every particle in the system and then injects the desired kinetic energy and sets the desired mean velocity in the system.

Parameters
[in]V_mean_goalThe mean velocity you want to set after injecting energy
[in]Ek_goalThe kinetic energy you want to inject into the system
5306 {
5307  Vec3D meanVelocity = getTotalMomentum() / getTotalMass();
5308 
5309  //correct the mean velocity to zero
5310  for (auto& p : particleHandler)
5311  {
5312  p->addVelocity(-meanVelocity);
5313  }
5314 }
Vec3D getTotalMomentum() const
JMFT: Return the total momentum of the system, excluding fixed particles.
Definition: DPMBase.cc:1624

References getTotalMass(), getTotalMomentum(), and particleHandler.

Referenced by FreeCooling2DinWalls::setupInitialConditions().

◆ setMeanVelocityAndKineticEnergy()

void DPMBase::setMeanVelocityAndKineticEnergy ( Vec3D  V_mean_goal,
Mdouble  Ek_goal 
)

This function will help you set a fixed kinetic energy and mean velocity in your system.

The function first generates random velocities for every particle in the system and then injects the desired kinetic energy and sets the desired mean velocity in the system.

Parameters
[in]V_mean_goalThe mean velocity you want to set after injecting energy
[in]Ek_goalThe kinetic energy you want to inject into the system
5323 {
5324  Vec3D V_mean;
5325  Mdouble Ek_mean_goal = 0, Ek_fluct_factor = 0;
5326  RNG rng;
5327 
5328  //assign random velocity to each particle
5329  for (auto& p : particleHandler)
5330  {
5331  p->setVelocity(Vec3D(rng.getRandomNumber(-1, 1), rng.getRandomNumber(-1, 1), rng.getRandomNumber(-1, 1)));
5332  }
5333 
5334  //calculate the mean velocity in the system now
5335  Ek_mean_goal = 0.5 * getTotalMass() * V_mean_goal.getLengthSquared();
5336  V_mean = getTotalMomentum() / getTotalMass();
5337  //check if the user input mean kinetic energy is larger than the total kinetic energy input, then return error
5338  logger.assert_always(0.5 * getTotalMass() * V_mean_goal.getLengthSquared() < Ek_goal,
5339  "Too large mean velocity input, Kinetic energy from mean velocity part is larger than the "
5340  "total kinetic energy you want to set");
5341 
5342  //correct the mean velocity to zero
5343  for (auto& p : particleHandler)
5344  {
5345  p->addVelocity(-V_mean);
5346  }
5347 
5348  //set the new fluctuating velocity based on the goal fluctuating kinetic energy
5349  Ek_fluct_factor = std::sqrt((Ek_goal - Ek_mean_goal) / getKineticEnergy());
5350  for (auto& p : particleHandler)
5351  {
5352  p->setVelocity(Ek_fluct_factor * p->getVelocity());
5353  }
5354 
5355  //correct the mean velocity finally to the user set values
5356  V_mean = getTotalMomentum() / getTotalMass();
5357  for (auto& p : particleHandler)
5358  {
5359  p->addVelocity(V_mean_goal - V_mean);
5360  }
5361 
5362  //check the final mean velocity and kinetic energy
5363  logger(INFO, "In DPMBase::setMeanVelocityAndKineticEnergy,\nV_mean_final %\n Ek_final %",
5365 }
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:53
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:143
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:332

References getKineticEnergy(), Vec3D::getLengthSquared(), RNG::getRandomNumber(), getTotalMass(), getTotalMomentum(), INFO, logger, and particleHandler.

◆ setMin() [1/2]

void DPMBase::setMin ( const Vec3D newMin)

Sets the minimum coordinates of the problem domain.

This specifies one corner of the problem's cuboidal bounding box. These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

A sanity check is performed to verify that each of the minimum coordinates are greater than the corresponding maximum coordinates. It raises a (logged) warning if not.

Parameters
[in]newMin
1119 {
1120 if (max_.x() < newMin.x() ||
1121 max_.y() < newMin.y() ||
1122 max_.z() < newMin.z())
1123 {
1124 logger(WARN, "Warning in setMin: lower bound is larger"
1125  " than upper bound. (%,%,%) < (%,%,%)",
1126  max_.x(), max_.y(), max_.z(), newMin.x(), newMin.y(), newMin.z());
1127 }
1128 else
1129 {
1130 min_ = newMin;
1131 }
1132 }

References logger, max_, min_, WARN, Vec3D::x(), Vec3D::y(), and Vec3D::z().

Referenced by ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), InsertionBoundarySelfTest::InsertionBoundarySelfTest(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), loadingTest(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), multiParticleT1::multiParticleT1(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleInclusion::ParticleInclusion(), FileReader::read(), setMin(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), VisualisationTest::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), MovingWalls::setupInitialConditions(), AreaVTK::setupInitialConditions(), SinterPair::SinterPair(), StressStrainControl::StressStrainControl(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), and TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test().

◆ setMin() [2/2]

void DPMBase::setMin ( Mdouble  xMin,
Mdouble  yMin,
Mdouble  zMin 
)

Sets the minimum coordinates of the problem domain.

As in setMin but the coordinates are passed as three Mdouble, not a Vec3D.

1139 {
1140 setMin(Vec3D(xMin, yMin, zMin));
1141 }
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1118

References setMin().

◆ setName() [1/2]

void DPMBase::setName ( const char name)

Calls setName(std::string)

Parameters
[in]name
450 {
451 setName(std::string(name));
452 }

References units::name, and setName().

◆ setName() [2/2]

void DPMBase::setName ( const std::string &  name)

Allows to set the name of all the files (ene, data, fstat, restart, stat)

Parameters
[in]name
423 {
424 if (NUMBER_OF_PROCESSORS > 1)
425 {
426 name_ = name; // was before this->name_ = name
427 dataFile.setName(name_ + ".data" + std::to_string(PROCESSOR_ID));
428 fStatFile.setName(name_ + ".fstat" + std::to_string(PROCESSOR_ID));
429 restartFile.setName(name_ + ".restart" + std::to_string(PROCESSOR_ID));
430 statFile.setName(name_ + ".stat" + std::to_string(PROCESSOR_ID));
431 eneFile.setName(name_ + ".ene" + std::to_string(PROCESSOR_ID));
432 getInteractionFile().setName(name_ + ".interaction" + std::to_string(PROCESSOR_ID));
433 }
434 else
435 {
436 name_ = name; // was before this->name_ = name
437 dataFile.setName(name_ + ".data");
438 fStatFile.setName(name_ + ".fstat");
439 restartFile.setName(name_ + ".restart");
440 statFile.setName(name_ + ".stat");
441 eneFile.setName(name_ + ".ene");
442 interactionFile.setName(name_ + ".interaction");
443 }
444 }

References dataFile, eneFile, fStatFile, getInteractionFile(), interactionFile, units::name, name_, NUMBER_OF_PROCESSORS, PROCESSOR_ID, restartFile, File::setName(), and statFile.

Referenced by ChuteRestartDemo::actionsOnRestart(), AngleOfRepose::AngleOfRepose(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), CGBasicSelfTest::CGBasicSelfTest(), ChutePeriodicDemo::ChutePeriodicDemo(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCStats::ClosedCSCStats(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), ChuteBottom::constructor(), constructor(), Contact::Contact(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), Slide::create_rough_wall(), CSCInit::CSCInit(), CSCRestart::CSCRestart(), CSCStats::CSCStats(), CSCWalls::CSCWalls(), DPM::DPM(), DPMBase(), FileReader::FileReader(), ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), Hertzian2DUnitTest::Hertzian2DUnitTest(), Indenter::Indenter(), inflowFromPeriodic::inflowFromPeriodic(), InitialConditions< SpeciesType >::InitialConditions(), initialiseSolve(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), load(), ChuteWithPeriodicInflow::loadPeriodicBox(), ChuteWithContraction::loadPeriodicBox(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MovingWalls::MovingWalls(), MultiParticlesInsertion::MultiParticlesInsertion(), multiParticleT1::multiParticleT1(), ParticleBeam::ParticleBeam(), ParticleInclusion::ParticleInclusion(), particleParticleTest(), PointIsAboveCurve(), read(), readNextArgument(), Mercury3DRestart::readNextArgument(), readOld(), regimeForceUnitTest::regimeForceUnitTest(), CGHandler::restart(), statistics_while_running< T >::run(), AngleOfRepose::run(), vibratedBed::run(), runFreeFall(), SaveCountUnitTest::SaveCountUnitTest(), SilbertPeriodic::set_study(), setName(), Funnel::setName_(), ChutePeriodic::setup(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Chain::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), Cstatic3D::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), ShearStage::ShearStage(), Siegen::Siegen(), SilbertPeriodic::SilbertPeriodic(), SingleParticle< SpeciesType >::SingleParticle(), SingleParticleIndenter::SingleParticleIndenter(), Sintering::Sintering(), SinterPair::SinterPair(), Slide::Slide(), statistics_while_running< T >::statistics_while_running(), StressStrainControl::StressStrainControl(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), BouncingSuperQuadric::test(), SlidingSpheresUnitTest::test(), ContactDetectionNormalSpheresTest::test(), ContactDetectionRotatedSpheresTest::test(), Packing::test(), HertzContactRestitutionUnitTest::test(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), Tutorial11::Tutorial11(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), viscoElasticUnitTest::viscoElasticUnitTest(), Wall::Wall(), wallParticleTest(), and ChutePeriodic::writeToLocalFolder().

◆ setNToWrite()

void DPMBase::setNToWrite ( int  nToWrite)

set the number of elements to write to the screen

sets nToWrite_. If a user wants to output e.g. particle information to the screen we limit the number of outputs to nToWrite elements to not get an overflow of information in the terminal.

Parameters
[in]nToWriteNumber of elements to write to the screen
854 {
855 nToWrite_ = nToWrite;
856 }

References nToWrite_.

◆ setNumberOfDomains()

void DPMBase::setNumberOfDomains ( std::vector< unsigned >  numberOfDomains)

Sets the number of domains in x-,y- and z-direction. Required for parallel computations.

Sets the number of domains in DPMbase.

The parallel code decomposes the domain according to these values

Parameters
[in]numberOfDomains
5214 {
5215 #ifdef MERCURYDPM_USE_MPI
5216  numberOfDomains_ = numberOfDomains;
5217  logger(INFO, "Split domain into a %x%x% grid",numberOfDomains[0],numberOfDomains[1],numberOfDomains[2]);
5218 #else
5219  logger(WARN, "Setting number of domains, but code is not compiled with MPI on");
5220 #endif
5221 }

References INFO, logger, numberOfDomains_, and WARN.

Referenced by RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), ForceLawsMPI2Test::ForceLawsMPI2Test(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), main(), splitDomain(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), and TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test().

◆ setNumberOfOMPThreads()

void DPMBase::setNumberOfOMPThreads ( int  numberOfOMPThreads)
1258 {
1259 logger.assert_always(numberOfOMPThreads > 0, "Number of OMP threads must be positive");
1260 numberOfOMPThreads_ = numberOfOMPThreads;
1261 
1262 #ifdef MERCURYDPM_USE_OMP
1263 if(numberOfOMPThreads > omp_get_max_threads()) {
1264 logger(INFO, "Number of omp threads set to the maximum number of threads allowed: %",
1265  omp_get_max_threads());
1266 numberOfOMPThreads_ = numberOfOMPThreads = omp_get_max_threads();
1267 }
1268 #pragma omp parallel num_threads(getNumberOfOMPThreads())
1269 {
1270 if (omp_get_thread_num()==0)
1271  logger(INFO, "Using % of % omp threads; testing thread",
1272  omp_get_num_threads(), omp_get_max_threads(), Flusher::NO_FLUSH);
1273 }
1274 #pragma omp parallel num_threads(getNumberOfOMPThreads())
1275 {
1276  logger(INFO, " %", std::to_string(omp_get_thread_num()), Flusher::NO_FLUSH);
1277  }
1278  logger(INFO,"");
1279 
1280 #else
1281  logger(WARN, "You are setting the number of omp threads to %, but OMP is not turned on", getNumberOfOMPThreads());
1282 #endif
1283 }

References getNumberOfOMPThreads(), INFO, logger, NO_FLUSH, numberOfOMPThreads_, and WARN.

Referenced by main(), and read().

◆ setOpenMode()

void DPMBase::setOpenMode ( std::fstream::openmode  openMode)

Sets File::openMode_ for all files (ene, data, fstat, restart, stat)

Parameters
[in]openmode
491 {
492 dataFile.setOpenMode(openMode);
493 fStatFile.setOpenMode(openMode);
494 restartFile.setOpenMode(openMode);
495 statFile.setOpenMode(openMode);
496 eneFile.setOpenMode(openMode);
497 interactionFile.setOpenMode(openMode);
498 }

References dataFile, eneFile, fStatFile, interactionFile, restartFile, File::setOpenMode(), and statFile.

Referenced by initialiseSolve().

◆ setParticleDimensions()

void DPMBase::setParticleDimensions ( unsigned int  particleDimensions)

Sets the particle dimensionality.

Sets the dimensionality of the particles. This affects whether particles are treated as rods, discs or spheres. This is used e.g. for calculating masses and moments of inertia.

Note that the system may possess a different dimensionality.

The particles can be chosen to be one- two- or three-dimensional by passing, respectively, arguments equal to 1, 2 or 3. The code also performs a sanity check to ensure that the dimensionality cannot be higher than three or lower than one. If an unphysical dimensionality is chosen, the particle dimension is set to be equal to the system dimension. Note, that we cannot throw an error here, since in some old restart files the "particleDimensions_" are 0.

Parameters
[in]particleDimensionsAn integer value representing the desired dimensionality of the particles: 1 → 1D, 2 → 2D, 3 → 3D.
1449 {
1450  if (particleDimensions >= 1 && particleDimensions <= 3)
1451  {
1452  particleDimensions_ = particleDimensions;
1454  }
1455  else
1456  {
1457  logger(WARN, "Error in setParticleDimensions; particleDimensions % is not 1, 2 or 3, setting it to "
1458  "systemDimension now (%)", particleDimensions, systemDimensions_);
1460  }
1461 }

References ParticleHandler::computeAllMasses(), logger, particleDimensions_, particleHandler, systemDimensions_, and WARN.

Referenced by constructor(), Mercury2D::constructor(), Mercury3D::constructor(), loadingTest(), main(), normalAndTangentialLoadingTest(), objectivenessTest(), SpeciesHandler::readOldObject(), readParAndIniFiles(), setDimension(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), and Siegen::Siegen().

◆ setParticlesWriteVTK()

void DPMBase::setParticlesWriteVTK ( bool  writeParticlesVTK)

Sets whether particles are written in a VTK file.

The VTK format is used for visualisation in Paraview.

Todo:
Move this (and the get) to ParticleHandler.
Parameters
[in]writeParticlesVTK
943 {
944 writeParticlesVTK_ = writeParticlesVTK;
946 {
948 }
949 delete vtkWriter_;
951 }
Definition: SphericalParticleVtkWriter.h:35

References particleHandler, vtkWriter_, writeParticlesVTK_, and writeSuperquadricParticlesVTK_.

Referenced by Chutebelt::actionsAfterTimeStep(), BaseCluster::actionsOnRestart(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), HorizontalMixer::HorizontalMixer(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), ParticleBeam::ParticleBeam(), protectiveWall::protectiveWall(), read(), ChutePeriodicDemo::setupInitialConditions(), multiParticleT1::setupInitialConditions(), NautaMixer::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MarbleRun::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), MovingWalls::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), SinterPair::SinterPair(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), and Tutorial11::Tutorial11().

◆ setRestarted()

◆ setRestartVersion()

void DPMBase::setRestartVersion ( std::string  newRV)

Sets restart_version.

Parameters
[in]newRV
1485 {
1486  restartVersion_ = newRV;
1487 }

References restartVersion_.

◆ setRotation()

void DPMBase::setRotation ( bool  rotation)
inline

Sets whether particle rotation is enabled or disabled.

Todo:
  • Passing true will enable particle rotation. Passing false will disable particle rotation.
    Parameters
    [in]newRotFlag
564  { rotation_ = rotation; }

References rotation_.

Referenced by ParticleHandler::addObject(), SpeciesHandler::addObject(), SpeciesHandler::removeObject(), MembraneDemo::setupInitialConditions(), and MembraneSelfTest::setupInitialConditions().

◆ setRunNumber()

void DPMBase::setRunNumber ( int  runNumber)

This sets the counter/Run number, overriding the defaults.

A simple "set function" which allows the user to simply overwrite the current run number to any valid new value.

Parameters
[in]runNumber- the value to which we want to (re)set the internally stored run number parameter, runNumber_
607 {
608 runNumber_ = runNumber;
609 }

References runNumber_.

Referenced by autoNumber(), and readNextArgument().

◆ setSaveCount()

void DPMBase::setSaveCount ( unsigned int  saveCount)

Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)

sets the number of time steps skipped between each save for ALL data files, except for the interaction file. Note, that the interaction file is independent of time steps, and just writes when an interaction starts or ends.

409 {
410 dataFile.setSaveCount(saveCount);
411 fStatFile.setSaveCount(saveCount);
412 restartFile.setSaveCount(saveCount);
413 statFile.setSaveCount(saveCount);
414 eneFile.setSaveCount(saveCount);
415 for (auto cg : cgHandler)
416 cg->statFile.setSaveCount(saveCount);
417 }

References cgHandler, dataFile, eneFile, fStatFile, restartFile, File::setSaveCount(), and statFile.

Referenced by BaseCluster::actionsAfterTimeStep(), DrumRot::actionsBeforeTimeStep(), SaveCountUnitTest::actionsBeforeTimeStep(), ChuteRestartDemo::actionsOnRestart(), DrumRot::actionsOnRestart(), BaseCluster::actionsOnRestart(), NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), AngleOfRepose::AngleOfRepose(), BoundariesSelfTest::BoundariesSelfTest(), CGBasicSelfTest::CGBasicSelfTest(), ChutePeriodicDemo::ChutePeriodicDemo(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCStats::ClosedCSCStats(), ClosedCSCWalls::ClosedCSCWalls(), constructor(), CSCStats::CSCStats(), CSCWalls::CSCWalls(), DPM::DPM(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), CLiveStatistics< T >::getLiveStatistics(), GranuDrum::GranuDrum(), Hertzian2DUnitTest::Hertzian2DUnitTest(), InitialConditions< SpeciesType >::InitialConditions(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), loadingTest(), main(), ChuteBottom::makeRoughBottom(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleBeam::ParticleBeam(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), runFreeFall(), Calibration::setOutput(), ChutePeriodic::setup(), CSCRun::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Chain::setupInitialConditions(), MarbleRun::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), DPM::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), Contact::setupInitialConditions(), Wall::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), LongHertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), SilbertHstop::SilbertHstop(), SilbertPeriodic::SilbertPeriodic(), SinterPair::SinterPair(), Slide::Slide(), statistics_while_running< T >::statistics_while_running(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), BouncingSuperQuadric::test(), SlidingSpheresUnitTest::test(), ContactDetectionNormalSpheresTest::test(), ContactDetectionRotatedSpheresTest::test(), HertzContactRestitutionUnitTest::test(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setSoftStop()

void DPMBase::setSoftStop ( )
protected

function for setting sigaction constructor.

5167  {
5168  logger(INFO,"Initiated soft stop");
5169  struct sigaction act{};
5170  memset(&act, 0, sizeof(act));
5171 
5172  act.sa_handler = &signalHandler;
5173 
5174  sigaction(SIGINT, &act, nullptr);
5175  sigaction(SIGTERM, &act, nullptr);
5176  sigaction(SIGKILL, &act, nullptr);
5177 }
static void signalHandler(int signal)
signal handler function.
Definition: DPMBase.cc:5141

References INFO, logger, and signalHandler().

Referenced by constructor().

◆ setSuperquadricParticlesWriteVTK()

void DPMBase::setSuperquadricParticlesWriteVTK ( bool  writeParticlesVTK)
Parameters
[in]writeParticlesVTK
957 {
958 writeSuperquadricParticlesVTK_ = writeParticlesVTK;
960 {
961 writeParticlesVTK_ = false;
962 }
963 delete vtkWriter_;
965 }
Definition: SuperQuadricParticleVtkWriter.h:34

References particleHandler, vtkWriter_, writeParticlesVTK_, and writeSuperquadricParticlesVTK_.

Referenced by main(), and BouncingSuperQuadric::test().

◆ setSystemDimensions()

void DPMBase::setSystemDimensions ( unsigned int  newDim)

Sets the system dimensionality.

Sets the dimensionality of the system. (Note that particles

may possess a different dimensionality.)

A sanity check is performed to ensure that the dimensionality is 1, 2 or 3. If not, an error message is logged and the simulation terminates.

Parameters
[in]newDimThe desired dimensionality of the system: 1 → 1D, 2 → 2D, 3 → 3D.

1418 {
1419  if (newDim >= 1 && newDim <= 3)
1420  systemDimensions_ = newDim;
1421  else
1422  {
1423  logger(ERROR, "Error in setSystemDimensions; newDim % is not 1, 2 or 3", newDim);
1424  }
1425 }

References ERROR, logger, and systemDimensions_.

Referenced by constructor(), Mercury2D::constructor(), Mercury3D::constructor(), loadingTest(), main(), normalAndTangentialLoadingTest(), objectivenessTest(), readNextArgument(), setDimension(), StressStrainControl::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), DPM::setupInitialConditions(), SimpleOpt::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), and T_protectiveWall::T_protectiveWall().

◆ setTime()

void DPMBase::setTime ( Mdouble  time)

Sets a new value for the current simulation time.

This may be useful in codes where some initial set-up is required e.g. if a system of particles is first prepared and then exposed to excitation. In this situation, getNumberOfTimeSteps() may be used to reset the time to zero at the point at which excitation begins to be applied.

Parameters
[in]time
837 {
838 Mdouble diff = time_ - time;
839 time_ = time;
840 //this sets the interaction timestamp, so each interaction has the right time
841 for (auto i: interactionHandler)
842 {
843 i->setTimeStamp(i->getTimeStamp() - diff);
844 }
845 }

References constants::i, interactionHandler, and time_.

Referenced by Chutebelt::actionsAfterTimeStep(), DrumRot::actionsBeforeTimeStep(), constructor(), initialiseSolve(), main(), FileReader::read(), readParAndIniFiles(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), and SingleParticleIndenter::SingleParticleIndenter().

◆ setTimeMax()

void DPMBase::setTimeMax ( Mdouble  newTMax)

Sets a new value for the maximum simulation duration.

A sanity check is performed to ensure that the new maximum simulation duration is nonnegative.

Parameters
[in]newTMmax
874 {
875 if (newTMax >= 0)
876 {
877 timeMax_ = newTMax;
878 }
879 else
880 {
881 logger(ERROR, "Error in setTimeMax, new timeMax=% is not positive", newTMax);
882 }
883 }

References ERROR, logger, and timeMax_.

Referenced by GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), SphericalIndenter::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), LawinenBox::actionsBeforeTimeStep(), ChuteRestartDemo::actionsOnRestart(), AngleOfRepose::AngleOfRepose(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), BoundariesSelfTest::BoundariesSelfTest(), ChutePeriodicDemo::ChutePeriodicDemo(), ClosedCSCStats::ClosedCSCStats(), ClosedCSCWalls::ClosedCSCWalls(), commandLineCG(), constructor(), Contact::Contact(), CSCStats::CSCStats(), CSCWalls::CSCWalls(), DPM::DPM(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), Hertzian2DUnitTest::Hertzian2DUnitTest(), InitialConditions< SpeciesType >::InitialConditions(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), load(), loadingTest(), main(), ChuteBottom::makeRoughBottom(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleBeam::ParticleBeam(), ParticleCreation::ParticleCreation(), ParticleInclusion::ParticleInclusion(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), FlowRule::run(), statistics_while_running< T >::run(), runFreeFall(), ChutePeriodic::setup(), ChuteWithContraction::setup_particles_initial_conditions(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Chain::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SimpleOpt::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), VisualisationTest::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), LongHertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), SilbertHstop::SilbertHstop(), SilbertPeriodic::SilbertPeriodic(), SingleParticle< SpeciesType >::SingleParticle(), SinterPair::SinterPair(), Slide::Slide(), SilbertHstop::solve_analytic(), statistics_while_running< T >::statistics_while_running(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), viscoElasticUnitTest::viscoElasticUnitTest(), Wall::Wall(), ClosedCSCRestart::writeOutputFiles(), and CSCRestart::writeOutputFiles().

◆ setTimeStep()

void DPMBase::setTimeStep ( Mdouble  timeStep)

Sets a new value for the simulation time step.

A sanity check is performed to ensure that the time step must be positive.

Parameters
[in]timeStepThe (Mdouble) value of the desired new time step
1235 {
1236 if (timeStep > 0.0)
1237 {
1238 timeStep_ = timeStep;
1239 }
1240 else
1241 {
1242 logger(ERROR, "Error in setTimeStep: new timeStep % is not positive", timeStep);
1243 }
1244 }

References ERROR, logger, and timeStep_.

Referenced by NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), AngledPeriodicBoundarySecondUnitTest::AngledPeriodicBoundarySecondUnitTest(), AngledPeriodicBoundaryUnitTest::AngledPeriodicBoundaryUnitTest(), AngleOfRepose::AngleOfRepose(), BouncingSuperQuadric::BouncingSuperQuadric(), BoundariesSelfTest::BoundariesSelfTest(), BaseCluster::calculateTimeStep(), CGBasicSelfTest::CGBasicSelfTest(), ChutePeriodicDemo::ChutePeriodicDemo(), ClosedCSCWalls::ClosedCSCWalls(), Contact::Contact(), CSCWalls::CSCWalls(), DPM::DPM(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), Hertzian2DUnitTest::Hertzian2DUnitTest(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), load(), loadingTest(), main(), ChuteBottom::makeRoughBottom(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleBeam::ParticleBeam(), ParticleCreation::ParticleCreation(), ParticleInclusion::ParticleInclusion(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), runFreeFall(), Cstatic2d::set_particle_properties(), Cstatic3D::set_particle_properties(), Calibration::setSpecies(), Material::setSpecies(), AxisymmetricWallSelfTest::setSpeciesAndTimeStep(), MercuryProblem::setSpeciesProperties(), ChutePeriodic::setup(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Chain::setupInitialConditions(), MarbleRun::setupInitialConditions(), StressStrainControl::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), FiveParticles::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), InitialConditions< SpeciesType >::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), VisualisationTest::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), Siegen::Siegen(), SilbertPeriodic::SilbertPeriodic(), SinterPair::SinterPair(), statistics_while_running< T >::statistics_while_running(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), viscoElasticUnitTest::viscoElasticUnitTest(), and Wall::Wall().

◆ setupInitialConditions()

void DPMBase::setupInitialConditions ( )
virtual

This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here.

A virtual function with no implementation but can be overriden.

Todo:
I (Anthony) wants to change this to be an external function. This has a lot of advantages especially when using copy-constructors. This is a major change and will break other codes, so therefore has to be done carefully.

This sets up the particles initial conditions it is as you expect the user to override this. By default the particles are randomly distributed

Reimplemented in ChuteWithHopper, ChuteBottom, Chute, BaseCluster, AreaVTK, WallSpecies, TangentialSpringUnitTest, TangentialSpringEnergyConservationUnitTest, SpeciesTest, SinterForceUnitTest, SeparateFilesSelfTest, SaveCountUnitTest, my_problem_HGRID, my_problem, RandomClusterInsertionBoundarySelfTest, PlasticForceUnitTest, PeriodicWallsWithSlidingFrictionUnitTest, PeriodicWalls, MpiPeriodicBoundaryUnitTest, MpiPeriodicBoundaryUnitTest, MpiPeriodicBoundaryUnitTest, MultiParticlesInsertion, MovingWallTangentialPrescribedPositionPrescribedVelocity, MovingWallTangentialPrescribedVelocity, MovingWallTangentialPrescribedPosition, MovingWallTangentialSimpleIntegration, MovingWallTangentialReference, MovingWallTangential, MovingWallPrescribedPositionPrescribedVelocity, MovingWallPrescribedVelocity, MovingWallPrescribedPosition, MovingWallSimpleIntegration, MovingWallReference, MovingWall, MovingWalls, MovingIntersectionOfWallsUnitTest_MovingReferenceFrame, MovingIntersectionOfWallsUnitTest_Basic, MpiMaserChuteTest, InclinedPlane, MD_demo, LongHertzianSinterForceUnitTest, HertzianSinterForceUnitTest, HertzContactRestitutionUnitTest, my_problem, FullRestartTest, FreeFall, FreeFall, FreeFallHertzMindlinUnitTest, RandomClusterInsertionBoundarySelfTest, ExtremeOverlapWithWallsUnitTest, EvaporationAndHeatTest, EnergyUnitTest, DrivenParticleClass, ChargedBondedParticleUnitTest, CreateDataAndFStatFiles, ParticleWall, TwoParticles, Packing, TwoParticles, Packing, ArcWallUnitTest, AngledPeriodicBoundaryUnitTest, AngledPeriodicBoundarySecondUnitTest, ParticleWallInteraction, ParticleParticleInteractionWithPlasticForces, ParticleParticleInteraction, Tutorial9, Tutorial8, Tutorial7, Tutorial6, Tutorial5, Tutorial4, Tutorial3, Tutorial2, Tutorial1, Tutorial12, Tutorial11, DPM, protectiveWall, MercuryProblem, MyProblem, VisualisationTest, ShapesDemo, ContactDetectionRotatedSpheresTest, ContactDetectionNormalSpheresTest, SphericalSuperQuadricCollision, SlidingSpheresUnitTest, EllipticalSuperQuadricCollision, GranularCollapse, EllipticalSuperQuadricCollision, EllipsoidsBouncingOnWallDemo, BouncingSuperQuadric, Wall, Contact, ScalingTestRun, ScalingTestInitialConditionsRelax, ScalingTestRun, ScalingTestInitialConditionsRelax, SphericalIndenter, InitialConditions< SpeciesType >, SingleParticle< SpeciesType >, SimpleOpt, RotatingDrum, DrumRot, UnionOfWalls, TriangulatedWallSelfTest, TriangulatedStepWallSelfTest, TriangulatedStepSelfTest, TriangulatedScrewSelfTest, RollingOverTriangleWalls, MembraneSelfTest, GetDistanceAndNormalForTriangleWalls, ContactDetectionIntersectionOfWallsTest, CoilSelfTest, AxisymmetricWallSelfTest, TwoParticleElasticCollision, TwoParticleElasticCollisionInteraction, TwoParticleElasticCollisionInteraction, TwoBondedParticleElasticCollision, ObliqueImpactSelfTest, DPM, LiquidMigrationSelfTest, HertzianBSHPInteractionTwoParticleElasticCollision, FreeFallSelfTest, FreeFallInteractionSelfTest, my_problem_HGRID, WallParticleCollision, ParticleParticleCollision, ChargedBondedParticleUnitTest, ChargedBondedInteractionSelfTest, ParticleCreation, DPM, SquarePacking, NewtonsCradleSelfTest, NewtonsCradleSelftest, CGStaticBalanceSelfTest, CGHandlerSelfTest, CGHandlerSelfTest, CGHandlerSelfTest, CGBasicSelfTest, PSDSelfTest, PSDSelfTest, SubcriticalMaserBoundarySelfTest, StressStrainControl, PSDSelfTest, PSDManualInsertionSelfTest, PolydisperseInsertionBoundarySelfTest, clumpTest, NozzleSelfTest, MultiplePSDSelfTest, LeesEdwardsSelfTest, InsertionBoundarySelfTest, InsertionBoundarySelfTest, DistributionToPSDSelfTest, DistributionSelfTest, DeletionBoundarySelfTest, CubeDeletionBoundarySelfTest, ConstantMassFlowMaserSelfTest, ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest, Chutebelt, SegregationPeriodic, SegregationPeriodic, SegregationPeriodic, RotatingDrum, RotatingDrum, Siegen, SegregationPeriodic, Silo, Penetration, MindlinSelfTest, HertzSelfTest, Drum, Silo, Polygon, Nurbs, MyCoil, GetDistanceAndNormalForTriangleWall, GetDistanceAndNormalForScrew, GetDistanceAndNormalForIntersectionOfWalls, statistics_while_running< T >, SilbertPeriodic, Mercury3DRestart, statistics_while_running< T >, statistics_while_running< T >, statistics_while_running< T >, SilbertPeriodic, CLiveStatistics< T >, inflowFromPeriodic, SilbertPeriodic, Restart, AngleOfRepose, CLiveStatistics< T >, SilbertPeriodic, SilbertPeriodic, AngleOfRepose, statistics_while_running< T >, statistics_while_running< T >, Cstatic3D, Cstatic2d, Cstatic2d, ChutePeriodic, FiveParticles, TimeDependentPeriodicBoundaryTest, TimeDependentPeriodicBoundary3DSelfTest, ShiftingMaserBoundarySelfTest, ShiftingConstantMassFlowMaserBoundarySelfTest, StressStrainControl, StressStrainControl, StressStrainControl, ParameterStudy3DDemo, ParameterStudy2DDemo, ParameterStudy1DDemo, MinimalExampleDrum, MarbleRun, MarbleRun, LeesEdwardsDemo, HourGlass, HourGlass2D, HourGlass2D, HeaterBoundaryTest, FreeCoolingDemoProblem, FreeCooling3DinWallsDemo, FreeCooling3DDemoProblem, FreeCooling2DinWallsDemo, FreeCooling2DinWalls, CubicCell, TwoByTwoMPIDomainMPI4Test, SubcriticalMaserBoundaryTESTMPI2Test, PeriodicBounaryEnteringMPIDomainTest, MpiPeriodicBoundaryUnitTest, MaserRepeatedOutInMPI2Test, LiquidMigrationMPI2Test, InsertionBoundaryMPI2Test, ForceLawsMPI2Test, Mercury3DRestart, Chain, Chain, my_problem, my_problem, my_problem, Binary, Funnel, ChuteWithVerticalHopper, MembraneDemo, VerticalMixer, RotatingDrumWet, Drum, NozzleDemo, NautaMixer, HorizontalMixerWalls, HorizontalMixer, ChuteWithPeriodicInflow, restart, free_cooling, my_problem, my_problem, RandomClusterInsertionBoundarySelfTest, multiParticleT1, multiParticleT1, multiParticleT1, multiParticleT1, multiParticleT1, multiParticleT1, multiParticleT1, SmoothChute, SmoothChute, MercuryLogo, ChuteWithWedge, ChutePeriodicDemo, AxisymmetricHopper, AirySavageHutter, Vreman, Vreman, Vreman, VariableBottom, VariableBottom, ChutePeriodic, SegregationPeriodic, ChuteRestart, VariableBottom, ChutePeriodic, ChutePeriodic, ChutePeriodic, ChutePeriodic, CSCWalls, CSCStats, CSCRun, CSCInit, ClosedCSCWalls, ClosedCSCStats, ClosedCSCRun, LawinenBox, LawinenBox, LawinenBox, T_protectiveWall, ExtremeOverlapVolumeUnitTest, and ExtremeOverlapUnitTest.

1999 {
2000 }

Referenced by initialiseSolve(), loadingTest(), normalAndTangentialLoadingTest(), and objectivenessTest().

◆ setWallsWriteVTK() [1/2]

void DPMBase::setWallsWriteVTK ( bool  writeVTK)

Sets whether walls are written into a VTK file.

Deprecated:
Use wallHandler.setWriteVTK(bool) instead (since 21-07-2021)

The VTK file is used for visualisation in Paraview.

Todo:
Move this (and the get) to WallHandler.
Parameters
[in]writeWallsVTK
924 {
925  FileType writeVTKFileType = writeVTK?FileType::MULTIPLE_FILES:FileType::NO_FILE;
926  logger(WARN, "DPMBase.setWallsWriteVTK(bool) is deprecated! Use wallHandler.setWriteVTK(bool) instead.");
927  wallHandler.setWriteVTK(writeVTKFileType);
928 }

References logger, MULTIPLE_FILES, NO_FILE, WallHandler::setWriteVTK(), wallHandler, and WARN.

◆ setWallsWriteVTK() [2/2]

void DPMBase::setWallsWriteVTK ( FileType  writeWallsVTK)

Sets whether walls are written into a VTK file.

Deprecated:
Use wallHandler.setWriteVTK(FileType) instead (since 21-07-2021)

Uses the preprocessor directive ifdef to check if there exists a CONTACT_LIST_HGRID, before any code is compiled. If CONTACT_LIST_HGRID does exist, this function can be used to return the "possibleContactsList" - but not to alter it.

The VTK file is used for visualisation in Paraview.

Todo:
Move this (and the get) to WallHandler.
Parameters
[in]writeWallsVTK
912 {
913  logger(WARN, "DPMBase.setWallsWriteVTK(FileType) is deprecated! Use wallHandler.setWriteVTK(FileType) instead.");
914  wallHandler.setWriteVTK(writeWallsVTK);
915 }

References logger, WallHandler::setWriteVTK(), wallHandler, and WARN.

Referenced by multiParticleT1::multiParticleT1().

◆ setWritePythonFileForVTKVisualisation()

void DPMBase::setWritePythonFileForVTKVisualisation ( bool  forceWritePythonFileForVTKVisualisation)
Todo:
When restarting the indexMax should be reset

Enables/disables the writePythonFileForVTKVisualisation() function.

Parameters
[in]forceWritePythonFileForVTKVisualisation
5496 {
5497  forceWritePythonFileForVTKVisualisation_ = forceWritePythonFileForVTKVisualisation;
5498 }

References forceWritePythonFileForVTKVisualisation_.

Referenced by AreaVTK::setupInitialConditions().

◆ setXBallsAdditionalArguments()

void DPMBase::setXBallsAdditionalArguments ( std::string  xBallsAdditionalArguments)

Set the additional arguments for xballs.

Used to set, from the driver code itself, arguments to control the visualisation of the simulation run using xballs. All arguments can be passed as a single string, for example:

setXBallsAdditionalArguments("-cmode 8 -solidf");

will set the colour mode (cmode) to 8 (colour dependent on species) and draw particles with solid lines (solidf)

Parameters
[in]newXBArgs
1348 {
1349  xBallsAdditionalArguments_ = xBallsAdditionalArguments;
1350 }

References xBallsAdditionalArguments_.

Referenced by BaseCluster::actionsOnRestart(), BoundariesSelfTest::BoundariesSelfTest(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCInit::CSCInit(), CSCWalls::CSCWalls(), DPM::DPM(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), InitialConditions< SpeciesType >::InitialConditions(), LawinenBox::LawinenBox(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), main(), MultiParticlesInsertion::MultiParticlesInsertion(), multiParticleT1::multiParticleT1(), read(), Calibration::setOutput(), CSCRun::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), DPM::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), BaseCluster::setupInitialConditions(), ShearStage::ShearStage(), SingleParticle< SpeciesType >::SingleParticle(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), Tutorial11::Tutorial11(), and TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test().

◆ setXBallsColourMode()

void DPMBase::setXBallsColourMode ( int  newCMode)

Set the xballs output mode.

Allows the user to change the default "cmode" (colour mode) variable in MercuryDPM's built-in visualiser, "XBalls". cmode takes an integer value between 1 and 27 (1 and 14 for 2D problems); to each integer is assigned a different colour mode, which can be used to assign colours to individual particles based on a parameter such as the particles radius, velocity, rotational energy etc. etc. For further details, refer to the Visualising data in xballs

Parameters
[in]newCModeThe numerical value corresponding to the colour mode (see Visualising data in xballs) you want to use when visually reconstructing Mercury simulations.
1301 {
1302  xBallsColourMode_ = newCMode;
1303 }

References xBallsColourMode_.

Referenced by main(), and ChutePeriodic::setup().

◆ setXBallsScale()

void DPMBase::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.

Parameters
[in]newScaleThe desired new scaling or "zoom". Values > 1 act to "zoom out", values < 1 act to "zoom in".
1364 {
1365  xBallsScale_ = newScale;
1366 }

References xBallsScale_.

Referenced by main().

◆ setXBallsVectorScale()

void DPMBase::setXBallsVectorScale ( double  newVScale)

Set the scale of vectors in xballs.

Allows the user to choose the default vector scaling, i.e. the length of the vectors representing particle velocities in the XBalls visualisation software. Further details may be found in the Visualising data in xballs

Parameters
[in]newVScaleThe value of the desired vector length - a value of 100 sets the length to 1 particle radius, 1000 sets it to 10 particle radii etc.
1321 {
1322  xBallsVectorScale_ = newVScale;
1323 }

References xBallsVectorScale_.

Referenced by main(), and ChutePeriodic::setup().

◆ setXMax()

void DPMBase::setXMax ( Mdouble  newXMax)

Sets the value of XMax, the upper bound of the problem domain in the x-direction.

Deprecated:

An access function which allows the user to alter the value of the (private) x value of the "Vec3D" object "max_", thus setting the maximum x-value corresponding to the system, i.e. the upper limit of the domain in the x-direction.

These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

The function also performs a sanity check to stop the user defining an upper bound that is lower than the corresponding lower bound (XMin), giving a (logged) warning if the user attempts to do so.

Parameters
[in]newXMax
1166 {
1167 
1168 if (newXMax >= getXMin())
1169 {
1170 max_.x() = newXMax;
1171 }
1172 else
1173 {
1174 logger(WARN, "Warning in setXMax(%): xMax=%", newXMax, getXMin());
1175 }
1176 
1177 }

References getXMin(), logger, max_, WARN, and Vec3D::x().

Referenced by ChuteWithPeriodicInflow::AddContinuingBottom(), statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), Funnel::check_funnel(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), inflowFromPeriodic::inflowFromPeriodic(), InitialConditions< SpeciesType >::InitialConditions(), LawinenBox::LawinenBox(), load(), main(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), Chute::setChuteLength(), ChuteWithHopper::setChuteLength(), ChuteWithHopper::setHopperShift(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), SmoothChute::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Chain::setupInitialConditions(), FiveParticles::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Cstatic3D::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), FlowFrontChute::stretch(), T_protectiveWall::T_protectiveWall(), Tutorial11::Tutorial11(), StressStrainControlBoundary::updateDomainSize(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setXMin()

void DPMBase::setXMin ( Mdouble  newXMin)

Sets the value of XMin, the lower bound of the problem domain in the x-direction.

Deprecated:

An access function which allows the user to alter the value of the (private) x value of the "Vec3D" object "min_", thus setting the minimum x-value corresponding to the system, i.e. the lower limit of the domain in the x-direction.

These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

The function also performs a sanity check to stop the user defining a lower bound that is higher than the corresponding upper bound (XMax), giving a (logged) warning if the user attempts to do so.

Parameters
[in]newXMin
1011 {
1012 if (newXMin <= getXMax())
1013 {
1014 min_.x() = newXMin;
1015 }
1016 else
1017 {
1018 logger(WARN, "Warning in setXMin(%): xMax=%", newXMin, getXMax());
1019 }
1020 }

References getXMax(), logger, min_, WARN, and Vec3D::x().

Referenced by statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), Funnel::check_funnel(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), ChuteWithHopper::setChuteLength(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), SmoothChute::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Chain::setupInitialConditions(), FiveParticles::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), Tutorial11::Tutorial11(), StressStrainControlBoundary::updateDomainSize(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setYMax()

void DPMBase::setYMax ( Mdouble  newYMax)

Sets the value of YMax, the upper bound of the problem domain in the y-direction.

Deprecated:

An access function which allows the user to alter the value of the (private) y value of the "Vec3D" object "max_", thus setting the maximum y-value corresponding to the system, i.e. the upper limit of the domain in the y-direction.

These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

The function also performs a sanity check to stop the user defining an upper bound that is lower than the corresponding lower bound (YMin), giving a (logged) warning if the user attempts to do so.

Parameters
[in]newYMax
1192 {
1193 
1194 if (newYMax >= getYMin())
1195 {
1196 max_.y() = newYMax;
1197 }
1198 else
1199 {
1200 logger(WARN, "Warning in setYMax(%): yMax=%", newYMax, getYMin());
1201 }
1202 
1203 }

References getYMin(), logger, max_, WARN, and Vec3D::y().

Referenced by statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), Funnel::check_funnel(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), CSCWalls::CSCWalls(), ChuteWithPeriodicInflow::ExtendInWidth(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), LawinenBox::LawinenBox(), load(), main(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), Slide::set_Walls(), Chute::setChuteWidth(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), SmoothChute::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Chain::setupInitialConditions(), FiveParticles::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Cstatic3D::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), T_protectiveWall::T_protectiveWall(), Tutorial11::Tutorial11(), StressStrainControlBoundary::updateDomainSize(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setYMin()

void DPMBase::setYMin ( Mdouble  newYMin)

Sets the value of YMin, the lower bound of the problem domain in the y-direction.

Deprecated:

An access function which allows the user to alter the value of the (private) y value of the "Vec3D" object "min_", thus setting the minimum y-value corresponding to the system, i.e. the lower limit of the domain in the y-direction.

These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

The function also performs a sanity check to stop the user defining a lower bound that is higher than the corresponding upper bound (YMax), giving a (logged) warning if the user attempts to do so.

Parameters
[in]newYMin
1035 {
1036 if (newYMin <= getYMax())
1037 {
1038 min_.y() = newYMin;
1039 }
1040 else
1041 {
1042 logger(WARN, "Warning in setYMin(%): yMax=%", newYMin, getYMax());
1043 }
1044 }

References getYMax(), logger, min_, WARN, and Vec3D::y().

Referenced by statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), Funnel::check_funnel(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), Slide::set_Walls(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), SmoothChute::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Chain::setupInitialConditions(), FiveParticles::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), Tutorial11::Tutorial11(), StressStrainControlBoundary::updateDomainSize(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setZMax()

void DPMBase::setZMax ( Mdouble  newZMax)

Sets the value of ZMax, the upper bound of the problem domain in the z-direction.

Deprecated:

An access function which allows the user to alter the value of the (private) z value of the "Vec3D" object "max_", thus setting the maximum z-value corresponding to the system, i.e. the upper limit of the domain in the z-direction.

These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

The function also performs a sanity check to stop the user defining an upper bound that is lower than the corresponding lower bound (ZMin), giving a (logged) warning if the user attempts to do so.

Parameters
[in]newZMax
1218 {
1219 if (newZMax >= getZMin())
1220 {
1221 max_.z() = newZMax;
1222 }
1223 else
1224 {
1225 logger(WARN, "Warning in setZMax(%): zMax=%", newZMax, getZMin());
1226 }
1227 }

References getZMin(), logger, max_, WARN, and Vec3D::z().

Referenced by Chutebelt::actionsAfterTimeStep(), ChutePeriodic::add_flow_particles(), SilbertPeriodic::add_flow_particles(), Chute::addFlowParticlesCompactly(), ChuteWithHopper::addHopper(), statistics_while_running< T >::auto_set_domain(), statistics_while_running< T >::auto_set_z(), BoundariesSelfTest::BoundariesSelfTest(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readNextArgument(), Chute::readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), ClosedCSCWalls::saveWalls(), AngleOfRepose::set_H(), SilbertPeriodic::set_H(), Slide::set_Walls(), Chute::setInflowHeight(), ChutePeriodic::setup(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), LawinenBox::setupInitialConditions(), SmoothChute::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Chain::setupInitialConditions(), FiveParticles::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Cstatic3D::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MovingWall::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), T_protectiveWall::T_protectiveWall(), Tutorial11::Tutorial11(), StressStrainControlBoundary::updateDomainSize(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ setZMin()

void DPMBase::setZMin ( Mdouble  newZMin)

Sets the value of ZMin, the lower bound of the problem domain in the z-direction.

Deprecated:

An access function which allows the user to alter the value of the (private) z value of the "Vec3D" object "min_", thus setting the minimum z-value corresponding to the system, i.e. the lower limit of the domain in the z-direction.

These bounds are used for display, plotting and statistics purposes. They do not affect the dynamics.

The function also performs a sanity check to stop the user defining a lower bound that is higher than the corresponding upper bound (ZMax), giving a (logged) warning if the user attempts to do so.

Parameters
[in]newZMin
1059 {
1060 
1061 if (newZMin <= getZMax())
1062 {
1063 min_.z() = newZMin;
1064 }
1065 else
1066 {
1067 logger(WARN, "Warning in setZMin(%): zMax=%", newZMin, getZMax());
1068 }
1069 
1070 }

References getZMax(), logger, min_, WARN, and Vec3D::z().

Referenced by statistics_while_running< T >::auto_set_domain(), statistics_while_running< T >::auto_set_z(), BoundariesSelfTest::BoundariesSelfTest(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), multiParticleT1::multiParticleT1(), ParticleCreation::ParticleCreation(), readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), Slide::set_Walls(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), SmoothChute::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Chain::setupInitialConditions(), FiveParticles::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), SimpleOpt::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), Tutorial11::Tutorial11(), StressStrainControlBoundary::updateDomainSize(), and viscoElasticUnitTest::viscoElasticUnitTest().

◆ signalHandler()

void DPMBase::signalHandler ( int  signal)
staticprotected

signal handler function.

5141  {
5142  switch (signal) {
5143  case SIGINT:
5144  logger(INFO, "SIGINT has been captured!\nMercuryDPM is writing the files, then it will stop!");
5145  // continue Flag must be set to false here!
5146  continueFlag_ = false;
5147  //exit(SIGTERM); // this will interrupt the simulation
5148  return;
5149  case SIGTERM:
5150  logger(INFO, "\nSIGTERM has been captured!\nMercuryDPM is writing the files, then it will stop!");
5151  // continue Flag must be set to false here!
5152  continueFlag_ = false;
5153  return;
5154  case SIGKILL:
5155  logger(INFO, "\nSIGKILL has been captured!\nMercuryDPM is writing the files, then it will stop!");
5156  continueFlag_ = false;
5157  return;
5158  default:
5159  logger(INFO, "No Signal to Capture!");
5160  }
5161 }

References continueFlag_, INFO, and logger.

Referenced by setSoftStop().

◆ solve() [1/2]

void DPMBase::solve ( )

The work horse of the code.

Todo:
IFCD @AT, TW: Consider moving some things before the time loop to actionsBeforeTimeLoop
4271 {
4272  initialiseSolve();
4273 
4274  // Can be used to measure simulation time
4275  clock_.tic();
4276  // This is the main loop over advancing time
4277  while (getTime() < getTimeMax() && continueSolve())
4278  {
4280  }
4281  // Can be used to measure simulation time
4282  clock_.toc();
4283 
4284  finaliseSolve();
4285 }
void initialiseSolve()
Beginning of the solve routine, before time stepping.
Definition: DPMBase.cc:4171
virtual void computeOneTimeStep()
Performs everything needed for one time step, used in the time-loop of solve().
Definition: DPMBase.cc:4305
void finaliseSolve()
End of the solve routine, after time stepping.
Definition: DPMBase.cc:4287
virtual bool continueSolve() const
A virtual function for deciding whether to continue the simulation, based on a user-specified criteri...
Definition: DPMBase.cc:1990
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
Definition: MercuryTime.h:70
void tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
Definition: MercuryTime.h:59

References clock_, computeOneTimeStep(), continueSolve(), finaliseSolve(), getTime(), getTimeMax(), initialiseSolve(), Time::tic(), and Time::toc().

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), commandLineCG(), ClusterGenerator::create(), CLiveStatistics< T >::getLiveStatistics(), main(), ChuteBottom::makeRoughBottom(), MovingWalls::MovingWalls(), particleParticleTest(), PointIsAboveCurve(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), vibratedBed::run(), runFreeFall(), SaveCountUnitTest::SaveCountUnitTest(), solve(), SilbertHstop::solve_analytic(), statistics_while_running< T >::statistics_while_running(), ContactDetectionIntersectionOfWallsTest::test(), BouncingSuperQuadric::test(), SlidingSpheresUnitTest::test(), ContactDetectionNormalSpheresTest::test(), ContactDetectionRotatedSpheresTest::test(), Packing::test(), HertzContactRestitutionUnitTest::test(), and wallParticleTest().

◆ solve() [2/2]

void DPMBase::solve ( int  argc,
char argv[] 
)

The work horse of the code. Can handle flags from the command line.

This method allows flags to be passed to Mercury from driver codes, such that variables can be altered without needing to alter the driver files - for example, if the user wishes to give specific commands for the manner in which the system will be displayed in xballs.

After reading in the arguments provided, the normal 'solve()' routine is called. For full details see the documentation of the solve() function (linked).

Parameters
[in]argc
[in]argv
800 {
801 readArguments(argc, argv);
802 solve();
803 }
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4391
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270

References readArguments(), and solve().

◆ splitDomain()

void DPMBase::splitDomain ( DomainSplit  domainSplit)

Splits domain as neatly as possible. e.g. splitDomain(XY) splits domain into a 6x5x1 grid for 30 processors, a 6x6x1 grid for 36 processors

Todo:
the function needs improvement: for non-cubic domains (with different domain length in x,y,z), having a equal number of grid cell is not the best choice.
5223  {
5224  //one-d problems
5225  if (domainSplit == DomainSplit::X) {
5227  return;
5228  } else if (domainSplit == DomainSplit::Y) {
5230  return;
5231  } else if (domainSplit == DomainSplit::Z) {
5233  return;
5234  }
5235  //two-d problems
5236  // split into axb grid with a the largest integer that divides NUMBER_OF_PROCESSORS and is smaller than sqrt(NUMBER_OF_PROCESSORS)
5237  unsigned a;
5238  for (unsigned n = floor(sqrt(NUMBER_OF_PROCESSORS));n>0; n--) {
5239  if (NUMBER_OF_PROCESSORS % n == 0) {
5240  a = n;
5241  break;
5242  }
5243  }
5244  if (domainSplit == DomainSplit::XY) {
5246  return;
5247  } else if (domainSplit == DomainSplit::XZ) {
5249  return;
5250  } else if (domainSplit == DomainSplit::YZ) {
5252  return;
5253  }
5254  //three-d problems
5255  // split into axbxc grid with
5256  // - a the largest integer that divides NUMBER_OF_PROCESSORS and is smaller than cbrt(NUMBER_OF_PROCESSORS)
5257  // - b the largest integer that divides NUMBER_OF_PROCESSORS/a and is smaller than sqrt(NUMBER_OF_PROCESSORS/a)
5258  unsigned b;
5259  for (unsigned n = floor(cbrt(NUMBER_OF_PROCESSORS));n>0; n--) {
5260  if (NUMBER_OF_PROCESSORS % n == 0) {
5261  a = n;
5262  break;
5263  }
5264  }
5265  for (unsigned n = floor(sqrt(NUMBER_OF_PROCESSORS/a));n>0; n--) {
5266  if (NUMBER_OF_PROCESSORS % (n*a) == 0) {
5267  b = n;
5268  break;
5269  }
5270  }
5272 }
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5213

References n, NUMBER_OF_PROCESSORS, setNumberOfDomains(), X, XY, XZ, Y, YZ, and Z.

◆ synchroniseParticle()

void DPMBase::synchroniseParticle ( BaseParticle p,
unsigned  fromProcessor = 0 
)
protected
5111 {
5112 #ifdef MERCURYDPM_USE_MPI
5113  MPIContainer& communicator = MPIContainer::Instance();
5114 
5115  //The processor that contains the particle that needs to be copied needs to identify the target, and communicate this
5116  MPIParticle pInfo;
5117  if (communicator.getProcessorID() == fromProcessor)
5118  {
5120  }
5121 
5122  //Broadcast from processor i
5123  communicator.broadcast(&pInfo,MercuryMPIType::PARTICLE,fromProcessor);
5125 #endif
5126 }
@ PARTICLE
Definition: MpiContainer.h:67
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species.
Definition: MpiDataClass.cc:105
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:131

References MPIContainer::broadcast(), copyDataFromMPIParticleToParticle(), MPISphericalParticle::copyDataFromParticleToMPIParticle(), MPIContainer::getProcessorID(), MPIContainer::Instance(), PARTICLE, and particleHandler.

◆ updateGhostGrid()

void DPMBase::updateGhostGrid ( BaseParticle P)

Checks if the Domain/periodic interaction distance needs to be updated and updates it accordingly.

Checks if the domain and periodicBoundaryHandler need to update the interaction distance. If this is the case it will update the ghost particles as well.

When adding a new particle with a larger interaction radius than all previous particles, the domain needs to update the interactionDistance and initialise all particles that are now also included in the communication zones. All other domains are updated as well.

Parameters
[in]PPointer to a baseParticle that recently has been added to the simulation
1838 {
1839 #ifdef MERCURYDPM_USE_MPI
1840  if (NUMBER_OF_PROCESSORS == 1) { return; }
1841 
1842  //Check if the interactionRadius of the BaseParticle is larger than given in the domain
1844  if(2.0*P->getMaxInteractionRadius() > domainHandler.getInteractionDistance())
1845  {
1846  logger(VERBOSE,"Processor % | Updating mpi grid. Old interactionDistance: %, new interactionDistance %.",
1847  PROCESSOR_ID,domainHandler.getInteractionDistance(),2.0*P->getMaxInteractionRadius());
1848 
1849  //Update the interactionDistance in the domain and periodicBoundaryHandler
1850  domainHandler.setInteractionDistance(2.0*P->getMaxInteractionRadius());
1851  periodicBoundaryHandler.setInteractionDistance(2.0*P->getMaxInteractionRadius());
1852 
1853  //Find new ghost particless
1856  }
1857 #endif
1858 }
Mdouble getInteractionDistance()
Gets the interaction distance of the domain handler.
Definition: DomainHandler.cc:324

References DomainHandler::addNewParticles(), PeriodicBoundaryHandler::addNewParticles(), domainHandler, DomainHandler::getCurrentDomain(), DomainHandler::getInteractionDistance(), logger, NUMBER_OF_PROCESSORS, Global_Physical_Variables::P, periodicBoundaryHandler, PROCESSOR_ID, DomainHandler::setInteractionDistance(), PeriodicBoundaryHandler::setInteractionDistance(), and VERBOSE.

Referenced by ParticleHandler::addObject().

◆ write()

void DPMBase::write ( std::ostream &  os,
bool  writeAllParticles = true 
) const
virtual
     \brief Loads all MD data and plots statistics for all time steps in the .data file
    &zwj;/

void statisticsFromRestartData(const char *name); /

Todo:
what to do with statisticsFromRestartData?
/*!
   \brief Writes all data into a restart file

Writes out all relevant information - e.g. system dimensions, run duration, particle information - for a .restart file to the chosen output stream, os. More detailed comments may be seen in the body of the code.

Parameters
[in]writeAllParticlesA boolean which decides whether or not all particle information is written to the output file. (Otherwise, only a small number of particles are printed.)
[in]nToWrite

Reimplemented in MercuryBase, ChuteWithHopper, Chute, Funnel, BaseCluster, MembraneSelfTest, MembraneDemo, SegregationPeriodic, SegregationPeriodic, and SegregationPeriodic.

3542 {
3543  os << "MercuryDPM " << getVersion();
3544  //which outputs basic information regarding the various files (.data, .fstat etc. etc.)
3545  //only writes the run number if it is different from 0
3546  if (runNumber_ != 0)
3547  os << " runNumber " << runNumber_;
3548  os << " name " << name_;
3549  os << " revision " << getRevision();
3550  os << " repository " << getRepositoryURL() << '\n';
3551  os << "dataFile " << dataFile << '\n';
3552  os << "fStatFile " << fStatFile << '\n';
3553  os << "eneFile " << eneFile << '\n';
3554  os << "restartFile " << restartFile << '\n';
3555  os << "statFile " << statFile << '\n';
3556  os << "interactionFile " << interactionFile << '\n';
3557  //Outputs the "domain" corresponding to the system for
3558  //use with XBalls, as well as other information regarding the system as a whole
3559  os << "xMin " << getXMin()
3560  << " xMax " << getXMax()
3561  << " yMin " << getYMin()
3562  << " yMax " << getYMax()
3563  << " zMin " << getZMin()
3564  << " zMax " << getZMax() << '\n'
3565  << "timeStep " << getTimeStep()
3566  << " time " << getTime()
3567  << " ntimeSteps " << numberOfTimeSteps_
3568  << " timeMax " << getTimeMax() << '\n'
3569  << "systemDimensions " << getSystemDimensions()
3570  << " particleDimensions " << getParticleDimensions()
3571  << " gravity " << getGravity()
3572  << " backgroundDrag " <<getBackgroundDrag();
3573  os << " writeVTK " << writeParticlesVTK_
3574  << " " << wallHandler.getWriteVTK()
3575  << " " << interactionHandler.getWriteVTK()
3576  << " " << boundaryHandler.getWriteVTK()
3577  << " " << (vtkWriter_?vtkWriter_->getFileCounter():0)
3578  << " " << wallVTKWriter_.getFileCounter()
3580  << " " << boundaryVTKWriter_.getFileCounter();
3581 
3582  // Outputting the wall details vtk enum values and file types.
3583  // For example, we have three wall details options with enum values 4, 12 and 25, and three corresponding filetypes
3584  // NO_FILE, ONE_FILE and MULTIPLE_FILES. Let's also say the file counter is at 101.
3585  // The output will be: writeWallDetailsVTK 3 4 NO_FILE 12 ONE_FILE 25 MULTIPLE_FILES 101
3586  // Only write when any of them have something other than NO_FILE. In this way the selftests restart files all keep working.
3588  {
3589  std::unordered_map<WallHandler::DetailsVTKOptions, FileType> writeWallDetailsVTK = wallHandler.getWriteWallDetailsVTKAll();
3590  os << " writeWallDetailsVTK " << writeWallDetailsVTK.size();
3591  for (const auto& p : writeWallDetailsVTK)
3592  os << " " << static_cast<int>(p.first) << " " << p.second;
3593  os << " " << wallDetailsVTKWriter_.getFileCounter();
3594  }
3595 
3596  os << " random ";
3597  random.write(os);
3598 #ifdef MERCURYDPM_USE_OMP
3599  //Write number of OMP threads
3600  if(getNumberOfOMPThreads() > 1) {
3601  os << " numberOfOMPThreads " << getNumberOfOMPThreads();
3602  }
3603 #endif
3604 #ifdef MERCURYDPM_USE_MPI
3605  //Check if we are dealing with multiple cores
3606  if (NUMBER_OF_PROCESSORS > 1 )
3607  {
3608  os << " numberOfProcessors " << NUMBER_OF_PROCESSORS
3610  }
3611 #endif
3612  //only write xBallsArguments if they are nonzero
3614  os << " xBallsArguments " << getXBallsAdditionalArguments();
3615  os << '\n';
3616  //writes all species (including mixed species) to an output stream
3617 
3618  speciesHandler.write(os);
3619 
3620  //outputs the number of walls in the system
3621  os << "Walls " << wallHandler.getNumberOfObjects() << std::endl;
3622  if (writeAllParticles || wallHandler.getSize() < 9) {
3623  for (BaseWall* w : wallHandler)
3624  os << (*w) << std::endl;
3625  } else {
3626  for (int i=0; i<2; ++i)
3627  os << *wallHandler.getObject(i) << std::endl;
3628  os << "...\n";
3629  }
3630 
3631  //outputs the number of boundaries in the system
3632  os << "Boundaries " << boundaryHandler.getNumberOfObjects() << std::endl;
3633  if (writeAllParticles || boundaryHandler.getSize() < 9)
3634  {
3635  for (BaseBoundary* b: boundaryHandler)
3636  os << (*b) << std::endl;
3637  }
3638  else
3639  {
3640  for (int i = 0; i < 2; ++i)
3641  os << *boundaryHandler.getObject(i) << std::endl;
3642  os << "...\n";
3643  }
3644 
3645  if (writeAllParticles || particleHandler.getSize() < getNToWrite())
3646  {
3647  //if the "writeAllParticles" bool == true, or there are fewer than 4 particles
3648  //calls the particleHandler version of the "write" function and also
3649  //outputs to file all relevant particle information for all particles in the system
3650  particleHandler.write(os);
3651  }
3652  else
3653  {
3654  //otherwise, only prints out limited information
3655  os << "Particles " << particleHandler.getSize() << '\n';
3656  for (unsigned int i = 0; i < getNToWrite(); i++)
3657  os << *(particleHandler.getObject(i)) << '\n';
3658  os << "..." << '\n';
3659  }
3660  // Similarly, print out interaction details (all of them, or up to nToWrite of them)
3661  if (writeAllParticles || interactionHandler.getNumberOfObjects() < getNToWrite())
3662  {
3664  }
3665  else
3666  {
3667  os << "Interactions " << interactionHandler.getNumberOfObjects() << '\n';
3668  for (unsigned int i = 0; i < getNToWrite(); i++)
3669  os << *(interactionHandler.getObject(i)) << '\n';
3670  os << "..." << '\n';
3671  }
3672 }
const std::string getRevision()
Definition: CMakeDefinitions.cc:42
const std::string getRepositoryURL()
Definition: CMakeDefinitions.cc:47
const std::string getVersion()
Definition: CMakeDefinitions.cc:52
unsigned getFileCounter() const
Definition: BaseVTKWriter.h:56
bool getWriteVTK() const
Definition: BoundaryHandler.h:90
unsigned int getParticleDimensions() const
Returns the particle dimensionality.
Definition: DPMBase.cc:1467
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
Definition: DPMBase.cc:1355
int getNToWrite() const
get the number of elements to write to the
Definition: DPMBase.cc:864
void write(std::ostream &os) const
Writes the InteractionHandler to an output stream, for example a restart file.
Definition: InteractionHandler.cc:433
FileType getWriteVTK() const
Definition: InteractionHandler.cc:559
void write(std::ostream &os) const
void write(std::ostream &os) const
Definition: RNG.cc:78
virtual void write(std::ostream &os) const
Write all the species and mixed species to an output stream.
Definition: SpeciesHandler.cc:929
std::unordered_map< DetailsVTKOptions, FileType > getWriteWallDetailsVTKAll() const
Definition: WallHandler.cc:515
bool getWriteDetailsVTKAny() const
Definition: WallHandler.cc:508

References boundaryHandler, boundaryVTKWriter_, helpers::compare(), dataFile, eneFile, fStatFile, getBackgroundDrag(), BaseVTKWriter< H >::getFileCounter(), getGravity(), getNToWrite(), BaseHandler< T >::getNumberOfObjects(), getNumberOfOMPThreads(), BaseHandler< T >::getObject(), getParticleDimensions(), getRepositoryURL(), getRevision(), BaseHandler< T >::getSize(), getSystemDimensions(), getTime(), getTimeMax(), getTimeStep(), getVersion(), WallHandler::getWriteDetailsVTKAny(), BoundaryHandler::getWriteVTK(), InteractionHandler::getWriteVTK(), WallHandler::getWriteVTK(), WallHandler::getWriteWallDetailsVTKAll(), getXBallsAdditionalArguments(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), constants::i, interactionFile, interactionHandler, interactionVTKWriter_, name_, NUMBER_OF_PROCESSORS, numberOfDomains_, numberOfTimeSteps_, particleHandler, random, restartFile, runNumber_, speciesHandler, statFile, vtkWriter_, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, InteractionHandler::write(), RNG::write(), ParticleHandler::write(), SpeciesHandler::write(), writeParticlesVTK_, XAXIS, YAXIS, and ZAXIS.

Referenced by statistics_while_running< T >::actionsBeforeTimeLoop(), operator<<(), CLiveStatistics< T >::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), Slide::Slide(), MercuryBase::write(), and writeRestartFile().

◆ writeDataFile()

void DPMBase::writeDataFile ( )
2953 {
2955  {
2957  dataFile.close();
2958  }
2959 }
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....
Definition: DPMBase.cc:2359
bool openWrite(unsigned)
First sets openmode to write (and append in some cases), then calls open().
Definition: File.cc:381

References File::close(), dataFile, File::getFstream(), getNumberOfTimeSteps(), File::openWrite(), and outputXBallsData().

Referenced by main(), and writeOutputFiles().

◆ writeEneFile()

void DPMBase::writeEneFile ( )
2962 {
2964  {
2965  //If the file type is "multiple files, writes a header for each individual files. If not, only writes for the first time step
2967  eneFile.close();
2968  }
2969 }
virtual void writeEneTimeStep(std::ostream &os) const
Write the global kinetic, potential energy, etc. in the system.
Definition: DPMBase.cc:2104

References File::close(), eneFile, File::getFstream(), getNumberOfTimeSteps(), File::openWrite(), and writeEneTimeStep().

Referenced by main(), and writeOutputFiles().

◆ writeEneHeader()

void DPMBase::writeEneHeader ( std::ostream &  os) const
protectedvirtual

Writes a header with a certain format for ENE file.

If the "append" flag is off (false) - i.e. the file has not been restarted - creates a header for the output ".ene" file. The headers simply give titles to each of the columns output to this file.

If the "append" flag is on (true), i.e. if the file has restarted, simply ends the function without writing a header - otherwise restarted files will have a random header at the point of restart, making data processing more difficult...

The function takes as an argument an output stream, "os", which tells the compiler where to output the headers, if they are required.

Parameters
[in]osThe output stream to the file in which the header should be written.
Todo:
JMFT: Get rid of aligned columns. They make things too wide. (changed back) *‍/
Todo:
{Why is there a +6 here? TW: to get the numbers and title aligned}
Todo:
Add number of particles to this file (change from Jonny to be added later)

Reimplemented in BaseCoupling< Mercury3D, SolidProblem< SCoupledElement< ELEMENT > > >, BaseCoupling< Mercury3D, SolidProblem< ScaleCoupledElement< ELEMENT > > >, SlidingFrictionUnitTest, SphericalIndenter, Sintering, and SingleParticle< SpeciesType >.

2015 {
2016  //only write if we don't restart
2017  if (getAppend())
2018  return;
2019 
2021 
2024  long width = os.precision() + 6;
2025  os << std::setw(width)
2026  << "time " << std::setw(width)
2027  << "gravitEnergy " << std::setw(width) //gravitational potential energy
2028  << "traKineticEnergy " << std::setw(width) //translational kinetic energy
2029  << "rotKineticEnergy " << std::setw(width) //rotational kE
2030  << "elasticEnergy " << std::setw(width)
2031  << "centerOfMassX " << std::setw(width)
2032  << "centerOfMassY " << std::setw(width)
2033  << "centerOfMassZ\n";
2034 }

References getAppend().

Referenced by writeEneTimeStep().

◆ writeEneTimeStep()

void DPMBase::writeEneTimeStep ( std::ostream &  os) const
protectedvirtual

Write the global kinetic, potential energy, etc. in the system.

The function cycles over all particles within the system (or rather, the particleHandler), creating sums of the relevant energies and "mass lengths" (m.x, m.y, m.z) from which the system's centre of mass can also be calculated. The summed energy values and calculated centre of mass values are then output to the file corresponding to "os" alongside the current time step.

A check is performed - if (!p->isFixed()) - to ensure that calculations are not performed on fixed particles, as these are assigned an effectively infinite mass and would hence cause compiler issues.

Parameters
[in]osThe output stream to which the data will be written

Reimplemented in BaseCoupling< Mercury3D, SolidProblem< SCoupledElement< ELEMENT > > >, BaseCoupling< Mercury3D, SolidProblem< ScaleCoupledElement< ELEMENT > > >, SlidingFrictionUnitTest, SphericalIndenter, Sintering, SingleParticle< SpeciesType >, Slide, Slide, Silo, Penetration, Drum, LawinenBox, LawinenBox, and LawinenBox.

2105 {
2108  writeEneHeader(os);
2109 
2110  const Mdouble m = particleHandler.getMass();
2112  //Ensure the numbers fit into a constant width column: for this we need the precision given by the operating system,
2113  //plus a few extra characters for characters like a minus and scientific notation.
2114  const static int width = os.precision() + 6;
2115  os << std::setw(width) << getTime()
2116  << " " << std::setw(width) << -Vec3D::dot(getGravity(), com)
2117  << " " << std::setw(width) << particleHandler.getKineticEnergy()
2118  << " " << std::setw(width) << particleHandler.getRotationalEnergy()
2119  << " " << std::setw(width) << getElasticEnergy()
2120  // we need to write x, y and z coordinates separately, otherwise the width of the columns is incorrect
2121  << " " << std::setw(width)
2122  << (m == 0 ? constants::NaN : com.X / m) //set to nan because 0/0 implementation in gcc and clang differs
2123  << " " << std::setw(width) << (m == 0 ? constants::NaN : com.Y / m)
2124  << " " << std::setw(width) << (m == 0 ? constants::NaN : com.Z / m)
2125  << std::endl;
2126 }
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Definition: DPMBase.cc:2014
Mdouble getRotationalEnergy() const
Definition: ParticleHandler.cc:586
Vec3D getMassTimesPosition() const
Definition: ParticleHandler.cc:636
Mdouble getKineticEnergy() const
Definition: ParticleHandler.cc:557
const Mdouble NaN
Definition: GeneralDefine.h:43

References Vec3D::dot(), eneFile, File::getCounter(), getElasticEnergy(), File::getFileType(), getGravity(), ParticleHandler::getKineticEnergy(), ParticleHandler::getMass(), ParticleHandler::getMassTimesPosition(), ParticleHandler::getRotationalEnergy(), getTime(), MULTIPLE_FILES, MULTIPLE_FILES_PADDED, constants::NaN, particleHandler, writeEneHeader(), Vec3D::X, Vec3D::Y, and Vec3D::Z.

Referenced by writeEneFile().

◆ writeFStatFile()

void DPMBase::writeFStatFile ( )
2972 {
2974  {
2976  //fStatFile.getFstream().ignore(2000,'\t');
2977  fStatFile.close();
2978  }
2979 }
virtual void writeFstatHeader(std::ostream &os) const
Writes a header with a certain format for FStat file.
Definition: DPMBase.cc:2043

References File::close(), fStatFile, File::getFstream(), getNumberOfTimeSteps(), File::openWrite(), and writeFstatHeader().

Referenced by main(), and writeOutputFiles().

◆ writeFstatHeader()

void DPMBase::writeFstatHeader ( std::ostream &  os) const
protectedvirtual

Writes a header with a certain format for FStat file.

The function takes as an argument an output stream and, to the corresponding file, outputs the relevant header and data for the ".fstat"-type output files. For more information regarding the fstat file format, please refer to the user guide on the Mercury website

Parameters
[in]osThe output stream (e.g. a file stream or cout)

Reimplemented in protectiveWall.

2044 {
2045 
2046  // line #1: time, volume fraction
2047  // line #2: wall box: wx0, wy0, wz0, wx1, wy1, wz1
2048  // line #3: radii-min-max & moments: rad_min, rad_max, r1, r2, r3, r4
2049  os << "#"
2050  << " " << getTime()
2051  << " " << 1 //marker that these are fstat files with contact point instead of center point
2052  << '\n';
2053  os << "#"
2054  << " " << getXMin()
2055  << " " << getYMin()
2056  << " " << getZMin()
2057  << " " << getXMax()
2058  << " " << getYMax()
2059  << " " << getZMax()
2060  << '\n';
2061  os << "#"
2062  << " ";
2063 
2064  if (!(particleHandler.getSmallestParticleLocal() == nullptr))
2065  {
2067  }
2068  else
2069  {
2070  os << std::numeric_limits<double>::quiet_NaN();
2071  }
2072  os << " ";
2073  if (!(particleHandler.getLargestParticleLocal() == nullptr))
2074  {
2076  }
2077  else
2078  {
2079  os << std::numeric_limits<double>::quiet_NaN();
2080  }
2081 
2082  os << " " << 0
2083  << " " << 0
2084  << " " << 0
2085  << " " << 0
2086  << '\n';
2087  //B: write data
2089  {
2090  c->writeToFStat(os, getTime());
2091  }
2092  //os << std::flush;
2093 }
BaseParticle * getSmallestParticleLocal() const
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the loc...
Definition: ParticleHandler.cc:502
BaseParticle * getLargestParticleLocal() const
Gets a pointer to the largest BaseParticle (by interactionRadius) in the ParticleHandler of the local...
Definition: ParticleHandler.cc:526

References ParticleHandler::getLargestParticleLocal(), BaseParticle::getRadius(), ParticleHandler::getSmallestParticleLocal(), getTime(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), interactionHandler, and particleHandler.

Referenced by writeFStatFile().

◆ writeOutputFiles()

void DPMBase::writeOutputFiles ( )
virtual

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

Writes headers and all relevant information to the relevant output files. Note that the writeFstatHeader() actually contains within it the functionality to write the full fstat data, whereas for .ene files the functions to write the headers and main data are separate. Note that the interaction file is not written here: it is written with the start and end of each interaction.

The function [X].saveCurrentTimeStep(numberOfTimeSteps_) returns true if:

a) The current time step is greater than or equal to the time step at which the next write or read operation is supposed to happen.

b) The FileType is not "NO_FILE".

c) The file is open.

Reimplemented in Mercury3DRestart, Mercury3DRestarter, CSCRestart, ClosedCSCRestart, StatisticsVector< T >, StatisticsVector< O >, and StatisticsVector< XZ >.

4050 {
4051  //writing fstat data if .saveCurrentTimeStep(numberOfTimeSteps_) is true
4053  {
4054  writeFStatFile();
4055  }
4056 
4057  //writing .ene data if .saveCurrentTimeStep(numberOfTimeSteps_) is true
4059  {
4060  writeEneFile();
4061  }
4062  //writing .data data if .saveCurrentTimeStep(numberOfTimeSteps_) is true
4064  {
4066  if (getRestarted() || dataFile.getCounter() == 0)
4068  writeDataFile();
4069  } else {
4071  }
4072  printTime();
4073  writeVTKFiles();
4074  }
4075  cgHandler.evaluate();
4076 
4077 
4078  //write restart file last, otherwise the output counters are wrong
4080  {
4081  writeRestartFile();
4082  }
4083 }
void evaluate()
Contains the code executed at each time step.
Definition: CGHandler.cc:97
void writeVTKFiles() const
Definition: DPMBase.cc:2128
void writeEneFile()
Definition: DPMBase.cc:2961
virtual void writeXBallsScript() const
This writes a script which can be used to load the xballs problem to display the data just generated.
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2942
virtual void printTime() const
Displays the current simulation time and the maximum simulation duration.
Definition: DPMBase.cc:1970
void writeFStatFile()
Definition: DPMBase.cc:2971
void writeDataFile()
Definition: DPMBase.cc:2952
bool saveCurrentTimeStep(unsigned int ntimeSteps)
determined if this time step has to be written; if so, opens the output file
Definition: File.cc:312
bool saveCurrentTimeStepNoFileTypeCheck(unsigned int ntimeSteps)
Definition: File.cc:317

References cgHandler, dataFile, eneFile, CGHandler::evaluate(), fStatFile, File::getCounter(), File::getFileType(), getRestarted(), NO_FILE, numberOfTimeSteps_, printTime(), restartFile, File::saveCurrentTimeStep(), File::saveCurrentTimeStepNoFileTypeCheck(), File::setLastSavedTimeStep(), writeDataFile(), writeEneFile(), writeFStatFile(), writeRestartFile(), writeVTKFiles(), and writeXBallsScript().

Referenced by computeOneTimeStep(), forceWriteOutputFiles(), ClosedCSCRestart::writeOutputFiles(), CSCRestart::writeOutputFiles(), Mercury3DRestarter::writeOutputFiles(), and Mercury3DRestart::writeOutputFiles().

◆ writePythonFileForVTKVisualisation()

void DPMBase::writePythonFileForVTKVisualisation ( ) const
2172 {
2173 #ifdef MERCURYDPM_USE_MPI
2174  if (PROCESSOR_ID == 0)
2175  {
2176 #endif
2177  logger(INFO, "Writing python script for paraview visualisation");
2178 
2179  std::string script = "#script to visualise the output of data2pvd of MercuryDPM in paraview.\n"
2180  "#usage: change the path below to your own path, open paraview\n"
2181  "#Tools->Python Shell->Run Script->VisualisationScript.py\n"
2182  "#or run paraview --script=VisualisationScript.py \n"
2183  "\n"
2184  "from paraview.simple import *\n"
2185  "import os\n"
2186  "import glob\n"
2187  "import re # for natural sorting\n\n"
2188  "# Path to directory containing vtu files\n"
2189  "# Hardcoded (for windows you might need to change start of path, for example: from /mnt/c/MyFolder to c:/MyFolder)\n"
2190  "#dirPath = '" + helpers::getPath() + "'\n"
2191  "# Or directory containing this script\n"
2192  "dirPath = os.path.dirname(os.path.realpath(__file__))\n"
2193  "# Change to directory\n"
2194  "os.chdir(dirPath)\n\n";
2195 
2196  script += "# Some functions to achieve natural sorting for the numbering of the files (regardless of them being padded or not etc.)\n"
2197  "# See https://stackoverflow.com/questions/5967500/how-to-correctly-sort-a-string-with-a-number-inside for more info\n"
2198  "def atoi(text):\n"
2199  "\treturn int(text) if text.isdigit() else text\n"
2200  "\n"
2201  "def natural_keys(text):\n"
2202  "\treturn [ atoi(c) for c in re.split(r'(\\d+)', text) ]\n\n";
2203 
2204  script += "simName = '" + getName() + "' # name of the simulation\n\n";
2205 
2206  if (getParticlesWriteVTK())
2207  {
2208 #ifdef MERCURYDPM_USE_MPI
2209  if (NUMBER_OF_PROCESSORS > 1)
2210  {
2211  script += "# PARTICLES ##########################################################\n"
2212  "for processorNumber in range(0, " + std::to_string(NUMBER_OF_PROCESSORS) + "):\n"
2213  "\t# Load data in any order and sort it\n"
2214  "\tDataParticles = glob.glob('./' + simName + 'Processor_' + str(processorNumber) + '_Particle_*.vtu')\n"
2215  "\tDataParticles.sort(key = natural_keys)"
2216  "\t# Load the data and visualise it in paraview\n"
2217  "\tparticles = XMLUnstructuredGridReader(FileName = DataParticles, registrationName = simName + 'Processor_' + str(processorNumber) + '_Particle_*')\n"
2218  "\tglyphP = Glyph(particles, registrationName = 'Glyph Particle')\n" // From here on no differences with (non-)MPI
2219  "\tglyphP.GlyphType = 'Sphere'\n"
2220  "\tglyphP.ScaleArray = 'Radius'\n"
2221  "\tglyphP.ScaleFactor = 2\n"
2222  "\tglyphP.GlyphMode = 'All Points'\n"
2223  "\tparticlesDisplay = Show(glyphP)\n"
2224  "\t#ColorBy(particlesDisplay, ('POINTS', 'Velocity', 'Magnitude'))\n"
2225  "\t#particlesDisplay.Opacity = 0.5\n"
2226  "\n\n";
2227  }
2228  else
2229  {
2230 #endif
2231  script += "# PARTICLES ##########################################################\n"
2232  "# Load data in any order and sort it\n"
2233  "DataParticles = glob.glob('./' + simName + 'Particle_*.vtu')\n"
2234  "DataParticles.sort(key = natural_keys)"
2235  "# Load the data and visualise it in paraview\n"
2236  "particles = XMLUnstructuredGridReader(FileName = DataParticles, registrationName = simName + 'Particle_*')\n"
2237  "glyphP = Glyph(particles, registrationName = 'Glyph Particle')\n" // From here on no differences with (non-)MPI
2238  "glyphP.GlyphType = 'Sphere'\n"
2239  "glyphP.ScaleArray = 'Radius'\n"
2240  "glyphP.ScaleFactor = 2\n"
2241  "glyphP.GlyphMode = 'All Points'\n"
2242  "particlesDisplay = Show(glyphP)\n"
2243  "#ColorBy(particlesDisplay, ('POINTS', 'Velocity', 'Magnitude'))\n"
2244  "#particlesDisplay.Opacity = 0.5\n"
2245  "\n\n";
2246 #ifdef MERCURYDPM_USE_MPI
2247  }
2248 #endif
2249  }
2250 
2252  {
2253  script += "# WALLS ##############################################################\n"
2254  "# Load data in any order and sort it\n"
2255  "DataWalls = glob.glob('./' + simName + 'Wall_*.vtu')\n"
2256  "DataWalls.sort(key = natural_keys)"
2257  "# Load the data and visualise it in paraview\n"
2258  "walls = XMLUnstructuredGridReader(FileName = DataWalls, registrationName = simName + 'Wall_*')\n"
2259  "wallsDisplay = Show(walls)\n"
2260  "#wallsDisplay.Opacity = 0.5\n"
2261  "\n\n";
2262  }
2263 
2265  {
2266 #ifdef MERCURYDPM_USE_MPI
2267  if (NUMBER_OF_PROCESSORS > 1)
2268  {
2269  script += "# INTERACTIONS #######################################################\n"
2270  "for processorNumber in range(0, " + std::to_string(NUMBER_OF_PROCESSORS) + "):\n"
2271  "\t# Load data in any order and sort it\n"
2272  "\tDataInteractions = glob.glob('./' + simName + 'Processor_' + str(processorNumber) + '_Interaction_*.vtu')\n"
2273  "\tDataInteractions.sort(key = natural_keys)"
2274  "\t# Load the data and visualise it in paraview\n"
2275  "\tinteractions = XMLUnstructuredGridReader(FileName = DataInteractions, registrationName = simName + 'Processor_' + str(processorNumber) + '_Interaction_*')\n"
2276  "\tglyphI = Glyph(interactions, registrationName = 'Glyph Interaction')\n" // From here on no differences with (non-)MPI
2277  "\tglyphI.GlyphType = 'Arrow'\n"
2278  "\tglyphI.OrientationArray = 'Normal'\n"
2279  "\tglyphI.ScaleArray = 'Force'\n"
2280  "\tglyphI.ScaleFactor = 0.01\n"
2281  "\tglyphI.GlyphMode = 'All Points'\n"
2282  "\tinteractionsDisplay = Show(glyphI)\n"
2283  "\t#ColorBy(interactionsDisplay, ('POINTS', 'Force'))\n"
2284  "\t#interactionsDisplay.Opacity = 0.5\n"
2285  "\n\n";
2286  }
2287  else
2288  {
2289 #endif
2290  script += "# INTERACTIONS #######################################################\n"
2291  "# Load data in any order and sort it\n"
2292  "DataInteractions = glob.glob('./' + simName + 'Interaction_*.vtu')\n"
2293  "DataInteractions.sort(key = natural_keys)"
2294  "# Load the data and visualise it in paraview\n"
2295  "interactions = XMLUnstructuredGridReader(FileName = DataInteractions, registrationName = simName + 'Interaction_*')\n"
2296  "glyphI = Glyph(interactions, registrationName = 'Glyph Interaction')\n" // From here on no differences with (non-)MPI
2297  "glyphI.GlyphType = 'Arrow'\n"
2298  "glyphI.OrientationArray = 'Normal'\n"
2299  "glyphI.ScaleArray = 'Force'\n"
2300  "glyphI.ScaleFactor = 0.01\n"
2301  "glyphI.GlyphMode = 'All Points'\n"
2302  "interactionsDisplay = Show(glyphI)\n"
2303  "#ColorBy(interactionsDisplay, ('POINTS', 'Force'))\n"
2304  "#interactionsDisplay.Opacity = 0.5\n"
2305  "\n\n";
2306 #ifdef MERCURYDPM_USE_MPI
2307  }
2308 #endif
2309  }
2310 
2312  {
2313  script += "# WALL DETAILS - BOUNDING BOX ########################################\n"
2314  "# Load data in any order and sort it\n"
2315  "DataWDBoundingBox = glob.glob('./' + simName + 'WallDetailsBoundingBox_*.vtu')\n"
2316  "DataWDBoundingBox.sort(key = natural_keys)"
2317  "# Load the data and visualise it in paraview\n"
2318  "wdBoundingBox = XMLUnstructuredGridReader(FileName = DataWDBoundingBox, registrationName = simName + 'WallDetailsBoundingBox_*')\n"
2319  "wdBoundingBoxDisplay = Show(wdBoundingBox)\n"
2320  "wdBoundingBoxDisplay.Representation = 'Wireframe'\n"
2321  "\n\n";
2322  }
2323 
2325  {
2326  script += "# WALL DETAILS - NURBS WALL ##########################################\n"
2327  "# Load data in any order and sort it\n"
2328  "DataWDNurbsWall = glob.glob('./' + simName + 'WallDetailsNurbsWall_*.vtu')\n"
2329  "DataWDNurbsWall.sort(key = natural_keys)"
2330  "# Load the data and visualise it in paraview\n"
2331  "wdNurbsWall = XMLUnstructuredGridReader(FileName = DataWDNurbsWall, registrationName = simName + 'WallDetailsNurbsWall_*')\n"
2332  "wdNurbsWallDisplay = Show(wdNurbsWall)\n"
2333  "wdNurbsWallDisplay.Representation = 'Wireframe'\n"
2334  "ColorBy(wdNurbsWallDisplay, ('POINTS', 'ID'))\n"
2335  "glyphWDNW = Glyph(wdNurbsWall, registrationName='Glyph NURBS Control Point')\n"
2336  "glyphWDNW.GlyphType = 'Sphere'\n"
2337  "glyphWDNW.ScaleArray = 'Weight'\n"
2338  "glyphWDNW.ScaleFactor = 0.05\n"
2339  "glyphWDNW.GlyphMode = 'All Points'\n"
2340  "glyphWDNWDisplay = Show(glyphWDNW)\n"
2341  "ColorBy(glyphWDNWDisplay, ('POINTS', 'ID'))\n"
2342  "\n\n";
2343  }
2344 
2345  script += "GetAnimationScene().PlayMode = 'Snap To TimeSteps'\n"
2346  "Render()\n"
2347  "ResetCamera()\n";
2348 
2349  helpers::writeToFile(getName() + ".py", script);
2350 #ifdef MERCURYDPM_USE_MPI
2351  } // end of communicator is root statement
2352 #endif
2353 }
bool getParticlesWriteVTK() const
Returns whether particles are written in a VTK file.
Definition: DPMBase.cc:985
@ BOUNDINGBOX
Writes a bounding box around the domain.
@ NURBSWALL
Writes the NURBS control points.
FileType getWriteDetailsVTK(DetailsVTKOptions) const
Definition: WallHandler.cc:494
std::string getPath()
Definition: FileIOHelpers.cc:224
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58

References WallHandler::BOUNDINGBOX, getName(), getParticlesWriteVTK(), helpers::getPath(), WallHandler::getWriteDetailsVTK(), InteractionHandler::getWriteVTK(), WallHandler::getWriteVTK(), INFO, interactionHandler, logger, NO_FILE, NUMBER_OF_PROCESSORS, WallHandler::NURBSWALL, PROCESSOR_ID, wallHandler, and helpers::writeToFile().

Referenced by writeVTKFiles().

◆ writeRestartFile()

void DPMBase::writeRestartFile ( )
virtual

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

Calls the write() function in order to output all relevant data (particle positions and velocities, system dimensions, positions of walls and boundaries...) to a restart file.

See also readRestartFile

Reimplemented in FlowRule, FlowRule, FlowRule, FlowRule, and FlowRule.

2943 {
2945  {
2946  //logger(DEBUG, "Writing restart file %th time step",getNumberOfTimeSteps());
2948  restartFile.close();
2949  }
2950 }
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Definition: DPMBase.cc:3541
bool openWriteNoAppend(unsigned)
Definition: File.cc:398

References File::close(), File::getFstream(), getNumberOfTimeSteps(), File::openWriteNoAppend(), restartFile, and write().

Referenced by ParameterStudy1DDemo::actionsAfterSolve(), ParameterStudy2DDemo::actionsAfterSolve(), ParameterStudy3DDemo::actionsAfterSolve(), ChutePeriodic::add_flow_particles(), SilbertPeriodic::add_flow_particles(), main(), PointIsAboveCurve(), AngleOfRepose::run(), vibratedBed::run(), CSCInit::save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), statistics_while_running< T >::statistics_while_running(), writeOutputFiles(), and FlowRule::writeRestartFile().

◆ writeVTKFiles()

void DPMBase::writeVTKFiles ( ) const
protected
2129 {
2131  {
2136  } // else do nothing
2137 
2139  {
2140  vtkWriter_->writeVTK();
2141  } // else do nothing
2142 
2144  {
2146  }
2147 
2149  {
2151  }
2152 
2154  {
2156  }
2157 
2158  //only write once
2159  bool writePython = getParticlesWriteVTK() || wallHandler.getWriteVTK() != FileType::NO_FILE ||
2162 
2164 
2165  if (writePython && getTime() == 0)
2166  {
2168  }
2169 }
virtual void writeVTK() const =0
void writeVTK() const override
writes a vtk file
Definition: BoundaryVTKWriter.cc:29
bool getSuperquadricParticlesWriteVTK() const
Definition: DPMBase.cc:993
void writePythonFileForVTKVisualisation() const
Definition: DPMBase.cc:2171
void writeVTK() const override
writes a vtk file
Definition: InteractionVTKWriter.cc:29
void writeVTK() const override
Definition: WallDetailsVTKWriter.cc:31
void writeVTK() const override
Definition: WallVTKWriter.cc:52

References boundaryHandler, boundaryVTKWriter_, forceWritePythonFileForVTKVisualisation_, BaseVTKWriter< H >::getFileCounter(), getParticlesWriteVTK(), getSuperquadricParticlesWriteVTK(), getTime(), WallHandler::getWriteDetailsVTKAny(), BoundaryHandler::getWriteVTK(), InteractionHandler::getWriteVTK(), WallHandler::getWriteVTK(), interactionHandler, interactionVTKWriter_, MULTIPLE_FILES, MULTIPLE_FILES_PADDED, NO_FILE, ONE_FILE, vtkWriter_, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, writePythonFileForVTKVisualisation(), BaseVTKWriter< H >::writeVTK(), BoundaryVTKWriter::writeVTK(), InteractionVTKWriter::writeVTK(), WallDetailsVTKWriter::writeVTK(), and WallVTKWriter::writeVTK().

Referenced by GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), MyCoil::setupInitialConditions(), Nurbs::setupInitialConditions(), Polygon::setupInitialConditions(), Silo::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), and writeOutputFiles().

◆ writeXBallsScript()

virtual void DPMBase::writeXBallsScript ( ) const
virtual

This writes a script which can be used to load the xballs problem to display the data just generated.

Todo:
Implement or make pure virtual

Reimplemented in ChuteWithPeriodicInflow.

Referenced by ClosedCSCRun::ClosedCSCRun(), CSCInit::CSCInit(), main(), CSCRun::setupInitialConditions(), and writeOutputFiles().

Member Data Documentation

◆ append_

bool DPMBase::append_
private

A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example.

Referenced by DPMBase(), getAppend(), and setAppend().

◆ backgroundDrag_

Mdouble DPMBase::backgroundDrag_
private

This is a global background drag to help retard particles, or to do a simple fluid drag. The force particleVeclocity*backgroundDrag is applied.

Referenced by DPMBase(), getBackgroundDrag(), read(), and setBackgroundDrag().

◆ boundaryHandler

BoundaryHandler DPMBase::boundaryHandler

An object of the class BoundaryHandler which concerns insertion and deletion of particles into or from regions.

Referenced by T_protectiveWall::actionsAfterTimeStep(), GranuHeap::actionsAfterTimeStep(), LeesEdwardsDemo::actionsAfterTimeStep(), ShiftingConstantMassFlowMaserBoundarySelfTest::actionsAfterTimeStep(), ShiftingMaserBoundarySelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), Chutebelt::actionsAfterTimeStep(), BoundariesSelfTest::actionsAfterTimeStep(), PolydisperseInsertionBoundarySelfTest::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), protectiveWall::actionsAfterTimeStep(), SilbertPeriodic::add_flow_particles(), AngledPeriodicBoundarySecondUnitTest::AngledPeriodicBoundarySecondUnitTest(), AngledPeriodicBoundaryUnitTest::AngledPeriodicBoundaryUnitTest(), BoundariesSelfTest::BoundariesSelfTest(), ChuteWithPeriodicInflow::Check_and_Duplicate_Periodic_Particle(), checkAndDuplicatePeriodicParticles(), Mercury3Dclump::checkClumpForInteractionPeriodic(), checkInteractionWithBoundaries(), checkParticleForInteractionLocalPeriodic(), ChutePeriodicDemo::ChutePeriodicDemo(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ClosedCSCWalls::ClosedCSCWalls(), Mercury3Dclump::computeAllForces(), computeOneTimeStep(), constructor(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), Funnel::create_walls(), CSCWalls::CSCWalls(), DPMBase(), ChuteWithPeriodicInflow::ExtendInWidth(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), GranuDrum::GranuDrum(), InitialConditions< SpeciesType >::InitialConditions(), initialiseSolve(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), main(), protectiveWall::protectiveWall(), read(), readOld(), readParAndIniFiles(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), multiParticleT1::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), my_problem::setupInitialConditions(), NozzleDemo::setupInitialConditions(), Drum::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), InsertionBoundaryMPI2Test::setupInitialConditions(), MaserRepeatedOutInMPI2Test::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicBounaryEnteringMPIDomainTest::setupInitialConditions(), SubcriticalMaserBoundaryTESTMPI2Test::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), LeesEdwardsDemo::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), StressStrainControl::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), TimeDependentPeriodicBoundaryTest::setupInitialConditions(), Cstatic2d::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), Silo::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Tutorial6::setupInitialConditions(), Packing::setupInitialConditions(), FullRestartTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), ShearStage::ShearStage(), T_protectiveWall::T_protectiveWall(), write(), and writeVTKFiles().

◆ boundaryVTKWriter_

BoundaryVTKWriter DPMBase::boundaryVTKWriter_
private

◆ cgHandler

◆ clock_

Time DPMBase::clock_

record when the simulation started

Referenced by getCPUTime(), getWallTime(), and solve().

◆ continueFlag_

volatile sig_atomic_t DPMBase::continueFlag_ = true
staticprivate

Stores whether code should be stopped

Referenced by continueSolve(), and signalHandler().

◆ dataFile

File DPMBase::dataFile

An instance of class File to handle in- and output into a .data file.

Referenced by RotatingDrumWet::actionsAfterTimeStep(), ParameterStudy1DDemo::actionsBeforeTimeLoop(), ParameterStudy2DDemo::actionsBeforeTimeLoop(), ParameterStudy3DDemo::actionsBeforeTimeLoop(), BaseCluster::actionsOnRestart(), NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), BoundariesSelfTest::BoundariesSelfTest(), ClosedCSCRun::ClosedCSCRun(), closeFiles(), commandLineCG(), ChuteBottom::constructor(), constructor(), CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), findNextExistingDataFile(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), getDataFile(), CLiveStatistics< T >::getLiveStatistics(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), LeesEdwardsDemo::LeesEdwardsDemo(), main(), MultiParticlesInsertion::MultiParticlesInsertion(), read(), readDataFile(), readNextArgument(), readNextDataFile(), readOld(), readParAndIniFiles(), BaseWall::renderWall(), resetFileCounter(), CGHandler::restart(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), CSCInit::save(), SaveCountUnitTest::SaveCountUnitTest(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), AngleOfRepose::set_study(), SilbertPeriodic::set_study(), setFileType(), setLastSavedTimeStep(), setLogarithmicSaveCount(), FlowRule::setName(), setName(), setOpenMode(), Calibration::setOutput(), setSaveCount(), ChutePeriodic::setup(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), Packing::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), BaseCluster::setupInitialConditions(), SilbertHstop::SilbertHstop(), SilbertPeriodic::SilbertPeriodic(), statistics_while_running< T >::statistics_while_running(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), write(), writeDataFile(), writeOutputFiles(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ domainHandler

◆ eneFile

◆ forceWritePythonFileForVTKVisualisation_

bool DPMBase::forceWritePythonFileForVTKVisualisation_ { true }
private

◆ fStatFile

File DPMBase::fStatFile

An instance of class File to handle in- and output into a .fstat file.

Referenced by ChuteRestartDemo::actionsOnRestart(), BaseCluster::actionsOnRestart(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), BoundariesSelfTest::BoundariesSelfTest(), closeFiles(), ChuteWithPeriodicInflow::computeInternalForces(), ChuteBottom::constructor(), constructor(), CGHandler::evaluateDataFiles(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), getFStatFile(), CLiveStatistics< T >::getLiveStatistics(), HorizontalMixer::HorizontalMixer(), InitialConditions< SpeciesType >::InitialConditions(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), main(), ParticleParticleCollision::ParticleParticleCollision(), read(), readNextArgument(), readNextFStatFile(), readOld(), readParAndIniFiles(), resetFileCounter(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), setFileType(), setLastSavedTimeStep(), setLogarithmicSaveCount(), setName(), setOpenMode(), setSaveCount(), ChutePeriodic::setup(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), MarbleRun::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), Packing::setupInitialConditions(), MovingWalls::setupInitialConditions(), BaseCluster::setupInitialConditions(), SilbertHstop::SilbertHstop(), SilbertPeriodic::SilbertPeriodic(), statistics_while_running< T >::statistics_while_running(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), Tutorial11::Tutorial11(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), write(), writeFStatFile(), and writeOutputFiles().

◆ gravity_

Vec3D DPMBase::gravity_
private

Gravity vector.

Referenced by DPMBase(), getGravity(), read(), readOld(), and setGravity().

◆ interactionFile

File DPMBase::interactionFile

File class to handle in- and output into .interactions file. This file hold information about interactions.

Referenced by closeFiles(), ChuteBottom::constructor(), constructor(), getInteractionFile(), read(), resetFileCounter(), setName(), setOpenMode(), and write().

◆ interactionHandler

InteractionHandler DPMBase::interactionHandler

An object of the class InteractionHandler.

Referenced by ForceLawsMPI2Test::actionsAfterSolve(), Contact::actionsAfterSolve(), TwoByTwoMPIDomainMPI4Test::actionsAfterTimeStep(), SlidingSpheresUnitTest::actionsAfterTimeStep(), SphericalSuperQuadricCollision::actionsAfterTimeStep(), ContactDetectionNormalSpheresTest::actionsAfterTimeStep(), ContactDetectionRotatedSpheresTest::actionsAfterTimeStep(), MercuryProblem::actionsAfterTimeStep(), ForceLawsMPI2Test::actionsBeforeTimeStep(), ConstantRestitutionSelfTest::actionsBeforeTimeStep(), QuaternionWallUnitTest::actionsBeforeTimeStep(), PeriodicWallsWithSlidingFrictionUnitTest::actionsBeforeTimeStep(), SilbertPeriodic::add_flow_particles(), DropletBoundary::checkBoundaryAfterParticlesMove(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), PeriodicBoundaryHandler::collectInteractionData(), computeAllForces(), DPM::computeAllForcesNoHGrid(), computeForcesDueToWalls(), Mercury3Dclump::computeForcesDueToWalls(), computeInternalForce(), Mercury3Dclump::computeInternalForce(), computeOneTimeStep(), constructor(), BaseCluster::createAdjacencyMatrix(), DPMBase(), CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), Domain::finaliseBoundaryDataTransmission(), gatherContactStatistics(), getElasticEnergy(), LiquidMigrationPeriodicBoundaryInteraction::getLiquidBridgeVolume(), Sintering::getMeanPlasticOverlap(), InitialConditions< SpeciesType >::getMeanRelativeContactRadius(), Sintering::getMeanRelativeContactRadius(), regimeForceUnitTest::getMeanRelativeContactRadius(), getStaticStress(), importParticlesAs(), initialiseSolve(), main(), BaseCluster::makeDataAnalysis(), BaseCluster::makeGnuplotFile(), outputInteractionDetails(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), Domain::performBoundaryDataTransmission(), PeriodicBoundaryHandler::performNewParticleTransmission(), GranuDrum::printTime(), Drum::printTime(), RotatingDrumWet::printTime(), ForceLawsMPI2Test::printTime(), LiquidMigrationMPI2Test::printTime(), ParticleInclusion::printTime(), LiquidMigrationSelfTest::printTime(), TwoParticleElasticCollisionInteraction::printTime(), EvaporationAndHeatTest::printTime(), PeriodicBoundaryHandler::processLocalInteractionData(), PeriodicBoundaryHandler::processReceivedInteractionData(), Domain::processReceivedInteractionData(), FileReader::read(), read(), readNextFStatFile(), removeDuplicatePeriodicParticles(), CGHandler::restart(), CSCWalls::saveWalls(), setInteractionsWriteVTK(), setTime(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), MovingWalls::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), ContactDetectionTester::testEllipsoidsContact(), ContactDetectionWithWallTester::testEllipsoidsContact(), ContactDetectionTester::testSpheresContact(), ContactDetectionWithWallTester::testSpheresContact(), write(), BaseCluster::writeAmatFile(), SingleParticle< SpeciesType >::writeEneTimeStep(), SlidingFrictionUnitTest::writeEneTimeStep(), writeFstatHeader(), writePythonFileForVTKVisualisation(), BaseCluster::writeToOverlFile(), and writeVTKFiles().

◆ interactionVTKWriter_

InteractionVTKWriter DPMBase::interactionVTKWriter_
private

◆ max_

◆ min_

Vec3D DPMBase::min_
private

These vectors are used for the XBalls domain, and occasionally people use it to add walls.

Referenced by constructor(), DPMBase(), getMin(), getXCenter(), getXMin(), getYCenter(), getYMin(), getZCenter(), getZMin(), read(), readNextDataFile(), readOld(), setDomain(), setMax(), setMin(), setXMin(), setYMin(), and setZMin().

◆ name_

std::string DPMBase::name_
private

the name of the problem, used, e.g., for the output files

Referenced by constructor(), getName(), read(), setName(), and write().

◆ nToWrite_

int DPMBase::nToWrite_
private

number of elements to write to a screen

Referenced by constructor(), getNToWrite(), and setNToWrite().

◆ numberOfDomains_

std::vector<unsigned> DPMBase::numberOfDomains_
private

Vector containing the number of domains in x-,y- and z-direction, required for parallel computations.

Referenced by constructor(), decompose(), DPMBase(), getNumberOfDomains(), read(), setNumberOfDomains(), and write().

◆ numberOfOMPThreads_

int DPMBase::numberOfOMPThreads_
private

◆ numberOfTimeSteps_

unsigned int DPMBase::numberOfTimeSteps_
private

◆ paoloParticleHandler

ParticleHandler DPMBase::paoloParticleHandler

Fake particleHandler created by Paolo needed temporary by just Paolo.

◆ particleDimensions_

unsigned int DPMBase::particleDimensions_
private

determines if 2D or 3D particle volume is used for mass calculations

Referenced by DPMBase(), getParticleDimensions(), read(), and setParticleDimensions().

◆ particleHandler

ParticleHandler DPMBase::particleHandler

An object of the class ParticleHandler, contains the pointers to all the particles created.

Referenced by DPM::actionsAfterSolve(), MaserRepeatedOutInMPI2Test::actionsAfterSolve(), PSDManualInsertionSelfTest::actionsAfterSolve(), HertzianBSHPInteractionTwoParticleElasticCollision::actionsAfterSolve(), Contact::actionsAfterSolve(), EllipsoidsBouncingOnWallDemo::actionsAfterSolve(), EllipticalSuperQuadricCollision::actionsAfterSolve(), SphericalSuperQuadricCollision::actionsAfterSolve(), VisualisationTest::actionsAfterSolve(), SpeciesTest::actionsAfterSolve(), BaseCluster::actionsAfterSolve(), RotatingDrumWet::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), multiParticleT1::actionsAfterTimeStep(), TwoByTwoMPIDomainMPI4Test::actionsAfterTimeStep(), CubicCell::actionsAfterTimeStep(), LeesEdwardsDemo::actionsAfterTimeStep(), ShiftingConstantMassFlowMaserBoundarySelfTest::actionsAfterTimeStep(), ShiftingMaserBoundarySelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), vibratedBed::actionsAfterTimeStep(), BoundariesSelfTest::actionsAfterTimeStep(), FluxAndPeriodicBoundarySelfTest::actionsAfterTimeStep(), FluxBoundarySelfTest::actionsAfterTimeStep(), PolydisperseInsertionBoundarySelfTest::actionsAfterTimeStep(), DPM::actionsAfterTimeStep(), BouncingSuperQuadric::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), SlidingSpheresUnitTest::actionsAfterTimeStep(), SphericalSuperQuadricCollision::actionsAfterTimeStep(), ContactDetectionNormalSpheresTest::actionsAfterTimeStep(), ContactDetectionRotatedSpheresTest::actionsAfterTimeStep(), MercuryProblem::actionsAfterTimeStep(), DrivenParticleClass::actionsAfterTimeStep(), Slide::actionsBeforeTimeLoop(), LawinenBox::actionsBeforeTimeStep(), DPM::actionsBeforeTimeStep(), SmoothChute::actionsBeforeTimeStep(), AngleOfRepose::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), Chutebelt::actionsBeforeTimeStep(), PeriodicWallsWithSlidingFrictionUnitTest::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), ConstantMassFlowMaserBoundary::activateMaser(), SubcriticalMaserBoundary::activateMaser(), SubcriticalMaserBoundaryTEST::activateMaser(), ChutePeriodic::add_flow_particles(), SilbertPeriodic::add_flow_particles(), ChuteWithPeriodicInflow::AddContinuingBottom(), Chute::addFlowParticlesCompactly(), ChuteWithHopper::addHopper(), SpeciesHandler::addObject(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), BaseWall::addParticlesAtWall(), BaseCluster::applyCentralForce(), statistics_while_running< T >::auto_set_domain(), statistics_while_running< T >::auto_set_z(), Membrane::buildMesh(), ChuteWithPeriodicInflow::Check_and_Duplicate_Periodic_Particle(), checkAndDuplicatePeriodicParticles(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), InsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), Mercury3Dclump::checkClumpForInteraction(), Mercury3Dclump::checkClumpForInteractionPeriodic(), checkInteractionWithBoundaries(), checkParticleForInteractionLocal(), checkParticleForInteractionLocalPeriodic(), checkSettings(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ChuteWithPeriodicInflow::cleanChute(), ChuteWithContraction::cleanChute(), Funnel::cleanChute(), Chute::cleanChute(), ContactDetectionTester::cleanup(), PeriodicBoundaryHandler::clearCommunicationLists(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), computeAllForces(), Mercury3Dclump::computeAllForces(), DPM::computeAllForcesNoHGrid(), computeInternalForces(), ChuteWithPeriodicInflow::computeInternalForces(), DPM::computeLocalVolumeFraction(), computeOneTimeStep(), computeWallForces(), constructor(), MercuryLogo::constructTextAsParticles(), ScalingTestInitialConditionsRelax::continueSolve(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), SubcriticalMaserBoundaryTEST::copyExtraParticles(), Funnel::create_funnel(), Slide::create_rough_wall(), BaseCluster::createAdjacencyMatrix(), AngleOfRepose::createBaseSpecies(), SilbertPeriodic::createBaseSpecies(), Chute::createBottom(), CurvyChute::createBottom(), PeriodicBoundary::createGhostParticle(), TimeDependentPeriodicBoundary::createGhostParticle(), Membrane::createVertexParticles(), CSCInit::CSCInit(), BaseCluster::dampVelocities(), decompose(), deleteGhostParticles(), DPM::DPM(), DPMBase(), CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), SubcriticalMaserBoundaryTEST::extendBottom(), ChuteWithPeriodicInflow::ExtendInWidth(), fillDomainWithParticles(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), SphericalIndenter::getBedHeight(), getCentreOfMass(), getGravitationalEnergy(), MercuryBase::getHGridTargetMaxInteractionRadius(), MercuryBase::getHGridTargetMinInteractionRadius(), MercuryBase::getHGridTargetNumberOfBuckets(), getKineticEnergy(), getKineticStress(), LiquidMigrationPeriodicBoundaryInteraction::getLiquidFilmVolume(), InitialConditions< SpeciesType >::getMeanRelativeContactRadius(), Sintering::getMeanRelativeContactRadius(), regimeForceUnitTest::getMeanRelativeContactRadius(), ParticleParticleCollision::getRelativeVelocity(), WallParticleCollision::getRelativeVelocity(), getRotationalEnergy(), getTotalMass(), getTotalMomentum(), GranuHeap::GranuHeap(), Hertzian2DUnitTest::Hertzian2DUnitTest(), MercuryBase::hGridActionsBeforeTimeStep(), MercuryBase::hGridNeedsRebuilding(), MercuryBase::hGridRebuild(), importParticlesAs(), Indenter::Indenter(), InitialConditions< SpeciesType >::InitialConditions(), HGridOptimiser::initialise(), initialiseSolve(), Membrane::initializeEdgeBendingQuantities(), integrateAfterForceComputation(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), integrateBeforeForceComputation(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), HorizontalMixer::introduceSingleParticle(), LawinenBox::LawinenBox(), load(), main(), BaseCluster::makeDataAnalysis(), ChuteBottom::makeRoughBottom(), MarbleRun::MarbleRun(), MercuryCGSelfTest::MercuryCGSelfTest(), MovingWall::MovingWall(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ChuteWithPeriodicInflow::outputXBallsDataParticlee(), ParticleBeam::ParticleBeam(), ParticleInclusion::ParticleInclusion(), BaseCluster::particleInsertionSuccessful(), LawinenBox::printTime(), GranuDrum::printTime(), GranuHeap::printTime(), ChuteWithPeriodicInflow::printTime(), NozzleDemo::printTime(), Drum::printTime(), RotatingDrumWet::printTime(), VerticalMixer::printTime(), LiquidMigrationMPI2Test::printTime(), ParticleBeam::printTime(), SilbertPeriodic::printTime(), vibratedBed::printTime(), CubeDeletionBoundarySelfTest::printTime(), DeletionBoundarySelfTest::printTime(), DistributionSelfTest::printTime(), DistributionToPSDSelfTest::printTime(), InsertionBoundarySelfTest::printTime(), MultiplePSDSelfTest::printTime(), NozzleSelfTest::printTime(), PolydisperseInsertionBoundarySelfTest::printTime(), PSDManualInsertionSelfTest::printTime(), PSDSelfTest::printTime(), LiquidMigrationSelfTest::printTime(), SinterPair::printTime(), EvaporationAndHeatTest::printTime(), RandomClusterInsertionBoundarySelfTest::printTime(), MultiParticlesInsertion::printTime(), regimeForceUnitTest::printTime(), BaseCluster::printTime(), Chute::printTime(), PeriodicBoundaryHandler::processLocalGhostParticles(), Domain::processReceivedBoundaryParticleData(), PeriodicBoundaryHandler::processReceivedGhostParticleData(), FileReader::read(), InsertionBoundary::read(), Membrane::read(), read(), InteractionHandler::readAndAddObject(), readNextDataFile(), readNextFStatFile(), readOld(), CurvyChute::recreateBottom(), regimeForceUnitTest::regimeForceUnitTest(), removeDuplicatePeriodicParticles(), CGHandler::restart(), MeshTriangle::retrieveVertexParticles(), CSCInit::save(), save(), Membrane::saveVertexPositions(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), Slide::set_Walls(), ParticleSpecies::setDensity(), setFixedParticles(), MeshTriangle::setHandler(), setMeanVelocity(), setMeanVelocityAndKineticEnergy(), setParticleDimensions(), setParticlesWriteVTK(), BaseParticle::setSpecies(), setSuperquadricParticlesWriteVTK(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), free_cooling::setupInitialConditions(), restart::setupInitialConditions(), HorizontalMixerWalls::setupInitialConditions(), MembraneDemo::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), Chain::setupInitialConditions(), ForceLawsMPI2Test::setupInitialConditions(), LiquidMigrationMPI2Test::setupInitialConditions(), MaserRepeatedOutInMPI2Test::setupInitialConditions(), PeriodicBounaryEnteringMPIDomainTest::setupInitialConditions(), SubcriticalMaserBoundaryTESTMPI2Test::setupInitialConditions(), TwoByTwoMPIDomainMPI4Test::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), ParameterStudy1DDemo::setupInitialConditions(), ParameterStudy2DDemo::setupInitialConditions(), ParameterStudy3DDemo::setupInitialConditions(), StressStrainControl::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), FiveParticles::setupInitialConditions(), Cstatic2d::setupInitialConditions(), Cstatic3D::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), SquarePacking::setupInitialConditions(), DPM::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), FreeFallInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), MembraneSelfTest::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), SphericalIndenter::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Contact::setupInitialConditions(), Wall::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), GranularCollapse::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), VisualisationTest::setupInitialConditions(), MercuryProblem::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial1::setupInitialConditions(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), Tutorial9::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), AngledPeriodicBoundaryUnitTest::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), FreeFall::setupInitialConditions(), FullRestartTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWallTangential::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringEnergyConservationUnitTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), BaseCluster::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), ContactDetectionTester::setupParticles(), Siegen::Siegen(), SingleParticle< SpeciesType >::SingleParticle(), SingleParticleIndenter::SingleParticleIndenter(), SinterPair::SinterPair(), Slide::Slide(), statistics_while_running< T >::statistics_while_running(), StressStrainControl::StressStrainControl(), FlowFrontChute::stretch(), synchroniseParticle(), ContactDetectionNormalSpheresTest::test(), InertiaTensorTester::test(), VolumeTest::test(), HertzContactRestitutionUnitTest::test(), PeriodicBoundaryHandler::updateMaserParticle(), PeriodicBoundaryHandler::updateParticleStatus(), viscoElasticUnitTest::viscoElasticUnitTest(), write(), BaseCluster::writeAmatFile(), writeEneTimeStep(), LawinenBox::writeEneTimeStep(), Drum::writeEneTimeStep(), Penetration::writeEneTimeStep(), Silo::writeEneTimeStep(), Slide::writeEneTimeStep(), SingleParticle< SpeciesType >::writeEneTimeStep(), writeFstatHeader(), Calibration::writePSDToFile(), and BaseCluster::writeToOverlFile().

◆ periodicBoundaryHandler

◆ random

RNG DPMBase::random

This is a random generator, often used for setting up the initial conditions etc...

Referenced by SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), NautaMixer::addParticles(), HeaterBoundary::checkBoundaryAfterParticleMoved(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), InsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), BaseCluster::computeInternalStructure(), constructor(), LawinenBox::create_inflow_particle(), ChutePeriodic::create_inflow_particle(), ChuteWithContraction::create_inflow_particle(), ChuteWithVerticalHopper::create_inflow_particle(), Funnel::create_inflow_particle(), AngleOfRepose::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), SegregationWithHopper::create_inflow_particle(), Slide::create_rough_wall(), Chute::createBottom(), CurvyChute::createBottom(), Chute::createFlowParticle(), DPMBase(), InitialConditions< SpeciesType >::InitialConditions(), HorizontalMixer::introduceParticlesInDomain(), LawinenBox::LawinenBox(), main(), BaseCluster::particleInsertionSuccessful(), particleParticleTest(), MD_demo::RandomRadius(), read(), readNextArgument(), BaseCluster::setRadii(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), NozzleDemo::setupInitialConditions(), Binary::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), FiveParticles::setupInitialConditions(), Cstatic2d::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), Contact::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), Tutorial11::setupInitialConditions(), MD_demo::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), ChuteBottom::setupInitialConditions(), wallParticleTest(), and write().

◆ readSpeciesFromDataFile_

bool DPMBase::readSpeciesFromDataFile_
private

Determines if the last column of the data file is interpreted as the info parameter during restart.

Referenced by constructor(), DPMBase(), readNextArgument(), readNextDataFile(), and readSpeciesFromDataFile().

◆ restarted_

bool DPMBase::restarted_
private

A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run and the fileCounters reset.

Referenced by DPMBase(), getRestarted(), and setRestarted().

◆ restartFile

File DPMBase::restartFile

An instance of class File to handle in- and output into a .restart file.

Referenced by BaseCluster::actionsOnRestart(), BoundariesSelfTest::BoundariesSelfTest(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCStats::ClosedCSCStats(), closeFiles(), commandLineCG(), ChuteBottom::constructor(), constructor(), CSCRestart::CSCRestart(), CSCStats::CSCStats(), CGHandler::evaluateRestartFiles(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), CLiveStatistics< T >::getLiveStatistics(), getRestartFile(), Indenter::Indenter(), InitialConditions< SpeciesType >::InitialConditions(), initialiseSolve(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), main(), read(), readNextArgument(), Mercury3DRestart::readNextArgument(), readOld(), readRestartFile(), resetFileCounter(), CGHandler::restart(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), CSCInit::save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), setFileType(), setLastSavedTimeStep(), setLogarithmicSaveCount(), setName(), setOpenMode(), Calibration::setOutput(), setSaveCount(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), MarbleRun::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), BaseCluster::setupInitialConditions(), SilbertPeriodic::SilbertPeriodic(), SingleParticle< SpeciesType >::SingleParticle(), statistics_while_running< T >::statistics_while_running(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), Tutorial11::Tutorial11(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), write(), writeOutputFiles(), and writeRestartFile().

◆ restartVersion_

std::string DPMBase::restartVersion_
private

Previous versions of MercuryDPM had a different restart file format, the below member variable allows one to specify the version in order to choose between the available version support.

Referenced by DPMBase(), getRestartVersion(), read(), and setRestartVersion().

◆ rotation_

bool DPMBase::rotation_
private

A flag to turn on/off particle rotation. true will enable particle rotation. false will disable particle rotation.

Referenced by DPMBase(), getRotation(), and setRotation().

◆ runNumber_

int DPMBase::runNumber_
private

This stores the run number for saving.

Referenced by constructor(), DPMBase(), getRunNumber(), read(), setRunNumber(), and write().

◆ speciesHandler

SpeciesHandler DPMBase::speciesHandler

A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.

Referenced by ShiftingConstantMassFlowMaserBoundarySelfTest::actionsAfterTimeStep(), ShiftingMaserBoundarySelfTest::actionsAfterTimeStep(), DropletBoundary::actionsBeforeTimeLoop(), SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), NautaMixer::addBaseWall(), NautaMixer::addConeWall(), ChuteWithPeriodicInflow::AddContinuingBottom(), ChuteWithHopper::addHopper(), InteractionHandler::addInteraction(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), BaseWall::addParticlesAtWall(), ConstantMassFlowMaserBoundary::addParticleToMaser(), SubcriticalMaserBoundary::addParticleToMaser(), NautaMixer::addScrew(), NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), NautaMixer::addTopWall(), AngledPeriodicBoundarySecondUnitTest::AngledPeriodicBoundarySecondUnitTest(), AngledPeriodicBoundaryUnitTest::AngledPeriodicBoundaryUnitTest(), AngleOfRepose::AngleOfRepose(), AreaVTK::AreaVTK(), BouncingSuperQuadric::BouncingSuperQuadric(), BoundariesSelfTest::BoundariesSelfTest(), BaseCluster::calculateTimeStep(), CGBasicSelfTest::CGBasicSelfTest(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), checkSettings(), ChutePeriodicDemo::ChutePeriodicDemo(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ClosedCSCWalls::ClosedCSCWalls(), ChuteWithPeriodicInflow::computeInternalForces(), BaseCluster::computeInternalStructure(), constructor(), Contact::Contact(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), copyDataFromMPIParticleToParticle(), ChutePeriodic::create_inflow_particle(), FlowRule::create_inflow_particle(), SilbertPeriodic::create_inflow_particle(), AngleOfRepose::createBaseSpecies(), SilbertPeriodic::createBaseSpecies(), Chute::createBottom(), CurvyChute::createBottom(), InteractionHandler::createEmptyInteraction(), Chute::createFlowParticle(), ParameterStudy1DDemo::createSpecies(), ParameterStudy2DDemo::createSpecies(), ParameterStudy3DDemo::createSpecies(), MercuryProblem::createTriangleWall(), CSCInit::CSCInit(), CSCWalls::CSCWalls(), decompose(), InteractionHandler::deleteEmptyInteraction(), DPM::DPM(), DPMBase(), fillDomainWithParticles(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), FlowRule::getDensityVariation(), NurbsWall::getDistanceAndNormal(), Screw::getDistanceAndNormal(), IntersectionOfWalls::getDistanceAndNormal(), InteractionHandler::getInteraction(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), GranularCollapse::GranularCollapse(), Hertzian2DUnitTest::Hertzian2DUnitTest(), HertzianSinterForceUnitTest::HertzianSinterForceUnitTest(), Indenter::Indenter(), inflowFromPeriodic::inflowFromPeriodic(), InitialConditions< SpeciesType >::InitialConditions(), MembraneDemo::initializeSpecies(), MembraneSelfTest::initializeSpecies(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), InsertionBoundarySelfTest::InsertionBoundarySelfTest(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), inflowFromPeriodic::integrateBeforeForceComputation(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), HorizontalMixer::introduceSingleParticle(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), MarbleRun::loadBigSeesaw(), ChuteWithPeriodicInflow::loadPeriodicBox(), MarbleRun::loadSmallSeesaw(), MarbleRun::loadSTLFile(), main(), ChuteBottom::makeRoughBottom(), MarbleRun::MarbleRun(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MD_demo::MD_demo(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MovingIntersectionOfWallsUnitTest_Basic::MovingIntersectionOfWallsUnitTest_Basic(), MovingWall::MovingWall(), MultiParticlesInsertion::MultiParticlesInsertion(), ParticleBeam::ParticleBeam(), ParticleCreation::ParticleCreation(), ParticleInclusion::ParticleInclusion(), BaseCluster::particleInsertionSuccessful(), ParticleParticleCollision::ParticleParticleCollision(), ParticleParticleInteraction::ParticleParticleInteraction(), ParticleParticleInteractionWithPlasticForces::ParticleParticleInteractionWithPlasticForces(), ParticleWallInteraction::ParticleWallInteraction(), PlasticForceUnitTest::PlasticForceUnitTest(), ShearStage::printTime(), protectiveWall::protectiveWall(), FileReader::read(), ConstantMassFlowMaserBoundary::read(), SubcriticalMaserBoundary::read(), Membrane::read(), MembraneDemo::read(), MembraneSelfTest::read(), read(), readNextDataFile(), readNextFStatFile(), readOld(), readParAndIniFiles(), CurvyChute::recreateBottom(), regimeForceUnitTest::regimeForceUnitTest(), CGHandler::restart(), runFreeFall(), Cstatic2d::set_particle_properties(), Cstatic3D::set_particle_properties(), FlowRule::setDensityVariation(), AxisymmetricWallSelfTest::setGeometry(), BaseParticle::setIndSpecies(), MercuryOS::setMaterialProperties(), BaseCluster::setSpecies(), Calibration::setSpecies(), Material::setSpecies(), AxisymmetricWallSelfTest::setSpeciesAndTimeStep(), MercuryProblem::setSpeciesProperties(), ChutePeriodic::setup(), ExtremeOverlapUnitTest::setupInitialConditions(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), LawinenBox::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), free_cooling::setupInitialConditions(), restart::setupInitialConditions(), HorizontalMixer::setupInitialConditions(), NozzleDemo::setupInitialConditions(), Drum::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), Chain::setupInitialConditions(), ForceLawsMPI2Test::setupInitialConditions(), InsertionBoundaryMPI2Test::setupInitialConditions(), LiquidMigrationMPI2Test::setupInitialConditions(), MaserRepeatedOutInMPI2Test::setupInitialConditions(), PeriodicBounaryEnteringMPIDomainTest::setupInitialConditions(), SubcriticalMaserBoundaryTESTMPI2Test::setupInitialConditions(), TwoByTwoMPIDomainMPI4Test::setupInitialConditions(), CubicCell::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DDemoProblem::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), FreeCoolingDemoProblem::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), LeesEdwardsDemo::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), ParameterStudy1DDemo::setupInitialConditions(), ParameterStudy2DDemo::setupInitialConditions(), ParameterStudy3DDemo::setupInitialConditions(), StressStrainControl::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), TimeDependentPeriodicBoundary3DSelfTest::setupInitialConditions(), TimeDependentPeriodicBoundaryTest::setupInitialConditions(), FiveParticles::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), MyCoil::setupInitialConditions(), Nurbs::setupInitialConditions(), Polygon::setupInitialConditions(), Silo::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), LeesEdwardsSelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGBasicSelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), SquarePacking::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), FreeFallInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), SphericalIndenter::setupInitialConditions(), Contact::setupInitialConditions(), Wall::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), SlidingSpheresUnitTest::setupInitialConditions(), SphericalSuperQuadricCollision::setupInitialConditions(), ContactDetectionNormalSpheresTest::setupInitialConditions(), ContactDetectionRotatedSpheresTest::setupInitialConditions(), ShapesDemo::setupInitialConditions(), VisualisationTest::setupInitialConditions(), MercuryProblem::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial1::setupInitialConditions(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), Tutorial9::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), AngledPeriodicBoundarySecondUnitTest::setupInitialConditions(), AngledPeriodicBoundaryUnitTest::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), FreeFall::setupInitialConditions(), FullRestartTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), TangentialSpringEnergyConservationUnitTest::setupInitialConditions(), TangentialSpringUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), BaseCluster::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), ContactDetectionWithWallTester::setupParticleAndWall(), ContactDetectionTester::setupParticles(), Chute::setupSideWalls(), Siegen::Siegen(), SilbertPeriodic::SilbertPeriodic(), SingleParticle< SpeciesType >::SingleParticle(), Sintering::Sintering(), SinterPair::SinterPair(), statistics_while_running< T >::statistics_while_running(), StressStrainControl::StressStrainControl(), SubcriticalMaserBoundaryTESTMPI2Test::SubcriticalMaserBoundaryTESTMPI2Test(), T_protectiveWall::T_protectiveWall(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), BoundingRadiusTester::test(), InertiaTensorTester::test(), VolumeTest::test(), ShapeGradientHessianTester::testCushion(), ShapeGradientHessianTester::testEllipsoid(), ShapeGradientHessianTester::testRoundedBeam(), ShapeGradientHessianTester::testSphere(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), TwoByTwoMPIDomainMPI4Test::TwoByTwoMPIDomainMPI4Test(), viscoElasticUnitTest::viscoElasticUnitTest(), Wall::Wall(), and write().

◆ statFile

◆ systemDimensions_

unsigned int DPMBase::systemDimensions_
private

The dimensions of the simulation i.e. 2D or 3D.

Referenced by checkSettings(), DPMBase(), getSystemDimensions(), read(), readOld(), setParticleDimensions(), and setSystemDimensions().

◆ time_

Mdouble DPMBase::time_
private

◆ timeMax_

Mdouble DPMBase::timeMax_
private

Stores the duration of the simulation.

Referenced by DPMBase(), getTimeMax(), read(), readOld(), and setTimeMax().

◆ timeStep_

Mdouble DPMBase::timeStep_
private

Stores the simulation time step.

Referenced by computeOneTimeStep(), constructor(), DPMBase(), getNextTime(), getTimeStep(), read(), readOld(), and setTimeStep().

◆ vtkWriter_

◆ wallDetailsVTKWriter_

WallDetailsVTKWriter DPMBase::wallDetailsVTKWriter_
private

◆ wallHandler

WallHandler DPMBase::wallHandler

An object of the class WallHandler. Contains pointers to all the walls created.

Referenced by T_protectiveWall::actionsAfterTimeStep(), GranuHeap::actionsAfterTimeStep(), multiParticleT1::actionsAfterTimeStep(), NozzleDemo::actionsAfterTimeStep(), MaserRepeatedOutInMPI2Test::actionsAfterTimeStep(), HourGlass2D::actionsAfterTimeStep(), HourGlass::actionsAfterTimeStep(), MarbleRun::actionsAfterTimeStep(), MinimalExampleDrum::actionsAfterTimeStep(), ShiftingConstantMassFlowMaserBoundarySelfTest::actionsAfterTimeStep(), ShiftingMaserBoundarySelfTest::actionsAfterTimeStep(), vibratedBed::actionsAfterTimeStep(), Chutebelt::actionsAfterTimeStep(), NozzleSelfTest::actionsAfterTimeStep(), GranularCollapse::actionsAfterTimeStep(), MercuryProblem::actionsAfterTimeStep(), protectiveWall::actionsAfterTimeStep(), Tutorial11::actionsAfterTimeStep(), LawinenBox::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), DrumRot::actionsBeforeTimeStep(), RotatingDrum::actionsBeforeTimeStep(), DrumRot::actionsOnRestart(), NautaMixer::addBaseWall(), VerticalMixerStraightBlades::addBlades(), VerticalMixerAngledBlades::addBlades(), NautaMixer::addConeWall(), ChuteWithHopper::addHopper(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), VerticalMixerAngledBlades::addPrettyBlades(), NautaMixer::addScrew(), NautaMixer::addTopWall(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), DropletBoundary::checkBoundaryAfterParticlesMove(), checkParticleForInteractionLocal(), MercuryBase::checkParticleForInteractionLocal(), checkSettings(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), computeAllForces(), Mercury3Dclump::computeAllForces(), DPM::computeAllForcesNoHGrid(), computeOneTimeStep(), constructor(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), Slide::create_rough_wall(), Funnel::create_walls(), Chute::createBottom(), MercuryProblem::createTriangleWall(), CSCWalls::CSCWalls(), DPMBase(), CGHandler::evaluateRestartFiles(), getWallsWriteVTK(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), handleParticleAddition(), handleParticleRemoval(), HorizontalMixer::HorizontalMixer(), InitialConditions< SpeciesType >::InitialConditions(), initialiseSolve(), integrateAfterForceComputation(), integrateBeforeForceComputation(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), load(), MarbleRun::loadBigSeesaw(), MarbleRun::loadSmallSeesaw(), MarbleRun::loadSTLFile(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MovingWall::MovingWall(), MovingWalls::MovingWalls(), ParticleCreation::ParticleCreation(), PeriodicBoundaryHandler::processLocalInteractionData(), PeriodicBoundaryHandler::processReceivedInteractionData(), Domain::processReceivedInteractionData(), protectiveWall::protectiveWall(), FileReader::read(), Membrane::read(), read(), Funnel::read(), readNextFStatFile(), readOld(), readParAndIniFiles(), save(), ContractionWithPeriodicInflow::set_symmetric_contraction(), ChuteWithPeriodicInflowAndContraction::set_symmetric_contraction(), ChuteWithContraction::set_symmetric_contraction(), Slide::set_Walls(), AxisymmetricWallSelfTest::setGeometry(), HorizontalMixer::setOuterWalls(), HorizontalMixerWalls::setOuterWalls(), Calibration::setOutput(), HorizontalMixer::setScrewCore(), HorizontalMixerWalls::setScrewCore(), HorizontalMixer::setScrewWalls(), BaseWall::setSpecies(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), multiParticleT1::setupInitialConditions(), NautaMixer::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), Chain::setupInitialConditions(), MaserRepeatedOutInMPI2Test::setupInitialConditions(), PeriodicBounaryEnteringMPIDomainTest::setupInitialConditions(), FreeCooling2DinWallsDemo::setupInitialConditions(), FreeCooling3DinWallsDemo::setupInitialConditions(), HeaterBoundaryTest::setupInitialConditions(), HourGlass2D::setupInitialConditions(), HourGlass::setupInitialConditions(), MarbleRun::setupInitialConditions(), MinimalExampleDrum::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), Cstatic2d::setupInitialConditions(), AngleOfRepose::setupInitialConditions(), SilbertPeriodic::setupInitialConditions(), statistics_while_running< T >::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), MyCoil::setupInitialConditions(), Nurbs::setupInitialConditions(), Polygon::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), SquarePacking::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), my_problem_HGRID::setupInitialConditions(), FreeFallInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleElasticCollisionInteraction::setupInitialConditions(), TwoParticleElasticCollision::setupInitialConditions(), AxisymmetricWallSelfTest::setupInitialConditions(), CoilSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), TriangulatedStepSelfTest::setupInitialConditions(), TriangulatedStepWallSelfTest::setupInitialConditions(), TriangulatedWallSelfTest::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), DrumRot::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Wall::setupInitialConditions(), BouncingSuperQuadric::setupInitialConditions(), EllipsoidsBouncingOnWallDemo::setupInitialConditions(), GranularCollapse::setupInitialConditions(), EllipticalSuperQuadricCollision::setupInitialConditions(), protectiveWall::setupInitialConditions(), Tutorial11::setupInitialConditions(), Tutorial12::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), Tutorial9::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ArcWallUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), FreeFall::setupInitialConditions(), FullRestartTest::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), ChuteBottom::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), ContactDetectionWithWallTester::setupParticleAndWall(), Chute::setupSideWalls(), setWallsWriteVTK(), Slide::Slide(), FlowFrontChute::stretch(), T_protectiveWall::T_protectiveWall(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), Tutorial11::Tutorial11(), write(), LawinenBox::writeEneTimeStep(), Slide::writeEneTimeStep(), writePythonFileForVTKVisualisation(), and writeVTKFiles().

◆ wallVTKWriter_

WallVTKWriter DPMBase::wallVTKWriter_
private

◆ writeParticlesVTK_

bool DPMBase::writeParticlesVTK_
private

A flag to turn on/off the vtk writer for particles.

Referenced by constructor(), DPMBase(), getParticlesWriteVTK(), setParticlesWriteVTK(), setSuperquadricParticlesWriteVTK(), and write().

◆ writeSuperquadricParticlesVTK_

bool DPMBase::writeSuperquadricParticlesVTK_
private

◆ xBallsAdditionalArguments_

std::string DPMBase::xBallsAdditionalArguments_
private

A string of additional arguments for xballs can be specified (see XBalls/xballs.txt). e.g. "-solidf -v0".

Referenced by constructor(), DPMBase(), getXBallsAdditionalArguments(), and setXBallsAdditionalArguments().

◆ xBallsColourMode_

int DPMBase::xBallsColourMode_
private

XBalls is a package to view the particle data. As an alternative MercuryDPM also supports ParaView. The below variable is used to set the argument cmode in xballs script (see XBalls/xballs.txt)

Referenced by constructor(), DPMBase(), getXBallsColourMode(), and setXBallsColourMode().

◆ xBallsScale_

Mdouble DPMBase::xBallsScale_
private

sets the xballs argument scale (see XBalls/xballs.txt)

Referenced by constructor(), DPMBase(), getXBallsScale(), and setXBallsScale().

◆ xBallsVectorScale_

Mdouble DPMBase::xBallsVectorScale_
private

sets the xballs argument vscale (see XBalls/xballs.txt)

Referenced by constructor(), DPMBase(), getXBallsVectorScale(), and setXBallsVectorScale().


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