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< intget1DParametersFromRunNumber (int size_x) const
 This turns a counter into 1 index, which is a useful feature for performing 1D parameter study. The index run from 1:size_x, while the study number starts at 0 (initially the counter=1 in COUNTER_DONOTDEL) More...
 
std::vector< intget2DParametersFromRunNumber (int size_x, int size_y) const
 This turns a counter into 2 indices which is a very useful feature for performing a 2D study. The indices run from 1:size_x and 1:size_y, while the study number starts at 0 ( initially the counter=1 in COUNTER_DONOTDEL) More...
 
std::vector< intget3DParametersFromRunNumber (int size_x, int size_y, int size_z) const
 This turns a counter into 3 indices, which is a useful feature for performing a 3D parameter study. The indices run from 1:size_x, 1:size_y and 1:size_z, while the study number starts at 0 ( initially the counter=1 in COUNTER_DONOTDEL) More...
 
int launchNewRun (const char *name, bool quick=false)
 This launches a code from within this code. Please pass the name of the code to run. More...
 
void setRunNumber (int runNumber)
 This sets the counter/Run number, overriding the defaults. More...
 
int getRunNumber () const
 This returns the current value of the counter (runNumber_) More...
 
virtual void decompose ()
 Sends particles from processorId to the root processor. More...
 
void solve ()
 The work horse of the code. More...
 
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
 Returns a constant reference to an Interactions file. More...
 
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 setVTKOutputDirectory (const std::string &dir)
 Sets the output directory of the VTK files. 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 getCenter () const
 get center of domain More...
 
Vec3D getMin () const
 Returns the minimum coordinates of the problem domain. More...
 
Vec3D getMax () const
 Returns the maximum coordinates of the problem domain. More...
 
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)
 Sets the number of omp threads. More...
 
int getNumberOfOMPThreads () const
 Returns the number of omp threads. More...
 
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 allowed to be negative 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 (Vec3D origin={0, 0, 0}) const
 Returns the global gravitational potential energy stored relative to a user-defined origin in the system. Note, if no origin is specified the real origin i.e. (0,0,0) is taken. More...
 
Mdouble getRotationalEnergy () const
 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< unsignedgetNumberOfDomains ()
 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)
 Handles the addition of particles to the particleHandler. More...
 
void writePythonFileForVTKVisualisation () const
 writes .py file for ParaView More...
 
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 disableSoftStop ()
 This prevents the initialisation of the soft stop feature. More...
 
void discontinueSolve ()
 This discontinues the solve loop after the current time step is finished. More...
 

Private Member Functions

void setSoftStop ()
 function for setting sigaction constructor. More...
 
void initialiseVTK () const
 Generates the python file for vtk visualisation. Creates vtk output directories if needed. More...
 

Static Private Member Functions

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

Private Attributes

bool disableSoftStop_ = false
 
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< unsignednumberOfDomains_
 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 
965 {X, Y, Z, XY, XZ, YZ, XYZ};
@ XY
Definition: StatisticsVector.h:21
@ XZ
Definition: StatisticsVector.h:21
@ YZ
Definition: StatisticsVector.h:21
@ XYZ
Definition: StatisticsVector.h:21
#define X
Definition: icosphere.cpp:20
#define Z
Definition: icosphere.cpp:21
const char Y
Definition: test/EulerAngles.cpp:32

◆ ReadOptions

enum DPMBase::ReadOptions : int
strong
Enumerator
ReadAll 
ReadNoInteractions 
ReadNoParticlesAndInteractions 
233  : int {
234  ReadAll,
235  ReadNoInteractions,
236  ReadNoParticlesAndInteractions
237  };

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

176 {
177 constructor();
178 }
InteractionVTKWriter interactionVTKWriter_
Definition: DPMBase.h:1375
WallVTKWriter wallVTKWriter_
Definition: DPMBase.h:1373
WallDetailsVTKWriter wallDetailsVTKWriter_
Definition: DPMBase.h:1379
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1453
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1458
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1473
void constructor()
A function which initialises the member variables to default values, so that the problem can be solve...
Definition: DPMBase.cc:188
BoundaryVTKWriter boundaryVTKWriter_
Definition: DPMBase.h:1377

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 overridden to copy the contents, not just the pointer.

Parameters
[in]other
106 {
107  setName(other.getName());
108  runNumber_ = other.runNumber_;
111  gravity_ = other.gravity_;
113 /* xMin_ = other.xMin_;
114  xMax_ = other.xMax_;
115  yMin_ = other.yMin_;
116  yMax_ = other.yMax_;
117  zMin_ = other.zMin_;
118  zMax_ = other.zMax_;*/
119  min_ = other.min_;
120  max_ = other.max_;
122  time_ = other.time_;
123  timeStep_ = other.timeStep_;
125  timeMax_ = other.timeMax_;
126  restartVersion_ = other.restartVersion_; //to read new and old restart data
127  restarted_ = other.restarted_; //to see if it was restarted or not
128  append_ = other.append_;
129  rotation_ = other.rotation_;
130  xBallsColourMode_ = other.xBallsColourMode_; // sets the xballs argument cmode (see xballs.txt)
131  xBallsVectorScale_ = other.xBallsVectorScale_; // sets the xballs argument vscale (see xballs.txt)
132  xBallsScale_ = other.xBallsScale_; // sets the xballs argument scale (see xballs.txt)
133  xBallsAdditionalArguments_ = other.xBallsAdditionalArguments_; // std::string where additional xballs argument can be specified (see xballs.txt)
136 
137 //effectively saying "if there exists a CONTACT_LIST_HGRID, copy it, if not, ignore."
138 #ifdef CONTACT_LIST_HGRID
139 possibleContactList=other.possibleContactList;
140 #endif
141  random = other.random;
142 
147  wallHandler.setDPMBase(this);
150  //Initialise the handlers
153 
154  //setting contents equal to the other handlers!
157  cgHandler = other.cgHandler;
158  //cgHandler = other.cgHandler.copy(); //\todo
159  //cgHandler.setDPMBase(this);
160  wallHandler = other.wallHandler;
163  vtkWriter_ = other.vtkWriter_;
167 }
void setDPMBase(DPMBase *DPMBase)
Sets the problem that is solved using this handler.
Definition: BaseHandler.h:726
ParticleVtkWriter * vtkWriter_
Definition: DPMBase.h:1371
Vec3D max_
Definition: DPMBase.h:1317
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1433
Vec3D min_
These vectors are used for the XBalls domain, and occasionally people use it to add walls.
Definition: DPMBase.h:1316
int xBallsColourMode_
XBalls is a package to view the particle data. As an alternative MercuryDPM also supports ParaView....
Definition: DPMBase.h:1387
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:400
unsigned int systemDimensions_
The dimensions of the simulation i.e. 2D or 3D.
Definition: DPMBase.h:1290
std::vector< unsigned > numberOfDomains_
Vector containing the number of domains in x-,y- and z-direction, required for parallel computations.
Definition: DPMBase.h:1311
PeriodicBoundaryHandler periodicBoundaryHandler
Internal handler that deals with periodic boundaries, especially in a parallel build.
Definition: DPMBase.h:1463
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:377
int numberOfOMPThreads_
Definition: DPMBase.h:1285
Mdouble timeMax_
Stores the duration of the simulation.
Definition: DPMBase.h:1337
int runNumber_
This stores the run number for saving.
Definition: DPMBase.h:1407
bool restarted_
A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run an...
Definition: DPMBase.h:1349
Mdouble xBallsScale_
sets the xballs argument scale (see XBalls/xballs.txt)
Definition: DPMBase.h:1397
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1479
Mdouble backgroundDrag_
This is a global background drag to help retard particles, or to do a simple fluid drag....
Definition: DPMBase.h:1306
Mdouble xBallsVectorScale_
sets the xballs argument vscale (see XBalls/xballs.txt)
Definition: DPMBase.h:1392
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1443
std::string restartVersion_
Previous versions of MercuryDPM had a different restart file format, the below member variable allows...
Definition: DPMBase.h:1344
bool writeParticlesVTK_
A flag to turn on/off the vtk writer for particles.
Definition: DPMBase.h:1367
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1438
bool rotation_
A flag to turn on/off particle rotation. true will enable particle rotation. false will disable parti...
Definition: DPMBase.h:1362
DomainHandler domainHandler
An object of the class DomainHandler which deals with parallel code.
Definition: DPMBase.h:1468
bool readSpeciesFromDataFile_
Determines if the last column of the data file is interpreted as the info parameter during restart.
Definition: DPMBase.h:1422
bool writeSuperquadricParticlesVTK_
Definition: DPMBase.h:1369
std::string xBallsAdditionalArguments_
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt)....
Definition: DPMBase.h:1402
bool append_
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example.
Definition: DPMBase.h:1355
Mdouble timeStep_
Stores the simulation time step.
Definition: DPMBase.h:1332
Vec3D gravity_
Gravity vector.
Definition: DPMBase.h:1300
unsigned int numberOfTimeSteps_
Stores the number of time steps.
Definition: DPMBase.h:1327
unsigned int particleDimensions_
determines if 2D or 3D particle volume is used for mass calculations
Definition: DPMBase.h:1295
Mdouble time_
Stores the current simulation time.
Definition: DPMBase.h:1322
void initialise()
Definition: DomainHandler.cc:412
void initialise()
Initialises the communication list vectors as they can not be determined on compile time.
Definition: PeriodicBoundaryHandler.cc:1765

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.

276 {
277 delete vtkWriter_;
278 }

References vtkWriter_.

Member Function Documentation

◆ actionsAfterSolve()

void DPMBase::actionsAfterSolve ( )
protectedvirtual

◆ actionsAfterTimeStep()

void DPMBase::actionsAfterTimeStep ( )
protectedvirtual

A virtual function which allows to define operations to be executed after time step.

no implementation but can be overridden in its derived classes.

Reimplemented in BaseCluster, MpiPeriodicBoundaryUnitTest, DrivenParticleClass, Tutorial11, protectiveWall, MercuryProblem, ContactDetectionRotatedSpheresTest, ContactDetectionNormalSpheresTest, SphericalSuperQuadricCollision, SlidingSpheresUnitTest, GranularCollapse, EllipticalSuperQuadricCollision, EllipsoidsBouncingOnWallDemo, BouncingSuperQuadric, SphericalIndenter, DPM, DPM, PolydisperseInsertionBoundarySelfTest, NozzleSelfTest, FluxBoundarySelfTest, FluxAndPeriodicBoundarySelfTest, BoundariesSelfTest, SingleParticleSegregation, Chutebelt, RotatingDrumBidisperseInitialise, OneParticleCoolingSelfTest, OneParticleHeatingSelfTest, vibratedBed, TimeDependentPeriodicBoundaryTest, TimeDependentPeriodicBoundary3DSelfTest, ShiftingMaserBoundarySelfTest, ShiftingConstantMassFlowMaserBoundarySelfTest, PrintWallTimeMixinDemo, MinimalExampleDrum, MarbleRun, LeesEdwardsDemo, HourGlass, HourGlass2D, HourGlass2D, FreeCoolingDemoProblem, FreeCooling3DinWallsDemo, FreeCooling3DDemoProblem, FreeCooling2DinWallsDemo, CubicCell, TwoByTwoMPIDomainMPI4Test, MaserRepeatedOutInMPI2Test, NozzleDemo, RotatingDrumWet, NozzleDemo, HorizontalMixer, CFDDEMCoupleTest, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ClosedCSCWalls, ClosedCSCRun, ClosedCSCRestart, ShearStage, GranuHeap, T_protectiveWall, Vreman, Vreman, and Vreman.

1868 {
1869 }

Referenced by ChangingTOIParticle::actionsAfterTimeStep(), and computeOneTimeStep().

◆ 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 overridden in its derived classes.

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

1659 {
1660 }

Referenced by initialiseSolve().

◆ actionsBeforeTimeStep()

void DPMBase::actionsBeforeTimeStep ( )
protectedvirtual

◆ 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 overridden in its derived classes.

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

1673 {
1674 }

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
1651 {
1652  return (pI != pJ && pI->isInContactWith(pJ));
1653 }
virtual bool isInContactWith(const BaseParticle *P) const
Get whether or not this particle is in contact with the given particle.
Definition: BaseParticle.cc:845

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

531 {
533 
534 if (!getRestarted())
535 {
537 }
538 }
static void incrementRunNumberInFile()
Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store...
Definition: DPMBase.cc:619
bool getRestarted() const
Returns the flag denoting if the simulation was restarted or not.
Definition: DPMBase.cc:1484
void setRunNumber(int runNumber)
This sets the counter/Run number, overriding the defaults.
Definition: DPMBase.cc:597
static int readRunNumberFromFile()
Read the run number or the counter from the counter file (COUNTER_DONOTDEL)
Definition: DPMBase.cc:544

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

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

5109 {
5110  //Looping over all boundaries in the boundaryHandler
5111  for (BaseBoundary* boundary : boundaryHandler)
5112  {
5113  //Calls the createPeriodicParticles() function which checks if a particle is adequately
5114  //close to a periodic particle that a periodic (ghost) particle should be created and,
5115  //if so, creates one and adds it to the system (hence the necessity to keep "N" variable).
5116  //
5117  // (The loop is over all boundaries, but if a boundary is not a PeriodicBoundary, then
5118  // this does nothing.)
5119  boundary->createPeriodicParticles(particleHandler);
5120  }
5121 
5122  // OMP parallelism
5123  /*#pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
5124  for (int k = 0; k < boundaryHandler.getNumberOfObjects(); k++)
5125  {
5126  //Calls the createPeriodicParticles() function which checks if a particle is adequately
5127  //close to a periodic particle that a periodic (ghost) particle should be created and,
5128  //if so, creates one and adds it to the system (hence the necessity to keep "N" variable).
5129  //
5130  // (The loop is over all boundaries, but if a boundary is not a PeriodicBoundary, then
5131  // this does nothing.)
5132 
5133  BaseBoundary* boundary = boundaryHandler.getObject(k);
5134  #pragma omp critical
5135  boundary->createPeriodicParticles(particleHandler);
5136  }*/
5137 }
Definition: BaseBoundary.h:28

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.

3303 {
3304 
3305  //Cycling over all boundaries within the system...
3306  for (BaseBoundary* b : boundaryHandler)
3307  {
3308  //check all boundaries...
3309  b->checkBoundaryAfterParticlesMove(particleHandler);
3310 
3311 
3312 #ifdef MERCURYDPM_USE_MPI
3313  //When ghost particles are deleted by deletion boundaries they need to be removed
3314  //from their communication lists to avoid segfaults
3315  if (NUMBER_OF_PROCESSORS > 1)
3316  {
3317  //Flush deleted particles from mpi communication zones
3318  getCurrentDomain()->flushParticles(b->getParticlesToBeDeleted());
3320  periodicBoundaryHandler.flushParticles(b->getParticlesToBeDeleted());
3322  }
3323 
3324  //Delete particles that were in communication zone
3325  for (auto p_it = b->getParticlesToBeDeleted().begin(); p_it != b->getParticlesToBeDeleted().end(); p_it++)
3326  {
3327  particleHandler.removeGhostObject((*p_it)->getIndex());
3328  }
3329 #endif
3330  }
3331 }
#define NUMBER_OF_PROCESSORS
For the MPI communication routines this quantity is often required. defining this macro makes the cod...
Definition: GeneralDefine.h:41
Scalar * b
Definition: benchVecAdd.cpp:17
Domain * getCurrentDomain()
Function that returns a pointer to the domain corresponding to the processor.
Definition: DPMBase.cc:5378
void cleanCommunicationLists()
Removes nullptrs from boundaryParticleList_ and boundaryParticleListNeighbour_.
Definition: Domain.cc:1721
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:1677
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:416
void cleanCommunicationLists()
Definition: PeriodicBoundaryHandler.cc:1750
void flushParticles(std::set< BaseParticle * > &particlesToBeFlushed)
Removes particles from the periodiocParticleList_ and periociGhostList_.
Definition: PeriodicBoundaryHandler.cc:1683

References b, 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.

4885 {
4886 #ifdef MERCURYDPM_USE_MPI
4887  if (NUMBER_OF_PROCESSORS == 1)
4888  {
4890  }
4891 
4892  int localInteraction = checkParticleForInteractionLocal(p);
4893  //The root gathers all values and computes the global value
4894  int *interactionList = nullptr;
4895  if (PROCESSOR_ID == 0)
4896  {
4897  interactionList = new int [NUMBER_OF_PROCESSORS];
4898  }
4899 
4900  //Gather all local values
4901  MPIContainer::Instance().gather(localInteraction,interactionList);
4902 
4903  //Compute the global value
4904  int globalInteraction = 1;
4905  if (PROCESSOR_ID == 0)
4906  {
4907  for (int i = 0; i < NUMBER_OF_PROCESSORS; i++)
4908  {
4909  if (interactionList[i] == 0)
4910  {
4911  globalInteraction = 0;
4912  break;
4913  }
4914  }
4915  }
4916  //The root now tells the other processors what the global value for the interaction is
4917  MPIContainer::Instance().broadcast(globalInteraction);
4918 
4919  //Convert the result back to bool
4920  bool interaction = globalInteraction;
4921 #else
4922  bool interaction = checkParticleForInteractionLocalPeriodic(p);
4923 #endif
4924  return interaction;
4925 }
int i
Definition: BiCGSTAB_step_by_step.cpp:9
#define PROCESSOR_ID
Definition: GeneralDefine.h:42
float * p
Definition: Tutorial_Map_using.cpp:9
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:4983
bool checkParticleForInteractionLocalPeriodic(const BaseParticle &P)
Definition: DPMBase.cc:4933
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:420
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:407
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:113

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

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

4984 {
4985  Mdouble distance;
4986  Vec3D normal;
4987 
4988  //Check if it has no collision with walls
4989  for (BaseWall* w : wallHandler)
4990  {
4991  //returns false if the function getDistanceAndNormal returns true,
4992  //i.e. if there exists an interaction between wall and particle
4993  // \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.)
4994  if (w->getDistanceAndNormal(p, distance, normal))
4995  {
4996  //std::cout<<"failure: Collision with wall: "<<**it<<std::endl;
4997  return false;
4998  }
4999  else
5000  {
5001  //std::cout<<"No collision with wall: "<<**it<<std::endl;
5002  }
5003  }
5004 
5005  //Check if it has no collision with other particles
5006  for (BaseParticle* q : particleHandler)
5007  {
5008  //returns false if the particle separation is less than the relevant sum of interaction radii
5009  //(i.e. another particle is in contact with P)
5010  if (Vec3D::getDistanceSquared(q->getPosition(), p.getPosition())
5011  < mathsFunc::square(p.getSumOfInteractionRadii(q)))
5012  {
5013  //std::cout<<"failure: Collision with particle "<<**it<<std::endl;
5014  return false;
5015  }
5016  else
5017  {
5018  //std::cout<<"No collision with particle "<<**it<<std::endl;
5019  }
5020  }
5021  return true;
5023 }
RowVector3d w
Definition: Matrix_resize_int.cpp:3
Definition: BaseParticle.h:33
Basic class for walls.
Definition: BaseWall.h:28
Definition: Kernel/Math/Vector.h:30
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Definition: Kernel/Math/Vector.h:303
EIGEN_DEVICE_FUNC const Scalar & q
Definition: SpecialFunctionsImpl.h:2019
void normal(const Vector< double > &x, Vector< double > &normal)
Definition: free_surface_rotation.cc:65
T square(const T val)
squares a number
Definition: ExtendedMath.h:86

References Vec3D::getDistanceSquared(), WallFunction::normal(), p, particleHandler, Eigen::numext::q, mathsFunc::square(), w, 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
4934 {
4935  //A vector of ghost particles of the particle that is to be inserted (empty if no periodic boundaries are present)
4936  std::vector<Vec3D> pPeriodic;
4937  for (BaseBoundary* b : boundaryHandler)
4938  {
4939  PeriodicBoundary* pb = dynamic_cast<PeriodicBoundary*>(b);
4940  if (pb && particleHandler.getNumberOfObjects() > 0 )
4941  {
4942  const Mdouble maxDistance = p.getMaxInteractionRadius() + particleHandler.getLargestParticle()->getMaxInteractionRadius();
4943  for (int i = pPeriodic.size() - 1; i >= 0; --i)
4944  {
4945  if (pb->getDistance(pPeriodic[i]) < maxDistance)
4946  {
4947  pPeriodic.push_back(pPeriodic[i]);
4948  pb->shiftPosition(pPeriodic.back());
4949  }
4950  }
4951  if (pb->getDistance(p) < maxDistance)
4952  {
4953  pPeriodic.push_back(p.getPosition());
4954  pb->shiftPosition(pPeriodic.back());
4955  }
4956  }
4957  }
4958  //check the particle AND the ghost particles for intersection problems
4959  bool insertable = checkParticleForInteractionLocal(p);
4960  if (!pPeriodic.empty()) {
4961  BaseParticle* q = p.copy();
4962  for (const Vec3D& pos : pPeriodic) {
4963  q->setPosition(pos);
4964  insertable &= checkParticleForInteractionLocal(*q);
4965  }
4966  delete q;
4967  }
4968  return insertable;
4969 }
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:345
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:1323
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
Definition: ParticleHandler.cc:528
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:20
const char const int const int const RealScalar const RealScalar const int const RealScalar * pb
Definition: level2_impl.h:28

References b, boundaryHandler, checkParticleForInteractionLocal(), ParticleHandler::getLargestParticle(), BaseParticle::getMaxInteractionRadius(), ParticleHandler::getNumberOfObjects(), i, p, particleHandler, pb, and Eigen::numext::q.

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.
4066 {
4067  //check if name is set
4068  logger.assert_always(getName() != "",
4069  "File name not set: use setName()");
4070  //check if time step is set
4071  logger.assert_always(getTimeStep() != 0,
4072  "Time step undefined: use setTimeStep()");
4073  //check if domain is set
4074  logger.assert_always(getXMax() > getXMin(),
4075  "Domain size not set: use setXMin() and setXMax()");
4076  logger.assert_always(getYMax() > getYMin(),
4077  "Domain size not set: use setYMin() and setYMax()");
4078  logger.assert_always(systemDimensions_ == 3 ? (getZMax() > getZMin()) : (getZMax() >= getZMin()),
4079  "Domain size not set: use setZMin() and setZMax()", systemDimensions_);
4080 
4081  //check for species parameters
4082  logger.assert_always(speciesHandler.getNumberOfObjects() > 0,
4083  "No species defined: use speciesHandler.copyAndAddObject()");
4084  for (BaseParticle* p : particleHandler)
4085  {
4086  logger.assert_always(p->getSpecies() != nullptr, "particle % has no species", p->getId());
4087  }
4088  for (BaseWall* w : wallHandler)
4089  {
4090  logger.assert_always(w->getSpecies() != nullptr, "% with index % has no species", w->getName(), w->getId());
4091  }
4092 }
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:656
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:603
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:610
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:616
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:622
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:634
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:628

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

Referenced by initialiseSolve().

◆ closeFiles()

void DPMBase::closeFiles ( )

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

482 {
483 dataFile.close();
484 fStatFile.close();
486 statFile.close();
487 eneFile.close();
489 }
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1494
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1489
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1484
File interactionFile
File class to handle in- and output into .interactions file. This file hold information about interac...
Definition: DPMBase.h:1510
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1499
File statFile
An instance of class File to handle in- and output into a .stat file.
Definition: DPMBase.h:1504
void close()
Closes the file by calling fstream_.close()
Definition: File.cc:385

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 overridden 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, SingleParticleSegregation, and MembraneDemo.

1096 {}

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.

3428 {
3429  //Resetting all forces on both particles and walls to zero
3430  #pragma omp parallel num_threads(getNumberOfOMPThreads())
3431  {
3432  #pragma omp for
3433  for (int k = 0; k < particleHandler.getSize(); ++k) {
3435  }
3436  #pragma omp for
3437  for (int k = 0; k < wallHandler.getSize(); k++) {
3439  }
3440  }
3441  logger(DEBUG,"All forces set to zero");
3442 
3443  // for omp simulations, reset the newObjects_ variable (used for reduction)
3445 
3446  // compute all internal and external forces; for omp simulations, this can be done in parallel
3447  #pragma omp parallel num_threads(getNumberOfOMPThreads())
3448  {
3449  //logger(INFO, "Number of omp threads = %", getNumberOfOMPThreads());
3451  #pragma omp for schedule(dynamic)
3452  for (int k = 0; k < particleHandler.getSize(); ++k) {
3454  //computing both internal forces (e.g. due to collisions)
3455  //and external forces (e.g. gravity)
3456  //(compute internal forces compares the current particle p
3457  //with all others in the handler!)
3459  // body forces
3461  }
3462 
3463  // wall-forces
3464  #pragma omp for schedule(dynamic)
3465  for (int k = 0; k < wallHandler.getSize(); k++) {
3468  w->computeWear();
3469  }
3470 
3471  }
3472 
3473  #ifdef MERCURYDPM_TRIANGLE_WALL_CORRECTION
3474  // This statement deals with interactions of a particle with a group of walls:
3475  // 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.
3476  // A second modification is done in #BaseWall::getInteractionWith
3478  for (BaseParticle *p : particleHandler) {
3479  // find all current interactions between this particle and a TriangleWall
3480  std::vector<BaseInteraction *> wallInters;
3481  double overlapSum = 0.0;
3482  for (const auto i : p->getInteractions()) {
3483  if (i->getI()->getName() == "TriangleWall" && i->getTimeStamp() > getNumberOfTimeSteps()) {
3484  wallInters.push_back(i);
3485  overlapSum += i->getOverlap();
3486  }
3487  }
3488  // if more than one interactions are detected, we have a concave wall interaction problem.
3489  if (wallInters.size() > 1) {
3491  // get the multiple contact points to define the new contact plane, normal, and overlap
3492  for (BaseInteraction *i : wallInters) {
3493  auto q = i->getI();
3494  // undo the force/torque computation from multiple TriangleWalls
3495  p->addForce(-i->getForce());
3496  q->addForce(i->getForce());
3497  if (getRotation()) {
3498  p->addTorque(-i->getTorque() + Vec3D::cross(p->getPosition() - i->getContactPoint(), i->getForce()));
3499  q->addTorque( i->getTorque() - Vec3D::cross(q->getPosition() - i->getContactPoint(), i->getForce()));
3500  }
3501  // reset the forces
3502  double w = i->getOverlap() / overlapSum;
3503  i->setContactPoint(p->getPosition() - (p->getRadius() - 0.5 * i->getOverlap()) * w * i->getNormal());
3504  i->setForce(i->getForce() * w);
3505  i->setTorque(i->getTorque() * w);
3506  // applies the reset forces to the particle and the wall
3507  p->addForce(i->getForce());
3508  q->addForce(-i->getForce());
3509  if (getRotation()) {
3510  p->addTorque( i->getTorque() - Vec3D::cross(p->getPosition() - i->getContactPoint(), i->getForce()));
3511  q->addTorque(-i->getTorque() + Vec3D::cross(q->getPosition() - i->getContactPoint(), i->getForce()));
3512  }
3513  }
3514  }
3515  }
3516  #endif
3517 
3518 #ifdef CONTACT_LIST_HGRID
3519  PossibleContact* Curr=possibleContactList.getFirstPossibleContact();
3520  while(Curr)
3521  {
3522  computeInternalForces(Curr->getP1(),Curr->getP2());
3523  Curr=Curr->getNext();
3524  }
3525 #endif
3526 
3527  // Check wall forces
3528  #pragma omp for schedule(dynamic)
3529  for (int k = 0; k < wallHandler.getNumberOfObjects(); k++) {
3531  w->checkInteractions(&interactionHandler, getNumberOfTimeSteps() + 1);
3532  }
3533 
3535 
3536  // for omp simulations, sum up all forces and add all newObjects_ (needed since both are using reduction)
3537  #ifdef MERCURYDPM_USE_OMP
3538  if (getNumberOfOMPThreads()>1) {
3540  }
3541  //Resetting all forces on both particles and walls to zero
3542  #pragma omp parallel num_threads(getNumberOfOMPThreads())
3543  {
3544  #pragma omp for
3545  for (int k = 0; k < particleHandler.getSize(); k++) {
3547  }
3548  #pragma omp for
3549  for (int k = 0; k < wallHandler.getSize(); k++) {
3551  } //end reset forces loop
3552  }
3553  #endif
3554 
3555  //end outer loop over contacts.
3556 }
@ DEBUG
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:663
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:621
void sumForceTorqueOMP()
Definition: BaseInteractable.cc:140
virtual void resetForceTorque(int numberOfOMPthreads)
Definition: BaseInteractable.cc:119
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:39
int getNumberOfOMPThreads() const
Returns the number of omp threads.
Definition: DPMBase.cc:1277
virtual void computeWallForces(BaseWall *w)
Definition: DPMBase.cc:5516
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:815
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:3564
virtual void computeAdditionalForces()
A virtual function which allows to define operations to be executed prior to the OMP force collect.
Definition: DPMBase.h:1096
virtual void computeExternalForces(BaseParticle *)
Computes the external forces, such as gravity, acting on particles.
Definition: DPMBase.cc:3198
bool getRotation() const
Indicates whether particle rotation is enabled or disabled.
Definition: DPMBase.h:554
void resetNewObjectsOMP()
Definition: InteractionHandler.cc:102
void addNewObjectsOMP()
Definition: InteractionHandler.cc:109
Class that describes a possible contact between two BaseParticle.
Definition: PossibleContact.h:21
BaseParticle * getP2()
Gets a pointer to the second BaseParticle in this PossibleContact.
Definition: PossibleContact.h:118
PossibleContact * getNext()
Gets the next PossibleContact in the general linked list of PossibleContact.
Definition: PossibleContact.h:146
BaseParticle * getP1()
Gets a pointer to the first BaseParticle in this PossibleContact.
Definition: PossibleContact.h:109
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:143
char char char int int * k
Definition: level2_impl.h:374

