MercuryDPM
Beta
|
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>
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 FilesAndRunNumber &other) | |
Copy constructor type-1. More... | |
DPMBase (const DPMBase &other) | |
Copy constructor type-2. More... | |
virtual | ~DPMBase () |
virtual destructor More... | |
void | solve () |
The work horse of the code. More... | |
void | checkSettings () |
Checks if the essentials are set properly to go ahead with solving the problem. More... | |
virtual void | writeOutputFiles () |
Writes the simulation data onto all the files i.e. .data, .ene, .fstat ... More... | |
void | solve (int argc, char *argv[]) |
The solve function is the work horse of the code with the user input. 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 double | getInfo (const BaseParticle &P) const |
A virtual method that allows the user to overrride and set what is written into the info column in the data file. By default it returns the Species ID number. More... | |
virtual void | writeRestartFile () |
Stores all the particle data for current save time step. Calls the write function. More... | |
int | readRestartFile () |
Reads all the particle data corresponding to the current saved time step. Which is what the restart file basically stores. The problem description with the latest particle data. More... | |
int | readRestartFile (std::string fileName) |
Also reads all the particle data corresponding to the current saved time step. More... | |
virtual void | write (std::ostream &os, bool writeAllParticles=true) const |
Loads all MD data and plots statistics for all timesteps in the .data file. More... | |
virtual void | read (std::istream &is) |
Reads all particle data into a restart file. More... | |
virtual void | readOld (std::istream &is) |
Reads all particle data into a restart file; old version. More... | |
bool | readDataFile (const std::string fileName, unsigned int format=0) |
This allows particle data to be reloaded from data files. More... | |
bool | readParAndIniFiles (const std::string fileName) |
Allows the user to read par.ini files (useful to read MDCLR files) 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 XBalls/xballs.txt. More... | |
bool | findNextExistingDataFile (Mdouble tMin, bool verbose=true) |
Useful when fileType is chosen as Multiple Files or Multiple files with padded. 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[]) |
virtual bool | checkParticleForInteraction (const BaseParticle &P) |
Checks if the particle having any interaction with walls or other particles. More... | |
Mdouble | getTime () const |
Access function for the time. More... | |
unsigned int | getNtimeSteps () const |
Returns the current counter of time steps. More... | |
void | setTime (Mdouble time) |
Access function for the time. More... | |
void | setTimeMax (Mdouble newTMax) |
Allows the upper time limit to be changed. More... | |
Mdouble | getTimeMax () const |
Allows the user to access the total simulation time during the simulation. Cannot change it though. More... | |
void | setDoCGAlways (bool newDoCGFlag) |
void | setRotation (bool newRotFlag) |
Allows to set the flag for enabling or disabling particle rotation in the simulations. More... | |
bool | getRotation () const |
Returns a flag indicating if particle rotation is enabled or disabled. More... | |
bool | getDoCGAlways () 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... | |
void | setXMin (Mdouble newXMin) |
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin. More... | |
void | setYMin (Mdouble newYMin) |
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin. More... | |
void | setZMin (Mdouble newZMin) |
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin. More... | |
void | setXMax (Mdouble newXMax) |
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax. More... | |
void | setYMax (Mdouble newYMax) |
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax. More... | |
void | setZMax (Mdouble newZMax) |
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax. More... | |
void | setTimeStep (Mdouble newDt) |
Allows the time step dt to be changed. More... | |
Mdouble | getTimeStep () const |
Allows the time step dt to be accessed. More... | |
void | setXBallsColourMode (int newCMode) |
Set the xball output mode. More... | |
int | getXBallsColourMode () const |
Get the xball 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 |
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) |
Allows to modify the gravity vector. More... | |
Vec3D | getGravity () const |
Returns the gravity vector. More... | |
void | setDimension (unsigned int newDim) |
Sets the system and particle dimension. More... | |
void | setSystemDimensions (unsigned int newDim) |
Allows for the dimension of the simulation to be changed. More... | |
unsigned int | getSystemDimensions () const |
Returns the dimension of the simulation. Note there is also a particle dimension. More... | |
void | setParticleDimensions (unsigned int particleDimensions) |
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres. More... | |
unsigned int | getParticleDimensions () const |
Returns the particle dimensions. 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 the flag denoting if the append option is on or off. More... | |
void | setAppend (bool newAppendFlag) |
Allows to set the append option. 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... | |
bool | areInContact (const BaseParticle *pI, const BaseParticle *pJ) const |
Checks if two particle are in contact or is there any positive overlap. More... | |
virtual void | hGridInsertParticle (BaseParticle *obj UNUSED) |
no implementation but can be overidden in its derived classes. More... | |
virtual void | hGridUpdateParticle (BaseParticle *obj UNUSED) |
no implementation but can be overidden in its derived classes. More... | |
virtual void | hGridRemoveParticle (BaseParticle *obj UNUSED) |
no implementation but can be overidden in its derived classes. More... | |
virtual void | hGridUpdateMove (BaseParticle *, Mdouble) |
no implementation but can be overidden in its derived classes. More... | |
virtual void | 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) |
//Not unsigned index because of possible wall collisions. More... | |
Public Member Functions inherited from FilesAndRunNumber | |
FilesAndRunNumber () | |
Constructor. More... | |
FilesAndRunNumber (const FilesAndRunNumber &other) | |
Copy constructor. More... | |
virtual | ~FilesAndRunNumber () |
Constructor. More... | |
void | constructor () |
a function called by the FilesAndRunNumber() (constructor) More... | |
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... | |
int | readRunNumberFromFile () |
Read the run number or the counter from the counter file (COUNTER_DONOTDEL) More... | |
void | autoNumber () |
The autoNumber() function is the trigger. It calls three functions. setRunNumber(), readRunNumberFromFile() and incrementRunNumberInFile(). More... | |
std::vector< int > | get2DParametersFromRunNumber (int size_x, int size_y) |
This turns a counter into two indices which is an amazing feature for doing two dimensional parameter studies. 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... | |
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... | |
void | read (std::istream &is) |
Accepts an input stream std::istream. More... | |
void | write (std::ostream &os) const |
Accepts an output stream read function, which accepts an input stream std::ostream. More... | |
Public Member Functions inherited from Files | |
Files () | |
A constructor. More... | |
virtual | ~Files () |
A destructor, watch out its a virtual destructor. More... | |
Files (const Files &other) | |
Copy constructor. More... | |
MERCURY_DEPRECATED File & | getDataFile () |
The non const version. Allows one to edit the File::dataFile. More... | |
MERCURY_DEPRECATED File & | getEneFile () |
The non const version. Allows to edit the File::eneFile. More... | |
MERCURY_DEPRECATED File & | getFStatFile () |
The non const version. Allows to edit the File::fStatFile. More... | |
MERCURY_DEPRECATED File & | getRestartFile () |
The non const version. Allows to edit the File::restartFile. More... | |
MERCURY_DEPRECATED File & | getStatFile () |
The non const version. Allows to edit the File::statFile. More... | |
MERCURY_DEPRECATED const File & | getDataFile () const |
The const version. Does not allow for any editing of the File::dataFile. More... | |
MERCURY_DEPRECATED const File & | getEneFile () const |
The const version. Does not allow for any editing of the File::eneFile. More... | |
MERCURY_DEPRECATED const File & | getFStatFile () const |
The const version. Does not allow for any editing of the File::fStatFile. More... | |
MERCURY_DEPRECATED const File & | getRestartFile () const |
The const version. Does not allow for any editing of the File::restartFile. More... | |
MERCURY_DEPRECATED const File & | getStatFile () const |
The const version. Does not allow for any editing of the File::statFile. 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 | read (std::istream &is) |
Extracts data from the input stream (which is basically a file you want to read from) into name_, restartFile .... More... | |
void | write (std::ostream &os) const |
Writes data into a file from the member variables name_, restartFile, dataFile etc. More... | |
void | openFiles () |
Opens all the files (ene, data, fstat, restart, stat) for reading and writing purposes. More... | |
void | closeFiles () |
Closes all files (ene, data, fstat, restart, stat) that were opened to read or write. More... | |
void | setNextSavedTimeStep (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... | |
Public Attributes | |
SpeciesHandler | speciesHandler |
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera. 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... | |
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... | |
InteractionHandler | interactionHandler |
An object of the class InteractionHandler. More... | |
Public Attributes inherited from Files | |
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... | |
Protected Member Functions | |
virtual void | computeAllForces () |
Computes all the forces acting on the particles by using the setTorque and setForce methods. See BaseInteractible.cc. More... | |
virtual void | computeInternalForces (BaseParticle *i) |
Computes the forces between particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces) More... | |
virtual void | computeInternalForces (BaseParticle *P1, BaseParticle *P2) |
Computes the forces between particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces) More... | |
virtual void | computeExternalForces (BaseParticle *PI) |
Computes the external forces acting on particles (e.g. gravitational) More... | |
virtual void | computeForcesDueToWalls (BaseParticle *PI) |
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 bool | getHGridUpdateEachTimeStep () const |
virtual void | actionsBeforeTimeStep () |
A virtual function which allows to define operations to be executed before the new time step. 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... | |
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. See XBalls/xballs.txt. However, MercuryDPM supports a much better viewer now called Paraview. See the tutorials section in the documentation. More... | |
virtual void | outputXBallsDataParticle (const unsigned int i, const 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. 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 |
This function enables one to write the global energy available in the system after each time step. The default is to compute the rotational and translational kinetic energy, potential energy and the centre of mass. More... | |
virtual void | initialiseStatistics () |
no implementation but can be overidden in its derived classes. More... | |
virtual void | outputStatistics () |
no implementation but can be overidden in its derived classes. More... | |
void | gatherContactStatistics () |
virtual void | processStatistics (bool usethese UNUSED) |
no implementation but can be overidden in its derived classes. More... | |
virtual void | finishStatistics () |
no implementation but can be overidden in its derived classes. More... | |
virtual void | integrateBeforeForceComputation () |
This is were 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. More... | |
virtual void | integrateAfterForceComputation () |
Integration is done after force computations. We apply the Velocity verlet scheme. See http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet. 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 () |
no implementation but can be overidden in its derived classes. More... | |
virtual void | hGridActionsAfterIntegration () |
no implementation but can be overidden in its derived classes. More... | |
virtual void | broadPhase (BaseParticle *i) |
By broad one means to screen and determine an approximate number of particles that a given particle can be in contact with. Hence the word "Broad phase" of contact detection. More... | |
void | setFixedParticles (unsigned int n) |
void | initialiseTangentialSprings () |
virtual void | printTime () const |
Displays the current simulation time onto your screen for example. More... | |
virtual bool | continueSolve () const |
void | outputInteractionDetails () const |
Displays the interaction details corresponding to the pointer objects in the interaction handler. More... | |
bool | isTimeEqualTo (Mdouble time) const |
Checks if the input variable "time" is the current time in the simulation. More... | |
void | removeDuplicatePeriodicParticles () |
Removes periodic duplicate Particles. More... | |
void | checkAndDuplicatePeriodicParticles () |
In case of periodic boundaries, the below methods checks and adds particles when necessary into the particle handler. See DPMBase.cc and PeriodicBoundary.cc for more details. More... | |
Private Attributes | |
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 | xMin_ |
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMin. More... | |
Mdouble | xMax_ |
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMax. More... | |
Mdouble | yMin_ |
If the length of the problem domain in y-direction is YMax - YMin, the above variable stores YMin. More... | |
Mdouble | yMax_ |
If the length of the problem domain in y-direction is YMax - XMin, the above variable stores YMax. More... | |
Mdouble | zMin_ |
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMin. More... | |
Mdouble | zMax_ |
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMax. More... | |
Mdouble | time_ |
Stores the current simulation time. More... | |
unsigned int | ntimeSteps_ |
Stores the number of time steps. More... | |
Mdouble | timeStep_ |
Stores the simulation time step. More... | |
Mdouble | timeMax_ |
Stores the duration of the simulation. More... | |
Mdouble | elasticEnergy_ |
used in force calculations 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. 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. More... | |
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... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const DPMBase &md) |
Operator overloading of DPMBase class. More... | |
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).
DPMBase::DPMBase | ( | ) |
Constructor that calls the "void constructor()".
Definition at line 135 of file DPMBase.cc.
References constructor().
DPMBase::DPMBase | ( | const FilesAndRunNumber & | other | ) |
Copy constructor type-1.
[in] | other |
Definition at line 83 of file DPMBase.cc.
References constructor().
DPMBase::DPMBase | ( | const DPMBase & | other | ) |
Copy constructor type-2.
[in] | other |
Definition at line 92 of file DPMBase.cc.
References append_, boundaryHandler, gravity_, interactionHandler, ntimeSteps_, particleDimensions_, particleHandler, random, restarted_, restartVersion_, rotation_, BaseHandler< T >::setDPMBase(), speciesHandler, systemDimensions_, time_, timeMax_, timeStep_, wallHandler, xBallsAdditionalArguments_, xBallsColourMode_, xBallsScale_, xBallsVectorScale_, xMax_, xMin_, yMax_, yMin_, zMax_, and zMin_.
|
virtual |
|
protectedvirtual |
A virtual function which allows to define operations to be executed after the solve().
no implementation but can be overidden in its derived classes.
Definition at line 662 of file DPMBase.cc.
Referenced by solve(), and Mercury3DRestart::writeOutputFiles().
|
protectedvirtual |
A virtual function which allows to define operations to be executed after time step.
no implementation but can be overidden in its derived classes.
Definition at line 669 of file DPMBase.cc.
Referenced by solve().
|
protectedvirtual |
A virtual function. Allows one to carry out any operations before the start of the time loop.
no implementation but can be overriden in its derived classes.
Definition at line 598 of file DPMBase.cc.
Referenced by solve().
|
protectedvirtual |
A virtual function which allows to define operations to be executed before the new time step.
no implementation but can be overidden in its derived classes.
Reimplemented in Chute, and ChuteBottom.
Definition at line 655 of file DPMBase.cc.
Referenced by solve().
|
protectedvirtual |
A virtual function where the users can add extra code which is executed only when the code is restarted.
no implementation but can be overidden in its derived classes.
Definition at line 612 of file DPMBase.cc.
Referenced by solve().
bool DPMBase::areInContact | ( | const BaseParticle * | pI, |
const BaseParticle * | pJ | ||
) | const |
Checks if two particle are in contact or is there any positive overlap.
[in] | pI | |
[in] | pJ |
Definition at line 590 of file DPMBase.cc.
References Vec3D::getDistanceSquared(), BaseParticle::getInteractionRadius(), BaseInteractable::getPosition(), and mathsFunc::square().
Referenced by Mercury3D::hGridHasContactsInTargetCell().
|
protectedvirtual |
By broad one means to screen and determine an approximate number of particles that a given particle can be in contact with. Hence the word "Broad phase" of contact detection.
[in] | i |
Reimplemented in MercuryBase.
Definition at line 738 of file DPMBase.cc.
References BaseHandler< T >::begin(), computeInternalForces(), and particleHandler.
Referenced by computeInternalForces().
|
protected |
In case of periodic boundaries, the below methods checks and adds particles when necessary into the particle handler. See DPMBase.cc and PeriodicBoundary.cc for more details.
Definition at line 2409 of file DPMBase.cc.
References boundaryHandler, BaseHandler< T >::getNumberOfObjects(), BaseHandler< T >::getObject(), and particleHandler.
Referenced by solve().
|
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.
\\ calls checkBoundaryAfterParticleMoved()
Definition at line 1509 of file DPMBase.cc.
References BaseHandler< T >::begin(), boundaryHandler, BaseHandler< T >::end(), and particleHandler.
Referenced by solve().
|
virtual |
Checks if the particle having any interaction with walls or other particles.
A very useful feature. For e.g. when one wants to have an initial condition with particles free of interactions with other particles or walls, one could use this method and check for particles if they are interacting. If yes, then it would not consider this particle for insertion and continue onto next particle. However can prove expensive if the number of particles is large.
[in] | p |
Reimplemented in MercuryBase.
Definition at line 2353 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), Vec3D::getDistanceSquared(), BaseParticle::getInteractionRadius(), BaseInteractable::getPosition(), particleHandler, mathsFunc::square(), and wallHandler.
Referenced by InsertionBoundary::checkBoundaryBeforeTimeStep().
void DPMBase::checkSettings | ( | ) |
Checks if the essentials are set properly to go ahead with solving the problem.
Definition at line 1824 of file DPMBase.cc.
References BaseHandler< T >::getNumberOfObjects(), getParticleDimensions(), getSystemDimensions(), getTimeStep(), and speciesHandler.
Referenced by solve().
|
protectedvirtual |
Computes all the forces acting on the particles by using the setTorque and setForce methods. See BaseInteractible.cc.
Reset all forces to zero
Now loop over all particles contacts computing force contributions
Now loop over all other particles looking for contacts
Definition at line 1586 of file DPMBase.cc.
References BaseHandler< T >::begin(), computeExternalForces(), computeInternalForces(), BaseHandler< T >::end(), PossibleContact::getNext(), PossibleContact::getP1(), PossibleContact::getP2(), particleHandler, and wallHandler.
Referenced by solve().
|
protectedvirtual |
Computes the external forces acting on particles (e.g. gravitational)
[in] | CI |
Definition at line 1451 of file DPMBase.cc.
References BaseInteractable::addForce(), computeForcesDueToWalls(), getGravity(), BaseParticle::getMass(), and BaseParticle::isFixed().
Referenced by computeAllForces().
|
protectedvirtual |
Computes the forces on the particles due to the walls (normals are outward normals)
[in] | pI |
Definition at line 1465 of file DPMBase.cc.
References BaseInteractable::addForce(), BaseInteractable::addTorque(), BaseHandler< T >::begin(), BaseInteraction::computeForce(), Vec3D::cross(), BaseHandler< T >::end(), BaseInteraction::getContactPoint(), BaseInteraction::getForce(), BaseParticle::getPeriodicFromParticle(), BaseInteractable::getPosition(), getRotation(), getTime(), BaseInteraction::getTorque(), interactionHandler, and wallHandler.
Referenced by computeExternalForces().
|
protectedvirtual |
Computes the forces between particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces)
[in] | i |
Definition at line 1633 of file DPMBase.cc.
References broadPhase().
Referenced by broadPhase(), computeAllForces(), Mercury3D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithinTargetCell(), Mercury2D::hGridFindContactsWithTargetCell(), and Mercury3D::hGridFindContactsWithTargetCell().
|
protectedvirtual |
Computes the forces between particles (internal in the sense that the sum over all these forces is zero i.e. fully modelled forces)
[in] | P1 | |
[in] | P2 |
Definition at line 1405 of file DPMBase.cc.
References BaseInteractable::addForce(), BaseInteractable::addTorque(), BaseInteraction::computeForce(), Vec3D::cross(), BaseInteraction::getContactPoint(), BaseInteraction::getForce(), BaseObject::getId(), BaseParticle::getInteractionWith(), BaseParticle::getPeriodicFromParticle(), BaseInteractable::getPosition(), getRotation(), getTime(), BaseInteraction::getTorque(), interactionHandler, and BaseParticle::isFixed().
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().
Definition at line 777 of file DPMBase.cc.
References boundaryHandler, gravity_, interactionHandler, loggerOutput, logWriteAndDie(), ntimeSteps_, LoggerOutput::onFatal, particleHandler, random, setAppend(), BaseHandler< T >::setDPMBase(), Files::setName(), setParticleDimensions(), RNG::setRandomSeed(), setRestarted(), Files::setSaveCount(), BaseHandler< T >::setStorageCapacity(), setSystemDimensions(), speciesHandler, time_, timeMax_, timeStep_, wallHandler, xBallsAdditionalArguments_, xBallsColourMode_, xBallsScale_, xBallsVectorScale_, xMax_, xMin_, yMax_, yMin_, zMax_, and zMin_.
Referenced by DPMBase().
|
protectedvirtual |
bool DPMBase::findNextExistingDataFile | ( | Mdouble | tMin, |
bool | verbose = true |
||
) |
Useful when fileType is chosen as Multiple Files or Multiple files with padded.
[in] | tMin | |
[in] | verbose |
Definition at line 1191 of file DPMBase.cc.
References Files::dataFile, File::getCounter(), File::getFileType(), File::getFstream(), File::getName(), MULTIPLE_FILES, MULTIPLE_FILES_PADDED, and File::openNextFile().
|
protectedvirtual |
no implementation but can be overidden in its derived classes.
Reimplemented in StatisticsVector< T >.
Definition at line 710 of file DPMBase.cc.
Referenced by solve(), and Mercury3DRestart::writeOutputFiles().
|
virtual |
//Not unsigned index because of possible wall collisions.
no implementation but can be overidden in its derived classes.
Reimplemented in StatisticsVector< T >.
Definition at line 696 of file DPMBase.cc.
Referenced by BaseInteraction::gatherContactStatistics().
|
protected |
Definition at line 687 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), and interactionHandler.
bool DPMBase::getAppend | ( | ) | const |
Returns the flag denoting if the append option is on or off.
Definition at line 536 of file DPMBase.cc.
References append_.
Referenced by solve(), and writeEneHeader().
bool DPMBase::getDoCGAlways | ( | ) | const |
Mdouble DPMBase::getElasticEnergy | ( | ) | const |
Returns the global elastic energy within the system.
Definition at line 552 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), and interactionHandler.
Referenced by writeEneTimestep().
Vec3D DPMBase::getGravity | ( | ) | const |
Returns the gravity vector.
Definition at line 438 of file DPMBase.cc.
References gravity_.
Referenced by computeExternalForces(), ChuteWithHopper::getMaximumVelocityInducedByGravity(), Chute::setChuteAngle(), write(), and writeEneTimestep().
|
protectedvirtual |
Reimplemented in MercuryBase.
Definition at line 647 of file DPMBase.cc.
|
virtual |
A virtual method that allows the user to overrride and set what is written into the info column in the data file. By default it returns the Species ID number.
Definition at line 580 of file DPMBase.cc.
References BaseObject::getId(), and BaseInteractable::getSpecies().
Mdouble DPMBase::getKineticEnergy | ( | ) | const |
Returns the global kinetic energy stored in the system.
Definition at line 563 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), and particleHandler.
unsigned int DPMBase::getNtimeSteps | ( | ) | const |
Returns the current counter of time steps.
Definition at line 165 of file DPMBase.cc.
References ntimeSteps_.
unsigned int DPMBase::getParticleDimensions | ( | ) | const |
Returns the particle dimensions.
Definition at line 492 of file DPMBase.cc.
References particleDimensions_.
Referenced by checkSettings(), ParticleSpecies::getMassFromRadius(), BaseParticle::getParticleDimensions(), and write().
bool DPMBase::getRestarted | ( | ) | const |
Returns the flag denoting if the simulation was restarted or not.
Definition at line 519 of file DPMBase.cc.
References restarted_.
Referenced by solve(), and writeOutputFiles().
std::string DPMBase::getRestartVersion | ( | ) | const |
This is to take into account for different Mercury versions. Returns the version of the restart file.
Definition at line 501 of file DPMBase.cc.
References restartVersion_.
Referenced by Chute::read().
bool DPMBase::getRotation | ( | ) | const |
Returns a flag indicating if particle rotation is enabled or disabled.
Definition at line 217 of file DPMBase.cc.
References rotation_.
Referenced by computeForcesDueToWalls(), and computeInternalForces().
unsigned int DPMBase::getSystemDimensions | ( | ) | const |
Returns the dimension of the simulation. Note there is also a particle dimension.
Definition at line 466 of file DPMBase.cc.
References systemDimensions_.
Referenced by checkSettings(), HGridOptimiser::initialise(), outputXBallsData(), readNextDataFile(), StatisticsVector< T >::setNZ(), and write().
Mdouble DPMBase::getTime | ( | ) | const |
Access function for the time.
Definition at line 158 of file DPMBase.cc.
References time_.
Referenced by StatisticsVector< T >::check_current_time_for_statistics(), computeForcesDueToWalls(), computeInternalForces(), integrateAfterForceComputation(), integrateBeforeForceComputation(), isTimeEqualTo(), outputXBallsData(), Chute::printTime(), printTime(), LeesEdwardsBoundary::shiftVerticalPosition(), solve(), LeesEdwardsBoundary::write(), write(), writeEneTimestep(), and writeFstatHeader().
Mdouble DPMBase::getTimeMax | ( | ) | const |
Allows the user to access the total simulation time during the simulation. Cannot change it though.
Definition at line 194 of file DPMBase.cc.
References timeMax_.
Referenced by StatisticsVector< T >::getTimeMaxStat(), Chute::printTime(), printTime(), Mercury3DRestart::readNextArgument(), readNextArgument(), solve(), and write().
Mdouble DPMBase::getTimeStep | ( | ) | const |
Allows the time step dt to be accessed.
Definition at line 368 of file DPMBase.cc.
References timeStep_.
Referenced by StatisticsVector< T >::check_current_time_for_statistics(), checkSettings(), SlidingFrictionInteraction::computeFrictionForce(), FrictionInteraction::computeFrictionForce(), ChuteWithHopper::getTimeStepRatio(), integrateAfterForceComputation(), integrateBeforeForceComputation(), isTimeEqualTo(), ChuteBottom::makeRoughBottom(), readNextArgument(), readParAndIniFiles(), solve(), and write().
std::string DPMBase::getXBallsAdditionalArguments | ( | ) | const |
Definition at line 410 of file DPMBase.cc.
References xBallsAdditionalArguments_.
int DPMBase::getXBallsColourMode | ( | ) | const |
Get the xball colour mode (CMode)
Definition at line 382 of file DPMBase.cc.
References xBallsColourMode_.
double DPMBase::getXBallsScale | ( | ) | const |
Returns the scale of the view in xballs.
Definition at line 424 of file DPMBase.cc.
References xBallsScale_.
double DPMBase::getXBallsVectorScale | ( | ) | const |
Returns the scale of vectors used in xballs.
Definition at line 396 of file DPMBase.cc.
References xBallsVectorScale_.
Mdouble DPMBase::getXMax | ( | ) | const |
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax,.
Definition at line 231 of file DPMBase.cc.
References xMax_.
Referenced by Chute::cleanChute(), Chute::createBottom(), ChuteWithHopper::getChuteLength(), Chute::getChuteLength(), ChuteWithHopper::getMaximumVelocityInducedByGravity(), StatisticsVector< T >::getXMaxStat(), HGridOptimiser::initialise(), outputXBallsData(), readParAndIniFiles(), ChuteWithHopper::setHopperShift(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), setXMin(), write(), and writeFstatHeader().
Mdouble DPMBase::getXMin | ( | ) | const |
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin,.
Definition at line 224 of file DPMBase.cc.
References xMin_.
Referenced by Chute::cleanChute(), Chute::createBottom(), StatisticsVector< T >::getXMinStat(), HGridOptimiser::initialise(), outputXBallsData(), readParAndIniFiles(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), setXMax(), write(), and writeFstatHeader().
Mdouble DPMBase::getYMax | ( | ) | const |
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax,.
Definition at line 245 of file DPMBase.cc.
References yMax_.
Referenced by ChuteWithHopper::addHopper(), Chute::createBottom(), Chute::getChuteWidth(), StatisticsVector< T >::getYMaxStat(), HGridOptimiser::initialise(), outputXBallsData(), readParAndIniFiles(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), setYMin(), write(), and writeFstatHeader().
Mdouble DPMBase::getYMin | ( | ) | const |
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin,.
Definition at line 238 of file DPMBase.cc.
References yMin_.
Referenced by ChuteWithHopper::addHopper(), Chute::createBottom(), StatisticsVector< T >::getYMinStat(), HGridOptimiser::initialise(), outputXBallsData(), readParAndIniFiles(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), setYMax(), write(), and writeFstatHeader().
Mdouble DPMBase::getZMax | ( | ) | const |
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax,.
Definition at line 259 of file DPMBase.cc.
References zMax_.
Referenced by StatisticsVector< T >::getZMaxStat(), HGridOptimiser::initialise(), outputXBallsData(), readParAndIniFiles(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), setZMin(), write(), and writeFstatHeader().
Mdouble DPMBase::getZMin | ( | ) | const |
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin,.
Definition at line 252 of file DPMBase.cc.
References zMin_.
Referenced by Chute::createBottom(), StatisticsVector< T >::getZMinStat(), HGridOptimiser::initialise(), outputXBallsData(), readParAndIniFiles(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), setZMax(), write(), and writeFstatHeader().
|
protectedvirtual |
no implementation but can be overidden in its derived classes.
Reimplemented in MercuryBase.
Definition at line 731 of file DPMBase.cc.
Referenced by solve().
|
protectedvirtual |
no implementation but can be overidden in its derived classes.
Reimplemented in MercuryBase.
Definition at line 724 of file DPMBase.cc.
Referenced by solve().
|
protectedvirtual |
A virtual function that allows one to carry out hGrid operations before the start of the time loop.
no implementation but can be overidden in its derived classes.
Reimplemented in MercuryBase.
Definition at line 605 of file DPMBase.cc.
Referenced by solve().
|
protectedvirtual |
A virtual function that allows one to set or execute hGrid parameters or operations before every simulation time step.
no implementation but can be overidden in its derived classes.
Reimplemented in MercuryBase.
Definition at line 619 of file DPMBase.cc.
Referenced by solve().
|
virtual |
no implementation but can be overidden in its derived classes.
Definition at line 626 of file DPMBase.cc.
Referenced by ParticleHandler::addObject().
|
virtual |
no implementation but can be overidden in its derived classes.
Definition at line 640 of file DPMBase.cc.
Referenced by ParticleHandler::removeLastObject(), and ParticleHandler::removeObject().
|
virtual |
no implementation but can be overidden in its derived classes.
Reimplemented in MercuryBase.
Definition at line 717 of file DPMBase.cc.
Referenced by BaseParticle::integrateBeforeForceComputation().
|
virtual |
no implementation but can be overidden in its derived classes.
Definition at line 633 of file DPMBase.cc.
Referenced by ParticleHandler::addObject(), MercuryBase::hGridActionsBeforeTimeStep(), and MercuryBase::hGridRebuild().
|
protectedvirtual |
no implementation but can be overidden in its derived classes.
Reimplemented in StatisticsVector< T >.
Definition at line 676 of file DPMBase.cc.
Referenced by solve().
|
protected |
|
protectedvirtual |
Integration is done after force computations. We apply the Velocity verlet scheme. See http://en.wikipedia.org/wiki/Verlet_integration#Velocity_Verlet.
Definition at line 1524 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), getTime(), getTimeStep(), particleHandler, and wallHandler.
Referenced by solve().
|
protectedvirtual |
This is were 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.
Definition at line 1495 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), getTime(), getTimeStep(), particleHandler, and wallHandler.
Referenced by solve().
|
protected |
Checks if the input variable "time" is the current time in the simulation.
Definition at line 2446 of file DPMBase.cc.
References getTime(), and getTimeStep().
|
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.
Definition at line 2424 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), and interactionHandler.
|
protectedvirtual |
no implementation but can be overidden in its derived classes.
Reimplemented in StatisticsVector< T >.
Definition at line 683 of file DPMBase.cc.
|
protectedvirtual |
This function writes the location of the walls and particles in a format the XBalls program can read. See XBalls/xballs.txt. However, MercuryDPM supports a much better viewer now called Paraview. See the tutorials section in the documentation.
[in] | os |
Definition at line 947 of file DPMBase.cc.
References BaseHandler< T >::getNumberOfObjects(), getSystemDimensions(), getTime(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), outputXBallsDataParticle(), and particleHandler.
Referenced by writeOutputFiles().
|
protectedvirtual |
This function writes out the particle locations into an output stream in a format the XBalls program can read.
Referenced by outputXBallsData().
|
protectedvirtual |
Displays the current simulation time onto your screen for example.
Reimplemented in Chute.
Definition at line 758 of file DPMBase.cc.
References getTime(), and getTimeMax().
Referenced by Mercury3DRestart::readNextArgument(), and writeOutputFiles().
|
protectedvirtual |
no implementation but can be overidden in its derived classes.
Reimplemented in StatisticsVector< T >.
Definition at line 703 of file DPMBase.cc.
|
virtual |
Reads all particle data into a restart file.
[in] | is |
todo{Do we want to calculate the mass?}
Reimplemented in ChuteWithHopper, Chute, and MercuryBase.
Definition at line 1695 of file DPMBase.cc.
References boundaryHandler, BaseHandler< T >::clear(), ParticleHandler::clear(), FATAL, helpers::getLineFromStringStream(), gravity_, INFO, interactionHandler, logger, ntimeSteps_, particleDimensions_, particleHandler, BaseHandler< T >::read(), FilesAndRunNumber::read(), BoundaryHandler::readObject(), WallHandler::readObject(), ParticleHandler::readObject(), readOld(), restartVersion_, speciesHandler, systemDimensions_, time_, timeMax_, timeStep_, wallHandler, xMax_, xMin_, yMax_, yMin_, zMax_, and zMin_.
Referenced by MercuryBase::read(), and readRestartFile().
bool DPMBase::readArguments | ( | int | argc, |
char * | argv[] | ||
) |
Can interpret main function input arguments that are passed by the driver codes.
[in] | argc | |
[in] | *argv[] |
Definition at line 2029 of file DPMBase.cc.
References readNextArgument().
Referenced by solve().
bool DPMBase::readDataFile | ( | const std::string | fileName, |
unsigned int | format = 0 |
||
) |
This allows particle data to be reloaded from data files.
E.g. If one has a data file. This function loads data from the .data file i.e. you get position, velocity, angular velocty, 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 things many parameters, like density cannot be set using the data file.
[in] | fileName | |
[in] | format | (format for specifying if its for 2D or 3D data) |
Definition at line 989 of file DPMBase.cc.
References File::close(), Files::dataFile, File::getFileType(), File::getFstream(), File::getName(), ONE_FILE, File::open(), readNextDataFile(), File::setFileType(), and File::setName().
Referenced by readNextArgument().
|
virtual |
[in] | i | |
[in] | argc | |
[in] | *argv[] |
argv[i+1] interpreted as argument of type char*, Mdouble, integer or boolean unless noted
-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).
-clean of -c removes all files <name>.*.
Reimplemented in MercuryBase, ChuteWithHopper, Chute, and Mercury3DRestart.
Definition at line 2057 of file DPMBase.cc.
References FilesAndRunNumber::autoNumber(), Files::dataFile, Files::eneFile, Files::fStatFile, Files::getName(), getTimeMax(), getTimeStep(), random, RNG::randomise(), readDataFile(), readRestartFile(), Files::restartFile, setAppend(), File::setFileType(), Files::setFileType(), setFixedParticles(), setGravity(), Files::setName(), FilesAndRunNumber::setRunNumber(), File::setSaveCount(), Files::setSaveCount(), setSystemDimensions(), setTimeMax(), setTimeStep(), setXMax(), setXMin(), setYMax(), setYMin(), setZMax(), setZMin(), Files::statFile, and to_string_padded().
Referenced by readArguments(), and MercuryBase::readNextArgument().
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 XBalls/xballs.txt.
[in] | format |
Definition at line 1224 of file DPMBase.cc.
References BaseHandler< T >::begin(), ParticleHandler::computeAllMasses(), BaseHandler< T >::copyAndAddObject(), Files::dataFile, BaseHandler< T >::end(), File::getFstream(), BaseHandler< T >::getNumberOfObjects(), getSystemDimensions(), File::openNextFile(), particleHandler, ParticleHandler::removeLastObject(), setTime(), setXMax(), setXMin(), setYMax(), setYMin(), setZMax(), setZMin(), time_, Vec3D::X, xMax_, xMin_, Vec3D::Y, yMax_, yMin_, Vec3D::Z, zMax_, and zMin_.
Referenced by readDataFile().
|
virtual |
Reads all particle data into a restart file; old version.
[in] | is |
Definition at line 1772 of file DPMBase.cc.
References boundaryHandler, Files::dataFile, Files::eneFile, Files::fStatFile, gravity_, particleHandler, BaseHandler< T >::read(), Files::restartFile, File::setFileType(), Files::setName(), File::setSaveCount(), speciesHandler, Files::statFile, systemDimensions_, time_, timeMax_, timeStep_, wallHandler, xMax_, xMin_, yMax_, yMin_, zMax_, and zMin_.
Referenced by read().
bool DPMBase::readParAndIniFiles | ( | const std::string | fileName | ) |
Allows the user to read par.ini files (useful to read MDCLR files)
[in] | fileName |
Definition at line 1018 of file DPMBase.cc.
References SpeciesHandler::addObject(), boundaryHandler, BaseHandler< T >::clear(), BaseHandler< T >::copyAndAddObject(), Files::dataFile, Files::fStatFile, getTimeStep(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), PeriodicBoundary::set(), InfiniteWall::set(), setGravity(), setParticleDimensions(), File::setSaveCount(), Files::setSaveCount(), setTime(), setTimeMax(), setTimeStep(), speciesHandler, and wallHandler.
int DPMBase::readRestartFile | ( | ) |
Reads all the particle data corresponding to the current saved time step. Which is what the restart file basically stores. The problem description with the latest particle data.
Calls the read() and sets the restarted_ flag to true (if the file is found)
Definition at line 1375 of file DPMBase.cc.
References File::close(), File::getFstream(), File::getName(), File::open(), read(), Files::restartFile, and setRestarted().
Referenced by Mercury3DRestart::readNextArgument(), readNextArgument(), and readRestartFile().
int DPMBase::readRestartFile | ( | std::string | fileName | ) |
Also reads all the particle data corresponding to the current saved time step.
[in] | fileName |
Definition at line 1395 of file DPMBase.cc.
References readRestartFile(), Files::restartFile, and File::setName().
|
protected |
Removes periodic duplicate Particles.
Removes particles created by CheckAndDuplicatePeriodicParticle(int i, int nWallPeriodic)). Note that between these two functions it is not allowed to create additional functions
Definition at line 2394 of file DPMBase.cc.
References BaseInteractable::getInteractions(), BaseHandler< T >::getNumberOfObjects(), BaseHandler< T >::getObject(), BaseParticle::getPeriodicFromParticle(), interactionHandler, particleHandler, ParticleHandler::removeObject(), and InteractionHandler::removeObjectKeepingPeriodics().
Referenced by solve().
void DPMBase::setAppend | ( | bool | newAppendFlag | ) |
Allows to set the append option.
[in] | newAppendFlag |
Definition at line 544 of file DPMBase.cc.
References append_.
Referenced by constructor(), Mercury3DRestart::readNextArgument(), and readNextArgument().
void DPMBase::setDimension | ( | unsigned int | newDim | ) |
Sets the system and particle dimension.
[in] | newDim |
Definition at line 445 of file DPMBase.cc.
References setParticleDimensions(), and setSystemDimensions().
void DPMBase::setDoCGAlways | ( | bool | newDoCGFlag | ) |
|
protected |
[in] | n |
Definition at line 749 of file DPMBase.cc.
References BaseParticle::fixParticle(), BaseHandler< T >::getNumberOfObjects(), BaseHandler< T >::getObject(), and particleHandler.
Referenced by readNextArgument().
void DPMBase::setGravity | ( | Vec3D | newGravity | ) |
Allows to modify the gravity vector.
[in] | newGravity |
Definition at line 431 of file DPMBase.cc.
References gravity_.
Referenced by readNextArgument(), readParAndIniFiles(), and Chute::setChuteAngleAndMagnitudeOfGravity().
void DPMBase::setParticleDimensions | ( | unsigned int | particleDimensions | ) |
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres.
[in] | particleDimensions |
Definition at line 474 of file DPMBase.cc.
References ParticleHandler::computeAllMasses(), particleDimensions_, and particleHandler.
Referenced by Mercury2D::constructor(), Mercury3D::constructor(), constructor(), SpeciesHandler::readOldObject(), readParAndIniFiles(), and setDimension().
void DPMBase::setRestarted | ( | bool | newRestartedFlag | ) |
Allows to set the flag stating if the simulation is to be restarted or not.
[in] | newRestartedFlag |
Definition at line 527 of file DPMBase.cc.
References restarted_.
Referenced by constructor(), and readRestartFile().
void DPMBase::setRestartVersion | ( | std::string | newRV | ) |
Sets restart_version.
[in] | newRV |
Definition at line 510 of file DPMBase.cc.
References restartVersion_.
void DPMBase::setRotation | ( | bool | newRotFlag | ) |
Allows to set the flag for enabling or disabling particle rotation in the simulations.
[in] | newRotFlag |
Definition at line 210 of file DPMBase.cc.
References rotation_.
Referenced by SpeciesHandler::addObject(), and SpeciesHandler::removeObject().
void DPMBase::setSystemDimensions | ( | unsigned int | newDim | ) |
Allows for the dimension of the simulation to be changed.
[in] | newDim |
Definition at line 453 of file DPMBase.cc.
References systemDimensions_.
Referenced by Mercury2D::constructor(), Mercury3D::constructor(), constructor(), readNextArgument(), and setDimension().
void DPMBase::setTime | ( | Mdouble | time | ) |
Access function for the time.
[in] | time |
Definition at line 172 of file DPMBase.cc.
References time_.
Referenced by readNextDataFile(), readParAndIniFiles(), and solve().
void DPMBase::setTimeMax | ( | Mdouble | newTMax | ) |
Allows the upper time limit to be changed.
[in] | newTMmax |
Definition at line 179 of file DPMBase.cc.
References timeMax_.
Referenced by ChuteBottom::makeRoughBottom(), readNextArgument(), and readParAndIniFiles().
void DPMBase::setTimeStep | ( | Mdouble | timeStep | ) |
Allows the time step dt to be changed.
[in] | timeStep |
Definition at line 353 of file DPMBase.cc.
References timeStep_.
Referenced by ChuteBottom::makeRoughBottom(), readNextArgument(), and readParAndIniFiles().
|
virtual |
This function allows to set the initial conditions for our problem to be solved, by default particle locations are randomly set. Remember particle properties must also be defined here.
A virtual function with no implementation but can be overriden.
This sets up the particles initial conditions it is as you expect the user to override this. By default the particles are randomly disibuted
Reimplemented in ChuteWithHopper, Chute, and ChuteBottom.
Definition at line 833 of file DPMBase.cc.
Referenced by solve().
void DPMBase::setXBallsAdditionalArguments | ( | std::string | newXBArgs | ) |
Set the additional arguments for xballs.
[in] | newXBArgs |
Definition at line 403 of file DPMBase.cc.
References xBallsAdditionalArguments_.
void DPMBase::setXBallsColourMode | ( | int | newCMode | ) |
Set the xball output mode.
[in] | newCMode |
Definition at line 375 of file DPMBase.cc.
References xBallsColourMode_.
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.
[in] | newScale |
Definition at line 417 of file DPMBase.cc.
References xBallsScale_.
void DPMBase::setXBallsVectorScale | ( | double | newVScale | ) |
Set the scale of vectors in xballs.
[in] | newVScale |
Definition at line 389 of file DPMBase.cc.
References xBallsVectorScale_.
void DPMBase::setXMax | ( | Mdouble | newXMax | ) |
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax.
[in] | newXMax |
Definition at line 309 of file DPMBase.cc.
References getXMin(), and xMax_.
Referenced by readNextArgument(), readNextDataFile(), ChuteWithHopper::setChuteLength(), Chute::setChuteLength(), and ChuteWithHopper::setHopperShift().
void DPMBase::setXMin | ( | Mdouble | newXMin | ) |
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin.
[in] | newXMin |
Definition at line 266 of file DPMBase.cc.
References getXMax(), and xMin_.
Referenced by readNextArgument(), readNextDataFile(), and ChuteWithHopper::setChuteLength().
void DPMBase::setYMax | ( | Mdouble | newYMax | ) |
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax.
[in] | newYMax |
Definition at line 324 of file DPMBase.cc.
References getYMin(), and yMax_.
Referenced by readNextArgument(), readNextDataFile(), and Chute::setChuteWidth().
void DPMBase::setYMin | ( | Mdouble | newYMin | ) |
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin.
[in] | newYMin |
Definition at line 280 of file DPMBase.cc.
References getYMax(), and yMin_.
Referenced by readNextArgument(), and readNextDataFile().
void DPMBase::setZMax | ( | Mdouble | newZMax | ) |
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax.
[in] | newZMax |
Definition at line 338 of file DPMBase.cc.
References getZMin(), and zMax_.
Referenced by ChuteWithHopper::addHopper(), Chute::readNextArgument(), readNextArgument(), readNextDataFile(), and Chute::setInflowHeight().
void DPMBase::setZMin | ( | Mdouble | newZMin | ) |
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin.
[in] | newZMin |
Definition at line 295 of file DPMBase.cc.
References getZMax(), and zMin_.
Referenced by readNextArgument(), and readNextDataFile().
void DPMBase::solve | ( | ) |
The work horse of the code.
Initialise the time and sets up the initial conditions for the simulation
Definition at line 1895 of file DPMBase.cc.
References actionsAfterSolve(), actionsAfterTimeStep(), actionsBeforeTimeLoop(), actionsBeforeTimeStep(), actionsOnRestart(), BaseHandler< T >::begin(), boundaryHandler, checkAndDuplicatePeriodicParticles(), checkInteractionWithBoundaries(), checkSettings(), Files::closeFiles(), computeAllForces(), ParticleHandler::computeAllMasses(), continueSolve(), BaseHandler< T >::end(), InteractionHandler::eraseOldInteractions(), finishStatistics(), getAppend(), Files::getName(), getRestarted(), FilesAndRunNumber::getRunNumber(), getTime(), getTimeMax(), getTimeStep(), hGridActionsAfterIntegration(), hGridActionsBeforeIntegration(), hGridActionsBeforeTimeLoop(), hGridActionsBeforeTimeStep(), initialiseStatistics(), integrateAfterForceComputation(), integrateBeforeForceComputation(), interactionHandler, ntimeSteps_, particleHandler, removeDuplicatePeriodicParticles(), Files::resetFileCounter(), Files::restartFile, Files::setName(), Files::setNextSavedTimeStep(), File::setOpenMode(), Files::setOpenMode(), setTime(), setupInitialConditions(), time_, timeStep_, and writeOutputFiles().
Referenced by ChuteBottom::makeRoughBottom(), and solve().
void DPMBase::solve | ( | int | argc, |
char * | argv[] | ||
) |
The solve function is the work horse of the code with the user input.
[in] | argc | |
[in] | argv |
Definition at line 150 of file DPMBase.cc.
References readArguments(), and solve().
|
virtual |
Loads all MD data and plots statistics for all timesteps in the .data file.
Writes all particle data into a restart file
[in] | os | |
[in] | writeAllParticles |
Reimplemented in ChuteWithHopper, Chute, and MercuryBase.
Definition at line 1642 of file DPMBase.cc.
References BaseHandler< T >::begin(), boundaryHandler, BaseHandler< T >::end(), getGravity(), BaseHandler< T >::getNumberOfObjects(), BaseHandler< T >::getObject(), getParticleDimensions(), getSystemDimensions(), getTime(), getTimeMax(), getTimeStep(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), interactionHandler, ntimeSteps_, particleHandler, speciesHandler, wallHandler, SpeciesHandler::write(), InteractionHandler::write(), FilesAndRunNumber::write(), and ParticleHandler::write().
Referenced by operator<<(), MercuryBase::write(), and writeRestartFile().
|
protectedvirtual |
Writes a header with a certain format for ENE file.
[in] | os |
todo{Why is there a +6 here? TW: to get the numbers and title aligned}
Definition at line 840 of file DPMBase.cc.
References getAppend().
Referenced by writeOutputFiles().
|
protectedvirtual |
This function enables one to write the global energy available in the system after each time step. The default is to compute the rotational and translational kinetic energy, potential energy and the centre of mass.
[in] | os |
todo{Why is there a +6 here? TW: to ensure the numbers fit into a constant width column}
Definition at line 912 of file DPMBase.cc.
References BaseHandler< T >::begin(), Vec3D::dot(), BaseHandler< T >::end(), getElasticEnergy(), getGravity(), getTime(), and particleHandler.
Referenced by writeOutputFiles().
|
protectedvirtual |
Writes a header with a certain format for FStat file.
[in] | os |
Definition at line 861 of file DPMBase.cc.
References BaseHandler< T >::begin(), BaseHandler< T >::end(), ParticleHandler::getLargestParticle(), BaseParticle::getRadius(), ParticleHandler::getSmallestParticle(), getTime(), getXMax(), getXMin(), getYMax(), getYMin(), getZMax(), getZMin(), interactionHandler, and particleHandler.
Referenced by writeOutputFiles().
|
virtual |
Writes the simulation data onto all the files i.e. .data, .ene, .fstat ...
Reimplemented in StatisticsVector< T >, and Mercury3DRestart.
Definition at line 1848 of file DPMBase.cc.
References File::close(), Files::dataFile, Files::eneFile, Files::fStatFile, File::getCounter(), File::getFileType(), File::getFstream(), getRestarted(), MULTIPLE_FILES, MULTIPLE_FILES_PADDED, NO_FILE, ntimeSteps_, outputXBallsData(), printTime(), Files::restartFile, File::saveCurrentTimestep(), writeEneHeader(), writeEneTimestep(), writeFstatHeader(), writeRestartFile(), and writeXBallsScript().
Referenced by solve(), and Mercury3DRestart::writeOutputFiles().
|
virtual |
Stores all the particle data for current save time step. Calls the write function.
/// See also MD::readRestartFile
Definition at line 1365 of file DPMBase.cc.
References File::getFstream(), Files::restartFile, and write().
Referenced by writeOutputFiles().
|
virtual |
This writes a script which can be used to load the xballs problem to display the data just generated.
Referenced by writeOutputFiles().
|
friend |
Operator overloading of DPMBase class.
|
private |
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example.
Definition at line 826 of file DPMBase.h.
Referenced by DPMBase(), getAppend(), and setAppend().
BoundaryHandler DPMBase::boundaryHandler |
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or from regions.
Definition at line 888 of file DPMBase.h.
Referenced by checkAndDuplicatePeriodicParticles(), checkInteractionWithBoundaries(), constructor(), DPMBase(), read(), readOld(), readParAndIniFiles(), ChuteBottom::setupInitialConditions(), Chute::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), Chute::setupSideWalls(), solve(), and write().
|
private |
|
private |
Gravity vector.
Definition at line 745 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getGravity(), read(), readOld(), and setGravity().
InteractionHandler DPMBase::interactionHandler |
An object of the class InteractionHandler.
Definition at line 893 of file DPMBase.h.
Referenced by computeForcesDueToWalls(), computeInternalForces(), constructor(), DPMBase(), gatherContactStatistics(), getElasticEnergy(), outputInteractionDetails(), read(), removeDuplicatePeriodicParticles(), solve(), write(), and writeFstatHeader().
|
private |
Stores the number of time steps.
Definition at line 791 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getNtimeSteps(), read(), solve(), write(), and writeOutputFiles().
|
private |
determines if 2D or 3D particle volume is used for mass calculations
Definition at line 740 of file DPMBase.h.
Referenced by DPMBase(), getParticleDimensions(), read(), and setParticleDimensions().
ParticleHandler DPMBase::particleHandler |
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition at line 878 of file DPMBase.h.
Referenced by ChuteWithHopper::addHopper(), SpeciesHandler::addObject(), broadPhase(), checkAndDuplicatePeriodicParticles(), InsertionBoundary::checkBoundaryBeforeTimeStep(), checkInteractionWithBoundaries(), checkParticleForInteraction(), Chute::cleanChute(), computeAllForces(), constructor(), Chute::createBottom(), DPMBase(), MercuryBase::getHGridTargetMaxInteractionRadius(), MercuryBase::getHGridTargetMinInteractionRadius(), MercuryBase::getHGridTargetNumberOfBuckets(), getKineticEnergy(), MercuryBase::hGridActionsBeforeTimeStep(), MercuryBase::hGridNeedsRebuilding(), MercuryBase::hGridRebuild(), HGridOptimiser::initialise(), integrateAfterForceComputation(), integrateBeforeForceComputation(), ChuteBottom::makeRoughBottom(), outputXBallsData(), Chute::printTime(), read(), readNextDataFile(), InteractionHandler::readObject(), readOld(), removeDuplicatePeriodicParticles(), ParticleSpecies::setDensity(), setFixedParticles(), setParticleDimensions(), BaseParticle::setSpecies(), ChuteBottom::setupInitialConditions(), solve(), write(), writeEneTimestep(), and writeFstatHeader().
RNG DPMBase::random |
This is a random generator, often used for setting up the initial conditions etc...
Definition at line 873 of file DPMBase.h.
Referenced by InsertionBoundary::checkBoundaryBeforeTimeStep(), constructor(), Chute::createBottom(), DPMBase(), readNextArgument(), and ChuteBottom::setupInitialConditions().
|
private |
A bool to check if the simulation was restarted or not.
Definition at line 820 of file DPMBase.h.
Referenced by DPMBase(), getRestarted(), and setRestarted().
|
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.
Definition at line 815 of file DPMBase.h.
Referenced by DPMBase(), getRestartVersion(), read(), and setRestartVersion().
|
private |
A flag to turn on/off particle rotation.
Definition at line 831 of file DPMBase.h.
Referenced by DPMBase(), getRotation(), and setRotation().
SpeciesHandler DPMBase::speciesHandler |
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera.
Definition at line 868 of file DPMBase.h.
Referenced by MaserBoundary::addParticleToMaser(), checkSettings(), constructor(), DPMBase(), InteractionHandler::getInteraction(), ChuteBottom::makeRoughBottom(), read(), readOld(), readParAndIniFiles(), BaseParticle::setIndSpecies(), Chute::setupInitialConditions(), ChuteWithHopper::setupInitialConditions(), and write().
|
private |
The dimensions of the simulation i.e. 2D or 3D.
Definition at line 735 of file DPMBase.h.
Referenced by DPMBase(), getSystemDimensions(), read(), readOld(), and setSystemDimensions().
|
private |
Stores the current simulation time.
Definition at line 786 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getTime(), read(), readNextDataFile(), readOld(), setTime(), and solve().
|
private |
Stores the duration of the simulation.
Definition at line 801 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getTimeMax(), read(), readOld(), and setTimeMax().
|
private |
Stores the simulation time step.
Definition at line 796 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getTimeStep(), read(), readOld(), setTimeStep(), and solve().
WallHandler DPMBase::wallHandler |
An object of the class WallHandler. Contains pointers to all the walls created.
Definition at line 883 of file DPMBase.h.
Referenced by ChuteWithHopper::addHopper(), MercuryBase::checkParticleForInteraction(), checkParticleForInteraction(), computeAllForces(), computeForcesDueToWalls(), constructor(), Chute::createBottom(), DPMBase(), integrateAfterForceComputation(), integrateBeforeForceComputation(), read(), InteractionHandler::readObject(), readOld(), readParAndIniFiles(), BaseWall::setSpecies(), ChuteBottom::setupInitialConditions(), Chute::setupSideWalls(), and write().
|
private |
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt). e.g. "-solidf -v0".
Definition at line 854 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getXBallsAdditionalArguments(), and setXBallsAdditionalArguments().
|
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)
Definition at line 839 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getXBallsColourMode(), and setXBallsColourMode().
|
private |
sets the xballs argument scale (see XBalls/xballs.txt)
Definition at line 849 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getXBallsScale(), and setXBallsScale().
|
private |
sets the xballs argument vscale (see XBalls/xballs.txt)
Definition at line 844 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getXBallsVectorScale(), and setXBallsVectorScale().
|
private |
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMax.
Definition at line 757 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getXMax(), read(), readNextDataFile(), readOld(), and setXMax().
|
private |
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMin.
Definition at line 751 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getXMin(), read(), readNextDataFile(), readOld(), and setXMin().
|
private |
If the length of the problem domain in y-direction is YMax - XMin, the above variable stores YMax.
Definition at line 769 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getYMax(), read(), readNextDataFile(), readOld(), and setYMax().
|
private |
If the length of the problem domain in y-direction is YMax - YMin, the above variable stores YMin.
Definition at line 763 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getYMin(), read(), readNextDataFile(), readOld(), and setYMin().
|
private |
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMax.
Definition at line 781 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getZMax(), read(), readNextDataFile(), readOld(), and setZMax().
|
private |
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMin.
Definition at line 775 of file DPMBase.h.
Referenced by constructor(), DPMBase(), getZMin(), read(), readNextDataFile(), readOld(), and setZMin().