51 #ifdef CONTACT_LIST_HGRID
117 void solve(
int argc,
char* argv[]);
171 virtual void write(std::ostream& os,
bool writeAllParticles=
true)
const;
177 virtual void read(std::istream& is);
184 virtual void readOld(std::istream &is);
197 bool readDataFile(
const std::string fileName,
unsigned int format = 0);
271 #ifdef CONTACT_LIST_HGRID
982 #ifdef CONTACT_LIST_HGRID
Container to store all ParticleSpecies.
virtual bool readUserDefinedWall(std::string type, std::istream &is)
Mdouble timeMax_
Stores the duration of the simulation.
void setTime(Mdouble time)
Access function for the time.
virtual void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop...
void setXBallsVectorScale(double newVScale)
Set the scale of vectors in xballs.
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Loads all MD data and plots statistics for all timesteps in the .data file.
FileType getWallsWriteVTK() const
Returns a flag indicating if particle rotation is enabled or disabled.
virtual void hGridUpdateParticle(BaseParticle *obj UNUSED)
no implementation but can be overidden in its derived classes.
Container to store pointers to all BaseBoundary objects.
void setXMax(Mdouble newXMax)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMax...
void setWallsWriteVTK(FileType writeWallsVTK)
Allows to set the flag for enabling or disabling particle rotation in the simulations.
void solve()
The work horse of the code.
Mdouble yMax_
If the length of the problem domain in y-direction is YMax - XMin, the above variable stores YMax...
virtual void hGridInsertParticle(BaseParticle *obj UNUSED)
no implementation but can be overidden in its derived classes.
int addL_
Stores the number of large particles that are to be added on restart.
The DPMBase header includes quite a few header files, defining all the handlers, which are essential...
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.
void checkAndDuplicatePeriodicParticles()
In case of periodic boundaries, the below methods checks and adds particles when necessary into the p...
int getXBallsColourMode() const
Get the xball colour mode (CMode)
void setTimeMax(Mdouble newTMax)
Allows the upper time limit to be changed.
bool areInContact(const BaseParticle *pI, const BaseParticle *pJ) const
Checks if two particle are in contact or is there any positive overlap.
void constructor()
A function which initialises the member variables to default values, so that the problem can be solve...
unsigned int getSystemDimensions() const
Returns the dimension of the simulation. Note there is also a particle dimension. ...
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
int getAddLarge() const
returns the number of large particles that are to be added on restart.
void setAddLarge(int new_addL)
sets the number of large particles that are to be added on restart.
unsigned int particleDimensions_
determines if 2D or 3D particle volume is used for mass calculations
bool readRestartFile(bool restarted=true)
Reads all the particle data corresponding to the current saved time step. Which is what the restart f...
Mdouble yMin_
If the length of the problem domain in y-direction is YMax - YMin, the above variable stores YMin...
void setYMin(Mdouble newYMin)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMin...
virtual void computeInternalForces(BaseParticle *i)
Computes the forces between particles (internal in the sense that the sum over all these forces is ze...
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax...
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin...
void setAddSmall(int new_addS)
sets the number of small particles that are to be added on restart.
unsigned int getParticleDimensions() const
Returns the particle dimensions.
bool readDataFile(const std::string fileName, unsigned int format=0)
This allows particle data to be reloaded from data files.
Vec3D getMin() const
Return the "bottom left" corner of the domain, a vector with xMin_, yMin_ and zMin_.
void setParticlesWriteVTK(bool writeParticlesVTK)
Allows to set the flag for enabling or disabling particle rotation in the simulations.
virtual void initialiseStatistics()
no implementation but can be overidden in its derived classes.
Mdouble elasticEnergy_
used in force calculations
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin...
void setXBallsColourMode(int newCMode)
Set the xball output mode.
virtual void readOld(std::istream &is)
Reads all data from a restart file, e.g. domain data and particle data; old version.
void setParticleDimensions(unsigned int particleDimensions)
Allows the dimension of the particle (f.e. for mass) to be changed. e.g. discs or spheres...
virtual ~DPMBase()
virtual destructor
virtual void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
void setZMax(Mdouble newZMax)
If the length of the problem domain in z-direction is XMax - XMin, this method sets ZMax...
void setDimension(unsigned int newDim)
Sets the system and particle dimension.
void setAppend(bool newAppendFlag)
Allows to set the append option.
virtual void writeOutputFiles()
Writes the simulation data onto all the files i.e. .data, .ene, .fstat ...
void setSystemDimensions(unsigned int newDim)
Allows for the dimension of the simulation to be changed.
void setGravity(Vec3D newGravity)
Allows to modify the gravity vector.
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...
virtual bool getHGridUpdateEachTimeStep() const
bool rotation_
A flag to turn on/off particle rotation.
bool getParticlesWriteVTK() const
Returns a flag indicating if particle rotation is enabled or disabled.
Mdouble zMax_
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMax...
FileType
With FileType options, one is able to choose if data is to be read/written from/into no or single or ...
bool restarted_
A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run an...
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax...
void setRotation(bool newRotFlag)
Allows to set the flag for enabling or disabling particle rotation in the simulations.
virtual void processStatistics(bool usethese UNUSED)
no implementation but can be overidden in its derived classes.
bool findNextExistingDataFile(Mdouble tMin, bool verbose=true)
Useful when fileType is chosen as Multiple Files or Multiple files with padded.
void setYMax(Mdouble newYMax)
If the length of the problem domain in y-direction is YMax - YMin, this method sets YMax...
unsigned int systemDimensions_
The dimensions of the simulation i.e. 2D or 3D.
This is a class that generates random numbers i.e. named the Random Number Generator (RNG)...
Mdouble zMin_
If the length of the problem domain in z-direction is ZMax - ZMin, the above variable stores ZMin...
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Mdouble xMax_
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMax...
Mdouble getGravitationalEnergy() const
Returns the global gravitational potential energy stored in the system.
unsigned int ntimeSteps_
Stores the number of time steps.
virtual void writeEneTimestep(std::ostream &os) const
This function enables one to write the global energy available in the system after each time step...
virtual void hGridActionsBeforeIntegration()
no implementation but can be overidden in its derived classes.
void initialiseTangentialSprings()
bool getAppend() const
Returns the flag denoting if the append option is on or off.
virtual bool readNextArgument(int &i, int argc, char *argv[])
Interprets the i^th command-line argument.
virtual bool checkParticleForInteraction(const BaseParticle &P)
Checks if the particle having any interaction with walls or other particles.
bool getRestarted() const
Returns the flag denoting if the simulation was restarted or not.
int xBallsColourMode_
XBalls is a package to view the particle data. As an alternative MercuryDPM also supports Paraview...
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Mdouble xBallsScale_
sets the xballs argument scale (see XBalls/xballs.txt)
void setXMin(Mdouble newXMin)
If the length of the problem domain in x-direction is XMax - XMin, this method sets XMin...
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
int addS_
Stores the number of small particles that are to be added on restart.
Container to store Interaction objects.
Mdouble domainSize() const
unsigned int getNtimeSteps() const
Returns the current counter of time steps.
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Mdouble time_
Stores the current simulation time.
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 ...
void setRestartVersion(std::string newRV)
Sets restart_version.
Vec3D getGravity() const
Returns the gravity vector.
void checkSettings()
Checks if the essentials are set properly to go ahead with solving the problem.
virtual void hGridActionsBeforeTimeLoop()
A virtual function that allows one to carry out hGrid operations before the start of the time loop...
bool readParAndIniFiles(const std::string fileName)
Allows the user to read par.ini files (useful to read MDCLR files)
virtual void computeAllForces()
Computes all the forces acting on the particles by using the setTorque and setForce methods...
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...
void setZMin(Mdouble newZMin)
If the length of the problem domain in z-direction is ZMax - ZMin, this method sets ZMin...
virtual void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
virtual void printTime() const
Displays the current simulation time onto your screen for example.
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. elastic, linear visco-elastic... et cetera...
InteractionHandler interactionHandler
An object of the class InteractionHandler.
FileType writeWallsVTK_
A flag to turn on/off the vtk writer for walls.
virtual void writeXBallsScript() const
This writes a script which can be used to load the xballs problem to display the data just generated...
void outputInteractionDetails() const
Displays the interaction details corresponding to the pointer objects in the interaction handler...
Vec3D getMax() const
Return the "upper right" corner of the domain, a vector with xMin_, yMin_ and zMin_.
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Container to store all BaseParticle.
void setFixedParticles(unsigned int n)
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax...
Mdouble xBallsVectorScale_
sets the xballs argument vscale (see XBalls/xballs.txt)
Mdouble xMin_
If the length of the problem domain in x-direction is XMax - XMin, the above variable stores XMin...
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step...
Mdouble timeStep_
Stores the simulation time step.
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Container to store all BaseWall.
RNG random
This is a random generator, often used for setting up the initial conditions etc...
virtual void hGridRemoveParticle(BaseParticle *obj UNUSED)
no implementation but can be overidden in its derived classes.
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 th...
bool writeParticlesVTK_
A flag to turn on/off the vtk writer for particles.
virtual void actionsOnRestart()
A virtual function where the users can add extra code which is executed only when the code is restart...
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin...
int getAddSmall() const
returns the number of small particles that are to be added on restart.
void gatherContactStatistics()
virtual void outputStatistics()
no implementation but can be overidden in its derived classes.
void setTimeStep(Mdouble newDt)
Allows the time step dt to be changed.
void removeDuplicatePeriodicParticles()
Removes periodic duplicate Particles.
bool checkParticleForInteractionLocalPeriodic(const BaseParticle &P)
void setMin(Vec3D min)
Sets the values xMin, yMin, zMin of the problem domain, which is [xMin,xMax]x[yMin,yMax]x[zMin,zMax].
virtual void integrateBeforeForceComputation()
This is were the integration is done, at the moment it is velocity Verlet integration and is done bef...
virtual void writeRestartFile()
Stores all the particle data for current save time step. Calls the write function.
std::string xBallsAdditionalArguments_
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt). e.g. "-solidf -v0".
double getXBallsVectorScale() const
Returns the scale of vectors used in xballs.
virtual bool continueSolve() const
It is publicly inherited from class Files. It defines an awesome feature that is ideal when doing a p...
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
no implementation but can be overidden in its derived classes.
virtual void computeForcesDueToWalls(BaseParticle *PI)
Computes the forces on the particles due to the walls (normals are outward normals) ...
std::string restartVersion_
Previous versions of MercuryDPM had a different restart file format, the below member variable allows...
friend std::ostream & operator<<(std::ostream &os, const DPMBase &md)
Operator overloading of DPMBase class, writes the StatType to the given ostream.
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Implementation of a 3D vector (by Vitaliy).
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
void setDoCGAlways(bool newDoCGFlag)
virtual void hGridActionsAfterIntegration()
no implementation but can be overidden in its derived classes.
bool getDoCGAlways() const
Mdouble getTimeStep() const
Allows the time step dt to be accessed.
double getXBallsScale() const
Returns the scale of the view in xballs.
virtual void hGridActionsBeforeTimeStep()
A virtual function that allows one to set or execute hGrid parameters or operations before every simu...
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.
bool getRotation() const
Returns a flag indicating if particle rotation is enabled or disabled.
virtual void finishStatistics()
no implementation but can be overidden in its derived classes.
virtual void broadPhase(BaseParticle *i)
By broad one means to screen and determine an approximate number of particles that a given particle c...
Mdouble getTime() const
Access function for the time.
virtual void checkInteractionWithBoundaries()
There are a range of boundaries one could implement depending on ones' problem. This methods checks f...
virtual void writeFstatHeader(std::ostream &os) const
Writes a header with a certain format for FStat file.
virtual void read(std::istream &is)
Reads all data from a restart file, e.g. domain data and particle data.
Mdouble getTimeMax() const
Allows the user to access the total simulation time during the simulation. Cannot change it though...
DPMBase()
Constructor that calls the "void constructor()".
Vec3D gravity_
Gravity vector.
virtual bool checkParticleForInteractionLocal(const BaseParticle &P)
Checks if a particle P has any interaction with walls or other particles in the local domain...
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
bool append_
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example...
void setMax(Vec3D max)
Sets the values xMax, yMax, zMax of the problem domain, which is [xMin,xMax]x[yMin,yMax]x[zMin,zMax].
virtual void computeExternalForces(BaseParticle *PI)
Computes the external forces acting on particles (e.g. gravitational)
std::string getRestartVersion() const
This is to take into account for different Mercury versions. Returns the version of the restart file...
bool isTimeEqualTo(Mdouble time) const
Checks if the input variable "time" is the current time in the simulation.