References InteractionHandler::addNewObjectsOMP(), computeAdditionalForces(), computeExternalForces(), computeInternalForces(), computeWallForces(), Vec3D::cross(), DEBUG, PossibleContact::getNext(), BaseHandler< T >::getNumberOfObjects(), getNumberOfOMPThreads(), getNumberOfTimeSteps(), BaseHandler< T >::getObject(), PossibleContact::getP1(), PossibleContact::getP2(), getRotation(), BaseHandler< T >::getSize(), i, interactionHandler, k, logger, p, particleHandler, Eigen::numext::q, BaseInteractable::resetForceTorque(), InteractionHandler::resetNewObjectsOMP(), BaseInteractable::sumForceTorqueOMP(), w, and wallHandler.

Referenced by Mercury3Dclump::computeAllForces(), 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, CFDDEMCoupleTest, my_problem, my_problem, PeriodicWalls, and Contact.

3199 {
3200  //Checks that the current particle is not "fixed"
3201  //and hence infinitely massive!
3202  if ((!CI->isFixed()) && (!CI->isPebble()))
3203  {
3204  // Applying the force due to gravity (F = m.g) Do not apply gravity to slave particles
3205  CI->addForce(getGravity() * CI->getMass()-getBackgroundDrag()*CI->getVelocity());
3206  // Still calls this in compute External Forces.
3207  // computeForcesDueToWalls(CI);
3208  }
3209 }
virtual const Vec3D & getVelocity() const
Returns the velocity of this interactable.
Definition: BaseInteractable.cc:307
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
Definition: BaseInteractable.cc:94
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:72
bool isPebble() const
Checks if particle is a pebble (belongs to a clump)
Definition: BaseParticle.h:639
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:305
const Mdouble getBackgroundDrag() const
Return the background drag.
Definition: DPMBase.h:801
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1382

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

Referenced by computeAllForces(), DPM::computeAllForcesNoHGrid(), Contact::computeExternalForces(), CFDDEMCoupleTest::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.

3219 {
3220 
3221  //No need to compute interactions between periodic particle images and walls
3222  if (pI->getPeriodicFromParticle() != nullptr)
3223  return;
3224 
3225  //Checks if the particle is interacting with the current wall
3226  BaseInteraction* i = w->getInteractionWith(pI, getNumberOfTimeSteps() + 1,
3228  if (i!=nullptr) {
3229  //...calculates the forces between the two objects...
3230  i->computeForce();
3231 
3232  //...and applies them to each of the two objects (wall and particle).
3233  pI->addForce(i->getForce());
3234  w->addForce(-i->getForce());
3235 
3236  //If the rotation flag is on, also applies the relevant torques
3237  //(getRotation() returns a boolean).
3238  if (getRotation()) // getRotation() returns a boolean.
3239  {
3240  pI->addTorque(i->getTorque() - Vec3D::cross(pI->getPosition() - i->getContactPoint(), i->getForce()));
3242  w->addTorque(-i->getTorque() + Vec3D::cross(w->getPosition() - i->getContactPoint(), i->getForce()));
3243  }
3244  }
3245 }
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
Definition: BaseInteractable.cc:110
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:197
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:324

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

Referenced by DPM::computeAllForcesNoHGrid(), Mercury3Dclump::computeForcesDueToWalls(), 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.

3144 {
3145  //Does not compute forces if particles are fixed
3146  //this is necessary because the rough bottom allows overlapping fixed particles
3147  if (P1->isFixed() && P2->isFixed())
3148  {
3149  return;
3150  }
3151 //Ensures that interactions between the "ghost" particles used to implement periodic behaviour
3152  //are not included in calculations
3153  //i.e. ends the function if both particles are "ghosts".
3154  if ((P1->getPeriodicFromParticle() != nullptr) && (P2->getPeriodicFromParticle() != nullptr))
3155  {
3156  return;
3157  }
3158 //if statement below ensures that the PI has the lower id than PJ
3159  BaseParticle* PI, * PJ;
3160  if (P1->getId() > P2->getId())
3161  {
3162  PI = P2;
3163  PJ = P1;
3164  }
3165  else
3166  {
3167  PI = P1;
3168  PJ = P2;
3169  }
3170  //checks if the two particles are interacting
3171  //("getInteractionWith" returns the relevant pointer if PI and PJ are interacting,
3172  //zero if not)
3173  //if statement above ensures that the PI has the lower id than PJ
3176  if (i!= nullptr) {
3177  //calculates the force corresponding to the interaction
3178  i->computeForce();
3179 
3180  //Applies the relevant calculated forces to PI and PJ
3181  PI->addForce(i->getForce());
3182  PJ->addForce(-i->getForce());
3183 
3184  //checks if particle rotation is turned on...
3185  if (getRotation()) {
3186  //...and, if so, performs equivalent calculations for the torque as were
3187  //performed for the force.
3188  PI->addTorque(i->getTorque() - Vec3D::cross(PI->getPosition() - i->getContactPoint(), i->getForce()));
3189  PJ->addTorque(-i->getTorque() + Vec3D::cross(PJ->getPosition() - i->getContactPoint(), i->getForce()));
3190  }
3191  }
3192 }
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:104
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:667

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

Referenced by DPM::computeAllForcesNoHGrid(), SphericalIndenter::computeExternalForces(), Mercury3Dclump::computeInternalForce(), 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.

3565 {
3566  for (auto it = particleHandler.begin(); (*it) != i; ++it)
3567  {
3568  computeInternalForce(i, *it);
3569  }
3570 }
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:698
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:3143

References BaseHandler< T >::begin(), computeInternalForce(), 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}
4371 {
4372  logger(DEBUG, "starting computeOneTimeStep()");
4373 
4374  logger(DEBUG, "about to call writeOutputFiles()");
4375  writeOutputFiles(); //everything is written at the beginning of the time step!
4376 
4377  logger(DEBUG, "about to call hGridActionsBeforeIntegration()");
4379 
4380  //Computes the half-time step velocity and full time step position and updates the particles accordingly
4381  logger(DEBUG, "about to call integrateBeforeForceComputation()");
4382 
4384  //New positions require the MPI and parallel periodic boundaries to do things
4385  logger(DEBUG, "about to call performGhostParticleUpdate()");
4387  // Some walls need to be aware of the new positions
4389 
4393 
4394  logger(DEBUG, "about to call checkInteractionWithBoundaries()");
4395  checkInteractionWithBoundaries(); // INSERTION boundaries handled
4396 
4397  logger(DEBUG, "about to call hGridActionsAfterIntegration()");
4399 
4400  // Compute forces
4402  // INSERTION/DELETION boundary flag change
4403  for (BaseBoundary* b : boundaryHandler)
4404  {
4405  b->checkBoundaryBeforeTimeStep(this);
4406  }
4407 
4408  logger(DEBUG, "about to call actionsBeforeTimeStep()");
4411  //interactionHandler.actionsBeforeTimeStep();
4412 
4413  logger(DEBUG, "about to call checkAndDuplicatePeriodicParticles()");
4415 
4416  logger(DEBUG, "about to call hGridActionsBeforeTimeStep()");
4418 
4419  //Creates and updates interactions and computes forces based on these
4420  logger(DEBUG, "about to call computeAllForces()");
4421  computeAllForces();
4422 
4423  logger(DEBUG, "about to call removeDuplicatePeriodicParticles()");
4425 
4426  logger(DEBUG, "about to call actionsAfterTimeStep()");
4428 
4429  //Computes new velocities and updates the particles accordingly
4430  logger(DEBUG, "about to call integrateAfterForceComputation()");
4432 
4433  //erase interactions that have not been used during the last time step
4434  //logger(DEBUG, "about to call interactionHandler.eraseOldInteractions(getNumberOfTimeSteps())");
4436  logger(DEBUG, "about to call interactionHandler.actionsAfterTimeStep()");
4439 
4440  time_ += timeStep_;
4442 
4443  logger(DEBUG, "finished computeOneTimeStep()");
4444 }
virtual void writeOutputFiles()
Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and ....
Definition: DPMBase.cc:4115
virtual void integrateAfterForceComputation()
Update particles' and walls' positions and velocities after force computation.
Definition: DPMBase.cc:3344
void removeDuplicatePeriodicParticles()
Removes periodic duplicate Particles.
Definition: DPMBase.cc:5065
virtual void hGridActionsBeforeIntegration()
This function has to be called before integrateBeforeForceComputation.
Definition: DPMBase.cc:1929
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: DPMBase.cc:1853
virtual void checkInteractionWithBoundaries()
There are a range of boundaries one could implement depending on ones' problem. This methods checks f...
Definition: DPMBase.cc:3302
virtual void computeAllForces()
Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseIntera...
Definition: DPMBase.cc:3427
virtual void hGridActionsAfterIntegration()
This function has to be called after integrateBeforeForceComputation.
Definition: DPMBase.cc:1936
void checkAndDuplicatePeriodicParticles()
For simulations using periodic boundaries, checks and adds particles when necessary into the particle...
Definition: DPMBase.cc:5108
virtual void integrateBeforeForceComputation()
Update particles' and walls' positions and velocities before force computation.
Definition: DPMBase.cc:3258
void performGhostParticleUpdate()
When the Verlet scheme updates the positions and velocities of particles, ghost particles will need a...
Definition: DPMBase.cc:5142
virtual void hGridActionsBeforeTimeStep()
A virtual function that allows one to set or execute hGrid parameters or operations before every simu...
Definition: DPMBase.cc:1679
virtual void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
Definition: DPMBase.cc:1867
void actionsAfterTimeStep()
Definition: InteractionHandler.cc:375
void eraseOldInteractions(unsigned)
erases interactions which have an old timestamp.
Definition: InteractionHandler.cc:357
void actionsAfterTimeStep()
Definition: ParticleHandler.cc:1378
void actionsBeforeTimeStep()
Definition: ParticleHandler.cc:1370
void actionsAfterParticleGhostUpdate()
Calls the method actionsAfterParticleGhostUpdate of every wall in the handler.
Definition: WallHandler.cc:436

References WallHandler::actionsAfterParticleGhostUpdate(), actionsAfterTimeStep(), InteractionHandler::actionsAfterTimeStep(), ParticleHandler::actionsAfterTimeStep(), actionsBeforeTimeStep(), ParticleHandler::actionsBeforeTimeStep(), b, 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.

5517 {
5518  //compute forces for all particles that are neither fixed nor ghosts
5519  for (auto p : particleHandler)
5520  {
5521  if (!p->isFixed() && p->getPeriodicFromParticle() == nullptr)
5522  {
5523  //w->computeForces(p);
5525  }
5526  }
5527 }
virtual void computeForcesDueToWalls(BaseParticle *, BaseWall *)
Computes the forces on the particles due to the walls (normals are outward normals)
Definition: DPMBase.cc:3218

References computeForcesDueToWalls(), p, particleHandler, and w.

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.

189 {
190  //constructor();
191  dataFile.getFstream().precision(10);
192  fStatFile.getFstream().precision(10);
193  eneFile.getFstream().precision(10);
194  restartFile.getFstream().precision(
195  std::numeric_limits<double>::digits10); //highly accurate, so the overlap is accurate
196  statFile.getFstream().precision(10);
197  statFile.getFstream().setf(std::ios::left);
198  interactionFile.getFstream().precision(10);
199  name_ = ""; // needs to be user-specified, otherwise checkSettings throws error
200  //by default, the fileType of all files is ONE_FILE. However, by default we don't want an interaction file since it
201  // is very large.
203 
204  runNumber_ = 0;
205 
206  //Decomposition direction for MPI
207  numberOfDomains_ = {1, 1, 1};
208 
209  //Check if MPI is already initialised
210  initialiseMPI();
211 
212  //This sets the maximum number of particles
217  cgHandler.setDPMBase(this);
219  wallHandler.setDPMBase(this);
225 
226  //set defaults for DPMBase parameters
229  setRestarted(false);
230  setGravity(Vec3D(0, 0, 0));
231  setBackgroundDrag(0.0);
232 
233  //This is the parameter of the numerical part
234  setTime(0);
235  numberOfTimeSteps_ = 0;
236  setTimeMax(0);
237  timeStep_ = 0; // needs to be user-specified, otherwise checkSettings throws error
238  setSaveCount(20);
239 
240  //This sets the default xballs domain
241  min_ = Vec3D(0, 0, 0);
242  max_ = Vec3D(0, 0, 0); // needs to be user-specified, otherwise checkSettings throws error
243 
244  //sets the default write particles data in VTK format flag to false
245  writeParticlesVTK_ = false;
247  vtkWriter_ = nullptr;
248 
249  setName(""); // needs to be user-specified, otherwise checkSettings throws error
250 
251  //Default mode is energy with no scale of the vectors
252  xBallsColourMode_ = 0;
253  xBallsVectorScale_ = -1;
254  xBallsScale_ = -1;
256  setAppend(false);
257 
258  //The default random seed is 0
260 
261  logger(DEBUG, "DPMBase problem constructor finished");
262 
263  readSpeciesFromDataFile_ = false;
264 
266 
267  //Set number of elements to write to the screen if a user wants to output write information to the terminal
268  nToWrite_ = 4;
269 }
@ NO_FILE
file will not be created/read
void initialiseMPI()
Inialises the MPI library.
Definition: MpiContainer.cc:116
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:386
void setBackgroundDrag(Mdouble backgroundDrag)
Simple access function to turn on a background drag. The force of particleVelocity*drag is applied (n...
Definition: DPMBase.h:795
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1439
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1492
std::string name_
the name of the problem, used, e.g., for the output files
Definition: DPMBase.h:1412
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:864
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1408
void setTime(Mdouble time)
Sets a new value for the current simulation time.
Definition: DPMBase.cc:827
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1513
int nToWrite_
number of elements to write to a screen
Definition: DPMBase.h:1427
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
Definition: File.cc:131
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:193
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:32

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

Alternatively, the discontinueSolve function can be used as well, which can be called directly from any place in the code.

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 >, RotatingDrumBidisperseInitialise, InitialBed, SilbertHstop, SilbertHstop, SilbertHstop, SilbertHstop, SilbertHstop, CSCWalls, CSCInit, ClosedCSCWalls, and T_protectiveWall.

1980 {
1981  return true;
1982 }

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

4155 {
4156 #ifdef MERCURYDPM_USE_MPI
4157 
4158  //If running in parallel build, but just running with one core - no domain decomposition required
4159  int numberOfRequiredProcessors = numberOfDomains_[Direction::XAXIS]*
4162  if (NUMBER_OF_PROCESSORS != numberOfRequiredProcessors)
4163  {
4164  logger(ERROR,"The domain decompositions expects % processors, but only % are requested.\n"
4165  "Either run your process using \"mpirun -np % [executable]\", "
4166  "or change the domain decomposition to e.g. setNumberOfDomains({%,1,1}).", numberOfRequiredProcessors, NUMBER_OF_PROCESSORS, numberOfRequiredProcessors, NUMBER_OF_PROCESSORS);
4167  }
4168 
4169  if (NUMBER_OF_PROCESSORS == 1) {return;}
4170 
4171  //Check if the simulation domain has been set
4172  logger.assert_always(getXMax() - getXMin() > 0,"Please set your simulation domain (setXMax(),setXmin()) before calling solve()");
4173  logger.assert_always(getYMax() - getYMin() > 0,"Please set your simulation domain (setYMax(),setYmin()) before calling solve()");
4174  logger.assert_always(getZMax() - getZMin() > 0,"Please set your simulation domain (setZMax(),setZmin()) before calling solve()");
4175 
4176  //Grab simulation domains
4177  std::vector<Mdouble> simulationMin{getXMin(), getYMin(), getZMin()};
4178  std::vector<Mdouble> simulationMax{getXMax(), getYMax(), getZMax()};
4179 
4180  //Check if the user input decomposition is correct
4181  logger.assert_always(numberOfDomains_[Direction::XAXIS] > 0,"Number of domain in x-direction incorrect: %",numberOfDomains_[Direction::XAXIS]);
4182  logger.assert_always(numberOfDomains_[Direction::YAXIS] > 0,"Number of domain in y-direction incorrect: %",numberOfDomains_[Direction::YAXIS]);
4183  logger.assert_always(numberOfDomains_[Direction::ZAXIS] > 0,"Number of domain in z-direction incorrect: %",numberOfDomains_[Direction::ZAXIS]);
4184 
4185  //Open domain decomposition, closed is not implemented
4186  bool open = true;
4187 
4188  //Check if the number of domains is equal to the number of processors
4190  "Number of Processors is not equal to number of domains. Processors %, domains, %",
4193 
4194  //Create all processor domains
4195 
4196  domainHandler.setDPMBase(this);
4197  domainHandler.createMesh(simulationMin, simulationMax, numberOfDomains_, open);
4198  logger(VERBOSE,"Number of domains: % | Number of processors: %",domainHandler.getNumberOfObjects(), NUMBER_OF_PROCESSORS);
4199  //logger.assert_always(domainHandler.getNumberOfObjects() == numberOfProcessors, "Invalid decomposition: Number of domains and processors are different");
4200 
4201  //Tell the current processor to which domain it belongs
4202  for (Domain* domain : domainHandler)
4203  {
4204  if (domain->getRank() == PROCESSOR_ID)
4205  {
4206  logger(VERBOSE,"processor: %, domain index: %",PROCESSOR_ID, domain->getIndex());
4208  }
4209  }
4210 
4211  //Define the mpi transfer types, which requires a definition of the species already
4213  logger.assert_always(speciesHandler.getNumberOfObjects() > 0, "Please create a particle species before calling solve()");
4215 
4216  //Make sure all processors are done with decomposition before proceeding
4217  logger(VERBOSE,"processor %: #real particles: %, #total particles: %", PROCESSOR_ID, particleHandler.getNumberOfRealObjects(), particleHandler.getSize());
4219 #endif
4220 }
@ YAXIS
Definition: GeneralDefine.h:57
@ XAXIS
Definition: GeneralDefine.h:57
@ ZAXIS
Definition: GeneralDefine.h:57
@ ERROR
@ VERBOSE
void setCurrentDomainIndex(unsigned int index)
This sets a domain to the processor.
Definition: DomainHandler.cc:218
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:71
The simulation can be subdivided into Domain's used in parallel code.
Definition: Domain.h:42
void initialiseMercuryMPITypes(const SpeciesHandler &speciesHandler)
Creates the MPI types required for communication of Mercury data through the MPI interface.
Definition: MpiContainer.cc:53
void sync()
Process all pending asynchronous communication requests before continuing.
Definition: MpiContainer.h:131
unsigned int getNumberOfRealObjects() const
Returns the number of real objects (on all processors)
Definition: ParticleHandler.cc:1302
SteadyAxisymAdvectionDiffusion problem on rectangular domain
Definition: steady_axisym_advection_diffusion.cc:151

References DomainHandler::createMesh(), domain, 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
5166 {
5167  //Flush mixed particles from lists (MP particles are located in both structures)
5168  if (periodicBoundaryHandler.getSize() > 0)
5169  {
5170  //Flush particles from boundaries
5171  domainHandler.getCurrentDomain()->flushParticles(particlesToBeDeleted);
5172  periodicBoundaryHandler.flushParticles(particlesToBeDeleted);
5173  }
5174 
5175  //Clean communication lists
5178 
5179  //Delete the particles
5180  for (auto particle_it : particlesToBeDeleted)
5181  {
5182  particleHandler.removeGhostObject(particle_it->getIndex());
5183  }
5184 }
Domain * getCurrentDomain()
Gets the domain assigned to the processor.
Definition: DomainHandler.cc:228

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

Referenced by performGhostParticleUpdate().

◆ disableSoftStop()

void DPMBase::disableSoftStop ( )
inlineprotected

This prevents the initialisation of the soft stop feature.

1253 { disableSoftStop_ = true; }
bool disableSoftStop_
Definition: DPMBase.h:1282

References disableSoftStop_.

◆ discontinueSolve()

void DPMBase::discontinueSolve ( )
inlineprotected

This discontinues the solve loop after the current time step is finished.

Use this to gracefully exit the simulation early, i.e. write the output files etc., by calling it from any place in the code. It is an alternative to overriding the continueSolve function.

1260 { continueFlag_ = false; }
static volatile sig_atomic_t continueFlag_
Definition: DPMBase.h:1277

References continueFlag_.

◆ 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
3024  {
3025  logger.assert_always(speciesHandler.getSize()>0,"There needs to be at least one species");
3029  b.set(p, 100, getMin(), getMax(), {0, 0, 0}, {0, 0, 0});
3030  b.insertParticles(this);
3031  logger(INFO,"Inserted % particles",particleHandler.getSize());
3032 }
@ INFO
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:642
It's an insertion boundary which has cuboidal shape (yes, 'CuboidalInsertionBoundary' would have been...
Definition: CubeInsertionBoundary.h:21
Vec3D getMax() const
Returns the maximum coordinates of the problem domain.
Definition: DPMBase.h:659
Vec3D getMin() const
Returns the minimum coordinates of the problem domain.
Definition: DPMBase.h:653
Definition: ParticleSpecies.h:16
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:16
RealScalar s
Definition: level1_cplx_impl.h:130

References b, BaseHandler< T >::getLastObject(), getMax(), getMin(), BaseHandler< T >::getSize(), INFO, logger, p, particleHandler, s, and speciesHandler.

◆ finaliseSolve()

void DPMBase::finaliseSolve ( )

End of the solve routine, after time stepping.

4352  {
4353 
4354  //force writing of the last time step
4356 
4357  //end loop over interaction count
4359 
4360  //To make sure getTime gets the correct time for outputting statistics
4361  finishStatistics();
4362 
4363  closeFiles();
4364 }
void closeFiles()
Closes all files (ene, data, fstat, restart, stat) that were opened to read or write.
Definition: DPMBase.cc:481
void forceWriteOutputFiles()
Writes output files immediately, even if the current time step was not meant to be written....
Definition: DPMBase.cc:4094
virtual void finishStatistics()
Definition: DPMBase.cc:1914
virtual void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
Definition: DPMBase.cc:1860

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.
2675 {
2677  {
2678  while (true)// This true corresponds to the if s
2679  {
2680  dataFile.open();
2681  //check if file exists and contains data
2682  int N;
2683  dataFile.getFstream() >> N;
2684  if (dataFile.getFstream().eof() || dataFile.getFstream().peek() == -1)
2685  {
2686  logger(WARN, "file % not found", dataFile.getName());
2687  return false;
2688  }
2689  //check if tmin condition is satisfied
2690  Mdouble t;
2691  dataFile.getFstream() >> t;
2692  if (t > tMin)
2693  {
2694  //set_file_counter(get_file_counter()-1);
2695  return true;
2696  }
2697  if (verbose)
2698  logger(VERBOSE, "Jumping file counter: %", dataFile.getCounter());
2699  }
2700  }
2701  return true;
2702 }
@ 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:143
bool open()
Checks if the file stream fstream_ has any issues while opening. Alongside, it also increments the ne...
Definition: File.cc:325
unsigned int getCounter() const
In case of multiple files, File::getCounter() returns the the number (FILE::Counter_) of the next fil...
Definition: File.cc:201
FileType getFileType() const
Gets the file type e.g. NOFILE, ONEFILE and MULTIPLE FILES. File::fileType_.
Definition: File.cc:185
@ N
Definition: constructor.cpp:22
t
Definition: plotPSD.py:36
bool verbose
Definition: statXZ.cpp:7

References dataFile, File::getCounter(), File::getFileType(), File::getFstream(), File::getName(), logger, MULTIPLE_FILES, MULTIPLE_FILES_PADDED, N, File::open(), plotPSD::t, 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 >.

1915 {
1916  cgHandler.finish();
1917 }
void finish()
Contains the code executed after the last time step.
Definition: CGHandler.cc:96

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.

4095 {
4097  writeOutputFiles();
4098 }
const unsigned NEVER
Definition: File.h:13
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:510

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

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

◆ gatherContactStatistics() [1/2]

void DPMBase::gatherContactStatistics ( )
protected
1888 {
1890  {
1891  c->gatherContactStatistics();
1892  }
1893 }
int c
Definition: calibrate.py:100

References calibrate::c, and 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 overridden in its derived classes.

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

1901 {
1902 }

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.
662 {
663 // Declare a vector of integers capable of storing 2 values
664 std::vector<int> temp(2);
665 
666 // Declare and initialise for the current simulation run number
667 int counter = getRunNumber();
668 
669 // Give studyNum value 0 if study is incomplete, otherwise value > 0
670 int studyNum = (counter-1)/sizeX;
671 counter = counter - sizeX*studyNum;
672 
673 int i = ((counter - 1) % sizeX) + 1;
674 logger(INFO,"StudyNum: % \t Counter: % \t i: %", studyNum, counter, i);
675 temp[0] = studyNum;
676 temp[1] = i;
677 
678 return temp;
679 }
int getRunNumber() const
This returns the current value of the counter (runNumber_)
Definition: DPMBase.cc:608

References getRunNumber(), 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>
690 {
691 //declares a vector of integers capable of storing 3 values,
692 std::vector<int> temp(3);
693 //declares and initialises an integer variable named "counter"
694 //with the current counter number, runNumber_
695 int counter = getRunNumber();
696 //calculates the total size of the study, i.e. the number of points
697 //in the 2D parameter space explored
698 int studySize = sizeX * sizeY;
699 //(counter - 1) / studySize gives a fraction comparing the number of runs conducted so far
700 //to the total size of the study, i.e. the total number of runs that need to be performed.
701 //since studyNum is an integer, will declare zero until an adequate number of runs has been performed,
702 //at which point it will equal 1
703 int studyNum = (counter - 1) / studySize;
704 
705 counter = counter - studySize * studyNum;
706 int i = ((counter - 1) % sizeX) + 1;
707 int j = ((counter - i) / sizeX) + 1;
708 logger(INFO,"StudyNum: % \t Counter: % \t i: % \t j: %", studyNum, counter, i, j);
709 
710 temp[0] = studyNum;
711 temp[1] = i;
712 temp[2] = j;
713 
714 return (temp);
715 }
std::ptrdiff_t j
Definition: tut_arithmetic_redux_minmax.cpp:2

References getRunNumber(), i, INFO, j, 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>
727 {
728 //declares a vector of integers capable of storing 4 values,
729 std::vector<int> temp(4);
730 //declares and initialises an integer variable named "counter"
731 //with the current counter number, runNumber_
732 int counter = getRunNumber();
733 //calculates the total size of the study, i.e. the number of points
734 //in the 3D parameter space explored
735 int studySize = sizeX * sizeY * sizeZ;
736 //(counter - 1) / studySize gives a fraction comparing the number of runs conducted so far
737 //to the total size of the study, i.e. the total number of runs that need to be performed.
738 //since studyNum is an integer, will declare zero until an adequate number of runs has been performed,
739 //at which point it will equal 1
740 int studyNum = (counter - 1) / studySize;
741 
742 counter = counter - studySize * studyNum;
743 int i = ((counter-1) % sizeX) + 1;
744 int j = static_cast<int>(std::floor((counter-1)/sizeX)) % sizeY + 1;
745 int k = static_cast<int>(std::floor((counter-1)/(sizeX*sizeY))) % sizeZ + 1;
746 logger(INFO,"StudyNum: % \t Counter: % \t i: % \t j: % \t k: %", studyNum, counter, i, j, k);
747 
748 temp[0] = studyNum;
749 temp[1] = i;
750 temp[2] = j;
751 temp[3] = k;
752 
753 return (temp);
754 }
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 floor(const bfloat16 &a)
Definition: BFloat16.h:643

References Eigen::bfloat16_impl::floor(), getRunNumber(), i, INFO, j, k, 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.
1502 {
1503  return append_;
1504 }

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.
801 {return backgroundDrag_;}

References backgroundDrag_.

Referenced by RotatingDrumBidisperseInitialise::actionsAfterTimeStep(), computeExternalForces(), and write().

◆ getCenter()

Vec3D DPMBase::getCenter ( ) const
inline

get center of domain

648  { return {getXCenter(), getYCenter(), getZCenter()}; }
Mdouble getZCenter() const
Definition: DPMBase.h:643
Mdouble getXCenter() const
Definition: DPMBase.h:637
Mdouble getYCenter() const
Definition: DPMBase.h:640

References getXCenter(), getYCenter(), and getZCenter().

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

1604 {
1606 }
Vec3D getCentreOfMass() const
Definition: ParticleHandler.cc:648

References ParticleHandler::getCentreOfMass(), and particleHandler.

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

◆ getCPUTime()

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

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
5379 {
5381 }

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)
284 {
285 return dataFile;
286 }

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)
333 {
334 return dataFile;
335 }

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.
1522 {
1523  Mdouble elasticEnergy = 0.0;
1524  // JMFT: Note that we do count the elastic energy of fixed particles here.
1525  for (const BaseInteraction* c : interactionHandler)
1526  {
1527  elasticEnergy += c->getElasticEnergy();
1528  }
1529  return elasticEnergy;
1530 }

References calibrate::c, and interactionHandler.

Referenced by SilbertHstop::actionAfterTimeStep(), BaseCluster::actionsAfterSolve(), GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), RotatingDrumBidisperseInitialise::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), T_protectiveWall::continueSolve(), ClosedCSCWalls::continueSolve(), CSCInit::continueSolve(), CSCWalls::continueSolve(), RotatingDrumBidisperseInitialise::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(), RotatingDrumBidisperseInitialise::printTime(), SingleParticleSegregation::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)
292 {
293 return eneFile;
294 }

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)
341 {
342 return eneFile;
343 }

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)
300 {
301 return fStatFile;
302 }

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)
349 {
350 return fStatFile;
351 }

References fStatFile.

◆ getGravitationalEnergy()

Mdouble DPMBase::getGravitationalEnergy ( Vec3D  origin = {0,0,0}) const

Returns the global gravitational potential energy stored relative to a user-defined origin in the system. Note, if no origin is specified the real origin i.e. (0,0,0) is taken.

Returns
gravitationalEnergy The total gravitational potential energy of all particles (relative to user-specified origin. If no origin is specified the real origin (0,0,0) is taken.
1553 {
1554  Mdouble gravitationalEnergy = 0;
1555  for (const BaseParticle* const p : particleHandler)
1556  {
1557  // Don't consider fixed particles. 'Fixed' particles aren't necessarily
1558  // stationary; it just means their position is prescribed.
1559  if (!(p->isFixed()))
1560  {
1561  gravitationalEnergy += p->getMass() * Vec3D::dot((-getGravity()), p->getPosition()-origin);
1562  }
1563  }
1564  return gravitationalEnergy;
1565 }
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:56

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

Referenced by InitialBed::continueSolve(), getTotalEnergy(), InitialBed::printTime(), and LaserOnLayer::printTime().

◆ getGravity()

◆ getHGridUpdateEachTimeStep()

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

Reimplemented in MercuryBase.

1708 {
1709  return true;
1710 }

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.

1632 {
1633 // return p.getSpecies()->getId(); // was getIndex()
1634  return p.getInfo();
1635 }

References p.

◆ getInteractionFile() [1/2]

File & DPMBase::getInteractionFile ( )

Return a reference to the file InteractionsFile.

Returns
A reference of object type File i.e. File* interactionFile_
324 {
325 return interactionFile;
326 }

References interactionFile.

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

◆ getInteractionFile() [2/2]

const File & DPMBase::getInteractionFile ( ) const

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.
373 {
374 return interactionFile;
375 }

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.
1536 {
1537  Mdouble kineticEnergy = 0;
1538  for (const BaseParticle* const p : particleHandler)
1539  {
1540  if (!(p->isFixed()))
1541  {
1542  kineticEnergy += .5 * p->getMass() * p->getVelocity().getLengthSquared();
1543  }
1544  }
1545  return kineticEnergy;
1546 }

References p, and particleHandler.

Referenced by SilbertHstop::actionAfterTimeStep(), BaseCluster::actionsAfterSolve(), GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), RotatingDrumBidisperseInitialise::actionsAfterTimeStep(), BaseCluster::actionsAfterTimeStep(), DrumRot::actionsBeforeTimeStep(), RotatingDrum::actionsBeforeTimeStep(), T_protectiveWall::continueSolve(), ClosedCSCWalls::continueSolve(), CSCInit::continueSolve(), CSCWalls::continueSolve(), InitialBed::continueSolve(), RotatingDrumBidisperseInitialise::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(), InitialBed::printTime(), LaserOnLayer::printTime(), RotatingDrumBidisperseInitialise::printTime(), SingleParticleSegregation::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).
5469 {
5470  Matrix3D F; //set the kinetic energy tensor, this is in terms of Sum(m*v^2)
5471  Vec3D J; //set the momentum tensor
5472 
5473  //calculate stress for kinetic part
5474  for (const auto& p : particleHandler)
5475  {
5476  F += Matrix3D::dyadic(p->getVelocity(), p->getVelocity()) * p->getMass();
5477  J += p->getVelocity() * p->getMass();
5478  }
5479 
5480  Matrix3D stressKinetic = F - Matrix3D::dyadic(J, J) / getTotalMass();
5481  stressKinetic /= getTotalVolume();
5482  return stressKinetic;
5483 }
JacobiRotation< float > J
Definition: Jacobi_makeJacobi.cpp:3
Mdouble getTotalVolume() const
Get the total volume of the cuboid system.
Definition: DPMBase.cc:5459
Mdouble getTotalMass() const
JMFT: Return the total mass of the system, excluding fixed particles.
Definition: DPMBase.cc:1587
Implementation of a 3D matrix.
Definition: Kernel/Math/Matrix.h:17
static Matrix3D dyadic(const Vec3D &a, const Vec3D &b)
Calculates the dyadic product of a two Vec3D: .
Definition: Matrix.cc:302
@ F
Definition: octree.h:74

References Matrix3D::dyadic(), oomph::OcTreeNames::F, getTotalMass(), getTotalVolume(), J, p, and particleHandler.

Referenced by getTotalStress().

◆ getMax()

Vec3D DPMBase::getMax ( ) const
inline

Returns the maximum coordinates of the problem domain.

660  { return max_; }

References max_.

Referenced by BaseWall::addParticlesAtWall(), ClosedCSCWalls::ClosedCSCWalls(), commandLineCG(), InfiniteWall::createVTK(), CSCWalls::CSCWalls(), SubcriticalMaserBoundaryTEST::extendBottom(), fillDomainWithParticles(), MembraneDemo::fixMembraneEdges(), MembraneSelfTest::fixMembraneEdges(), CGExactOverlapUnitTest::getVolume(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), main(), FileReader::read(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), InitialBed::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

Returns the minimum coordinates of the problem domain.

654  { return min_; }

References min_.

Referenced by BaseWall::addParticlesAtWall(), ClosedCSCWalls::ClosedCSCWalls(), commandLineCG(), InfiniteWall::createVTK(), CSCWalls::CSCWalls(), SubcriticalMaserBoundaryTEST::extendBottom(), fillDomainWithParticles(), MembraneDemo::fixMembraneEdges(), MembraneSelfTest::fixMembraneEdges(), CGExactOverlapUnitTest::getVolume(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), main(), FileReader::read(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), Domain::setBounds(), Domain::setRange(), Drum::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Binary::setupInitialConditions(), my_problem::setupInitialConditions(), InsertionBoundaryMPI2Test::setupInitialConditions(), FreeCooling2DinWalls::setupInitialConditions(), StressStrainControl::setupInitialConditions(), Cstatic2d::setupInitialConditions(), InitialBed::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()

const std::string & DPMBase::getName ( ) const

Returns the name of the file. Does not allow to change it though.

378 {
379 return name_;
380 }

References name_.

Referenced by ShearStage::actionsAfterSolve(), OneParticleHeatingSelfTest::actionsAfterTimeStep(), OneParticleCoolingSelfTest::actionsAfterTimeStep(), SingleParticleSegregation::actionsAfterTimeStep(), ThermalConductionSelfTest::actionsBeforeTimeStep(), BaseCluster::actionsOnRestart(), checkSettings(), commandLineCG(), DPMBase(), statistics_while_running< T >::finishStatistics(), WallDetailsVTKWriter::generateFileName(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), initialiseSolve(), LaserOnLayer::LaserOnLayer(), main(), BaseCluster::makeAmatFile(), BaseCluster::makeCdatFile(), BaseCluster::makeGnuplotFile(), BaseCluster::makeIntenalStructureFile(), BaseCluster::makeOverlFile(), readNextArgument(), Mercury3DRestart::readNextArgument(), removeOldFiles(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), vibratedBed::run(), save(), SaveCountUnitTest::SaveCountUnitTest(), ClosedCSCStats::setupInitialConditions(), CSCStats::setupInitialConditions(), AirySavageHutter::setupInitialConditions(), CFDDEMCoupleTest::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), MovingWalls::setupInitialConditions(), Chute::setupInitialConditions(), ShearStage::ShearStage(), statistics_while_running< T >::statistics_while_running(), Mercury3DRestart::writeOutputFiles(), Calibration::writePSDToFile(), writePythonFileForVTKVisualisation(), GranuDrum::writeResults(), GranuHeap::writeResults(), RotatingDrumBidisperse::writeResults(), HorizontalMixer::writeScript(), ChutePeriodic::writeToLocalFolder(), and ChuteWithPeriodicInflow::writeXBallsScript().

◆ getNextTime()

Mdouble DPMBase::getNextTime ( ) const

Returns the current simulation time.

Returns
time_
808 {
809 return time_ + timeStep_;
810 }

References time_, and timeStep_.

◆ 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
856 {
857 return nToWrite_;
858 }

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 coordinates of the parallel mesh
5370 {
5371  return numberOfDomains_;
5372 }

References numberOfDomains_.

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

◆ getNumberOfOMPThreads()

int DPMBase::getNumberOfOMPThreads ( ) const

Returns the number of omp threads.

1278 {
1279  //logger.assert_debug(numberOfOMPThreads_,"You need to set the number of OMP threads");
1280  return numberOfOMPThreads_;
1281 }

References numberOfOMPThreads_.

Referenced by SphericalIndenter::actionsBeforeTimeStep(), 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).
1459 {
1460  return particleDimensions_;
1461 }

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
977 {
978 return writeParticlesVTK_;
979 }

References writeParticlesVTK_.

Referenced by initialiseVTK(), writePythonFileForVTKVisualisation(), and writeVTKFiles().

◆ getRestarted()

bool DPMBase::getRestarted ( ) const

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

Returns
restarted_
1485 {
1486  return restarted_;
1487 }

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)
308 {
309 return restartFile;
310 }

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)
357 {
358 return restartFile;
359 }

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_
1467 {
1468  return restartVersion_;
1469 }

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.
555  { return rotation_; }

References rotation_.

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

◆ getRotationalEnergy()

Mdouble DPMBase::getRotationalEnergy ( ) const

Returns the global rotational energy stored in the system.

1568 {
1569  Mdouble kineticEnergy = 0;
1570  for (const BaseParticle* const p : particleHandler)
1571  {
1572  if (!(p->isFixed()))
1573  {
1574  kineticEnergy += .5 * Vec3D::dot(p->getAngularVelocity(), p->getInertia() * p->getAngularVelocity());
1575  }
1576  }
1577  return kineticEnergy;
1578 }

References Vec3D::dot(), p, 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.
609 {
610 return runNumber_;
611 }

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)
316 {
317 return statFile;
318 }

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)
365 {
366 return statFile;
367 }

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).
5491 {
5492  //stress components calculation variables
5493  Matrix3D stressStatic;
5494 
5495  //calculate the static stress tensor based on all the interactions
5496  for (const auto i : interactionHandler)
5497  {
5498  stressStatic += Matrix3D::dyadic(i->getForce(), i->getNormal()) * i->getDistance();
5499  }
5500 
5501  stressStatic /= getTotalVolume();
5502  return stressStatic;
5503 }

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

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

◆ getSuperquadricParticlesWriteVTK()

bool DPMBase::getSuperquadricParticlesWriteVTK ( ) const
Returns
bool
985 {
987 }

References writeSuperquadricParticlesVTK_.

Referenced by initialiseVTK(), and 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.)
1422 {
1423  return systemDimensions_;
1424 }

References systemDimensions_.

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

◆ getTime()

Mdouble DPMBase::getTime ( ) const

Returns the current simulation time.

Returns
time_
800 {
801 return time_;
802 }

References time_.

Referenced by SilbertHstop::actionAfterTimeStep(), GranuHeap::actionsAfterTimeStep(), ShearStage::actionsAfterTimeStep(), ChangingTOIParticle::actionsAfterTimeStep(), MaserRepeatedOutInMPI2Test::actionsAfterTimeStep(), FreeCooling2DinWallsDemo::actionsAfterTimeStep(), FreeCooling3DDemoProblem::actionsAfterTimeStep(), FreeCooling3DinWallsDemo::actionsAfterTimeStep(), FreeCoolingDemoProblem::actionsAfterTimeStep(), HourGlass::actionsAfterTimeStep(), MinimalExampleDrum::actionsAfterTimeStep(), OneParticleHeatingSelfTest::actionsAfterTimeStep(), OneParticleCoolingSelfTest::actionsAfterTimeStep(), Chutebelt::actionsAfterTimeStep(), SingleParticleSegregation::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(), MeltableForceLaw2SelfTest::actionsBeforeTimeStep(), MeltableForceLawSelfTest::actionsBeforeTimeStep(), ThermalConductionSelfTest::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(), PrintWallTimeMixin::deadReckoningEstimateRemainingWallTime(), BaseCluster::decreaseForce(), PrintWallTimeMixin::estimateRemainingWallTime(), 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(), CFDDEMCoupleTest::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(), InitialBed::printTime(), LaserOnLayer::printTime(), MeltableForceLaw2SelfTest::printTime(), MeltableForceLawSelfTest::printTime(), OneParticleHeatingSelfTest::printTime(), OneParticleCoolingSelfTest::printTime(), ThermalConductionSelfTest::printTime(), RotatingDrumBidisperseInitialise::printTime(), RotatingDrumBidisperse::printTime(), SingleParticleSegregation::printTime(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::printTime(), ConstantMassFlowMaserSelfTest::printTime(), CubeDeletionBoundarySelfTest::printTime(), DeletionBoundarySelfTest::printTime(), DistributionPhiNormalSelfTest::printTime(), DistributionSelfTest::printTime(), DistributionToPSDSelfTest::printTime(), InsertionBoundarySelfTest::printTime(), MultiplePSDSelfTest::printTime(), NozzleSelfTest::printTime(), PolydisperseInsertionBoundarySelfTest::printTime(), PSDManualInsertionSelfTest::printTime(), LiquidMigrationSelfTest::printTime(), TwoParticleCollisionInteraction::printTime(), TwoParticleElasticCollisionInteraction::printTime(), InitialConditions< SpeciesType >::printTime(), SinterPair::printTime(), SphericalIndenter::printTime(), DPM::printTime(), protectiveWall::printTime(), PSDSelfTest::printTime(), EvaporationAndHeatTest::printTime(), RandomClusterInsertionBoundarySelfTest::printTime(), HeatTransferUnitTest::printTime(), viscoElasticUnitTest::printTime(), MultiParticlesInsertion::printTime(), regimeForceUnitTest::printTime(), SetDistributionPhiNormalSelfTest::printTime(), BaseCluster::printTime(), Chute::printTime(), PrintWallTimeMixin::printTime(), PrintWallTimeMixin::PrintWallTimeMixin(), FileReader::read(), readNextDataFile(), readNextFStatFile(), BaseWall::renderWall(), CGHandler::restart(), statistics_while_running< T >::run(), CGFields::DisplacementField::setFields(), CGHandler::setPreviousEvaluationTimeToCurrentTime(), 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(), and HorizontalBaseScrew::writeVTK().

◆ getTimeMax()

Mdouble DPMBase::getTimeMax ( ) const

Returns the maximum simulation duration.

Returns
timeMax_
880 {
881 return timeMax_;
882 }

References timeMax_.

Referenced by AngleOfRepose::actionsBeforeTimeStep(), Slide::actionsBeforeTimeStep(), AirySavageHutter::actionsOnRestart(), ChutePeriodicDemo::ChutePeriodicDemo(), PrintWallTimeMixin::deadReckoningEstimateRemainingWallTime(), PrintWallTimeMixin::estimateRemainingWallTime(), ForceLawsMPI2Test::ForceLawsMPI2Test(), StatisticsVector< T >::getTimeMaxStat(), GranuDrum::GranuDrum(), LaserOnLayer::LaserOnLayer(), 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(), InitialBed::printTime(), LaserOnLayer::printTime(), RotatingDrumBidisperse::printTime(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::printTime(), ConstantMassFlowMaserSelfTest::printTime(), DistributionSelfTest::printTime(), DistributionToPSDSelfTest::printTime(), InsertionBoundarySelfTest::printTime(), MultiplePSDSelfTest::printTime(), NozzleSelfTest::printTime(), PolydisperseInsertionBoundarySelfTest::printTime(), PSDManualInsertionSelfTest::printTime(), SinterPair::printTime(), protectiveWall::printTime(), PSDSelfTest::printTime(), RandomClusterInsertionBoundarySelfTest::printTime(), MultiParticlesInsertion::printTime(), regimeForceUnitTest::printTime(), Chute::printTime(), PrintWallTimeMixin::printTime(), readNextArgument(), Mercury3DRestart::readNextArgument(), regimeForceUnitTest::regimeForceUnitTest(), RotatingDrumBidisperse::RotatingDrumBidisperse(), save(), ChutePeriodic::setup(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), MarbleRun::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), SingleParticle< SpeciesType >::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), HeatTransferUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), Slide::Slide(), solve(), 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.
1242 {
1243 return timeStep_;
1244 }

References timeStep_.

Referenced by ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), ClosedCSCWalls::actionsAfterTimeStep(), CFDDEMCoupleTest::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(), MeltableInteraction::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(), checkSettings(), ChutePeriodicDemo::ChutePeriodicDemo(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), FrictionInteraction::computeFrictionForce(), MindlinInteraction::computeFrictionForce(), MindlinRollingTorsionInteraction::computeFrictionForce(), ChuteWithPeriodicInflow::computeInternalForces(), SinterInteraction::computeNormalForce(), SinterLinInteraction::computeNormalForce(), HertzianSinterInteraction::computeSinterForce(), SlidingFrictionInteraction::computeSlidingSpring(), StressStrainControlBoundary::computeStrainRate(), 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(), LaserOnLayer::LaserOnLayer(), LeesEdwardsDemo::LeesEdwardsDemo(), main(), ChuteBottom::makeRoughBottom(), ParticleBeam::ParticleBeam(), ParticleCreation::ParticleCreation(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), BaseWall::renderWall(), Screw::rotate(), RotatingDrumBidisperse::RotatingDrumBidisperse(), 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(), CFDDEMCoupleTest::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MarbleRun::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), TwoParticleCollisionInteraction::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(), HeatTransferUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWall::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), Siegen::Siegen(), SilbertHstop::SilbertHstop(), SingleParticleSegregation::SingleParticleSegregation(), Slide::Slide(), TangentialSpringEnergyConservationUnitTest::TangentialSpringEnergyConservationUnitTest(), TimeDependentPeriodicBoundary3DSelfTest::TimeDependentPeriodicBoundary3DSelfTest(), TimeDependentPeriodicBoundaryTest::TimeDependentPeriodicBoundaryTest(), TriangulatedScrewSelfTest::TriangulatedScrewSelfTest(), TriangulatedStepSelfTest::TriangulatedStepSelfTest(), TriangulatedStepWallSelfTest::TriangulatedStepWallSelfTest(), TriangulatedWallSelfTest::TriangulatedWallSelfTest(), StressStrainControlBoundary::updateDomainSize(), and write().

◆ getTotalEnergy()

Mdouble DPMBase::getTotalEnergy ( ) const
1580  {
1582 }
Mdouble getRotationalEnergy() const
Returns the global rotational energy stored in the system.
Definition: DPMBase.cc:1567
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
Mdouble getGravitationalEnergy(Vec3D origin={0, 0, 0}) const
Returns the global gravitational potential energy stored relative to a user-defined origin in the sys...
Definition: DPMBase.cc:1552
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1521

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

◆ getTotalMass()

Mdouble DPMBase::getTotalMass ( ) const

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

Returns
double
1588 {
1589  /*
1590  double mass_sum = 0;
1591  for (std::vector<BaseParticle*>::const_iterator it = particleHandler.begin(); it != particleHandler.end(); ++it)
1592  if (!(*it)->isFixed())
1593  mass_sum += (*it)->getMass();
1594  return mass_sum;
1595  */
1596  return particleHandler.getMass();
1597 }
Mdouble getMass() const
Definition: ParticleHandler.cc:605

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
1614 {
1615  return particleHandler.getMomentum();
1616  /*
1617  Vec3D total_momentum = Vec3D(0,0,0);
1618  for (std::vector<BaseParticle*>::const_iterator it = particleHandler.begin(); it != particleHandler.end(); ++it)
1619  if (!(*it)->isFixed())
1620  total_momentum += (*it)->getMass() * (*it)->getVelocity();
1621  return total_momentum;
1622  */
1623 }
Vec3D getMomentum() const
Definition: ParticleHandler.cc:660

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).
5511 {
5512  return getKineticStress() + getStaticStress();
5513 }
Matrix3D getKineticStress() const
Calculate the kinetic stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5468
Matrix3D getStaticStress() const
Calculate the static stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5490

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.
5460 {
5461  return (getXMax() - getXMin()) * (getYMax() - getYMin()) * (getZMax() - getZMin());
5462 }

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

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

◆ getVtkWriter()

ParticleVtkWriter * DPMBase::getVtkWriter ( ) const
5384 {
5385  return vtkWriter_;
5386 }

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
965 {
966  logger(WARN, "DPMBase.getWallsWriteVTK() is deprecated! Use wallHandler.getWriteVTK() instead.");
967  return wallHandler.getWriteVTK();
968 }
FileType getWriteVTK() const
Returns whether walls are written in a VTK file.
Definition: WallHandler.cc:455

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

◆ getWallTime()

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

References clock_, and Time::getWallTime().

◆ getWallVTKWriter()

WallVTKWriter & DPMBase::getWallVTKWriter ( )

◆ getWritePythonFileForVTKVisualisation()

bool DPMBase::getWritePythonFileForVTKVisualisation ( ) const
5590 {
5592 }
bool forceWritePythonFileForVTKVisualisation_
Definition: DPMBase.h:1525

References forceWritePythonFileForVTKVisualisation_.

◆ getXBallsAdditionalArguments()

std::string DPMBase::getXBallsAdditionalArguments ( ) const

Returns the additional arguments for xballs.

Returns
xBallsAdditionalArguments_
1347 {
1349 }

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.
1302 {
1303  return xBallsColourMode_;
1304 }

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.
1364 {
1365  return xBallsScale_;
1366 }

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.
1322 {
1323  return xBallsVectorScale_;
1324 }

References xBallsVectorScale_.

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

◆ getXCenter()

Mdouble DPMBase::getXCenter ( ) const
inline
638  { return 0.5*(max_.X+min_.X); }
Mdouble X
the vector components
Definition: Kernel/Math/Vector.h:45

References max_, min_, and Vec3D::X.

Referenced by getCenter().

◆ getXMax()

Mdouble DPMBase::getXMax ( ) const
inline

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

611  { return max_.x(); }
Mdouble & x()
RW reference to X.
Definition: Kernel/Math/Vector.h:389

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(), CFDDEMCoupleTest::CalcPhiPAndFz(), 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(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LaserOnLayer::LaserOnLayer(), LawinenBox::LawinenBox(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), ChuteWithPeriodicInflow::loadPeriodicBox(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), RotatingDrumBidisperse::RotatingDrumBidisperse(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), CGFields::DisplacementField::setFields(), ChuteWithHopper::setHopperShift(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), ChangingTOIParticle::setupInitialConditions(), CFDDEMCoupleTest::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(), InitialBed::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), SingleParticleSegregation::setupInitialConditions(), DistributionPhiNormalSelfTest::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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::setupInitialConditions(), TwoParticleCollisionInteraction::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(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), Tutorial7::setupInitialConditions(), Tutorial8::setupInitialConditions(), Tutorial9::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::setupInitialConditions(), SinterForceUnitTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), setXMin(), Siegen::Siegen(), FlowFrontChute::stretch(), T_protectiveWall::T_protectiveWall(), StressStrainControlBoundary::updateDomainSize(), viscoElasticUnitTest::viscoElasticUnitTest(), write(), writeFstatHeader(), RotatingDrumBidisperse::writeResults(), 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.

604  { 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(), CFDDEMCoupleTest::CalcPhiPAndFz(), 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(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), CGFields::DisplacementField::setFields(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), ChangingTOIParticle::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(), InitialBed::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), SingleParticleSegregation::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), DistributionPhiNormalSelfTest::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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::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(), PSDSelfTest::setupInitialConditions(), MD_demo::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::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
641  { return 0.5*(max_.Y+min_.Y); }
Mdouble Y
Definition: Kernel/Math/Vector.h:45

References max_, min_, and Vec3D::Y.

Referenced by getCenter().

◆ getYMax()

Mdouble DPMBase::getYMax ( ) const
inline

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

623  { return max_.y(); }
Mdouble & y()
RW reference to Y.
Definition: Kernel/Math/Vector.h:401

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(), CFDDEMCoupleTest::CalcPhiPAndFz(), 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(), HorizontalMixer::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LawinenBox::LawinenBox(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), protectiveWall::protectiveWall(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), CGFields::DisplacementField::setFields(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), ChangingTOIParticle::setupInitialConditions(), CFDDEMCoupleTest::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(), InitialBed::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), DistributionPhiNormalSelfTest::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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::setupInitialConditions(), TwoParticleCollisionInteraction::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(), 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(), SetDistributionPhiNormalSelfTest::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.

617  { 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(), CFDDEMCoupleTest::CalcPhiPAndFz(), 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(), HorizontalMixer::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), main(), MercuryCGSelfTest::MercuryCGSelfTest(), outputXBallsData(), LiquidMigrationMPI2Test::outputXBallsData(), LiquidMigrationSelfTest::outputXBallsData(), SphericalIndenter::outputXBallsData(), ParticleCreation::ParticleCreation(), readParAndIniFiles(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), StressStrainControlBoundary::set(), CGFields::DisplacementField::setFields(), SphericalIndenter::setIndenterHeight(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), ChangingTOIParticle::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(), InitialBed::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), DistributionPhiNormalSelfTest::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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::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(), SetDistributionPhiNormalSelfTest::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
644  { return 0.5*(max_.Z+min_.Z); }
Mdouble Z
Definition: Kernel/Math/Vector.h:45

References max_, min_, and Vec3D::Z.

Referenced by getCenter().

◆ getZMax()

Mdouble DPMBase::getZMax ( ) const
inline

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

635  { return max_.z(); }
Mdouble & z()
RW reference to Z.
Definition: Kernel/Math/Vector.h:413

References max_, and Vec3D::z().

Referenced by SmoothChute::actionsBeforeTimeStep(), Chutebelt::actionsOnRestart(), StressStrainControlBoundary::activateStrainRateControl(), NautaMixer::addParticles(), NautaMixer::addParticlesAtWall(), CFDDEMCoupleTest::CalcPhiPAndFz(), 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(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), LaserOnLayer::LaserOnLayer(), 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(), CGFields::DisplacementField::setFields(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), ChangingTOIParticle::setupInitialConditions(), CFDDEMCoupleTest::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(), DistributionPhiNormalSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DPM::setupInitialConditions(), TwoParticleCollisionInteraction::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(), Tutorial2::setupInitialConditions(), Tutorial3::setupInitialConditions(), Tutorial4::setupInitialConditions(), Tutorial5::setupInitialConditions(), Tutorial6::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), FreeFall::setupInitialConditions(), MD_demo::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), SetDistributionPhiNormalSelfTest::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.

629  { 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(), 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(), CGFields::DisplacementField::setFields(), HorizontalMixer::setOuterWalls(), T_protectiveWall::setupInitialConditions(), LawinenBox::setupInitialConditions(), ClosedCSCWalls::setupInitialConditions(), CSCInit::setupInitialConditions(), CSCWalls::setupInitialConditions(), MercuryLogo::setupInitialConditions(), SmoothChute::setupInitialConditions(), ChangingTOIParticle::setupInitialConditions(), CFDDEMCoupleTest::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(), InitialBed::setupInitialConditions(), GetDistanceAndNormalForIntersectionOfWalls::setupInitialConditions(), GetDistanceAndNormalForScrew::setupInitialConditions(), GetDistanceAndNormalForTriangleWall::setupInitialConditions(), RotatingDrum::setupInitialConditions(), Chutebelt::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), DistributionPhiNormalSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), NewtonsCradleSelftest::setupInitialConditions(), NewtonsCradleSelfTest::setupInitialConditions(), ParticleCreation::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), DPM::setupInitialConditions(), TwoParticleCollisionInteraction::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(), PSDSelfTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), SetDistributionPhiNormalSelfTest::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

Handles 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.
5567 {
5568  for (auto w: wallHandler)
5569  {
5570  w->handleParticleAddition(id, p);
5571  }
5572 }

References p, w, and 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.
5552 {
5553  for (auto w: wallHandler)
5554  {
5555  w->handleParticleRemoval(id);
5556  }
5557 }

References w, and 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 overridden in its derived classes.

Reimplemented in MercuryBase.

1937 {
1938 }

Referenced by computeOneTimeStep().

◆ hGridActionsBeforeIntegration()

void DPMBase::hGridActionsBeforeIntegration ( )
protectedvirtual

This function has to be called before integrateBeforeForceComputation.

no implementation but can be overridden in its derived classes.

Reimplemented in MercuryBase.

1930 {
1931 }

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 overridden in its derived classes.

Reimplemented in MercuryBase.

1666 {
1667 }

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 overridden in its derived classes.

Reimplemented in MercuryBase.

1680 {
1681 }

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.

990  {};

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 overridden in its derived classes.

1687 {
1688 }

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

◆ hGridRemoveParticle()

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

no implementation but can be overridden in its derived classes.

1701 {
1702 }

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.
5034 {
5035  size_t nParticlesPreviouslyIn = particleHandler.getSize();
5036  for (auto k = particleH.begin(); k != particleH.end(); ++k) {
5037  auto p = particleHandler.copyAndAddObject( *k );
5038  p->setSpecies(species);
5039  }
5040 
5041  for (std::vector<BaseInteraction*>::const_iterator i = interactionH.begin(); i != interactionH.end(); ++i) {
5042  if ( (*i)->getP()->getInvMass() != 0.0 && (*i)->getI()->getInvMass() != 0.0 ) {
5044  j->importP(particleHandler.getObject(nParticlesPreviouslyIn + j->getP()->getIndex()));
5045  j->importI(particleHandler.getObject(nParticlesPreviouslyIn + j->getI()->getIndex()));
5046  j->setTimeStamp(getNumberOfTimeSteps());
5047  }
5048  }
5049 }
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:360
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:712

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

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

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

References out().

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.
4237  {
4238  logger(DEBUG, "Entered solve");
4239 #ifdef CONTACT_LIST_HGRID
4240  logger(INFO,"Using CONTACT_LIST_HGRID");
4241 #endif
4242 
4247  if (!getRestarted()) {
4248  // If the simulation is "new" (i.e. not restarted):
4249  // - set time, nTimeSteps to zero
4250  // - reset the file counter etc.
4251  // - decompose the domain based on XMin, XMax, ....
4252  // - run user-defined setupInitialConditions
4253  numberOfTimeSteps_ = 0;
4254  setTime(0.0);
4255  resetFileCounter();
4256  decompose();
4257  // \todo tw there was a function combining the next two lines, why is it back to the old version?
4258  //setLastSavedTimeStep(NEVER); //reset the counter
4259  //this is to ensure that the interaction time stamps agree with the resetting of the time value
4260  for (auto &i: interactionHandler)
4261  i->setTimeStamp(0);
4263  logger(DEBUG, "Have created the particles initial conditions");
4264  } else {
4265  // If the simulation is "restarted" (i.e. not restarted):
4266 
4267  // - run wall-defined actionsOnRestart
4268  for (auto w: wallHandler) {
4269  w->actionsOnRestart();
4270  }
4271 
4272  // - run user-defined actionsOnRestart
4273  actionsOnRestart();
4274  }
4275 
4276  // Check that the code has been correctly set up,
4277  // i.e. system dimensions, particles and time steps are sensibly implemented
4278  checkSettings();
4279 
4280  // If the simulation is "new" and the runNumber is used, append the run number to the problem name
4281  if (getRunNumber() > 0 && !getRestarted()) {
4282  std::stringstream name;
4283  name << getName() << "." << getRunNumber();
4284  setName(name.str());
4285  }
4286 
4287  //If append is true, files are appended, not overwritten
4288  if (getAppend()) {
4289  setOpenMode(std::fstream::out | std::fstream::app);
4290  //Restart files should always be overwritten.
4292  } else {
4294  }
4295 
4296  initialiseVTK();
4297 
4298  //sets the hgrid, writes headers to the .stat output file
4300 
4301  if (getInteractionFile().getFileType() == FileType::ONE_FILE) {
4302  logger(WARN, "Warning: interaction file will take up a lot of disk space!");
4304  }
4305 
4306  // Sets the mass of all particle.
4310 
4311  // Other initialisations
4312  //max_radius = getLargestParticle()->getRadius();
4313 
4317 
4318  if (!getRestarted())
4319  {
4320  // Performs a first force computation
4322 
4323  logger(DEBUG, "about to call performGhostParticleUpdate()");
4325 
4327  computeAllForces();
4330  logger(DEBUG, "Have computed the initial values for the forces ");
4331  }
4332 }
@ ONE_FILE
all data will be written into/ read from a single file called name_
void boundaryActionsBeforeTimeLoop()
Definition: BoundaryHandler.cc:240
bool getAppend() const
Returns whether the "append" option is on or off.
Definition: DPMBase.cc:1501
void checkSettings()
Checks if the essentials are set properly to go ahead with solving the problem.
Definition: DPMBase.cc:4065
virtual void initialiseStatistics()
Definition: DPMBase.cc:1874
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DPMBase.cc:1987
void setOpenMode(std::fstream::openmode openMode)
Sets File::openMode_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:468
virtual void hGridActionsBeforeTimeLoop()
A virtual function that allows one to carry out hGrid operations before the start of the time loop.
Definition: DPMBase.cc:1665
File & getInteractionFile()
Return a reference to the file InteractionsFile.
Definition: DPMBase.cc:323
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:1672
void resetFileCounter()
Resets the file counter for each file i.e. for ene, data, fstat, restart, stat)
Definition: DPMBase.cc:449
void initialiseVTK() const
Generates the python file for vtk visualisation. Creates vtk output directories if needed.
Definition: DPMBase.cc:2116
virtual void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop.
Definition: DPMBase.cc:1658
virtual void decompose()
Sends particles from processorId to the root processor.
Definition: DPMBase.cc:4154
void setOpenMode(std::fstream::openmode openMode)
Allows the user to Sets File::openMode_.
Definition: File.cc:225
void computeAllMasses(unsigned int indSpecies)
Computes the mass for all BaseParticle of the given species in this ParticleHandler.
Definition: ParticleHandler.cc:1213
string name
Definition: plotDoE.py:33

References InteractionHandler::actionsAfterTimeStep(), actionsBeforeTimeLoop(), actionsOnRestart(), BoundaryHandler::boundaryActionsBeforeTimeLoop(), boundaryHandler, checkAndDuplicatePeriodicParticles(), checkSettings(), computeAllForces(), ParticleHandler::computeAllMasses(), DEBUG, decompose(), getAppend(), getInteractionFile(), getName(), getRestarted(), getRunNumber(), hGridActionsBeforeTimeLoop(), hGridActionsBeforeTimeStep(), i, INFO, initialiseStatistics(), initialiseVTK(), interactionHandler, logger, plotDoE::name, numberOfTimeSteps_, ONE_FILE, File::open(), out(), particleHandler, performGhostParticleUpdate(), removeDuplicatePeriodicParticles(), resetFileCounter(), restartFile, setName(), setOpenMode(), File::setOpenMode(), setTime(), setupInitialConditions(), w, 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 >.

1875 {
1877 }
void initialise()
Contains the code executed before the first time step.
Definition: CGHandler.cc:70

References cgHandler, and CGHandler::initialise().

Referenced by initialiseSolve().

◆ initialiseVTK()

void DPMBase::initialiseVTK ( ) const
private

Generates the python file for vtk visualisation. Creates vtk output directories if needed.

2117 {
2118  bool writePythonScript = false;
2119 
2122  writePythonScript = true;
2123  }
2124 
2127  writePythonScript = true;
2128  }
2129 
2132  writePythonScript = true;
2133  }
2134 
2135  if (boundaryHandler.getWriteVTK()) {
2137  writePythonScript = true;
2138  }
2139 
2142  writePythonScript = true;
2143  }
2144 
2145  if (writePythonScript && forceWritePythonFileForVTKVisualisation_)
2146  {
2148  }
2149 }
const std::string & getOutputDirectory() const
Definition: BaseVTKWriter.h:57
bool getWriteVTK() const
Definition: BoundaryHandler.h:68
bool getParticlesWriteVTK() const
Returns whether particles are written in a VTK file.
Definition: DPMBase.cc:976
bool getSuperquadricParticlesWriteVTK() const
Definition: DPMBase.cc:984
void writePythonFileForVTKVisualisation() const
writes .py file for ParaView
Definition: DPMBase.cc:2186
FileType getWriteVTK() const
Definition: InteractionHandler.cc:539
bool getWriteDetailsVTKAny() const
Definition: WallHandler.cc:486
bool createDirectory(const std::string &directory, bool allowExists=false)
Creates a directory.
Definition: FileIOHelpers.cc:177

References boundaryHandler, boundaryVTKWriter_, helpers::createDirectory(), forceWritePythonFileForVTKVisualisation_, BaseVTKWriter< H >::getOutputDirectory(), getParticlesWriteVTK(), getSuperquadricParticlesWriteVTK(), WallHandler::getWriteDetailsVTKAny(), BoundaryHandler::getWriteVTK(), InteractionHandler::getWriteVTK(), WallHandler::getWriteVTK(), interactionHandler, interactionVTKWriter_, NO_FILE, vtkWriter_, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, and writePythonFileForVTKVisualisation().

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
1801 {
1802 #ifdef MERCURYDPM_USE_MPI
1803  //mpi particles only exist when there is more than one domain
1804  if (domainHandler.getSize() > 0)
1805  {
1806  //Add the particle to the mpi domain
1808  }
1809 
1810  //If periodic boundaries are present..
1811  if (periodicBoundaryHandler.getSize() > 0)
1812  {
1814  }
1815 #endif
1816 }
void addParticle(BaseParticle *particle)
Initialises a single particle which is added during the simulation.
Definition: Domain.cc:1589
void addNewParticle(BaseParticle *particle)
Adds a new particle to the periodic list.
Definition: PeriodicBoundaryHandler.cc:311

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.

3345 {
3346  //cycling through all particles, p, in the particleHandler
3347  //for_each(particleHandler.begin(), particleHandler.end(), [this](BaseParticle* p){
3348  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3349  for (int k = 0; k < particleHandler.getSize(); ++k) {
3351 #ifdef MERCURYDPM_USE_MPI
3352  //MPI particles do not require integration - they are updated by the communication step
3353  if (!(p->isMPIParticle() || p->isPeriodicGhostParticle()))
3354  {
3355  p->integrateAfterForceComputation(getTime(), getTimeStep());
3356  }
3357 #else
3358  //using the particle p's internal "integrateAfterForceComputation" function
3359  //to update the relevant parameters concerning the particle's position and motion
3360  p->integrateAfterForceComputation(getTime(), getTimeStep());
3361 #endif
3362  }
3363  //});
3364  //cycling through all walls, w, in the wallHandler
3365  //for_each(wallHandler.begin(), wallHandler.end(), [this](BaseWall* w){
3366  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3367  for (int k = 0; k < wallHandler.getSize(); k++) {
3369  //using the wall's internal "integrateAfterForceComputation" function
3370  //to update the relevant parameters concerning its position and motion
3371  w->integrateAfterForceComputation(getTime(), getTimeStep());
3372  }
3373  //});
3374 }
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:799

References BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getTime(), getTimeStep(), k, p, particleHandler, w, 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.

3259 {
3260  //cycling through all particles, p, in the particleHandler
3261  //for_each(particleHandler.begin(), particleHandler.end(), [this](BaseParticle* p)
3262  //for (BaseParticle* p : particleHandler) {
3263 
3264  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3265  for (int k = 0; k < particleHandler.getSize(); ++k) {
3267 #ifdef MERCURYDPM_USE_MPI
3268  //MPI particles are not integrated, they are purely ghost particles and get their new velocity and position from an MPI update
3269  if (!(p->isMPIParticle() || p->isPeriodicGhostParticle()))
3270  {
3271  p->integrateBeforeForceComputation(getTime(), getTimeStep());
3272  }
3273 #else
3274  //using the particle p's internal "integrateBeforeForceComputation" function
3275  //to update the relevant parameters concerning the particle's position and motion
3276  p->integrateBeforeForceComputation(getTime(), getTimeStep());
3277 #endif
3278  }
3279  //});
3280  //cycling through all walls, w, in the wallHandler
3281  //for_each(wallHandler.begin(), wallHandler.end(), [this](BaseWall* w)
3282  //for (BaseWall* w : wallHandler) {
3283  #pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
3284  for (int k = 0; k < wallHandler.getSize(); k++) {
3286  //using the wall's internal "integrateBeforeForceComputation" function
3287  //to update the relevant parameters concerning its position and motion
3288  w->integrateBeforeForceComputation(getTime(), getTimeStep());
3289  }
3290  //});
3291 }

References BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getTime(), getTimeStep(), k, p, particleHandler, w, 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.
5293 {
5294  return getTime() <= time && getTime() + getTimeStep() > time;
5295 }

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
767 {
768 //defines an (empty) stringstream named "com"
769 std::stringstream com("");
770 //adds the name of the code to run (fed in as an argument)
771 //to the "com" string and appends the string with " &"
772 com << name << " &";
773 //converts the stringstream "com" to a standard string, and then
774 //converts this string to a C string
775 //the string is then fed to the "system" function, which will run the named command
776 return system(com.str().c_str());
777 }

References plotDoE::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
1722 {
1723 #ifdef MERCURYDPM_USE_MPI
1724  //If only one core is used (i.e. domainHandler is empty) then the result is always true
1725  if (domainHandler.getSize() == 0)
1726  {
1727  return true;
1728  }
1729  //Get the current domain
1731 
1732  //Check if the particle is in the current domain
1733  if(domain->containsParticle(P))
1734  {
1735  //When adding a particle inside the domain, this should always be true
1736  return true;
1737  }
1738  else
1739  {
1740  //MPI particles that are inserted in the communication zone should still be inserted
1741  return (P->isMPIParticle());
1742  }
1743 #else
1744  return false;
1745 #endif
1746 }
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:77

References domain, 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)
1754 {
1755 
1756  bool insideCommunicationZone = false;
1757 #ifdef MERCURYDPM_USE_MPI
1758  MPIContainer& communicator = MPIContainer::Instance();
1759 
1760  //Check for the current domain if the particle is within the communication domain
1762 
1763  //The root gathers all results
1764  int *list = nullptr;
1765  if (PROCESSOR_ID == 0)
1766  {
1767  list = new int [NUMBER_OF_PROCESSORS];
1768  }
1769  communicator.gather(val,list);
1770 
1771  //Compute the global value
1772  //if on any processor the val is true, we have to do the communcation step
1774  int result = 0;
1775  if (PROCESSOR_ID == 0)
1776  {
1777  for (int i = 0; i< NUMBER_OF_PROCESSORS; i++)
1778  {
1779  if (list[i] == 1)
1780  {
1781  result = 1;
1782  break;
1783  }
1784  }
1785  }
1786 
1787  //The root now tells the other processors what the global value for the interaction is
1788  communicator.broadcast(result);
1789 
1790  //Convert the result back to bool
1791  insideCommunicationZone = result;
1792 #endif
1793  return insideCommunicationZone;
1794 }
bool isInCommunicationZone(BaseParticle *particle)
Check if the particle is in the communication zone of the current domain.
Definition: Domain.cc:420
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:109
val
Definition: calibrate.py:119

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

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

5273 {
5274  logger(INFO, "Interactions currently in the handler:\n", Flusher::NO_FLUSH);
5275  //looping over all individual objects in the interactionHandler
5277  {
5278  p->write(std::cout);
5279  logger(INFO, "\nInteraction % % between % and %",
5280  p->getName(), p->getId(), p->getP()->getId(), p->getI()->getId());
5281  }
5282 }

References INFO, interactionHandler, logger, NO_FLUSH, and p.

◆ outputStatistics()

void DPMBase::outputStatistics ( )
protectedvirtual

This function is overridden by StatisticsVector

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

1883 {
1884  //cgHandler.evaluate();
1885 }

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

2380 {
2381 
2382 
2383  //Set the correct formation based of dimension if the formation is not specified by the user
2384 
2385  unsigned int format=0;
2386  switch (getSystemDimensions())
2387  {
2388  case 2:
2389  format = 8;
2390  break;
2391  case 3:
2392  format = 14;
2393  break;
2394  default:
2395  logger(ERROR, "Unknown system dimension");
2396  }
2397 
2398  unsigned int numberOfParticles = particleHandler.getNumberOfRealObjectsLocal();
2399 
2400  // This outputs the location of walls and how many particles there are to file this is required by the xballs plotting
2401  if (format != 14) // dim = 1 or 2
2402  {
2403  os << numberOfParticles
2404  << " " << getTime()
2405  << " " << getXMin()
2406  << " " << getYMin()
2407  << " " << getXMax()
2408  << " " << getYMax()
2409  << " " << std::endl;
2410  }
2411  else
2412  {
2413  //dim==3
2414  os << numberOfParticles
2415  << " " << getTime()
2416  << " " << getXMin()
2417  << " " << getYMin()
2418  << " " << getZMin()
2419  << " " << getXMax()
2420  << " " << getYMax()
2421  << " " << getZMax()
2422  << " " << std::endl;
2423  }
2424 
2425  // This outputs the particle data
2426  for (unsigned int i = 0; i < particleHandler.getSize(); i++)
2427  {
2428 #ifdef MERCURYDPM_USE_MPI
2430  {
2432  }
2433 #else
2435 #endif
2436  }
2437 #ifdef DEBUG_OUTPUT
2438  logger(DEBUG, "Have output the properties of the problem to disk ");
2439 #endif
2440 }
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Definition: BaseParticle.cc:280
bool isMPIParticle() const
Indicates if this particle is a ghost in the MPI domain.
Definition: BaseParticle.cc:164
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:1421
unsigned int getNumberOfRealObjectsLocal() const
Returns the number of real objects on a local domain. MPI particles and periodic particles are neglec...
Definition: ParticleHandler.cc:1281
std::string format(const std::string &str, const std::vector< std::string > &find, const std::vector< std::string > &replace)
Definition: openglsupport.cpp:217

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

Referenced by CSCInit::save(), RotatingDrumBidisperseInitialise::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
5143 {
5144 #ifdef MERCURYDPM_USE_MPI
5145  //MPIContainer& communicator = MPIContainer::Instance();
5146  if (NUMBER_OF_PROCESSORS == 1) {return;}
5147 
5148  //Update the postion and velocity data of ghosts and perform some bookkeeping
5149  std::set<BaseParticle*> particlesToBeDeleted;
5150  domainHandler.updateStatus(particlesToBeDeleted);
5151  periodicBoundaryHandler.updateStatus(particlesToBeDeleted);
5152 
5153  //Delete particles
5154  deleteGhostParticles(particlesToBeDeleted);
5155 
5156  //Add new particles
5159 #endif
5160 }
void deleteGhostParticles(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DPMBase.cc:5165
void addNewParticles()
Definition: DomainHandler.cc:407
void updateStatus(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DomainHandler.cc:397
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates the positions/velocity of ghost particles and accordingly the status of these particles.
Definition: PeriodicBoundaryHandler.cc:129
void addNewParticles()
Adds new particles to the periodic particle lists.
Definition: PeriodicBoundaryHandler.cc:278

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

Referenced by computeOneTimeStep(), and initialiseSolve().

◆ performGhostVelocityUpdate()

void DPMBase::performGhostVelocityUpdate ( )
protected

updates the final time-step velocity of the ghost particles

5208 {
5209 #ifdef MERCURYDPM_USE_MPI
5210  if (NUMBER_OF_PROCESSORS == 1) {return;}
5211  // \todo If required, I can implement this for periodic particles, first discuss with Thomas if it is actually requiredf
5212  //periodicDomainHandler.updateVelocity()
5213  //domainHandler.updateVelocity();
5214 #endif
5215 }

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 PrintWallTimeMixin, Chute, BaseCluster, TangentialSpringEnergyConservationUnitTest, PSDSelfTest, SpeciesTest, SetDistributionPhiNormalSelfTest, regimeForceUnitTest, RandomClusterInsertionBoundarySelfTest, PeriodicWallsWithSlidingFrictionUnitTest, MultiParticlesInsertion, LiquidMigrationPeriodicBoundaryInteraction, viscoElasticUnitTest, LongHertzianSinterForceUnitTest, HeatTransferUnitTest, RandomClusterInsertionBoundarySelfTest, EvaporationAndHeatTest, PSDSelfTest, protectiveWall, DPM, SphericalIndenter, SinterPair, Sintering, InitialConditions< SpeciesType >, SingleParticle< SpeciesType >, TwoParticleElasticCollisionInteraction, TwoParticleCollisionInteraction, LiquidMigrationSelfTest, PSDSelfTest, PSDManualInsertionSelfTest, PolydisperseInsertionBoundarySelfTest, NozzleSelfTest, MultiplePSDSelfTest, InsertionBoundarySelfTest, DistributionToPSDSelfTest, DistributionSelfTest, DistributionPhiNormalSelfTest, DeletionBoundarySelfTest, CubeDeletionBoundarySelfTest, ConstantMassFlowMaserSelfTest, ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest, SingleParticleSegregation, RotatingDrumBidisperse, RotatingDrumBidisperseInitialise, Silo, Penetration, Drum, ThermalConductionSelfTest, OneParticleCoolingSelfTest, OneParticleHeatingSelfTest, MeltableForceLawSelfTest, MeltableForceLaw2SelfTest, LaserOnLayer, InitialBed, vibratedBed, statistics_while_running< T >, SilbertPeriodic, CLiveStatistics< T >, SilbertPeriodic, SilbertPeriodic, statistics_while_running< T >, statistics_while_running< T >, ParticleBeam, ParticleInclusion, LiquidMigrationMPI2Test, ForceLawsMPI2Test, VerticalMixer, NozzleDemo, RotatingDrumWet, Drum, NozzleDemo, HorizontalMixer, CFDDEMCoupleTest, 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.

1960 {
1961 #ifdef MERCURYDPM_USE_MPI
1962  MPIContainer& communicator = MPIContainer::Instance();
1963  if (communicator.getProcessorID() != 0)
1964  {
1965  return;
1966  }
1967 
1968 #endif
1969  logger(INFO, "t=%3.6, tmax=%3.6", getTime(), getTimeMax());
1970 }
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:879
std::size_t getProcessorID()
Reduces a scalar on all processors to one scalar on a target processor.
Definition: MpiContainer.cc:92

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

1908 {
1909 }

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

3735 {
3736 #ifdef MERCURYDPM_USE_MPI
3737  int previousNumberOfProcessors;
3738 #endif
3739  //Declares...
3740  std::string dummy;
3741  //...and reads in a dummy variable from the start of the stream "is"
3742  is >> dummy;
3743  //compare the string read in to the phrase "restart_version" to see if the stream corresponds
3744  //to a restart file (all restart files begin with this phrase)
3745  //if both strings match, strcmp(dummy.c_str(), "restart_version") returns 0 (here read as "false")
3746  if (dummy != "restart_version" && dummy != "MercuryDPM")
3747  {
3748  //If the strings do not match, if statement is fulfilled and the error logged
3749  //Note: only very old files did not have a restart_version
3750  logger(FATAL, "Error in DPMBase::read(is): this is not a valid restart file");
3751  }
3752  else
3753  {
3754  //reads in the restart version (earlier versions of Mercury possess different file formats!)
3755  is >> restartVersion_;
3756  //checking which version the current data file corresponds to, and reads the data in
3757  //accordingly
3758  if (restartVersion_ == "1.0" || restartVersion_ == "0.14")
3759  {
3760  //reads in and saves the relevant values from the data file to the current instance of DPMBase
3761  std::stringstream line;
3762 
3763  // Store path (if restart file is nonlocal)
3764  auto slash = restartFile.getName().rfind('/');
3765  std::string path;
3766  if (slash != std::string::npos)
3767  {
3768  path = restartFile.getName().substr(0, slash + 1);
3769  }
3770  if (!path.empty())
3771  {
3772  logger(INFO, "Adding path information (%) to file names", path);
3773  }
3774 
3775  //line 1
3777  //discards the whitespace (ws) at the start of the stream
3778  line >> std::ws;
3779  //uses the "peek" function to access the stream's first
3780  //non-whitespace character, and check if it is an "r"
3781  if (line.peek() == 'r')
3782  //if so, reads in the current run number
3783  line >> dummy >> runNumber_;
3784  //In either case, then uses the "Files" version of the read function
3785  //to read in the rest of the relevant information.
3786  line >> dummy >> name_;
3787  setName(name_);
3788 
3789  //Read line 2-7 (definition of i/o files)
3791  line >> dummy >> dataFile;
3793  line >> dummy >> fStatFile;
3795  line >> dummy >> eneFile;
3797  line >> dummy >> restartFile;
3799  line >> dummy >> statFile;
3800 
3801  // Add the file path from the restart file to the file names
3802  dataFile.setName(path + dataFile.getName());
3803  fStatFile.setName(path + fStatFile.getName());
3804  eneFile.setName(path + eneFile.getName());
3806  statFile.setName(path + statFile.getName());
3807 
3808  // Get current position
3809  //check if the next line starts with 'interactionFile'; otherwise, skip interaction
3810  if (helpers::isNext(is, "interactionFile"))
3811  {
3813  line >> interactionFile;
3815  }
3816 
3818  line >> dummy >> min_.x()
3819  >> dummy >> max_.x()
3820  >> dummy >> min_.y()
3821  >> dummy >> max_.y()
3822  >> dummy >> min_.z()
3823  >> dummy >> max_.z();
3824 
3826  line >> dummy >> timeStep_
3827  >> dummy >> time_
3828  >> dummy >> numberOfTimeSteps_
3829  >> dummy >> timeMax_;
3830 
3832  line >> dummy >> systemDimensions_
3833  >> dummy >> particleDimensions_
3834  >> dummy >> gravity_
3835  >> dummy >> backgroundDrag_;
3836  line >> dummy;
3837  if (!dummy.compare("writeVTK"))
3838  {
3839  FileType writeInteractionsVTK = FileType::NO_FILE, writeWallsVTK;
3840  unsigned particlesCounter, wallCounter, interactionCounter, boundaryCounter;
3841  bool writeBoundaryVTK, writeParticlesVTK;
3842  line >> writeParticlesVTK >> writeWallsVTK >> writeInteractionsVTK >> writeBoundaryVTK >> particlesCounter >> wallCounter >> interactionCounter >> boundaryCounter;
3843  line.clear();//because the number of arguments in writeVTK has changed
3844  line >> dummy;
3845  setParticlesWriteVTK(writeParticlesVTK);
3846  wallHandler.setWriteVTK(writeWallsVTK);
3847  interactionHandler.setWriteVTK(writeInteractionsVTK);
3848  boundaryHandler.setWriteVTK(writeBoundaryVTK);
3849  vtkWriter_->setFileCounter(particlesCounter);
3850  wallVTKWriter_.setFileCounter(wallCounter);
3851  interactionVTKWriter_.setFileCounter(interactionCounter);
3852  boundaryVTKWriter_.setFileCounter(boundaryCounter);
3853  }
3854 
3855  if (!dummy.compare("writeWallDetailsVTK"))
3856  {
3857  // Example input: writeWallDetailsVTK 3 4 NO_FILE 12 ONE_FILE 25 MULTIPLE_FILES 101
3858  // Number of options is 3, each option having an enum value and file type (4 NO_FILE), (12 ONE_FILE) and
3859  // (25 MULTIPLE_FILES). At the end the file counter (101).
3860  unsigned numberOfOptions, fileCounter, enumType;
3861  FileType fileType;
3862  line >> numberOfOptions;
3863  for (unsigned i = 0; i < numberOfOptions; i++)
3864  {
3865  line >> enumType >> fileType;
3866  wallHandler.setWriteDetailsVTK(static_cast<WallHandler::DetailsVTKOptions>(enumType), fileType);
3867  }
3868  line >> fileCounter;
3870  line.clear();
3871  line >> dummy;
3872  }
3873 
3874  if (!dummy.compare("vtkOutDir")){
3875  std::string particlesDir, wallsDir, interactionsDir, boundariesDir, wallDetailsDir;
3876  line >> particlesDir >> wallsDir >> interactionsDir >> boundariesDir >> wallDetailsDir;
3877  if (vtkWriter_) vtkWriter_->setOutputDirectory(particlesDir);
3879  interactionVTKWriter_.setOutputDirectory(interactionsDir);
3880  boundaryVTKWriter_.setOutputDirectory(boundariesDir);
3881  wallDetailsVTKWriter_.setOutputDirectory(wallDetailsDir);
3882  line >> dummy;
3883  }
3884 
3885  if (!dummy.compare("random"))
3886  {
3887  random.read(line);
3888  line >> dummy;
3889  }
3890 
3891 #ifdef MERCURYDPM_USE_OMP
3892  //Read the number of OMP threads
3893  if (!dummy.compare("numberOfOMPThreads")) {
3894  int numberOfOMPThreads;
3895  line >> numberOfOMPThreads;
3896  setNumberOfOMPThreads(numberOfOMPThreads);
3897  //logger(INFO," Check the number of OMP threads = % ", getNumberOfOMPThreads());
3898  }
3899 #endif
3900 #ifdef MERCURYDPM_USE_MPI
3901  if (!dummy.compare("numberOfProcessors"))
3902  {
3903  line >> previousNumberOfProcessors
3904  >> dummy >> numberOfDomains_[Direction::XAXIS]
3907  }
3908  else
3909  {
3910  logger(INFO,"Reading a serial restart file");
3911  //numberOfDomains_ = {1,1,1};
3912  }
3913 #endif
3914  if (!dummy.compare("xBallsArguments")) {
3917  }
3918 
3919  speciesHandler.read(is);
3920 
3921 #ifdef MERCURYDPM_USE_MPI
3922  //Initialise MPI structures and perform domain decomposition
3923  decompose();
3924 #endif
3925 
3926  //reading in the various relevant handlers
3927  unsigned int N;
3928  is >> dummy >> N;
3929  if (dummy.compare("Walls"))
3930  logger(ERROR, "DPMBase::read(is): Error during restart: 'Walls' argument could not be found.");
3931  wallHandler.clear();
3934  for (unsigned int i = 0; i < N; i++)
3935  {
3938  }
3939 
3940  is >> dummy >> N;
3943  if (dummy.compare("Boundaries"))
3944  logger(ERROR, "DPMBase::read(is): Error during restart: 'Boundaries' argument could not be found.");
3946  for (unsigned int i = 0; i < N; i++)
3947  {
3950  }
3951 
3953 
3954  is >> dummy >> N;
3955  is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
3956  //display a message if a large amount o fparticles is read
3957  if (N>2.5e5) logger(INFO, "Reading % particles (may take a while)",N);
3958  logger.assert_always(dummy.compare("Particles")==0, "DPMBase::read(is): Error during restart: 'Particles' argument could not be found. %",dummy);
3961  for (unsigned int i = 0; i < N; i++)
3962  {
3963  //ParticleHandler::readAndCreateObject reads line-by-line
3965  //skip the remaining data in line
3966  is.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
3968  //particleHandler.getLastObject()->computeMass();
3969  }
3970 #ifdef MERCURYDPM_USE_MPI
3971  //Interaction distances of the domainHandler and periodicBoundaryHandler need to be set
3972  Mdouble interactionRadius = particleHandler.getLargestInteractionRadius();
3973  domainHandler.setInteractionDistance(2.0*interactionRadius);
3974  periodicBoundaryHandler.setInteractionDistance(2.0*interactionRadius);
3975 
3976  if (NUMBER_OF_PROCESSORS > 1)
3977  {
3978  //Create ghost particles
3981  }
3982 #endif
3983  //Add interactions to particles and ghost particles
3984  if (opt==ReadOptions::ReadNoInteractions) return;
3986  }
3987  //reading in for older versions of the Mercury restart file.
3988  else if (!restartVersion_.compare("3"))
3989  {
3990  logger(INFO, "DPMBase::read(is): restarting from an old restart file (restart_version %).",
3991  restartVersion_);
3992  readOld(is);
3993  }
3994  //returning an error if there is no restart file to read in due to the use of outdated files.
3995  else
3996  {
3997  //only very old files did not have a restart_version
3998  logger(FATAL,
3999  "Error in DPMBase::read(is): restart_version % cannot be read; use an older version of Mercury to upgrade the file",
4000  restartVersion_);
4001  }
4002  }
4003 }
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:19
@ FATAL
void read(std::istream &is)
Reads all objects from restart data.
Definition: BaseHandler.h:551
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:536
void setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:677
void setFileCounter(unsigned fileCounter)
Definition: BaseVTKWriter.h:41
void setOutputDirectory(const std::string &dir)
Definition: BaseVTKWriter.h:46
void readAndAddObject(std::istream &is) final
Reads BaseBoundary into the BoundaryHandler from restart data.
Definition: BoundaryHandler.cc:188
void setWriteVTK(bool writeVTK)
Definition: BoundaryHandler.h:66
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:4008
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1338
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:933
void setNumberOfOMPThreads(int numberOfOMPThreads)
Sets the number of omp threads.
Definition: DPMBase.cc:1248
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance of the domain handler.
Definition: DomainHandler.cc:277
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:176
void read(std::istream &is)
Definition: InteractionHandler.cc:434
void setWriteVTK(FileType f)
Definition: InteractionHandler.cc:529
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:971
void readAndAddObject(std::istream &is) override
Definition: ParticleHandler.cc:1092
Mdouble getLargestInteractionRadius() const
Returns the largest interaction radius.
Definition: ParticleHandler.cc:766
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance.
Definition: PeriodicBoundaryHandler.cc:106
void read(std::istream &is)
Definition: RNG.cc:38
void setWriteDetailsVTK(DetailsVTKOptions, FileType)
Definition: WallHandler.cc:460
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:277
DetailsVTKOptions
Definition: WallHandler.h:96
void setWriteVTK(FileType)
Sets whether walls are written into a VTK file.
Definition: WallHandler.cc:445
#define max(a, b)
Definition: datatypes.h:23
line
Definition: calibrate.py:103
bool isNext(std::istream &is, const std::string &name)
Checks if the next argument in the input stream equals a certain string. When true,...
Definition: StringHelpers.cc:57
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:41
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286

References DomainHandler::addNewParticles(), PeriodicBoundaryHandler::addNewParticles(), backgroundDrag_, boundaryHandler, boundaryVTKWriter_, BaseHandler< T >::clear(), ParticleHandler::clear(), dataFile, decompose(), domainHandler, eneFile, ERROR, FATAL, fStatFile, ParticleHandler::getLargestInteractionRadius(), helpers::getLineFromStringStream(), File::getName(), gravity_, i, INFO, interactionFile, interactionHandler, interactionVTKWriter_, helpers::isNext(), calibrate::line, logger, max, max_, min_, N, 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(), BaseVTKWriter< H >::setOutputDirectory(), setParticlesWriteVTK(), BaseHandler< T >::setStorageCapacity(), WallHandler::setWriteDetailsVTK(), BoundaryHandler::setWriteVTK(), InteractionHandler::setWriteVTK(), WallHandler::setWriteVTK(), setXBallsAdditionalArguments(), speciesHandler, statFile, oomph::Global_string_for_annotation::string(), 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)
4459 {
4460  bool isRead = true;
4461  // Cycles over every second element. (Most flags will contain both name labels and actual data.
4462  // Those that don't will have to do i--; some examples in readNextArgument.)
4463  for (int i = 1; i < argc; i += 2)
4464  {
4465  logger(INFO, "interpreting input argument %\n", argv[i], Flusher::NO_FLUSH);
4466  for (int j = i + 1; j < argc; j++)
4467  {
4468  //looks for the next string that starts with a minus sign
4469  //i.e. the next flag, as each flag may take 0, 1 , 2, 3... arguments
4470  //and we need to make sure all are read in!
4471  if (argv[j][0] == '-')
4472  break;
4473  logger(INFO, " %\n", argv[j], Flusher::NO_FLUSH);
4474  }
4475  logger(INFO, "");
4476  //if "isRead" is true and "readNextArgument" is also true...
4477  //(i.e. checking if any argument is false)
4478  isRead &= readNextArgument(i, argc, argv);
4479 
4480  // If the read was unsuccessful, raise an error and quit. (JMFT: Used to just be a warning.)
4481  if (!isRead)
4482  {
4483  logger(ERROR, "Warning: not all arguments read correctly!");
4484  }
4485  }
4486  return isRead;
4487 }
virtual bool readNextArgument(int &i, int argc, char *argv[])
Interprets the i^th command-line argument.
Definition: DPMBase.cc:4595

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

Referenced by FlowRule::run(), vibratedBed::run(), and solve().

◆ 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)
2458 {
2459  //default value: dataFile.getFullName()
2460  if (!fileName.compare(""))
2462 
2463  std::string oldFileName = dataFile.getName();
2464  unsigned oldCounter = dataFile.getCounter();
2465  //Updates the name of the data file to the user-input from the argument.
2467  //opens a filestream of the input type
2468  dataFile.open(std::fstream::in);
2469  //Checks if the file has been successfully opened...
2470  if (!dataFile.getFstream().is_open() || dataFile.getFstream().bad())
2471  {
2472  //...and if not, ends the function and returns "false"
2473  logger(WARN, "Loading data file % failed.", fileName);
2474  return false;
2475  }
2476 
2477  //retrieves and saves the "FileType" of the file
2478  FileType fileTypeData = dataFile.getFileType();
2481  dataFile.setFileType(fileTypeData);
2482  dataFile.close();
2483  dataFile.setName(oldFileName);
2484  dataFile.setCounter(oldCounter);
2485  return true;
2486 }
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:2711
const std::string getFullName() const
Also allows to access the file name, however with additional information which is the file counter,...
Definition: File.cc:148
void setCounter(unsigned int counter)
Allows the user to set the file counter according to his need. Sets File::counter_.
Definition: File.cc:209
string fileName
Definition: UniformPSDSelfTest.py:10

References File::close(), dataFile, UniformPSDSelfTest::fileName, format(), File::getCounter(), File::getFileType(), File::getFstream(), File::getFullName(), File::getName(), logger, ONE_FILE, File::open(), readNextDataFile(), File::setCounter(), File::setFileType(), File::setName(), oomph::Global_string_for_annotation::string(), 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.

4596 {
4597  // The argument argv[i] identifies the label of the flag, and subsequent arguments (usually 1)
4598  // contain the content.
4599  //
4600  // For example...
4601  // Checks if the "-name" flag has been passed
4602  // The strcmp returns 0 if "argv[i]" is "-name" (i.e. !strcmp(argv[i], "-name") --> 1)
4603  // In this case, the setName function is run with the relevant input (i.e. the value which
4604  // immediately follows the "-name" flag
4605  if (!strcmp(argv[i], "-name"))
4606  {
4607  setName(argv[i + 1]);
4608  }
4609  // The above process is repeated for all viable flags.
4610  else if (!strcmp(argv[i], "-xmin"))
4611  {
4612  setXMin(atof(argv[i + 1]));
4613  }
4614  else if (!strcmp(argv[i], "-ymin"))
4615  {
4616  setYMin(atof(argv[i + 1]));
4617  }
4618  else if (!strcmp(argv[i], "-zmin"))
4619  {
4620  setZMin(atof(argv[i + 1]));
4621  }
4622  else if (!strcmp(argv[i], "-xmax"))
4623  {
4624  setXMax(atof(argv[i + 1]));
4625  }
4626  else if (!strcmp(argv[i], "-ymax"))
4627  {
4628  setYMax(atof(argv[i + 1]));
4629  }
4630  else if (!strcmp(argv[i], "-zmax"))
4631  {
4632  setZMax(atof(argv[i + 1]));
4633  //} else if (!strcmp(argv[i],"-svn")) {
4634  // std::cout << "svn version " << SVN_VERSION << std::endl;
4635  // i--;
4636  }
4637  else if (!strcmp(argv[i], "-dt"))
4638  {
4639  Mdouble old = getTimeStep();
4640  setTimeStep(atof(argv[i + 1]));
4641  logger(INFO, " reset dt from % to %", old, getTimeStep());
4642  }
4643 // else if (!strcmp(argv[i], "-Hertz"))
4644 // {
4645 // speciesHandler.getObject(0)->setForceType(ForceType::HERTZ);
4646 // i--;
4647 // }
4648  else if (!strcmp(argv[i], "-tmax"))
4649  {
4650  Mdouble old = getTimeMax();
4651  setTimeMax(atof(argv[i + 1]));
4652  logger(INFO, " reset timeMax from % to %", old, getTimeMax());
4653  }
4654  else if (!strcmp(argv[i], "-saveCount"))
4655  {
4656  Mdouble old = dataFile.getSaveCount();
4657  setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4658  logger(INFO, " reset saveCount from & to %", old, dataFile.getSaveCount());
4659  }
4660  else if (!strcmp(argv[i], "-saveCountData"))
4661  {
4662  dataFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4663  }
4664  else if (!strcmp(argv[i], "-saveCountFStat"))
4665  {
4666  fStatFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4667  }
4668  else if (!strcmp(argv[i], "-saveCountStat"))
4669  {
4670  statFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4671  }
4672  else if (!strcmp(argv[i], "-saveCountEne"))
4673  {
4674  eneFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4675  }
4676  else if (!strcmp(argv[i], "-saveCountRestart"))
4677  {
4678  restartFile.setSaveCount(static_cast<unsigned int>(atoi(argv[i + 1])));
4679  }
4680  else if (!strcmp(argv[i], "-dim"))
4681  {
4682  setSystemDimensions(static_cast<unsigned int>(atoi(argv[i + 1])));
4683  }
4684  else if (!strcmp(argv[i], "-gravity"))
4685  {
4687  setGravity(Vec3D(atof(argv[i + 1]), atof(argv[i + 2]), atof(argv[i + 3])));
4688  i += 2;
4689  }
4690  else if (!strcmp(argv[i], "-fileType"))
4691  { //uses int input
4692  setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4693  }
4694  else if (!strcmp(argv[i], "-fileTypeFStat"))
4695  { //uses int input
4696  fStatFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4697  }
4698  else if (!strcmp(argv[i], "-fileTypeRestart"))
4699  {
4700  restartFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4701  }
4702  else if (!strcmp(argv[i], "-fileTypeData"))
4703  {
4704  dataFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4705  }
4706  else if (!strcmp(argv[i], "-fileTypeStat"))
4707  {
4708  statFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4709  }
4710  else if (!strcmp(argv[i], "-fileTypeEne"))
4711  {
4712  eneFile.setFileType(static_cast<FileType>(atoi(argv[i + 1])));
4713  }
4714  else if (!strcmp(argv[i], "-auto_number"))
4715  {
4716  autoNumber();
4717  i--;
4718  }
4719 // else if (!strcmp(argv[i], "-number_of_saves"))
4720 // {
4721 // set_number_of_saves_all(atof(argv[i + 1]));
4722 // }
4723  else if (!strcmp(argv[i], "-restart") || !strcmp(argv[i], "-r"))
4724  {
4729 
4730  //use default filename if no argument is given
4731  if (i + 1 >= argc || argv[i + 1][0] == '-')
4732  {
4733  i--;
4734  filename = getName();
4735  logger(INFO, "%", getName());
4736  }
4737  else
4738  {
4739  filename = argv[i + 1];
4740  }
4741 
4742  //add ".restart" if necessary
4743  if (filename.find(".restart") == std::string::npos)
4744  {
4745  filename = filename + ".restart";
4746  }
4747 
4749  }
4750  else if (!strcmp(argv[i], "-clean") || !strcmp(argv[i], "-c"))
4751  {
4752  logger(INFO, "Remove old %.* files", getName());
4753  removeOldFiles();
4754  i--;
4755  }
4756  else if (!strcmp(argv[i], "-data"))
4757  {
4758  std::string filename = argv[i + 1];
4760  }
4761  else if (!strcmp(argv[i], "-readSpeciesFromDataFile"))
4762  {
4763  readSpeciesFromDataFile_ = true;
4764  i--;
4765  logger(INFO, "Last column of data file will be interpreted as species index");
4766  }
4767 // else if (!strcmp(argv[i], "-k"))
4768 // {
4769 // Mdouble old = getSpecies(0)->getStiffness();
4770 // getSpecies(0)->setStiffness(atof(argv[i + 1]));
4771 // std::cout << " reset k from " << old << " to " << getSpecies(0)->getStiffness() << std::endl;
4772 // }
4773 // else if (!strcmp(argv[i], "-dissipation") || !strcmp(argv[i], "-disp"))
4774 // {
4775 // Mdouble old = getSpecies(0)->getDissipation();
4776 // getSpecies(0)->setDissipation(atof(argv[i + 1]));
4777 // std::cout << " reset getDissipation() from " << old << " to " << getSpecies(0)->getDissipation() << std::endl;
4778 // }
4779 // else if (!strcmp(argv[i], "-kt"))
4780 // {
4781 // Mdouble old = getSpecies(0)->getSlidingStiffness();
4782 // getSpecies(0)->setSlidingStiffness(atof(argv[i + 1]));
4783 // std::cout << " reset kt from " << old << " to " << getSpecies(0)->getSlidingStiffness() << std::endl;
4784 // }
4785 // else if (!strcmp(argv[i], "-dispt"))
4786 // {
4787 // Mdouble old = getSpecies(0)->getSlidingDissipation();
4788 // getSpecies(0)->setSlidingDissipation(atof(argv[i + 1]));
4789 // std::cout << " reset dispt from " << old << " to " << getSpecies(0)->getSlidingDissipation() << std::endl;
4790 // }
4791 // else if (!strcmp(argv[i], "-krolling"))
4792 // {
4793 // Mdouble old = getSpecies(0)->getRollingStiffness();
4794 // getSpecies(0)->setRollingStiffness(atof(argv[i + 1]));
4795 // std::cout << " reset krolling from " << old << " to " << getSpecies(0)->getRollingStiffness() << std::endl;
4796 // }
4797 // else if (!strcmp(argv[i], "-disprolling"))
4798 // {
4799 // Mdouble old = getSpecies(0)->getRollingDissipation();
4800 // getSpecies(0)->setRollingDissipation(atof(argv[i + 1]));
4801 // std::cout << " reset disprolling from " << old << " to " << getSpecies(0)->getRollingDissipation() << std::endl;
4802 // }
4803 // else if (!strcmp(argv[i], "-mu"))
4804 // {
4805 // Mdouble old = getSpecies(0)->getSlidingFrictionCoefficient();
4806 // getSpecies(0)->setSlidingFrictionCoefficient(atof(argv[i + 1]));
4807 // std::cout << " reset mu from " << old << " to " << getSpecies(0)->getSlidingFrictionCoefficient() << std::endl;
4808 // }
4809 // else if (!strcmp(argv[i], "-murolling"))
4810 // {
4811 // Mdouble old = getSpecies(0)->getRollingFrictionCoefficient();
4812 // getSpecies(0)->setRollingFrictionCoefficient(atof(argv[i + 1]));
4813 // std::cout << " reset murolling from " << old << " to " << getSpecies(0)->getRollingFrictionCoefficient() << std::endl;
4814 // }
4815  else if (!strcmp(argv[i], "-randomise") || !strcmp(argv[i], "-randomize"))
4816  {
4817  random.randomise();
4818  i--;
4819  }
4820 // else if (!strcmp(argv[i], "-k0"))
4821 // {
4822 // Mdouble old = speciesHandler.getObject(0)->getAdhesionStiffness();
4823 // speciesHandler.getObject(0)->setAdhesionStiffness(atof(argv[i + 1]));
4824 // std::cout << " reset k0 from " << old << " to " << speciesHandler.getObject(0)->getAdhesionStiffness() << std::endl;
4825 // }
4826 // else if (!strcmp(argv[i], "-f0"))
4827 // {
4828 // Mdouble old = speciesHandler.getObject(0)->getBondForceMax();
4829 // speciesHandler.getObject(0)->setBondForceMax(atof(argv[i + 1]));
4830 // std::cout << " reset f0 from " << old << " to " << speciesHandler.getObject(0)->getBondForceMax() << std::endl;
4831 // }
4832 // else if (!strcmp(argv[i], "-AdhesionForceType"))
4833 // {
4834 // AdhesionForceType old = speciesHandler.getObject(0)->getAdhesionForceType();
4835 // speciesHandler.getObject(0)->setAdhesionForceType(argv[i + 1]);
4836 // std::cout << " reset AdhesionForceType from "
4837 // << static_cast<signed char>(old) << " to "
4838 // << static_cast<signed char>(speciesHandler.getObject(0)->getAdhesionForceType()) << std::endl;
4839 // }
4840  else if (!strcmp(argv[i], "-append"))
4841  {
4842  setAppend(true);
4843  i--;
4844  }
4845  else if (!strcmp(argv[i], "-fixedParticles"))
4846  {
4847  setFixedParticles(static_cast<unsigned int>(atoi(argv[i + 1])));
4848  }
4849 // else if (!strcmp(argv[i], "-rho"))
4850 // {
4851 // Mdouble old = speciesHandler.getObject(0)->getDensity();
4852 // speciesHandler.getObject(0)->setDensity(atof(argv[i + 1]));
4853 // std::cout << " reset rho from " << old << " to " << speciesHandler.getObject(0)->getDensity() << std::endl;
4854 // }
4855 // else if (!strcmp(argv[i], "-dim_particle"))
4856 // {
4857 // setParticleDimensions(atoi(argv[i + 1]));
4858 // }
4859  else if (!strcmp(argv[i], "-counter"))
4860  {
4861  setRunNumber(atoi(argv[i + 1]));
4862  }
4863  else
4864  {
4865  //returns false if the flag passed does not match any of the currently used flags.
4866  return false;
4867  }
4868  //returns true if argv is found
4869  return true;
4870 }
void removeOldFiles() const
Definition: DPMBase.cc:4492
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1025
void setFixedParticles(unsigned int n)
Sets a number, n, of particles in the particleHandler as "fixed particles".
Definition: DPMBase.cc:1949
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:530
bool readDataFile(std::string fileName="", unsigned int format=0)
This allows particle data to be reloaded from data files.
Definition: DPMBase.cc:2457
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1182
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:437
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1049
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1001
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:3043
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:251
unsigned int getSaveCount() const
Gets File::saveCount_.
Definition: File.cc:233
void randomise()
sets the random variables such that they differ for each run
Definition: RNG.cc:78
string filename
Definition: MergeRestartFiles.py:39

References autoNumber(), dataFile, eneFile, MergeRestartFiles::filename, fStatFile, getName(), File::getSaveCount(), getTimeMax(), getTimeStep(), 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(), statFile, and oomph::Global_string_for_annotation::string().

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)
2712 {
2713  logger(VERBOSE, "Read data file %, t=%, Np=%, Nc=%", dataFile.getFullName(), getTime(), particleHandler.getSize(), interactionHandler.getNumberOfObjects());
2714 
2715  dataFile.open(std::fstream::in);
2716  //logger(INFO,"Reading %",dataFile.getFullName());
2717  //fStatFile.open();
2718  //Set the correct format based of dimension if the format is not explicitly specified by the user
2719  if (format == 0)
2720  {
2721  //checking the dimensionality of the system
2723  switch (getSystemDimensions())
2724  {
2725  case 1:
2726  //if 2D, sets format 8 (data file has 8 columns for 2D)
2727  case 2:
2728  format = 8;
2729  break;
2730  case 3:
2731  //if 3D, sets format 14 (data file has 14 columns for 3D)
2732  format = 14;
2733  break;
2734  }
2735  //end case
2736  }
2737  //end if
2738 
2739  // read in the particle number (as a double)
2740  double doubleN = -1;
2741  dataFile.getFstream() >> doubleN;
2742 
2743  // If N cannot be read, we reached the end of the file
2744  if (doubleN == -1) return false;
2745 
2746  // converting N to an integer; skipping the line if there is a problem (this happens when there is a corrupt data file)
2747  unsigned N = doubleN;
2748  while (doubleN != N) {
2749  std::string dummy;
2750  getline(dataFile.getFstream(),dummy,'\n');
2751  logger(WARN,"Skipping bad line in data file: % %",doubleN, dummy);
2752  dataFile.getFstream() >> doubleN;
2753  N = doubleN;
2754  }
2755  //store the parameters you want to preserve:
2756  const size_t nHistory = std::min(N,particleHandler.getSize());
2757  std::vector<const ParticleSpecies*> species(nHistory);
2758  std::vector<bool> fix(nHistory);
2759  std::vector<Vec3D> positionHistory(nHistory);
2760  for (size_t i=0; i<nHistory; ++i) {
2762  species[i] = p->getSpecies();
2763  fix[i] = p->isFixed();
2764  positionHistory[i] = p->getPosition();
2765  //store from reading the restart file which particles are fixed and which species each particle has
2766  }
2767 
2768  BaseParticle* p;
2769  if (particleHandler.getSize() == 0) {
2770  logger.assert_always(speciesHandler.getSize()>0,"readData: species needs to be set first");
2772  p->unfix();
2773  } else {
2774  p = particleHandler.getObject(0)->copy();
2775  }
2776 
2777  //empty the particle handler
2780 
2781  //now fill it again with the read-in particles
2782  std::stringstream line;
2784  Mdouble radius;
2785  Vec3D position, velocity, angle, angularVelocity;
2786  size_t indSpecies;
2787  //read all other data available for the time step
2788  if (format==7) {
2789  line >> time_ >> min_.x() >> min_.y() >> min_.z() >> max_.x() >> max_.y() >> max_.z();
2790  for (size_t i = 0; i < N; ++i) {
2792  line >> position.X >> position.Z >> position.Y >> velocity.X >> velocity.Z
2793  >> velocity.Y >> radius
2794  >> indSpecies;
2795  p->setPosition(position);
2796  p->setVelocity(velocity);
2797  p->setOrientation({1, 0, 0, 0});
2798  p->setAngularVelocity({0.0, 0.0, 0.0});
2799  p->setRadius(radius);
2801  p->setSpecies(speciesHandler.getObject(indSpecies));
2802  else if (i < nHistory)
2803  p->setSpecies(species[i]);
2804  if (i < nHistory && fix[i])
2805  p->fixParticle();
2806  if (i < nHistory)
2807  p->setPreviousPosition(positionHistory[i]);
2808  else
2809  p->setPreviousPosition(p->getPosition());
2811  p->unfix();
2812  }
2813  } else if (format==8) {
2814  line >> time_ >> min_.x() >> min_.y() >> max_.x() >> max_.y();
2815  min_.z() = 0.0; max_.z() = 0.0;//For 2d functions we define Z to be of no interest
2816  for (size_t i = 0; i < N; ++i) {
2818  line >> position.X >> position.Y >> velocity.X >> velocity.Y >> radius >> angle.Z >> angularVelocity.Z >> indSpecies;
2819  Quaternion q;
2820  q.setAngleZ(angle.Z);
2821  p->setPosition(position);
2822  p->setVelocity(velocity);
2823  p->setOrientation(q);
2824  p->setAngularVelocity(-angularVelocity);
2825  p->setRadius(radius);
2826  if (readSpeciesFromDataFile_) p->setSpecies(speciesHandler.getObject(indSpecies));
2827  else if (i < nHistory) p->setSpecies(species[i]);
2828  if (i < nHistory && fix[i]) p->fixParticle();
2829  if (i < nHistory) p->setPreviousPosition(positionHistory[i]);
2830  else p->setPreviousPosition(p->getPosition());
2832  p->unfix();
2833  } //end for all particles
2834  } else if (format==14) {
2835  //This is a 3D format_
2836  // \todo : Check bounds or get rid of this function
2837  line >> time_ >> min_.x() >> min_.y() >> min_.z() >> max_.x() >> max_.y() >> max_.z();
2838  for (size_t i = 0; i < N; ++i) {
2840  line >> position >> velocity >> radius >> angle >> angularVelocity >> indSpecies;
2841 #ifdef MERCURYDPM_USE_MPI
2842  //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
2843  bool isMPIParticle = false;
2844  bool isPeriodicGhostParticle = false;
2845  if (NUMBER_OF_PROCESSORS > 1)
2846  {
2848  line >> isMPIParticle >> isPeriodicGhostParticle;
2849  }
2850 #endif
2851  p->setPosition(position);
2852  p->setVelocity(velocity);
2853  p->setOrientationViaEuler(angle);
2854  p->setAngularVelocity(angularVelocity);
2855  p->setRadius(radius);
2857  if (indSpecies<speciesHandler.getSize()) {
2858  p->setSpecies(speciesHandler.getObject(indSpecies));
2859  } else {
2860  logger(WARN, "Read in bad species data; species is not set");
2861  }
2862  } else if (i < nHistory)
2863  p->setSpecies(species[i]);
2864  if (i < nHistory && fix[i])
2865  p->fixParticle();
2866  if (i < nHistory) p->setPreviousPosition(positionHistory[i]);
2867  else p->setPreviousPosition(p->getPosition());
2868 #ifdef MERCURYDPM_USE_MPI
2870  {
2871  p->setMPIParticle(isMPIParticle);
2872  p->setPeriodicGhostParticle(isPeriodicGhostParticle);
2873  }
2874 #endif
2876  p->unfix();
2877  } //end read into existing particles logger(INFO, "read % particles", particleHandler.getNumberOfObjects());
2878  } else if (format==15) {
2879  line >> time_ >> min_.x() >> min_.y() >> min_.z() >> max_.z() >> max_.y() >> max_.z();
2880  for (size_t i = 0; i < N; ++i) {
2882  line >> position >> velocity >> radius >> angle >> angularVelocity >> indSpecies >> indSpecies;
2883  Quaternion q;
2884  q.setEuler(angle);
2885  p->setPosition(position);
2886  p->setVelocity(velocity);
2887  p->setOrientation(q);
2888  p->setAngularVelocity(angularVelocity);
2889  p->setRadius(radius);
2890  if (readSpeciesFromDataFile_) p->setSpecies(speciesHandler.getObject(indSpecies));
2891  else if (i < nHistory) p->setSpecies(species[i]);
2892  if (i < nHistory && fix[i]) p->fixParticle();
2893  if (i < nHistory) p->setPreviousPosition(positionHistory[i]);
2894  else p->setPreviousPosition(p->getPosition());
2896  } //end for all particles
2897  } //end if format
2898 
2900  return true;
2901 }
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Kernel/Math/Quaternion.h:42
#define min(a, b)
Definition: datatypes.h:22
constexpr internal::FixedInt< N > fix
Definition: IntegralConstant.h:214
double velocity(const double &t)
Angular velocity as function of time t.
Definition: jeffery_orbit.cc:107
double angle(const double &t)
Angular position as a function of time t.
Definition: jeffery_orbit.cc:98
radius
Definition: UniformPSDSelfTest.py:15

References Jeffery_Solution::angle(), ParticleHandler::clear(), ParticleHandler::computeAllMasses(), BaseParticle::copy(), BaseHandler< T >::copyAndAddObject(), dataFile, Eigen::fix, format(), File::getFstream(), File::getFullName(), helpers::getLineFromStringStream(), BaseHandler< T >::getNumberOfObjects(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getSystemDimensions(), getTime(), i, interactionHandler, calibrate::line, logger, max_, min, min_, N, NUMBER_OF_PROCESSORS, File::open(), p, particleHandler, Eigen::numext::q, UniformPSDSelfTest::radius, readSpeciesFromDataFile_, BaseHandler< T >::setStorageCapacity(), speciesHandler, oomph::Global_string_for_annotation::string(), time_, Jeffery_Solution::velocity(), VERBOSE, 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.

2904 {
2905  logger(VERBOSE, "Read fstat file %, t=%, Np=%, Nc=%", fStatFile.getFullName(), getTime(), particleHandler.getSize(), interactionHandler.getNumberOfObjects());
2906 
2907  fStatFile.open(std::fstream::in);
2908  std::string line;
2909  std::fstream& in = fStatFile.getFstream();
2910  // read the first three lines
2911  getline(in, line);
2912  getline(in, line);
2913  getline(in, line);
2914  Mdouble time;
2915  unsigned int indexP;
2916  int indexI; //could be negative
2918  while ((in.peek() != -1) && (in.peek() != '#'))
2919  {
2920  /* # 1: time
2921  # 2: particle Number i
2922  # 3: contact partner j (particles >= 0, walls < 0)
2923  # 4: x-position \
2924  # 5: y-position > of the contact point (I hope)
2925  # 6: z-position /
2926  # 7: delta = overlap at the contact
2927  # 8: ctheta = length of the tangential spring
2928  # 9: P1_P2_normal force |f^n|
2929  # 10: remaining (tangential) force |f^t|=|f-f^n|
2930  # 11-13: P1_P2_normal unit vector nx, ny, nz
2931  # 14-16: tangential unit vector tx, ty, tz
2932  */
2933  in >> time >> indexP >> indexI;
2934  logger(VERBOSE, "Read fstat line: t=% i=%, p=%", time, indexP, indexI);
2936  BaseInteraction* C;
2937  if (indexI >= 0)
2938  {
2939  BaseParticle* I = particleHandler.getObject(static_cast<const unsigned int>(indexI));
2940  //read only one of the two fstat lines reported
2941  if (indexI >= indexP or I->isFixed())
2942  {
2943  // particle pair contact
2945  C->setFStatData(in, P, I);
2946  // skip next line
2947  //in.ignore(256, '\n');
2948  } else logger(VERBOSE, "line ignored because indexI=% >= indexP=%", indexP, indexI);
2949  }
2950  else
2951  {
2952  // wall-particle contact
2953  while (wallHandler.getNumberOfObjects() <= -indexI - 1)
2954  {
2956  logger(WARN, "Added new wall because .fstat file indicates contact with wall % that doesn't exist",
2957  -indexI - 1);
2958  }
2959  BaseWall* I = wallHandler.getObject(static_cast<const unsigned int>(-indexI - 1));
2961  C->setFStatData(in, P, I);
2962  }
2963  //skip the rest of the line, to allow additional output and to ignore the second time a particle-particle contact is printed
2964  in.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
2965  }
2966  //logger(INFO,"read % contacts at t = % (N=%)",counter,timeStamp,interactionHandler.getNumberOfObjects());
2967  //interactionHandler.write(std::cout);
2968  //logger(INFO,"normal % %",interactionHandler.getObject(0)->getNormal(),interactionHandler.getObject(0)->getContactPoint());
2969  //logger(INFO,"normal % %",interactionHandler.getLastObject()->getNormal(),interactionHandler.getLastObject()->getContactPoint());
2970 }
Matrix< Scalar, Dynamic, Dynamic > C
Definition: bench_gemm.cpp:49
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:27
BaseInteraction * addInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Definition: InteractionHandler.cc:94
Definition: matrices.h:74
#define I
Definition: main.h:127

References InteractionHandler::addInteraction(), BaseHandler< T >::clear(), BaseHandler< T >::copyAndAddObject(), fStatFile, File::getFstream(), File::getFullName(), BaseHandler< T >::getLastObject(), BaseHandler< T >::getNumberOfObjects(), getNumberOfTimeSteps(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), getTime(), I, interactionHandler, calibrate::line, logger, max, File::open(), Global_Physical_Variables::P, particleHandler, speciesHandler, oomph::Global_string_for_annotation::string(), VERBOSE, 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
4009 {
4010  std::string dummy;
4011  is >> dummy >> dummy;
4012  setName(dummy);
4013 
4014  unsigned int saveCountData, saveCountEne, saveCountStat, saveCountFStat;
4015  unsigned int fileTypeFstat, fileTypeData, fileTypeEne, fileTypeRestart;
4016  is >> dummy >> min_.x()
4017  >> dummy >> max_.x()
4018  >> dummy >> min_.y()
4019  >> dummy >> max_.y()
4020  >> dummy >> min_.z()
4021  >> dummy >> max_.z()
4022  >> dummy >> timeStep_
4023  >> dummy >> time_
4024  >> dummy >> timeMax_
4025  >> dummy >> saveCountData
4026  >> dummy >> saveCountEne
4027  >> dummy >> saveCountStat
4028  >> dummy >> saveCountFStat
4029  >> dummy >> systemDimensions_
4030  >> dummy >> gravity_
4031  >> dummy >> fileTypeFstat
4032  >> dummy >> fileTypeData
4033  >> dummy >> fileTypeEne;
4034  dataFile.setSaveCount(saveCountData);
4035  eneFile.setSaveCount(saveCountEne);
4036  statFile.setSaveCount(saveCountStat);
4037  fStatFile.setSaveCount(saveCountFStat);
4038 
4039  fStatFile.setFileType(static_cast<FileType>(fileTypeFstat));
4040  dataFile.setFileType(static_cast<FileType>(fileTypeData));
4041  eneFile.setFileType(static_cast<FileType>(fileTypeEne));
4042 
4043  //this is optional to allow restart files with and without restartFile.getFileType()
4044  is >> dummy;
4045  if (!strcmp(dummy.c_str(), "options_restart"))
4046  {
4047  is >> fileTypeRestart;
4048  restartFile.setFileType(static_cast<FileType>(fileTypeRestart));
4049  }
4050 
4051  speciesHandler.read(is);
4052  wallHandler.read(is);
4053  boundaryHandler.read(is);
4054  particleHandler.read(is);
4055  setRestarted(true);
4056 }

References boundaryHandler, dataFile, eneFile, fStatFile, gravity_, max_, min_, particleHandler, BaseHandler< T >::read(), restartFile, File::setFileType(), setName(), setRestarted(), File::setSaveCount(), speciesHandler, statFile, oomph::Global_string_for_annotation::string(), 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)
2494 {
2495  //Opens the par.ini file
2496  std::fstream file;
2497  file.open(fileName, std::fstream::in);
2498  if (!file.is_open() || file.bad())
2499  {
2500  //std::cout << "Loading par.ini file " << filename << " failed" << std::endl;
2501  return false;
2502  }
2503 
2504  Mdouble doubleValue;
2505  int integerValue;
2506 
2507  // inputfile par.ini
2508  // line 1 =============================================================
2509  // Example: 1 1 0
2510  // 1: integer (0|1) switches from non-periodic to periodic
2511  // integer (5|6) does 2D integration only (y-coordinates fixed)
2512  // and switches from non-periodic to periodic
2513  // integer (11) uses a quarter system with circular b.c.
2514  file >> integerValue;
2515  //~ std::cout << "11" << integerValue << std::endl;
2516  if (integerValue == 0)
2517  {
2518  InfiniteWall w0;
2520  w0.set(Vec3D(-1, 0, 0), Vec3D(getXMin(), 0, 0));
2522  w0.set(Vec3D(1, 0, 0), Vec3D(getXMax(), 0, 0));
2524  w0.set(Vec3D(0, -1, 0), Vec3D(0, getYMin(), 0));
2526  w0.set(Vec3D(0, 1, 0), Vec3D(0, getYMax(), 0));
2528  w0.set(Vec3D(0, 0, -1), Vec3D(0, 0, getZMin()));
2530  w0.set(Vec3D(0, 0, 1), Vec3D(0, 0, getZMax()));
2532  }
2533  else if (integerValue == 1)
2534  {
2535  PeriodicBoundary b0;
2536  b0.set(Vec3D(1, 0, 0), getXMin(), getXMax());
2538  b0.set(Vec3D(0, 1, 0), getYMin(), getYMax());
2540  b0.set(Vec3D(0, 0, 1), getZMin(), getZMax());
2542  }
2543  else if (integerValue == 5)
2544  {
2545  InfiniteWall w0;
2547  w0.set(Vec3D(-1, 0, 0), Vec3D(-getXMin(), 0, 0));
2549  w0.set(Vec3D(1, 0, 0), Vec3D(getXMax(), 0, 0));
2551  w0.set(Vec3D(0, -1, 0), Vec3D(0, -getYMin(), 0));
2553  w0.set(Vec3D(0, 1, 0), Vec3D(0, getYMax(), 0));
2555 
2556  }
2557  else if (integerValue == 6)
2558  {
2559  PeriodicBoundary b0;
2560  b0.set(Vec3D(1, 0, 0), getXMin(), getXMax());
2562  b0.set(Vec3D(0, 1, 0), getYMin(), getYMax());
2564  b0.set(Vec3D(0, 0, 1), getZMin(), getZMax());
2566  }
2567  else
2568  {
2569  logger(ERROR, "Error in par.ini: line 1, value 1 is %", integerValue);
2570  }
2571 
2572  // 2: integer (0|1) dont use | use the search pattern for linked cells
2573  file >> integerValue; //ignore
2574 
2575  // 3: real - gravity in z direction: positive points upwards
2576  file >> doubleValue;
2577  setGravity(Vec3D(0.0, 0.0, doubleValue));
2578 
2579  // line 2 =============================================================
2580  // Example: -10000 .5e-2
2581  // 1: time end of simulation - (negative resets start time to zero
2582  // and uses -time as end-time)
2583  file >> doubleValue;
2584  if (doubleValue < 0)
2585  setTime(0);
2586  setTimeMax(fabs(doubleValue));
2587 
2588  // 2: time-step of simulation
2589  file >> doubleValue;
2590  setTimeStep(doubleValue);
2591 
2592  // line 3 =============================================================
2593  // Example: 1e-1 100
2594  file >> doubleValue;
2595  if (doubleValue >= 0)
2596  {
2597  // 1: time-step for output on time-series protocol file -> "ene"
2598  unsigned int savecount = static_cast<unsigned int>(round(doubleValue / getTimeStep()));
2599  setSaveCount(savecount);
2600 
2601  // 2: time-step for output on film (coordinate) file -> "c3d"
2602  // (fstat-output is coupled to c3d-output time-step)
2603  file >> doubleValue;
2604  savecount = static_cast<unsigned int>(round(doubleValue / getTimeStep()));
2605  dataFile.setSaveCount(savecount);
2606  fStatFile.setSaveCount(savecount);
2607  }
2608  else
2609  {
2610  // or: ---------------------------------------------------------------
2611  // 1: negative number is multiplied to the previous log-output-time
2612  // 2: requires initial log-output time
2613  // 3: negative number is multiplied to the previous film-output-time
2614  // 4: requires initial film-output time
2615  logger(ERROR, "Error in par.ini: line 3, value 1 is %", doubleValue);
2616  }
2617 
2618  // line 4 =============================================================
2619  // Example: 2000 1e5 1e3 1e2
2620  // 1: particle density (mass=4/3*constants::pi*density*rad^3)
2621  file >> doubleValue;
2622 
2623  //clear species handler
2627 
2629  S->setDensity(doubleValue);
2630 
2631  // 2: linear spring constant
2632  file >> doubleValue;
2633  S->setStiffness(doubleValue);
2634 
2635  // 3: linear dashpot constant
2636  file >> doubleValue;
2637  S->setDissipation(doubleValue);
2638 
2639  // 4: background damping dashpot constant
2640  file >> doubleValue;
2641  if (doubleValue != 0.0)
2642  logger(WARN, "Warning in par.ini: ignored background damping %", doubleValue);
2643 
2644  // line 5 =============================================================
2645  // Example: 0 0
2646  // 1: growth rate: d(radius) = xgrow * dt
2647  file >> doubleValue;
2648  if (doubleValue != 0.0)
2649  logger(WARN, "Warning in par.ini: ignored growth rate %", doubleValue);
2650 
2651  // 2: target volume_fraction
2652  file >> doubleValue;
2653  if (doubleValue != 0.0)
2654  logger(WARN, "Warning in par.ini: ignored target volume_fraction %", doubleValue);
2655 
2656  file.close();
2657  //std::cout << "Loaded par.ini file " << filename << std::endl;
2658  return true;
2659 }
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:12
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:148
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:97
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a PeriodicBoundary by its normal and positions.
Definition: PeriodicBoundary.cc:63
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: SpeciesHandler.h:32
void addObject(ParticleSpecies *S) override
Adds a new ParticleSpecies to the SpeciesHandler.
Definition: SpeciesHandler.cc:1008
EIGEN_STRONG_INLINE EIGEN_DEVICE_FUNC bfloat16 round(const bfloat16 &a)
Definition: BFloat16.h:646
Real fabs(const Real &a)
Definition: boostmultiprec.cpp:117
@ S
Definition: quadtree.h:62

References SpeciesHandler::addObject(), boundaryHandler, SpeciesHandler::clear(), BaseHandler< T >::copyAndAddObject(), dataFile, ERROR, boost::multiprecision::fabs(), UniformPSDSelfTest::fileName, fStatFile, BaseHandler< T >::getObject(), getTimeStep(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), logger, Eigen::bfloat16_impl::round(), oomph::QuadTreeNames::S, 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
3044 {
3045  //Assuming a filename corresponding to "restartFile" has already been established,
3046  //opens an input filestream to the relevant file
3047  if (restartFile.open(std::fstream::in))
3048  {
3049  // store the name of the file that will be read (because restarting can change the file name)
3051  //reads the input stream line-by-line
3052  read(restartFile.getFstream(), opt);
3053  logger(INFO, "Loaded restart file %", fileName);
3054  restartFile.close();
3055  //sets the flag such that other functions can tell that the file has been restarted
3056  //e.g. does not run "setUpInitialConditions" or add headers to the .ene files etc.
3057  setRestarted(true);
3058  return true;
3059  }
3060  else /* if the file could not be opened */
3061  {
3062  logger(INFO, "% could not be loaded.", restartFile.getFullName());
3063  return false;
3064  }
3065 }
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:3734

References File::close(), UniformPSDSelfTest::fileName, File::getFstream(), File::getFullName(), INFO, logger, File::open(), read(), restartFile, setRestarted(), and oomph::Global_string_for_annotation::string().

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(), LaserOnLayer::LaserOnLayer(), LawinenBox::LawinenBox(), ChuteWithPeriodicInflow::loadPeriodicBox(), ChuteWithContraction::loadPeriodicBox(), main(), readNextArgument(), Mercury3DRestart::readNextArgument(), readRestartFile(), CGHandler::restart(), RotatingDrumBidisperse::RotatingDrumBidisperse(), statistics_while_running< T >::run(), CSCRun::setupInitialConditions(), CFDDEMCoupleTest::setupInitialConditions(), Cstatic3D::setupInitialConditions(), OneParticleCoolingSelfTest::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
3075 {
3076  //add ".restart" if necessary
3077  if (fileName.find(".restart") == std::string::npos)
3078  {
3079  fileName.append(".restart");
3080  }
3081 
3082  //If padded or numbered files are used, we need to extract the counter and remove it from the filename
3083  //First find the last point in the restart name
3084  unsigned int pos = fileName.find('.');
3085  while (fileName.find('.', pos + 1) != std::string::npos)
3086  {
3087  pos = fileName.find('.', pos + 1);
3088  }
3089  //If the next char after the last . is a digit we are using numbered files
3090  std::string counter;
3091  if (isdigit(fileName[pos + 1]))
3092  {
3093  for (int i = pos + 1; i < fileName.length(); i++)
3094  {
3095  counter.push_back(fileName[i]);
3096  }
3097  //Set counter in restart file
3098  restartFile.setCounter(std::stoi(counter));
3099  logger(INFO, "Counter: %", std::stoi(counter));
3100  }
3101 
3102 #ifdef MERCURYDPM_USE_MPI
3103  //Correct for the processor number
3105  {
3106  //Modify file name
3107  const unsigned int length = fileName.length();
3108  if (isdigit(fileName[pos + 1]))
3109  {
3110  for (int i = pos + 1; i < length + 1; i++)
3111  {
3112  fileName.pop_back();
3113  }
3114  }
3116  if (counter.size() > 0)
3117  {
3118  fileName.append(".");
3119  fileName.append(counter);
3120  }
3121  }
3122 #endif
3123 
3125 
3126  logger(INFO, "Restarting from %", fileName);
3127  return readRestartFile(opt);
3128 }
bool fileExists(const std::string &strFilename)
Function to check if a file exists, is used to check if a run has already need done.
Definition: FileIOHelpers.cc:77
std::string to_string(T object, unsigned float_precision=8)
Definition: oomph_utilities.h:189

References helpers::fileExists(), UniformPSDSelfTest::fileName, i, INFO, logger, NUMBER_OF_PROCESSORS, PROCESSOR_ID, readRestartFile(), restartFile, File::setCounter(), File::setName(), oomph::Global_string_for_annotation::string(), and oomph::StringConversion::to_string().

◆ 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"

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

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.

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

5066 {
5067 #ifdef MERCURYDPM_USE_MPI
5069  if (NUMBER_OF_PROCESSORS == 1)
5070  {
5071 #endif
5072  //Looping from the *back* of the particle handler, where all the periodic or "ghost" particles are stored.
5073  //The loop ends when there exist no more periodic particles (i.e. "getPeriodicFromParticle()" returns a null pointer)
5074  for (unsigned int i = particleHandler.getSize();
5075  i >= 1 && particleHandler.getObject(i - 1)->getPeriodicFromParticle() != nullptr; i--)
5076  {
5077  while (!particleHandler.getObject(i - 1)->getInteractions().empty())
5078  {
5080  particleHandler.getObject(i - 1)->getInteractions().front()->getIndex());
5081  }
5083  }
5084 
5085  // OMP parallelism
5086  /*#pragma omp parallel for num_threads(getNumberOfOMPThreads()) //schedule(dynamic)
5087  for (unsigned int i = particleHandler.getSize(); i >= 1 ; i--)
5088  {
5089  if (particleHandler.getObject(i - 1)->getPeriodicFromParticle() != nullptr) {
5090  while (!particleHandler.getObject(i - 1)->getInteractions().empty()) {
5091  interactionHandler.removeObjectKeepingPeriodics(
5092  particleHandler.getObject(i - 1)->getInteractions().front()->getIndex());
5093  }
5094  particleHandler.removeObject(i - 1);
5095  }
5096  }*/
5097 
5098 #ifdef MERCURYDPM_USE_MPI
5099  }
5100 #endif
5101 }
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
Definition: BaseInteractable.h:256
void removeObjectKeepingPeriodics(unsigned int id)
Removes interactions of periodic particles when the periodic particles get deleted (see DPMBase::remo...
Definition: InteractionHandler.cc:296
void removeObject(unsigned int index) override
Removes a BaseParticle from the ParticleHandler.
Definition: ParticleHandler.cc:388

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

Referenced by computeOneTimeStep(), and initialiseSolve().

◆ removeOldFiles()

void DPMBase::removeOldFiles ( ) const
Note
If setVTKOutputDirectory() is used this function must be called after it.
4493 {
4494  //logger(INFO,"ID %",PROCESSOR_ID);
4495  //if (PROCESSOR_ID!=0) return;
4496 
4497  logger(INFO,"Removing old files named %.*",getName());
4498  std::ostringstream filename;
4499 
4500  // add processor id to file extension for mpi jobs
4502  // all the file extensions that should be deleted
4503  std::vector<std::string> ext{".restart"+p, ".stat"+p, ".fstat"+p, ".data"+p, ".ene"+p, ".xballs", ".py"};
4504  for (const auto& j : ext)
4505  {
4506  // remove files with given extension for FileType::ONE_FILE
4507  filename.str("");
4508  filename << getName() << j;
4509  if (!remove(filename.str().c_str()))
4510  {
4511  logger(INFO," File % successfully deleted",filename.str());
4512  }
4513  // remove files with given extension for FileType::MULTIPLE_FILES
4514  unsigned k = 0;
4515  filename.str("");
4516  filename << getName() << j << '.' << k;
4517  while (!remove(filename.str().c_str()))
4518  {
4519  if (k<3) logger(INFO," File % successfully deleted",filename.str());
4520  filename.clear();
4521  filename.str("");
4522  filename << getName() << j << '.' << ++k;
4523  }
4524  // remove files with given extension for FileType::MULTIPLE_FILES_PADDED
4525  k = 0;
4526  filename.str("");
4527  filename << getName() << j << '.' << to_string_padded(k);
4528  while (!remove(filename.str().c_str()))
4529  {
4530  if (k<3) logger(INFO," File % successfully deleted",filename.str());
4531  filename.clear();
4532  filename.str("");
4533  filename << getName() << j << '.' << to_string_padded(++k);
4534  }
4535  }
4536  // remove vtk files
4537  // add processor id to file extension for mpi jobs
4538  std::string q = (NUMBER_OF_PROCESSORS > 1)?("Processor_"+std::to_string(PROCESSOR_ID)+"_"):"";
4539  // all the file extensions that should be deleted
4540  ext = {"Wall_", q+"Particle_", q+"Interaction_", q+"Boundary_"};
4541  // List of VTK output directories, in same order as given extensions!
4542  std::vector<std::string> dirs{ wallVTKWriter_.getOutputDirectory(),
4546  for (int i = 0; i < ext.size(); i++)
4547  {
4548  const std::string j = ext[i];
4549  const std::string VTKDir = dirs[i];
4550  // remove files with given extension for FileType::ONE_FILE
4551  filename.str("");
4552  filename << VTKDir << "/" << getName() << j << ".vtu";
4553  if (!remove(filename.str().c_str()))
4554  {
4555  logger(INFO," File % successfully deleted",filename.str());
4556  }
4557  // remove files with given extension for FileType::MULTIPLE_FILES
4558  unsigned k = 0;
4559  filename.str("");
4560  filename << VTKDir << "/" << getName() << j << k << ".vtu";
4561  while (!remove(filename.str().c_str()))
4562  {
4563  if (k<3) logger(INFO," File % successfully deleted",filename.str());
4564  filename.str("");
4565  filename << VTKDir << "/" << getName() << j << ++k << ".vtu";
4566  }
4567  //std::cout << " File " << filename.str() << " not found" << std::endl;
4568  }
4569 }
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:22

References boundaryVTKWriter_, MergeRestartFiles::filename, getName(), BaseVTKWriter< H >::getOutputDirectory(), i, INFO, interactionVTKWriter_, j, k, logger, NUMBER_OF_PROCESSORS, p, PROCESSOR_ID, Eigen::numext::q, oomph::Global_string_for_annotation::string(), oomph::StringConversion::to_string(), to_string_padded(), vtkWriter_, and wallVTKWriter_.

Referenced by GranuDrum::GranuDrum(), LaserOnLayer::LaserOnLayer(), main(), readNextArgument(), RotatingDrumBidisperse::RotatingDrumBidisperse(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MarbleRun::setupInitialConditions(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), SingleParticleSegregation::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
1514 {
1515  append_ = newAppendFlag;
1516 }

References append_.

Referenced by ClosedCSCRestart::ClosedCSCRestart(), commandLineCG(), constructor(), CSCRestart::CSCRestart(), LawinenBox::LawinenBox(), 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 allowed to be negative i.e. create energy)

795 {backgroundDrag_=backgroundDrag;}

References backgroundDrag_.

Referenced by RotatingDrumBidisperseInitialise::actionsAfterTimeStep(), and 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.
1395 {
1396  setSystemDimensions(newDim);
1397  setParticleDimensions(newDim);
1398 }

References setParticleDimensions(), and setSystemDimensions().

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

◆ setDomain()

◆ 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)
438 {
439 dataFile.setFileType(fileType);
440 fStatFile.setFileType(fileType);
441 restartFile.setFileType(fileType);
442 statFile.setFileType(fileType);
443 eneFile.setFileType(fileType);
444 }

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(), CFDDEMCoupleTest::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"?
1950 {
1951  for (unsigned int i = 0; i < std::min(particleHandler.getSize(), n); i++)
1953 }
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:150

References BaseParticle::fixParticle(), BaseHandler< T >::getObject(), BaseHandler< T >::getSize(), i, min, 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.
1375 {
1376  gravity_ = newGravity;
1377 }

References gravity_.

Referenced by BoundariesSelfTest::BoundariesSelfTest(), CGBasicSelfTest::CGBasicSelfTest(), CGForceDensityUnitTest::CGForceDensityUnitTest(), ChangingTOIParticle::ChangingTOIParticle(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), constructor(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), InitialConditions< SpeciesType >::InitialConditions(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), load(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), ParticleCreation::ParticleCreation(), ParticleInclusion::ParticleInclusion(), ParticleParticleCollision::ParticleParticleCollision(), protectiveWall::protectiveWall(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), InitialBed::setupInitialConditions(), Drum::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::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(), PSDSelfTest::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(), SingleParticleSegregation::SingleParticleSegregation(), SinterPair::SinterPair(), Slide::Slide(), 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)
922 {
923  logger(WARN, "DPMBase.setInteractionsWriteVTK(bool) is deprecated! Use interactionHandler.setWriteVTK(bool) instead.");
925 }

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
511 {
512 dataFile.setLastSavedTimeStep(nextSavedTimeStep);
513 fStatFile.setLastSavedTimeStep(nextSavedTimeStep);
514 restartFile.setLastSavedTimeStep(nextSavedTimeStep);
515 //statFile.setLastSavedTimeStep(nextSavedTimeStep); //this one is not force-written
516 eneFile.setLastSavedTimeStep(nextSavedTimeStep);
517 }
void setLastSavedTimeStep(unsigned int lastSavedTimeStep)
Sets File::nextSavedTimeStep_.
Definition: File.cc:280

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 increment 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
5537 {
5538  dataFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5539  fStatFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5540  restartFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5541  statFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5542  eneFile.setlogarithmicSaveCount(logarithmicSaveCountBase);
5543 }
void setlogarithmicSaveCount(const Mdouble logarithmicSaveCountBase)
the function to set the user input base of logarithmic saving count
Definition: File.cc:261

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
1074 {
1075 if (min_.x() > newMax.x() ||
1076 min_.y() > newMax.y() ||
1077 min_.z() > newMax.z())
1078 {
1079 logger(WARN, "Warning in setMax: upper bound is smaller"
1080  " than lower bound. (%,%,%) > (%,%,%)",
1081  min_.x(), min_.y(), min_.z(), newMax.x(), newMax.y(), newMax.z());
1082 }
1083 else
1084 {
1085 max_ = newMax;
1086 }
1087 }

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

Referenced by ChangingTOIParticle::ChangingTOIParticle(), ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), InsertionBoundarySelfTest::InsertionBoundarySelfTest(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), loadingTest(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleInclusion::ParticleInclusion(), FileReader::read(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), HertzianBSHPInteractionTwoParticleElasticCollision::setupInitialConditions(), LiquidMigrationSelfTest::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoBondedParticleElasticCollision::setupInitialConditions(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::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(), CGDisplacementFieldUnitTest::setupInitialConditions(), CGExactOverlapUnitTest::setupInitialConditions(), CGForceDensityUnitTest::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FluxBoundaryPrescribedDistanceUnitTest::setupInitialConditions(), FluxBoundaryUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), HeatTransferUnitTest::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.

1139 {
1140 setMax(Vec3D(xMax, yMax, zMax));
1141 }
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073

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
5395 {
5396  Vec3D meanVelocity = getTotalMomentum() / getTotalMass();
5397 
5398  //correct the mean velocity to zero
5399  for (auto& p : particleHandler)
5400  {
5401  p->addVelocity(-meanVelocity);
5402  }
5403 }
Vec3D getTotalMomentum() const
JMFT: Return the total momentum of the system, excluding fixed particles.
Definition: DPMBase.cc:1613

References getTotalMass(), getTotalMomentum(), p, 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
5412 {
5413  Vec3D V_mean;
5414  Mdouble Ek_mean_goal = 0, Ek_fluct_factor = 0;
5415  RNG rng;
5416 
5417  //assign random velocity to each particle
5418  for (auto& p : particleHandler)
5419  {
5420  p->setVelocity(Vec3D(rng.getRandomNumber(-1, 1), rng.getRandomNumber(-1, 1), rng.getRandomNumber(-1, 1)));
5421  }
5422 
5423  //calculate the mean velocity in the system now
5424  Ek_mean_goal = 0.5 * getTotalMass() * V_mean_goal.getLengthSquared();
5425  V_mean = getTotalMomentum() / getTotalMass();
5426  //check if the user input mean kinetic energy is larger than the total kinetic energy input, then return error
5427  logger.assert_always(0.5 * getTotalMass() * V_mean_goal.getLengthSquared() < Ek_goal,
5428  "Too large mean velocity input, Kinetic energy from mean velocity part is larger than the "
5429  "total kinetic energy you want to set");
5430 
5431  //correct the mean velocity to zero
5432  for (auto& p : particleHandler)
5433  {
5434  p->addVelocity(-V_mean);
5435  }
5436 
5437  //set the new fluctuating velocity based on the goal fluctuating kinetic energy
5438  Ek_fluct_factor = std::sqrt((Ek_goal - Ek_mean_goal) / getKineticEnergy());
5439  for (auto& p : particleHandler)
5440  {
5441  p->setVelocity(Ek_fluct_factor * p->getVelocity());
5442  }
5443 
5444  //correct the mean velocity finally to the user set values
5445  V_mean = getTotalMomentum() / getTotalMass();
5446  for (auto& p : particleHandler)
5447  {
5448  p->addVelocity(V_mean_goal - V_mean);
5449  }
5450 
5451  //check the final mean velocity and kinetic energy
5452  logger(INFO, "In DPMBase::setMeanVelocityAndKineticEnergy,\nV_mean_final %\n Ek_final %",
5454 }
AnnoyingScalar sqrt(const AnnoyingScalar &x)
Definition: AnnoyingScalar.h:134
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:32
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:123
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Kernel/Math/Vector.h:324

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

◆ 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
1110 {
1111 if (max_.x() < newMin.x() ||
1112 max_.y() < newMin.y() ||
1113 max_.z() < newMin.z())
1114 {
1115 logger(WARN, "Warning in setMin: lower bound is larger"
1116  " than upper bound. (%,%,%) < (%,%,%)",
1117  max_.x(), max_.y(), max_.z(), newMin.x(), newMin.y(), newMin.z());
1118 }
1119 else
1120 {
1121 min_ = newMin;
1122 }
1123 }

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

Referenced by ChangingTOIParticle::ChangingTOIParticle(), ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), InsertionBoundarySelfTest::InsertionBoundarySelfTest(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), loadingTest(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), MultiParticlesInsertion::MultiParticlesInsertion(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleInclusion::ParticleInclusion(), FileReader::read(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::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(), CGDisplacementFieldUnitTest::setupInitialConditions(), CGExactOverlapUnitTest::setupInitialConditions(), CGForceDensityUnitTest::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FluxBoundaryPrescribedDistanceUnitTest::setupInitialConditions(), FluxBoundaryUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), HeatTransferUnitTest::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.

1130 {
1131 setMin(Vec3D(xMin, yMin, zMin));
1132 }
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109

References setMin().

◆ setName() [1/2]

void DPMBase::setName ( const char name)

Calls setName(std::string)

Parameters
[in]name
428 {
430 }

References plotDoE::name, setName(), and oomph::Global_string_for_annotation::string().

◆ 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
401 {
402 if (NUMBER_OF_PROCESSORS > 1)
403 {
404 name_ = name; // was before this->name_ = name
411 }
412 else
413 {
414 name_ = name; // was before this->name_ = name
415 dataFile.setName(name_ + ".data");
416 fStatFile.setName(name_ + ".fstat");
417 restartFile.setName(name_ + ".restart");
418 statFile.setName(name_ + ".stat");
419 eneFile.setName(name_ + ".ene");
420 interactionFile.setName(name_ + ".interaction");
421 }
422 }

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

Referenced by ChuteRestartDemo::actionsOnRestart(), AngleOfRepose::AngleOfRepose(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), CGBasicSelfTest::CGBasicSelfTest(), CGDisplacementFieldUnitTest::CGDisplacementFieldUnitTest(), CGExactOverlapUnitTest::CGExactOverlapUnitTest(), CGForceDensityUnitTest::CGForceDensityUnitTest(), ChangingTOIParticle::ChangingTOIParticle(), 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(), FluxBoundaryPrescribedDistanceUnitTest::FluxBoundaryPrescribedDistanceUnitTest(), FluxBoundaryUnitTest::FluxBoundaryUnitTest(), ForceLawsMPI2Test::ForceLawsMPI2Test(), GranuDrum::GranuDrum(), GranuHeap::GranuHeap(), Hertzian2DUnitTest::Hertzian2DUnitTest(), Indenter::Indenter(), inflowFromPeriodic::inflowFromPeriodic(), InitialConditions< SpeciesType >::InitialConditions(), initialiseSolve(), InsertionBoundaryMPI2Test::InsertionBoundaryMPI2Test(), LaserOnLayer::LaserOnLayer(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), load(), ChuteWithPeriodicInflow::loadPeriodicBox(), ChuteWithContraction::loadPeriodicBox(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MovingWalls::MovingWalls(), MultiParticlesInsertion::MultiParticlesInsertion(), ParticleBeam::ParticleBeam(), ParticleInclusion::ParticleInclusion(), read(), readNextArgument(), Mercury3DRestart::readNextArgument(), readOld(), regimeForceUnitTest::regimeForceUnitTest(), CGHandler::restart(), RotatingDrumBidisperse::RotatingDrumBidisperse(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), CFDDEMCoupleTest::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Chain::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), Cstatic3D::setupInitialConditions(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleHeatingSelfTest::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::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(), PSDSelfTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), HeatTransferUnitTest::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), ShearStage::ShearStage(), Siegen::Siegen(), SilbertPeriodic::SilbertPeriodic(), SingleParticle< SpeciesType >::SingleParticle(), SingleParticleIndenter::SingleParticleIndenter(), SingleParticleSegregation::SingleParticleSegregation(), 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(), 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
845 {
846 nToWrite_ = nToWrite;
847 }

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
5303 {
5304 #ifdef MERCURYDPM_USE_MPI
5305  numberOfDomains_ = numberOfDomains;
5306  logger(INFO, "Split domain into a %x%x% grid",numberOfDomains[0],numberOfDomains[1],numberOfDomains[2]);
5307 #else
5308  logger(WARN, "Setting number of domains, but code is not compiled with MPI on");
5309 #endif
5310 }

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)

Sets the number of omp threads.

1249 {
1250 logger.assert_always(numberOfOMPThreads > 0, "Number of OMP threads must be positive");
1251 numberOfOMPThreads_ = numberOfOMPThreads;
1252 
1253 #ifdef MERCURYDPM_USE_OMP
1254 if(numberOfOMPThreads > omp_get_max_threads()) {
1255 logger(INFO, "Number of omp threads set to the maximum number of threads allowed: %",
1256  omp_get_max_threads());
1257 numberOfOMPThreads_ = numberOfOMPThreads = omp_get_max_threads();
1258 }
1259 #pragma omp parallel num_threads(getNumberOfOMPThreads())
1260 {
1261 if (omp_get_thread_num()==0)
1262  logger(INFO, "Using % of % omp threads; testing thread",
1263  omp_get_num_threads(), omp_get_max_threads(), Flusher::NO_FLUSH);
1264 }
1265 #pragma omp parallel num_threads(getNumberOfOMPThreads())
1266 {
1267  logger(INFO, " %", std::to_string(omp_get_thread_num()), Flusher::NO_FLUSH);
1268  }
1269  logger(INFO,"");
1270 
1271 #else
1272  logger(WARN, "You are setting the number of omp threads to %, but OMP is not turned on", getNumberOfOMPThreads());
1273 #endif
1274 }

References getNumberOfOMPThreads(), INFO, logger, NO_FLUSH, numberOfOMPThreads_, oomph::StringConversion::to_string(), 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
469 {
470 dataFile.setOpenMode(openMode);
471 fStatFile.setOpenMode(openMode);
472 restartFile.setOpenMode(openMode);
473 statFile.setOpenMode(openMode);
474 eneFile.setOpenMode(openMode);
475 interactionFile.setOpenMode(openMode);
476 }

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.
1440 {
1441  if (particleDimensions >= 1 && particleDimensions <= 3)
1442  {
1443  particleDimensions_ = particleDimensions;
1445  }
1446  else
1447  {
1448  logger(WARN, "Error in setParticleDimensions; particleDimensions % is not 1, 2 or 3, setting it to "
1449  "systemDimension now (%)", particleDimensions, systemDimensions_);
1451  }
1452 }

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
934 {
935 writeParticlesVTK_ = writeParticlesVTK;
937 {
939 }
940 delete vtkWriter_;
942 }
Definition: SphericalParticleVtkWriter.h:13

References particleHandler, vtkWriter_, writeParticlesVTK_, and writeSuperquadricParticlesVTK_.

Referenced by Chutebelt::actionsAfterTimeStep(), BaseCluster::actionsOnRestart(), AxisymmetricWallSelfTest::AxisymmetricWallSelfTest(), HorizontalMixer::HorizontalMixer(), LaserOnLayer::LaserOnLayer(), main(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), ParticleBeam::ParticleBeam(), protectiveWall::protectiveWall(), read(), RotatingDrumBidisperse::RotatingDrumBidisperse(), ChutePeriodicDemo::setupInitialConditions(), ChangingTOIParticle::setupInitialConditions(), NautaMixer::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MarbleRun::setupInitialConditions(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), ThermalConductionSelfTest::setupInitialConditions(), Drum::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), SingleParticleSegregation::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), PSDSelfTest::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
1476 {
1477  restartVersion_ = newRV;
1478 }

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
548  { 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_
598 {
599 runNumber_ = runNumber;
600 }

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.

387 {
388 dataFile.setSaveCount(saveCount);
389 fStatFile.setSaveCount(saveCount);
390 restartFile.setSaveCount(saveCount);
391 statFile.setSaveCount(saveCount);
392 eneFile.setSaveCount(saveCount);
393 for (auto cg : cgHandler)
394 cg->statFile.setSaveCount(saveCount);
395 }

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(), LaserOnLayer::LaserOnLayer(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), LiquidMigrationMPI2Test::LiquidMigrationMPI2Test(), loadingTest(), main(), ChuteBottom::makeRoughBottom(), MaserRepeatedOutInMPI2Test::MaserRepeatedOutInMPI2Test(), MercuryCGSelfTest::MercuryCGSelfTest(), MinimalExampleDrum::MinimalExampleDrum(), normalAndTangentialLoadingTest(), objectivenessTest(), ParticleBeam::ParticleBeam(), readNextArgument(), readParAndIniFiles(), regimeForceUnitTest::regimeForceUnitTest(), RotatingDrumBidisperse::RotatingDrumBidisperse(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), runFreeFall(), Calibration::setOutput(), ChutePeriodic::setup(), CSCRun::setupInitialConditions(), CFDDEMCoupleTest::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), VerticalMixer::setupInitialConditions(), Chain::setupInitialConditions(), MarbleRun::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleHeatingSelfTest::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), ThermalConductionSelfTest::setupInitialConditions(), Drum::setupInitialConditions(), HertzSelfTest::setupInitialConditions(), MindlinSelfTest::setupInitialConditions(), Penetration::setupInitialConditions(), Silo::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionPhiNormalSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), DPM::setupInitialConditions(), TwoParticleCollisionInteraction::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), UnionOfWalls::setupInitialConditions(), Contact::setupInitialConditions(), Wall::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), Packing::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), HeatTransferUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), LongHertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), SilbertHstop::SilbertHstop(), SilbertPeriodic::SilbertPeriodic(), SingleParticleSegregation::SingleParticleSegregation(), 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 ( )
private

function for setting sigaction constructor.

5250 {
5251  if (disableSoftStop_)
5252  {
5253  logger(INFO, "Soft stop disabled.");
5254  return;
5255  }
5256 
5257  struct sigaction act{};
5258  memset(&act, 0, sizeof(act));
5259 
5260  act.sa_handler = &signalHandler;
5261 
5262  sigaction(SIGINT, &act, nullptr);
5263  sigaction(SIGTERM, &act, nullptr);
5264 
5265  logger(VERBOSE, "Soft stop enabled.");
5266 }
static void signalHandler(int signal)
signal handler function.
Definition: DPMBase.cc:5220

References disableSoftStop_, INFO, logger, signalHandler(), and VERBOSE.

Referenced by solve().

◆ setSuperquadricParticlesWriteVTK()

void DPMBase::setSuperquadricParticlesWriteVTK ( bool  writeParticlesVTK)
Parameters
[in]writeParticlesVTK
948 {
949 writeSuperquadricParticlesVTK_ = writeParticlesVTK;
951 {
952 writeParticlesVTK_ = false;
953 }
954 delete vtkWriter_;
956 }
Definition: SuperQuadricParticleVtkWriter.h:12

References particleHandler, vtkWriter_, writeParticlesVTK_, and writeSuperquadricParticlesVTK_.

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

1409 {
1410  if (newDim >= 1 && newDim <= 3)
1411  systemDimensions_ = newDim;
1412  else
1413  {
1414  logger(ERROR, "Error in setSystemDimensions; newDim % is not 1, 2 or 3", newDim);
1415  }
1416 }

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(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), DPM::setupInitialConditions(), SimpleOpt::setupInitialConditions(), GranularCollapse::setupInitialConditions(), ParticleParticleInteraction::setupInitialConditions(), ParticleParticleInteractionWithPlasticForces::setupInitialConditions(), ParticleWallInteraction::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), PSDSelfTest::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
828 {
829 Mdouble diff = time_ - time;
830 time_ = time;
831 //this sets the interaction timestamp, so each interaction has the right time
832 for (auto i: interactionHandler)
833 {
834 i->setTimeStamp(i->getTimeStamp() - diff);
835 }
836 }

References i, interactionHandler, and time_.

Referenced by Chutebelt::actionsAfterTimeStep(), DrumRot::actionsBeforeTimeStep(), constructor(), initialiseSolve(), main(), FileReader::read(), readParAndIniFiles(), RotatingDrumBidisperse::RotatingDrumBidisperse(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), OneParticleCoolingSelfTest::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
865 {
866 if (newTMax >= 0)
867 {
868 timeMax_ = newTMax;
869 }
870 else
871 {
872 logger(ERROR, "Error in setTimeMax, new timeMax=% is not positive", newTMax);
873 }
874 }

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(), LaserOnLayer::LaserOnLayer(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), 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(), RotatingDrumBidisperse::RotatingDrumBidisperse(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), FlowRule::run(), statistics_while_running< T >::run(), runFreeFall(), ChutePeriodic::setup(), ChuteWithContraction::setup_particles_initial_conditions(), ClosedCSCStats::setupInitialConditions(), CSCRun::setupInitialConditions(), CSCStats::setupInitialConditions(), CFDDEMCoupleTest::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Chain::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), ChutePeriodic::setupInitialConditions(), Cstatic3D::setupInitialConditions(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleHeatingSelfTest::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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(), DistributionPhiNormalSelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), FreeFallSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ObliqueImpactSelfTest::setupInitialConditions(), TwoParticleCollisionInteraction::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(), PSDSelfTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), HeatTransferUnitTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), LongHertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), BaseCluster::setupInitialConditions(), MercuryProblem::setupMercuryProblem(), SilbertHstop::SilbertHstop(), SilbertPeriodic::SilbertPeriodic(), SingleParticle< SpeciesType >::SingleParticle(), SingleParticleSegregation::SingleParticleSegregation(), 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
1226 {
1227 if (timeStep > 0.0)
1228 {
1229 timeStep_ = timeStep;
1230 }
1231 else
1232 {
1233 logger(ERROR, "Error in setTimeStep: new timeStep % is not positive", timeStep);
1234 }
1235 }

References ERROR, logger, and timeStep_.

Referenced by RotatingDrumBidisperseInitialise::actionsAfterTimeStep(), 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(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), 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(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), runFreeFall(), Cstatic2d::set_particle_properties(), Cstatic3D::set_particle_properties(), Calibration::setSpecies(), Material::setSpecies(), AxisymmetricWallSelfTest::setSpeciesAndTimeStep(), MercuryProblem::setSpeciesProperties(), ChutePeriodic::setup(), CFDDEMCoupleTest::setupInitialConditions(), NozzleDemo::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), Chain::setupInitialConditions(), MarbleRun::setupInitialConditions(), StressStrainControl::setupInitialConditions(), ShiftingConstantMassFlowMaserBoundarySelfTest::setupInitialConditions(), ShiftingMaserBoundarySelfTest::setupInitialConditions(), FiveParticles::setupInitialConditions(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleHeatingSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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(), DistributionPhiNormalSelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), CGHandlerSelfTest::setupInitialConditions(), CGStaticBalanceSelfTest::setupInitialConditions(), DPM::setupInitialConditions(), ChargedBondedInteractionSelfTest::setupInitialConditions(), ParticleParticleCollision::setupInitialConditions(), WallParticleCollision::setupInitialConditions(), TwoParticleCollisionInteraction::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(), PSDSelfTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), HeatTransferUnitTest::setupInitialConditions(), HertzContactRestitutionUnitTest::setupInitialConditions(), HertzianSinterForceUnitTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MovingWall::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), PlasticForceUnitTest::setupInitialConditions(), SaveCountUnitTest::setupInitialConditions(), SeparateFilesSelfTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::setupInitialConditions(), SpeciesTest::setupInitialConditions(), WallSpecies::setupInitialConditions(), AreaVTK::setupInitialConditions(), Siegen::Siegen(), SilbertPeriodic::SilbertPeriodic(), SingleParticleSegregation::SingleParticleSegregation(), SinterPair::SinterPair(), 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 overridden.

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, PSDSelfTest, SpeciesTest, SinterForceUnitTest, SetDistributionPhiNormalSelfTest, 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, HeatTransferUnitTest, my_problem, FullRestartTest, FreeFall, FreeFall, FreeFallHertzMindlinUnitTest, FluxBoundaryUnitTest, FluxBoundaryPrescribedDistanceUnitTest, RandomClusterInsertionBoundarySelfTest, ExtremeOverlapWithWallsUnitTest, EvaporationAndHeatTest, EnergyUnitTest, DrivenParticleClass, PSDSelfTest, ConsistencyInitialParticleWallOverlapUnitTest, ChargedBondedParticleUnitTest, CreateDataAndFStatFiles, ParticleWall, TwoParticles, Packing, TwoParticles, CGForceDensityUnitTest, CGExactOverlapUnitTest, CGDisplacementFieldUnitTest, 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, TwoParticleCollisionInteraction, TwoParticleClassicalWilletCollision, TwoParticleBagheriCollision, 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, InsertionBoundarySelfTest, InsertionBoundarySelfTest, DistributionToPSDSelfTest, DistributionSelfTest, DistributionPhiNormalSelfTest, DeletionBoundarySelfTest, CubeDeletionBoundarySelfTest, ConstantMassFlowMaserSelfTest, ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest, SingleParticleSegregation, Chutebelt, SegregationPeriodic, SegregationPeriodic, SegregationPeriodic, RotatingDrum, RotatingDrum, Siegen, SegregationPeriodic, Silo, Penetration, MindlinSelfTest, HertzSelfTest, Drum, Silo, Polygon, Nurbs, MyCoil, GetDistanceAndNormalForTriangleWall, GetDistanceAndNormalForScrew, GetDistanceAndNormalForIntersectionOfWalls, ThermalConductionSelfTest, OneParticleCoolingSelfTest, OneParticleHeatingSelfTest, MeltableForceLawSelfTest, MeltableForceLaw2SelfTest, InitialBed, 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, NozzleDemo, RotatingDrumWet, Drum, NozzleDemo, NautaMixer, HorizontalMixerWalls, HorizontalMixer, CFDDEMCoupleTest, ChuteWithPeriodicInflow, restart, free_cooling, my_problem, my_problem, RandomClusterInsertionBoundarySelfTest, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, ChangingTOIParticle, 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.

1988 {
1989 }

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

◆ setVTKOutputDirectory()

void DPMBase::setVTKOutputDirectory ( const std::string &  dir)

Sets the output directory of the VTK files.

492 {
493  if (vtkWriter_)
495  else
496  logger(WARN, "Failed to set VTK output directory for particles. Make sure to set particle VTK writing to true, "
497  "before setting the output directory.");
502 }

References boundaryVTKWriter_, interactionVTKWriter_, logger, BaseVTKWriter< H >::setOutputDirectory(), vtkWriter_, wallDetailsVTKWriter_, wallVTKWriter_, and WARN.

◆ 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
915 {
916  FileType writeVTKFileType = writeVTK?FileType::MULTIPLE_FILES:FileType::NO_FILE;
917  logger(WARN, "DPMBase.setWallsWriteVTK(bool) is deprecated! Use wallHandler.setWriteVTK(bool) instead.");
918  wallHandler.setWriteVTK(writeVTKFileType);
919 }

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
903 {
904  logger(WARN, "DPMBase.setWallsWriteVTK(FileType) is deprecated! Use wallHandler.setWriteVTK(FileType) instead.");
905  wallHandler.setWriteVTK(writeWallsVTK);
906 }

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

◆ setWritePythonFileForVTKVisualisation()

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

Enables/disables the writePythonFileForVTKVisualisation() function.

Parameters
[in]forceWritePythonFileForVTKVisualisation
5585 {
5586  forceWritePythonFileForVTKVisualisation_ = forceWritePythonFileForVTKVisualisation;
5587 }

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
1339 {
1340  xBallsAdditionalArguments_ = xBallsAdditionalArguments;
1341 }

References xBallsAdditionalArguments_.

Referenced by BaseCluster::actionsOnRestart(), BoundariesSelfTest::BoundariesSelfTest(), ChangingTOIParticle::ChangingTOIParticle(), 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(), read(), RotatingDrumBidisperse::RotatingDrumBidisperse(), 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.
1292 {
1293  xBallsColourMode_ = newCMode;
1294 }

References xBallsColourMode_.

Referenced by 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".
1355 {
1356  xBallsScale_ = newScale;
1357 }

References xBallsScale_.

◆ 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.
1312 {
1313  xBallsVectorScale_ = newVScale;
1314 }

References xBallsVectorScale_.

Referenced by 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
1157 {
1158 
1159 if (newXMax >= getXMin())
1160 {
1161 max_.x() = newXMax;
1162 }
1163 else
1164 {
1165 logger(WARN, "Warning in setXMax(%): xMax=%", newXMax, getXMin());
1166 }
1167 
1168 }

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

Referenced by ChuteWithPeriodicInflow::AddContinuingBottom(), statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), ChangingTOIParticle::ChangingTOIParticle(), 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(), 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
1002 {
1003 if (newXMin <= getXMax())
1004 {
1005 min_.x() = newXMin;
1006 }
1007 else
1008 {
1009 logger(WARN, "Warning in setXMin(%): xMax=%", newXMin, getXMax());
1010 }
1011 }

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

Referenced by statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), ChangingTOIParticle::ChangingTOIParticle(), Funnel::check_funnel(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), 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
1183 {
1184 
1185 if (newYMax >= getYMin())
1186 {
1187 max_.y() = newYMax;
1188 }
1189 else
1190 {
1191 logger(WARN, "Warning in setYMax(%): yMax=%", newYMax, getYMin());
1192 }
1193 
1194 }

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

Referenced by statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), ChangingTOIParticle::ChangingTOIParticle(), 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(), 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
1026 {
1027 if (newYMin <= getYMax())
1028 {
1029 min_.y() = newYMin;
1030 }
1031 else
1032 {
1033 logger(WARN, "Warning in setYMin(%): yMax=%", newYMin, getYMax());
1034 }
1035 }

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

Referenced by statistics_while_running< T >::auto_set_domain(), BoundariesSelfTest::BoundariesSelfTest(), ChangingTOIParticle::ChangingTOIParticle(), Funnel::check_funnel(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), 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
1209 {
1210 if (newZMax >= getZMin())
1211 {
1212 max_.z() = newZMax;
1213 }
1214 else
1215 {
1216 logger(WARN, "Warning in setZMax(%): zMax=%", newZMax, getZMin());
1217 }
1218 }

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(), ChangingTOIParticle::ChangingTOIParticle(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), 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(), CFDDEMCoupleTest::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
1050 {
1051 
1052 if (newZMin <= getZMax())
1053 {
1054 min_.z() = newZMin;
1055 }
1056 else
1057 {
1058 logger(WARN, "Warning in setZMin(%): zMax=%", newZMin, getZMax());
1059 }
1060 
1061 }

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(), ChangingTOIParticle::ChangingTOIParticle(), ClosedCSCWalls::ClosedCSCWalls(), clumpTest::clumpTest(), CSCWalls::CSCWalls(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), MarbleRun::includeInDomain(), InitialConditions< SpeciesType >::InitialConditions(), load(), main(), 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)
staticprivate

signal handler function.

5221 {
5222  switch (signal)
5223  {
5224  case SIGINT:
5225  if (!continueFlag_)
5226  {
5227  logger(INFO, "SIGINT has been captured for the second time!\nMercuryDPM will forcefully exit!");
5228  std::exit(SIGINT);
5229  }
5230 
5231  logger(INFO, "SIGINT has been captured!\nMercuryDPM will finish the current time step, then it will stop!\nHit Ctrl+C again to forcefully exit.");
5232  continueFlag_ = false;
5233  return;
5234 
5235  case SIGTERM:
5236  logger(INFO, "\nSIGTERM has been captured!\nMercuryDPM will finish the current time step, then it will stop!");
5237  continueFlag_ = false;
5238  return;
5239 
5240  default:
5241  logger(INFO, "No Signal to Capture!");
5242  }
5243 }

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
4335 {
4336  initialiseSolve();
4337  setSoftStop();
4338 
4339  // Can be used to measure simulation time
4340  clock_.tic();
4341  // This is the main loop over advancing time
4342  while (getTime() < getTimeMax() && continueSolve() && continueFlag_)
4343  {
4345  }
4346  // Can be used to measure simulation time
4347  clock_.toc();
4348 
4349  finaliseSolve();
4350 }
void initialiseSolve()
Beginning of the solve routine, before time stepping.
Definition: DPMBase.cc:4237
virtual void computeOneTimeStep()
Performs everything needed for one time step, used in the time-loop of solve().
Definition: DPMBase.cc:4370
void finaliseSolve()
End of the solve routine, after time stepping.
Definition: DPMBase.cc:4352
void setSoftStop()
function for setting sigaction constructor.
Definition: DPMBase.cc:5249
virtual bool continueSolve() const
A virtual function for deciding whether to continue the simulation, based on a user-specified criteri...
Definition: DPMBase.cc:1979
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
Definition: MercuryTime.h:49
void tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
Definition: MercuryTime.h:38

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

Referenced by FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), commandLineCG(), ClusterGenerator::create(), CLiveStatistics< T >::getLiveStatistics(), main(), ChuteBottom::makeRoughBottom(), MeltableForceLaw2SelfTest::MeltableForceLaw2SelfTest(), MeltableForceLawSelfTest::MeltableForceLawSelfTest(), MovingWalls::MovingWalls(), RotatingDrumBidisperse::RotatingDrumBidisperse(), 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(), and HertzContactRestitutionUnitTest::test().

◆ 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
791 {
792 readArguments(argc, argv);
793 solve();
794 }
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4458
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334

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.
5312  {
5313  //one-d problems
5314  if (domainSplit == DomainSplit::X) {
5316  return;
5317  } else if (domainSplit == DomainSplit::Y) {
5319  return;
5320  } else if (domainSplit == DomainSplit::Z) {
5322  return;
5323  }
5324  //two-d problems
5325  // split into axb grid with a the largest integer that divides NUMBER_OF_PROCESSORS and is smaller than sqrt(NUMBER_OF_PROCESSORS)
5326  unsigned a;
5327  for (unsigned n = floor(sqrt(NUMBER_OF_PROCESSORS));n>0; n--) {
5328  if (NUMBER_OF_PROCESSORS % n == 0) {
5329  a = n;
5330  break;
5331  }
5332  }
5333  if (domainSplit == DomainSplit::XY) {
5335  return;
5336  } else if (domainSplit == DomainSplit::XZ) {
5338  return;
5339  } else if (domainSplit == DomainSplit::YZ) {
5341  return;
5342  }
5343  //three-d problems
5344  // split into axbxc grid with
5345  // - a the largest integer that divides NUMBER_OF_PROCESSORS and is smaller than cbrt(NUMBER_OF_PROCESSORS)
5346  // - b the largest integer that divides NUMBER_OF_PROCESSORS/a and is smaller than sqrt(NUMBER_OF_PROCESSORS/a)
5347  unsigned b;
5348  for (unsigned n = floor(cbrt(NUMBER_OF_PROCESSORS));n>0; n--) {
5349  if (NUMBER_OF_PROCESSORS % n == 0) {
5350  a = n;
5351  break;
5352  }
5353  }
5354  for (unsigned n = floor(sqrt(NUMBER_OF_PROCESSORS/a));n>0; n--) {
5355  if (NUMBER_OF_PROCESSORS % (n*a) == 0) {
5356  b = n;
5357  break;
5358  }
5359  }
5361 }
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5302
const Scalar * a
Definition: level2_cplx_impl.h:32
EIGEN_DEVICE_FUNC EIGEN_ALWAYS_INLINE T cbrt(const T &x)
Definition: MathFunctions.h:1320

References a, b, Eigen::numext::cbrt(), Eigen::bfloat16_impl::floor(), n, NUMBER_OF_PROCESSORS, setNumberOfDomains(), sqrt(), X, XY, XZ, Y, YZ, and Z.

◆ synchroniseParticle()

void DPMBase::synchroniseParticle ( BaseParticle p,
unsigned  fromProcessor = 0 
)
protected
5190 {
5191 #ifdef MERCURYDPM_USE_MPI
5192  MPIContainer& communicator = MPIContainer::Instance();
5193 
5194  //The processor that contains the particle that needs to be copied needs to identify the target, and communicate this
5195  MPIParticle pInfo;
5196  if (communicator.getProcessorID() == fromProcessor)
5197  {
5199  }
5200 
5201  //Broadcast from processor i
5202  communicator.broadcast(&pInfo,MercuryMPIType::PARTICLE,fromProcessor);
5204 #endif
5205 }
@ PARTICLE
Definition: MpiContainer.h:46
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:84
Data class to send a particle over MPI.
Definition: MpiDataClass.h:60
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:110

References MPIContainer::broadcast(), copyDataFromMPIParticleToParticle(), MPISphericalParticle::copyDataFromParticleToMPIParticle(), MPIContainer::getProcessorID(), MPIContainer::Instance(), p, 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
1827 {
1828 #ifdef MERCURYDPM_USE_MPI
1829  if (NUMBER_OF_PROCESSORS == 1) { return; }
1830 
1831  //Check if the interactionRadius of the BaseParticle is larger than given in the domain
1833  if(2.0*P->getMaxInteractionRadius() > domainHandler.getInteractionDistance())
1834  {
1835  logger(VERBOSE,"Processor % | Updating mpi grid. Old interactionDistance: %, new interactionDistance %.",
1836  PROCESSOR_ID,domainHandler.getInteractionDistance(),2.0*P->getMaxInteractionRadius());
1837 
1838  //Update the interactionDistance in the domain and periodicBoundaryHandler
1839  domainHandler.setInteractionDistance(2.0*P->getMaxInteractionRadius());
1840  periodicBoundaryHandler.setInteractionDistance(2.0*P->getMaxInteractionRadius());
1841 
1842  //Find new ghost particless
1845  }
1846 #endif
1847 }
Mdouble getInteractionDistance()
Gets the interaction distance of the domain handler.
Definition: DomainHandler.cc:302

References DomainHandler::addNewParticles(), PeriodicBoundaryHandler::addNewParticles(), domain, 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.

3581 {
3582  os << "MercuryDPM " << getVersion();
3583  //which outputs basic information regarding the various files (.data, .fstat etc. etc.)
3584  //only writes the run number if it is different from 0
3585  if (runNumber_ != 0)
3586  os << " runNumber " << runNumber_;
3587  os << " name " << name_;
3588  os << " revision " << getRevision();
3589  os << " repository " << getRepositoryURL() << '\n';
3590  os << "dataFile " << dataFile << '\n';
3591  os << "fStatFile " << fStatFile << '\n';
3592  os << "eneFile " << eneFile << '\n';
3593  os << "restartFile " << restartFile << '\n';
3594  os << "statFile " << statFile << '\n';
3595  os << "interactionFile " << interactionFile << '\n';
3596  //Outputs the "domain" corresponding to the system for
3597  //use with XBalls, as well as other information regarding the system as a whole
3598  os << "xMin " << getXMin()
3599  << " xMax " << getXMax()
3600  << " yMin " << getYMin()
3601  << " yMax " << getYMax()
3602  << " zMin " << getZMin()
3603  << " zMax " << getZMax() << '\n'
3604  << "timeStep " << getTimeStep()
3605  << " time " << getTime()
3606  << " ntimeSteps " << numberOfTimeSteps_
3607  << " timeMax " << getTimeMax() << '\n'
3608  << "systemDimensions " << getSystemDimensions()
3609  << " particleDimensions " << getParticleDimensions()
3610  << " gravity " << getGravity()
3611  << " backgroundDrag " <<getBackgroundDrag();
3612  os << " writeVTK " << writeParticlesVTK_
3613  << " " << wallHandler.getWriteVTK()
3614  << " " << interactionHandler.getWriteVTK()
3615  << " " << boundaryHandler.getWriteVTK()
3616  << " " << (vtkWriter_?vtkWriter_->getFileCounter():0)
3617  << " " << wallVTKWriter_.getFileCounter()
3619  << " " << boundaryVTKWriter_.getFileCounter();
3620 
3621  // Outputting the wall details vtk enum values and file types.
3622  // For example, we have three wall details options with enum values 4, 12 and 25, and three corresponding filetypes
3623  // NO_FILE, ONE_FILE and MULTIPLE_FILES. Let's also say the file counter is at 101.
3624  // The output will be: writeWallDetailsVTK 3 4 NO_FILE 12 ONE_FILE 25 MULTIPLE_FILES 101
3625  // Only write when any of them have something other than NO_FILE. In this way the selftests restart files all keep working.
3627  {
3628  std::unordered_map<WallHandler::DetailsVTKOptions, FileType> writeWallDetailsVTK = wallHandler.getWriteWallDetailsVTKAll();
3629  os << " writeWallDetailsVTK " << writeWallDetailsVTK.size();
3630  for (const auto& p : writeWallDetailsVTK)
3631  os << " " << static_cast<int>(p.first) << " " << p.second;
3632  os << " " << wallDetailsVTKWriter_.getFileCounter();
3633  }
3634 
3635  // Only write vtk output directories if any of them are different then the default directory.
3636  if ((vtkWriter_ && vtkWriter_->getOutputDirectory() != ".") ||
3641  {
3642  os << " vtkOutDir " << (vtkWriter_ ? vtkWriter_->getOutputDirectory() : ".")
3647  }
3648 
3649 vtk_out_dir_done:
3650 
3651  os << " random ";
3652  random.write(os);
3653 #ifdef MERCURYDPM_USE_OMP
3654  //Write number of OMP threads
3655  if(getNumberOfOMPThreads() > 1) {
3656  os << " numberOfOMPThreads " << getNumberOfOMPThreads();
3657  }
3658 #endif
3659 #ifdef MERCURYDPM_USE_MPI
3660  //Check if we are dealing with multiple cores
3661  if (NUMBER_OF_PROCESSORS > 1 )
3662  {
3663  os << " numberOfProcessors " << NUMBER_OF_PROCESSORS
3665  }
3666 #endif
3667  //only write xBallsArguments if they are nonzero
3669  os << " xBallsArguments " << getXBallsAdditionalArguments();
3670  os << '\n';
3671  //writes all species (including mixed species) to an output stream
3672 
3673  speciesHandler.write(os);
3674 
3675  //outputs the number of walls in the system
3676  os << "Walls " << wallHandler.getNumberOfObjects() << std::endl;
3677  if (writeAllParticles || wallHandler.getSize() < 9) {
3678  for (BaseWall* w : wallHandler)
3679  os << (*w) << std::endl;
3680  } else {
3681  for (int i=0; i<2; ++i)
3682  os << *wallHandler.getObject(i) << std::endl;
3683  os << "...\n";
3684  }
3685 
3686  //outputs the number of boundaries in the system
3687  os << "Boundaries " << boundaryHandler.getNumberOfObjects() << std::endl;
3688  if (writeAllParticles || boundaryHandler.getSize() < 9)
3689  {
3691  os << (*b) << std::endl;
3692  }
3693  else
3694  {
3695  for (int i = 0; i < 2; ++i)
3696  os << *boundaryHandler.getObject(i) << std::endl;
3697  os << "...\n";
3698  }
3699 
3700  if (writeAllParticles || particleHandler.getSize() < getNToWrite())
3701  {
3702  //if the "writeAllParticles" bool == true, or there are fewer than 4 particles
3703  //calls the particleHandler version of the "write" function and also
3704  //outputs to file all relevant particle information for all particles in the system
3705  particleHandler.write(os);
3706  }
3707  else
3708  {
3709  //otherwise, only prints out limited information
3710  os << "Particles " << particleHandler.getSize() << '\n';
3711  for (unsigned int i = 0; i < getNToWrite(); i++)
3712  os << *(particleHandler.getObject(i)) << '\n';
3713  os << "..." << '\n';
3714  }
3715  // Similarly, print out interaction details (all of them, or up to nToWrite of them)
3716  if (writeAllParticles || interactionHandler.getNumberOfObjects() < getNToWrite())
3717  {
3719  }
3720  else
3721  {
3722  os << "Interactions " << interactionHandler.getNumberOfObjects() << '\n';
3723  for (unsigned int i = 0; i < getNToWrite(); i++)
3724  os << *(interactionHandler.getObject(i)) << '\n';
3725  os << "..." << '\n';
3726  }
3727 }
const std::string getRevision()
Definition: Configuration/CMakeDefinitions.cc:20
const std::string getRepositoryURL()
Definition: Configuration/CMakeDefinitions.cc:25
const std::string getVersion()
Definition: Configuration/CMakeDefinitions.cc:30
void compare(const Packet &a, const Packet &b)
Definition: blasutil.cpp:24
unsigned getFileCounter() const
Definition: BaseVTKWriter.h:36
unsigned int getParticleDimensions() const
Returns the particle dimensionality.
Definition: DPMBase.cc:1458
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
Definition: DPMBase.cc:1346
int getNToWrite() const
get the number of elements to write to the
Definition: DPMBase.cc:855
void write(std::ostream &os) const
Writes the InteractionHandler to an output stream, for example a restart file.
Definition: InteractionHandler.cc:413
void write(std::ostream &os) const
void write(std::ostream &os) const
Definition: RNG.cc:58
virtual void write(std::ostream &os) const
Write all the species and mixed species to an output stream.
Definition: SpeciesHandler.cc:1047
std::unordered_map< DetailsVTKOptions, FileType > getWriteWallDetailsVTKAll() const
Definition: WallHandler.cc:493

References b, boundaryHandler, boundaryVTKWriter_, compare(), dataFile, eneFile, fStatFile, getBackgroundDrag(), BaseVTKWriter< H >::getFileCounter(), getGravity(), getNToWrite(), BaseHandler< T >::getNumberOfObjects(), getNumberOfOMPThreads(), BaseHandler< T >::getObject(), BaseVTKWriter< H >::getOutputDirectory(), 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(), i, interactionFile, interactionHandler, interactionVTKWriter_, name_, NUMBER_OF_PROCESSORS, numberOfDomains_, numberOfTimeSteps_, p, particleHandler, random, restartFile, runNumber_, speciesHandler, statFile, vtkWriter_, w, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, InteractionHandler::write(), RNG::write(), ParticleHandler::write(), SpeciesHandler::write(), writeParticlesVTK_, XAXIS, YAXIS, and ZAXIS.

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

◆ writeDataFile()

void DPMBase::writeDataFile ( )
2990 {
2992  {
2994  dataFile.close();
2995  }
2996 }
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:2379
bool openWrite(unsigned)
First sets openmode to write (and append in some cases), then calls open().
Definition: File.cc:359

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

Referenced by writeOutputFiles().

◆ writeEneFile()

void DPMBase::writeEneFile ( )
2999 {
3001  {
3002  //If the file type is "multiple files", writes a header for each individual files. If not, only writes for the first time step
3004  eneFile.close();
3005  }
3006 }
virtual void writeEneTimeStep(std::ostream &os) const
Write the global kinetic, potential energy, etc. in the system.
Definition: DPMBase.cc:2092

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

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

2004 {
2005  //only write if we don't restart
2006  if (getAppend())
2007  return;
2008 
2012  long width = os.precision() + 6;
2013  os << std::setw(width)
2014  << "time " << std::setw(width)
2015  << "gravitEnergy " << std::setw(width) //gravitational potential energy
2016  << "traKineticEnergy " << std::setw(width) //translational kinetic energy
2017  << "rotKineticEnergy " << std::setw(width) //rotational kE
2018  << "elasticEnergy " << std::setw(width)
2019  << "centerOfMassX " << std::setw(width)
2020  << "centerOfMassY " << std::setw(width)
2021  << "centerOfMassZ\n";
2022 }

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.

2093 {
2096  writeEneHeader(os);
2097 
2098  const Mdouble m = particleHandler.getMass();
2100  //Ensure the numbers fit into a constant width column: for this we need the precision given by the operating system,
2101  //plus a few extra characters for characters like a minus and scientific notation.
2102  const static int width = os.precision() + 6;
2103  os << std::setw(width) << getTime()
2104  << " " << std::setw(width) << -Vec3D::dot(getGravity(), com)
2105  << " " << std::setw(width) << particleHandler.getKineticEnergy()
2106  << " " << std::setw(width) << particleHandler.getRotationalEnergy()
2107  << " " << std::setw(width) << getElasticEnergy()
2108  // we need to write x, y and z coordinates separately, otherwise the width of the columns is incorrect
2109  << " " << std::setw(width)
2110  << (m == 0 ? constants::NaN : com.X / m) //set to nan because 0/0 implementation in gcc and clang differs
2111  << " " << std::setw(width) << (m == 0 ? constants::NaN : com.Y / m)
2112  << " " << std::setw(width) << (m == 0 ? constants::NaN : com.Z / m)
2113  << std::endl;
2114 }
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Definition: DPMBase.cc:2003
Mdouble getRotationalEnergy() const
Definition: ParticleHandler.cc:580
Vec3D getMassTimesPosition() const
Definition: ParticleHandler.cc:630
Mdouble getKineticEnergy() const
Definition: ParticleHandler.cc:551
int * m
Definition: level2_cplx_impl.h:294
const Mdouble NaN
Definition: GeneralDefine.h:22

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

Referenced by writeEneFile().

◆ writeFStatFile()

void DPMBase::writeFStatFile ( )
3009 {
3011  {
3013  //fStatFile.getFstream().ignore(2000,'\t');
3014  fStatFile.close();
3015  }
3016 }
virtual void writeFstatHeader(std::ostream &os) const
Writes a header with a certain format for FStat file.
Definition: DPMBase.cc:2031

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

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

2032 {
2033 
2034  // line #1: time, volume fraction
2035  // line #2: wall box: wx0, wy0, wz0, wx1, wy1, wz1
2036  // line #3: radii-min-max & moments: rad_min, rad_max, r1, r2, r3, r4
2037  os << "#"
2038  << " " << getTime()
2039  << " " << 1 //marker that these are fstat files with contact point instead of center point
2040  << '\n';
2041  os << "#"
2042  << " " << getXMin()
2043  << " " << getYMin()
2044  << " " << getZMin()
2045  << " " << getXMax()
2046  << " " << getYMax()
2047  << " " << getZMax()
2048  << '\n';
2049  os << "#"
2050  << " ";
2051 
2052  if (!(particleHandler.getSmallestParticleLocal() == nullptr))
2053  {
2055  }
2056  else
2057  {
2058  os << std::numeric_limits<double>::quiet_NaN();
2059  }
2060  os << " ";
2061  if (!(particleHandler.getLargestParticleLocal() == nullptr))
2062  {
2064  }
2065  else
2066  {
2067  os << std::numeric_limits<double>::quiet_NaN();
2068  }
2069 
2070  os << " " << 0
2071  << " " << 0
2072  << " " << 0
2073  << " " << 0
2074  << '\n';
2075  //B: write data
2077  {
2078  c->writeToFStat(os, getTime());
2079  }
2080  //os << std::flush;
2081 }
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:331
BaseParticle * getSmallestParticleLocal() const
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the loc...
Definition: ParticleHandler.cc:496
BaseParticle * getLargestParticleLocal() const
Gets a pointer to the largest BaseParticle (by interactionRadius) in the ParticleHandler of the local...
Definition: ParticleHandler.cc:520

References calibrate::c, 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 >.

4116 {
4117  //writing fstat data if .saveCurrentTimeStep(numberOfTimeSteps_) is true
4119  {
4120  writeFStatFile();
4121  }
4122 
4123  //writing .ene data if .saveCurrentTimeStep(numberOfTimeSteps_) is true
4125  {
4126  writeEneFile();
4127  }
4128  //writing .data data if .saveCurrentTimeStep(numberOfTimeSteps_) is true
4130  {
4132  if (getRestarted() || dataFile.getCounter() == 0)
4134  writeDataFile();
4135  } else {
4137  }
4138  printTime();
4139  writeVTKFiles();
4140  }
4141  cgHandler.evaluate();
4142 
4143 
4144  //write restart file last, otherwise the output counters are wrong
4146  {
4147  writeRestartFile();
4148  }
4149 }
void evaluate()
Contains the code executed at each time step.
Definition: CGHandler.cc:77
void writeVTKFiles() const
Definition: DPMBase.cc:2151
void writeEneFile()
Definition: DPMBase.cc:2998
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:2979
virtual void printTime() const
Displays the current simulation time and the maximum simulation duration.
Definition: DPMBase.cc:1959
void writeFStatFile()
Definition: DPMBase.cc:3008
void writeDataFile()
Definition: DPMBase.cc:2989
bool saveCurrentTimeStep(unsigned int ntimeSteps)
determined if this time step has to be written; if so, opens the output file
Definition: File.cc:290
bool saveCurrentTimeStepNoFileTypeCheck(unsigned int ntimeSteps)
Definition: File.cc:295

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

writes .py file for ParaView

The function generates .py file with the same name as the simulation

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

References WallHandler::BOUNDINGBOX, getName(), BaseVTKWriter< H >::getOutputDirectory(), getParticlesWriteVTK(), helpers::getPath(), WallHandler::getWriteDetailsVTK(), InteractionHandler::getWriteVTK(), WallHandler::getWriteVTK(), INFO, interactionHandler, interactionVTKWriter_, logger, NO_FILE, NUMBER_OF_PROCESSORS, WallHandler::NURBSWALL, PROCESSOR_ID, oomph::Global_string_for_annotation::string(), oomph::StringConversion::to_string(), vtkWriter_, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, and helpers::writeToFile().

Referenced by initialiseVTK().

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

2980 {
2982  {
2983  //logger(DEBUG, "Writing restart file %th time step",getNumberOfTimeSteps());
2985  restartFile.close();
2986  }
2987 }
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Definition: DPMBase.cc:3580
bool openWriteNoAppend(unsigned)
Definition: File.cc:376

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(), AngleOfRepose::run(), vibratedBed::run(), CSCInit::save(), RotatingDrumBidisperseInitialise::save(), ClosedCSCWalls::saveWalls(), CSCWalls::saveWalls(), statistics_while_running< T >::statistics_while_running(), writeOutputFiles(), and FlowRule::writeRestartFile().

◆ writeVTKFiles()

void DPMBase::writeVTKFiles ( ) const
protected
2152 {
2154  {
2159  } // else do nothing
2160 
2162  {
2163  vtkWriter_->writeVTK();
2164  } // else do nothing
2165 
2167  {
2169  }
2170 
2172  {
2174  }
2175 
2177  {
2179  }
2180 }
virtual void writeVTK() const =0
void writeVTK() const override
writes a vtk file
Definition: BoundaryVTKWriter.cc:8
void writeVTK() const override
writes a vtk file
Definition: InteractionVTKWriter.cc:8
void writeVTK() const override
Definition: WallDetailsVTKWriter.cc:10
void writeVTK() const override
Definition: WallVTKWriter.cc:31

References boundaryHandler, boundaryVTKWriter_, BaseVTKWriter< H >::getFileCounter(), getParticlesWriteVTK(), getSuperquadricParticlesWriteVTK(), WallHandler::getWriteDetailsVTKAny(), BoundaryHandler::getWriteVTK(), InteractionHandler::getWriteVTK(), WallHandler::getWriteVTK(), interactionHandler, interactionVTKWriter_, MULTIPLE_FILES, MULTIPLE_FILES_PADDED, NO_FILE, ONE_FILE, vtkWriter_, wallDetailsVTKWriter_, wallHandler, wallVTKWriter_, 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(), RotatingDrumBidisperse::RotatingDrumBidisperse(), 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(), initialiseVTK(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), main(), protectiveWall::protectiveWall(), read(), readOld(), readParAndIniFiles(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), ChutePeriodic::setupInitialConditions(), MercuryLogo::setupInitialConditions(), ChangingTOIParticle::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(), SingleParticleSegregation::setupInitialConditions(), ConstantMassFlowMaserBoundaryMixedSpeciesSelfTest::setupInitialConditions(), ConstantMassFlowMaserSelfTest::setupInitialConditions(), CubeDeletionBoundarySelfTest::setupInitialConditions(), DeletionBoundarySelfTest::setupInitialConditions(), DistributionPhiNormalSelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), SubcriticalMaserBoundarySelfTest::setupInitialConditions(), TriangulatedScrewSelfTest::setupInitialConditions(), ScalingTestInitialConditionsRelax::setupInitialConditions(), ScalingTestRun::setupInitialConditions(), Tutorial6::setupInitialConditions(), Packing::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), FluxBoundaryPrescribedDistanceUnitTest::setupInitialConditions(), FluxBoundaryUnitTest::setupInitialConditions(), FullRestartTest::setupInitialConditions(), MD_demo::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), PeriodicWalls::setupInitialConditions(), PeriodicWallsWithSlidingFrictionUnitTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::setupInitialConditions(), Chute::setupInitialConditions(), ChuteBottom::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), ShearStage::ShearStage(), T_protectiveWall::T_protectiveWall(), write(), and writeVTKFiles().

◆ boundaryVTKWriter_

◆ 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 continue solving, see discontinueSolve.

Referenced by discontinueSolve(), signalHandler(), and solve().

◆ dataFile

File DPMBase::dataFile

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

Referenced by RotatingDrumWet::actionsAfterTimeStep(), OneParticleCoolingSelfTest::actionsAfterTimeStep(), ParameterStudy1DDemo::actionsBeforeTimeLoop(), ParameterStudy2DDemo::actionsBeforeTimeLoop(), ParameterStudy3DDemo::actionsBeforeTimeLoop(), ThermalConductionSelfTest::actionsBeforeTimeStep(), BaseCluster::actionsOnRestart(), NautaMixer::addSpeciesAndSetTimeStepAndSaveCount(), BoundariesSelfTest::BoundariesSelfTest(), ClosedCSCRun::ClosedCSCRun(), closeFiles(), commandLineCG(), ChuteBottom::constructor(), constructor(), InitialBed::continueSolve(), CGHandler::evaluateDataFiles(), CGHandler::evaluateRestartFiles(), findNextExistingDataFile(), FluxAndPeriodicBoundarySelfTest::FluxAndPeriodicBoundarySelfTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), getDataFile(), CLiveStatistics< T >::getLiveStatistics(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), 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(), RotatingDrumBidisperseInitialise::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(), MultiplePSDSelfTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::setupInitialConditions(), ContactDetectionIntersectionOfWallsTest::setupInitialConditions(), GetDistanceAndNormalForTriangleWalls::setupInitialConditions(), RollingOverTriangleWalls::setupInitialConditions(), Packing::setupInitialConditions(), PSDSelfTest::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().

◆ disableSoftStop_

bool DPMBase::disableSoftStop_ = false
private

Stores whether the soft stop should not be initialised.

Referenced by disableSoftStop(), and setSoftStop().

◆ 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(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), 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(), 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(), MeltableForceLaw2SelfTest::actionsBeforeTimeStep(), MeltableForceLawSelfTest::actionsBeforeTimeStep(), ThermalConductionSelfTest::actionsBeforeTimeStep(), ConstantRestitutionSelfTest::actionsBeforeTimeStep(), QuaternionWallUnitTest::actionsBeforeTimeStep(), PeriodicWallsWithSlidingFrictionUnitTest::actionsBeforeTimeStep(), SilbertPeriodic::add_flow_particles(), FixedClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), PeriodicBoundaryHandler::collectInteractionData(), computeAllForces(), DPM::computeAllForcesNoHGrid(), computeForcesDueToWalls(), 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(), initialiseVTK(), 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(), MeltableForceLaw2SelfTest::printTime(), MeltableForceLawSelfTest::printTime(), ThermalConductionSelfTest::printTime(), RotatingDrumBidisperse::printTime(), LiquidMigrationSelfTest::printTime(), TwoParticleElasticCollisionInteraction::printTime(), EvaporationAndHeatTest::printTime(), PeriodicBoundaryHandler::processLocalInteractionData(), PeriodicBoundaryHandler::processReceivedInteractionData(), Domain::processReceivedInteractionData(), FileReader::read(), read(), readNextDataFile(), readNextFStatFile(), removeDuplicatePeriodicParticles(), CGHandler::restart(), CSCWalls::saveWalls(), setInteractionsWriteVTK(), setTime(), ExtremeOverlapVolumeUnitTest::setupInitialConditions(), RotatingDrumWet::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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_

◆ 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(), ShearStage::actionsAfterTimeStep(), ClosedCSCRestart::actionsAfterTimeStep(), ClosedCSCRun::actionsAfterTimeStep(), ChangingTOIParticle::actionsAfterTimeStep(), RotatingDrumWet::actionsAfterTimeStep(), TwoByTwoMPIDomainMPI4Test::actionsAfterTimeStep(), CubicCell::actionsAfterTimeStep(), LeesEdwardsDemo::actionsAfterTimeStep(), ShiftingConstantMassFlowMaserBoundarySelfTest::actionsAfterTimeStep(), ShiftingMaserBoundarySelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundary3DSelfTest::actionsAfterTimeStep(), TimeDependentPeriodicBoundaryTest::actionsAfterTimeStep(), vibratedBed::actionsAfterTimeStep(), OneParticleHeatingSelfTest::actionsAfterTimeStep(), OneParticleCoolingSelfTest::actionsAfterTimeStep(), RotatingDrumBidisperseInitialise::actionsAfterTimeStep(), SingleParticleSegregation::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(), MeltableForceLaw2SelfTest::actionsBeforeTimeStep(), MeltableForceLawSelfTest::actionsBeforeTimeStep(), ThermalConductionSelfTest::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(), SingleParticleSegregation::addIntruderParticle(), 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(), CFDDEMCoupleTest::CalcPhiPAndFz(), ChuteWithPeriodicInflow::Check_and_Duplicate_Periodic_Particle(), checkAndDuplicatePeriodicParticles(), FixedClusterInsertionBoundary::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(), CGExactOverlapUnitTest::clear(), 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(), initialiseSolve(), Membrane::initializeEdgeBendingQuantities(), integrateAfterForceComputation(), ChuteWithPeriodicInflow::integrateBeforeForceComputation(), integrateBeforeForceComputation(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), HorizontalMixer::introduceSingleParticle(), LaserOnLayer::LaserOnLayer(), LawinenBox::LawinenBox(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), 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(), InitialBed::printTime(), LaserOnLayer::printTime(), MeltableForceLaw2SelfTest::printTime(), MeltableForceLawSelfTest::printTime(), OneParticleHeatingSelfTest::printTime(), OneParticleCoolingSelfTest::printTime(), ThermalConductionSelfTest::printTime(), RotatingDrumBidisperse::printTime(), SingleParticleSegregation::printTime(), CubeDeletionBoundarySelfTest::printTime(), DeletionBoundarySelfTest::printTime(), DistributionSelfTest::printTime(), DistributionToPSDSelfTest::printTime(), InsertionBoundarySelfTest::printTime(), MultiplePSDSelfTest::printTime(), NozzleSelfTest::printTime(), PolydisperseInsertionBoundarySelfTest::printTime(), PSDManualInsertionSelfTest::printTime(), LiquidMigrationSelfTest::printTime(), SinterPair::printTime(), PSDSelfTest::printTime(), EvaporationAndHeatTest::printTime(), RandomClusterInsertionBoundarySelfTest::printTime(), HeatTransferUnitTest::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(), RotatingDrumBidisperse::RotatingDrumBidisperse(), CSCInit::save(), RotatingDrumBidisperseInitialise::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(), ChangingTOIParticle::setupInitialConditions(), free_cooling::setupInitialConditions(), restart::setupInitialConditions(), CFDDEMCoupleTest::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(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleHeatingSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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(), 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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::setupInitialConditions(), TwoParticleCollisionInteraction::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(), CGDisplacementFieldUnitTest::setupInitialConditions(), CGExactOverlapUnitTest::setupInitialConditions(), CGForceDensityUnitTest::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), ConsistencyInitialParticleWallOverlapUnitTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), FluxBoundaryPrescribedDistanceUnitTest::setupInitialConditions(), FluxBoundaryUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), FreeFall::setupInitialConditions(), FullRestartTest::setupInitialConditions(), HeatTransferUnitTest::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(), WallVTKWriter::writeCGFields(), 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(), 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(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), main(), BaseCluster::particleInsertionSuccessful(), MD_demo::RandomRadius(), read(), readNextArgument(), RotatingDrumBidisperse::RotatingDrumBidisperse(), 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(), InitialBed::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(), 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(), RotatingDrumBidisperse::RotatingDrumBidisperse(), FlowRule::run(), statistics_while_running< T >::run(), AngleOfRepose::run(), CSCInit::save(), RotatingDrumBidisperseInitialise::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(), SingleParticleSegregation::addIntruderParticle(), 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(), CGDisplacementFieldUnitTest::CGDisplacementFieldUnitTest(), CGExactOverlapUnitTest::CGExactOverlapUnitTest(), CGForceDensityUnitTest::CGForceDensityUnitTest(), RandomClusterInsertionBoundary::checkBoundaryBeforeTimeStep(), checkSettings(), ChutePeriodicDemo::ChutePeriodicDemo(), ChuteWithPeriodicInflowAndContinuingBottom::ChuteWithPeriodicInflowAndContinuingBottom(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ChuteWithPeriodicInflowAndVariableBottom::ChuteWithPeriodicInflowAndVariableBottom(), ClosedCSCWalls::ClosedCSCWalls(), ChuteWithPeriodicInflow::computeInternalForces(), BaseCluster::computeInternalStructure(), constructor(), Contact::Contact(), ContractionWithPeriodicInflow::ContractionWithPeriodicInflow(), 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(), FluxBoundaryPrescribedDistanceUnitTest::FluxBoundaryPrescribedDistanceUnitTest(), FluxBoundarySelfTest::FluxBoundarySelfTest(), FluxBoundaryUnitTest::FluxBoundaryUnitTest(), 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(), LaserOnLayer::LaserOnLayer(), LawinenBox::LawinenBox(), LeesEdwardsDemo::LeesEdwardsDemo(), LeesEdwardsSelfTest::LeesEdwardsSelfTest(), 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(), RotatingDrumBidisperse::RotatingDrumBidisperse(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), ChangingTOIParticle::setupInitialConditions(), free_cooling::setupInitialConditions(), restart::setupInitialConditions(), CFDDEMCoupleTest::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(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), OneParticleHeatingSelfTest::setupInitialConditions(), OneParticleCoolingSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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(), DistributionPhiNormalSelfTest::setupInitialConditions(), DistributionSelfTest::setupInitialConditions(), DistributionToPSDSelfTest::setupInitialConditions(), InsertionBoundarySelfTest::setupInitialConditions(), MultiplePSDSelfTest::setupInitialConditions(), NozzleSelfTest::setupInitialConditions(), clumpTest::setupInitialConditions(), PolydisperseInsertionBoundarySelfTest::setupInitialConditions(), PSDManualInsertionSelfTest::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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::setupInitialConditions(), TwoParticleCollisionInteraction::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(), CGDisplacementFieldUnitTest::setupInitialConditions(), CGExactOverlapUnitTest::setupInitialConditions(), CGForceDensityUnitTest::setupInitialConditions(), CreateDataAndFStatFiles::setupInitialConditions(), ChargedBondedParticleUnitTest::setupInitialConditions(), ConsistencyInitialParticleWallOverlapUnitTest::setupInitialConditions(), PSDSelfTest::setupInitialConditions(), DrivenParticleClass::setupInitialConditions(), EnergyUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), RandomClusterInsertionBoundarySelfTest::setupInitialConditions(), FluxBoundaryPrescribedDistanceUnitTest::setupInitialConditions(), FluxBoundaryUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), FreeFall::setupInitialConditions(), FullRestartTest::setupInitialConditions(), HeatTransferUnitTest::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(), SetDistributionPhiNormalSelfTest::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(), SingleParticleSegregation::SingleParticleSegregation(), Sintering::Sintering(), SinterPair::SinterPair(), 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_

◆ wallHandler

WallHandler DPMBase::wallHandler

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

Referenced by T_protectiveWall::actionsAfterTimeStep(), GranuHeap::actionsAfterTimeStep(), ChangingTOIParticle::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(), checkParticleForInteractionLocal(), MercuryBase::checkParticleForInteractionLocal(), checkSettings(), ChuteWithContraction::ChuteWithContraction(), ChuteWithPeriodicInflowAndContraction::ChuteWithPeriodicInflowAndContraction(), ClosedCSCRestart::ClosedCSCRestart(), ClosedCSCRun::ClosedCSCRun(), ClosedCSCWalls::ClosedCSCWalls(), 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(), initialiseVTK(), integrateAfterForceComputation(), integrateBeforeForceComputation(), HorizontalMixer::introduceParticlesAtWall(), ContactDetectionIntersectionOfWallsTest::introduceParticlesAtWall(), HorizontalMixer::introduceParticlesInDomain(), LaserOnLayer::LaserOnLayer(), 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(), RotatingDrumBidisperse::RotatingDrumBidisperse(), RotatingDrumBidisperseInitialise::RotatingDrumBidisperseInitialise(), 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(), ChangingTOIParticle::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(), InitialBed::setupInitialConditions(), MeltableForceLaw2SelfTest::setupInitialConditions(), MeltableForceLawSelfTest::setupInitialConditions(), ThermalConductionSelfTest::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(), DistributionPhiNormalSelfTest::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(), TwoParticleBagheriCollision::setupInitialConditions(), TwoParticleClassicalWilletCollision::setupInitialConditions(), TwoParticleCollisionInteraction::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(), ConsistencyInitialParticleWallOverlapUnitTest::setupInitialConditions(), EvaporationAndHeatTest::setupInitialConditions(), ExtremeOverlapWithWallsUnitTest::setupInitialConditions(), FreeFallHertzMindlinUnitTest::setupInitialConditions(), FreeFall::setupInitialConditions(), FullRestartTest::setupInitialConditions(), InclinedPlane::setupInitialConditions(), MpiMaserChuteTest::setupInitialConditions(), MovingIntersectionOfWallsUnitTest_Basic::setupInitialConditions(), MovingWalls::setupInitialConditions(), MultiParticlesInsertion::setupInitialConditions(), MpiPeriodicBoundaryUnitTest::setupInitialConditions(), SetDistributionPhiNormalSelfTest::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_

◆ 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: