 |
revision: v0.14
|
Go to the documentation of this file.
54 #ifdef CONTACT_LIST_HGRID
199 void solve(
int argc,
char* argv[]);
271 virtual void write(std::ostream& os,
bool writeAllParticles =
true)
const;
289 virtual void readOld(std::istream& is);
294 bool readDataFile(std::string fileName =
"",
unsigned int format = 0);
444 const std::string&
getName()
const;
535 #ifdef CONTACT_LIST_HGRID
1367 #ifdef CONTACT_LIST_HGRID
void setDPMBase(DPMBase *DPMBase)
Sets the problem that is solved using this handler.
Definition: BaseHandler.h:718
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1073
unsigned int getNumberOfRealObjects() const
Returns the number of real objects (on all processors)
Definition: ParticleHandler.cc:1294
Mdouble xBallsScale_
sets the xballs argument scale (see XBalls/xballs.txt)
Definition: DPMBase.h:1349
virtual void processStatistics(bool)
Definition: DPMBase.cc:1909
File & getInteractionFile()
Return a reference to the file InteractionsFile.
Definition: DPMBase.cc:343
void addNewParticles()
Definition: DomainHandler.cc:429
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:678
Container to store pointers to all BaseBoundary objects.
Definition: BoundaryHandler.h:39
T square(const T val)
squares a number
Definition: ExtendedMath.h:106
bool rotation_
A flag to turn on/off particle rotation. true will enable particle rotation. false will disable parti...
Definition: DPMBase.h:1311
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:420
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
Definition: File.cc:165
void close()
Closes the file by calling fstream_.close()
Definition: File.cc:407
void addNewObjectsOMP()
Definition: InteractionHandler.cc:132
const ParticleSpecies * getSpecies() const
Returns a pointer to the species of this BaseInteractable.
Definition: BaseInteractable.h:108
virtual void computeExternalForces(BaseParticle *)
Computes the external forces, such as gravity, acting on particles.
Definition: DPMBase.cc:3074
void setRunNumber(int runNumber)
This sets the counter/Run number, overriding the defaults.
Definition: DPMBase.cc:603
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
Definition: File.cc:215
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:2921
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1225
bool openWriteNoAppend(unsigned)
Definition: File.cc:398
unsigned int getParticleDimensions() const
Returns the particle dimensionality.
Definition: DPMBase.cc:1458
int nToWrite_
number of elements to write to a screen
Definition: DPMBase.h:1379
bool append_
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example.
Definition: DPMBase.h:1304
Definition: ParticleVtkWriter.h:34
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1109
std::string to_string_padded(unsigned int value)
Pads the number This function tries to pad the number to 4 digits, which is used when you create mult...
Definition: File.cc:44
virtual void computeOneTimeStep()
Performs everything needed for one time step, used in the time-loop of solve().
Definition: DPMBase.cc:4139
static int readRunNumberFromFile()
Read the run number or the counter from the counter file (COUNTER_DONOTDEL)
Definition: DPMBase.cc:550
Mdouble getLargestInteractionRadius() const
Returns the largest interaction radius.
Definition: ParticleHandler.cc:768
bool getSuperquadricParticlesWriteVTK() const
Definition: DPMBase.cc:984
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1241
ParticleVtkWriter * getVtkWriter() const
Definition: DPMBase.cc:5130
Container that stores all CG objects.
Definition: CGHandler.h:65
Species< LinearViscoelasticNormalSpecies, SlidingFrictionSpecies > LinearViscoelasticSlidingFrictionSpecies
Definition: LinearViscoelasticSlidingFrictionSpecies.h:34
bool saveCurrentTimeStepNoFileTypeCheck(unsigned int ntimeSteps)
Definition: File.cc:317
virtual void hGridActionsBeforeTimeLoop()
A virtual function that allows one to carry out hGrid operations before the start of the time loop.
Definition: DPMBase.cc:1667
Container to store pointers to all BasePeriodicBoundary objects.
Definition: PeriodicBoundaryHandler.h:46
void setlogarithmicSaveCount(const Mdouble logarithmicSaveCountBase)
the function to set the user input base of logarithmic saving count
Definition: File.cc:283
double getCPUTime()
Definition: DPMBase.h:871
bool mpiIsInCommunicationZone(BaseParticle *particle)
Checks if the position of the particle is in an mpi communication zone or not.
Definition: DPMBase.cc:1755
void writePythonFileForVTKVisualisation() const
Definition: DPMBase.cc:2155
void setXBallsColourMode(int newCMode)
Set the xballs output mode.
Definition: DPMBase.cc:1291
Vec3D getMomentum() const
Definition: ParticleHandler.cc:662
virtual void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop.
Definition: DPMBase.cc:1660
Time clock_
record when the simulation started
Definition: DPMBase.h:1467
Container to store Interaction objects.
Definition: InteractionHandler.h:44
void actionsAfterTimeStep()
Definition: ParticleHandler.cc:1362
bool readSpeciesFromDataFile_
Determines if the last column of the data file is interpreted as the info parameter during restart.
Definition: DPMBase.h:1374
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:934
void clear() override
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: SpeciesHandler.h:54
void setWriteVTK(bool writeVTK)
Definition: BoundaryHandler.h:88
bool readDataFile(std::string fileName="", unsigned int format=0)
This allows particle data to be reloaded from data files.
Definition: DPMBase.cc:2346
void setAngleZ(Mdouble psi)
Converts the rotation angle in the XY plane into a quaternion (for Mercury2D). See Wikipedia for deta...
Definition: Quaternion.cc:492
void fixParticle()
Fix Particle function. It fixes a Particle by setting its inverse mass and inertia and velocities to ...
Definition: BaseParticle.cc:165
virtual void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
Definition: DPMBase.cc:1869
bool getRestarted() const
Returns the flag denoting if the simulation was restarted or not.
Definition: DPMBase.cc:1484
virtual void shiftPosition(BaseParticle *p) const override
shifts the particle
Definition: PeriodicBoundary.cc:219
static void incrementRunNumberInFile()
Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store...
Definition: DPMBase.cc:625
Matrix3D getStaticStress() const
Calculate the static stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5237
BaseParticle * getPeriodicFromParticle() const
Returns the 'original' particle this one's a periodic copy of.
Definition: BaseParticle.h:341
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
Definition: DPMBase.cc:1346
void resetNewObjectsOMP()
Definition: InteractionHandler.cc:125
std::string restartVersion_
Previous versions of MercuryDPM had a different restart file format, the below member variable allows...
Definition: DPMBase.h:1293
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1439
void setLogarithmicSaveCount(Mdouble logarithmicSaveCountBase)
Sets File::logarithmicSaveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:5283
Mdouble getRotationalEnergy() const
Definition: ParticleHandler.cc:582
void setSoftStop()
function for setting sigaction constructor.
Definition: DPMBase.cc:5003
virtual void hGridUpdateParticle(BaseParticle *obj UNUSED)
Definition: DPMBase.cc:1695
static void signalHandler(int signal)
signal handler function.
Definition: DPMBase.cc:4977
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:3531
virtual void hGridActionsBeforeIntegration()
This function has to be called before integrateBeforeForceComputation.
Definition: DPMBase.cc:1931
FileType writeWallsVTK_
A flag to turn on/off the vtk writer for walls.
Definition: DPMBase.h:1316
bool isInCommunicationZone(BaseParticle *particle)
Check if the particle is in the communication zone of the current domain.
Definition: Domain.cc:441
@ YAXIS
Definition: GeneralDefine.h:78
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.
Definition: DPMBase.cc:772
Mdouble getNextTime() const
Returns the current simulation time.
Definition: DPMBase.cc:813
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:607
void readAndAddObject(std::istream &is) final
Reads BaseBoundary into the BoundaryHandler from restart data.
Definition: BoundaryHandler.cc:209
void setPosition(const Vec3D &position)
Sets the position of this BaseInteractable.
Definition: BaseInteractable.h:239
void tic()
This is like a start button of a stopwatch. Assigns the variable start with the current number of clo...
Definition: MercuryTime.h:55
bool getParticlesWriteVTK() const
Returns whether particles are written in a VTK file.
Definition: DPMBase.cc:976
MERCURY_DEPRECATED File & getStatFile()
The non const version. Allows to edit the File::statFile.
Definition: DPMBase.cc:335
void addTorque(const Vec3D &addTorque)
Adds an amount to the torque on this BaseInteractable.
Definition: BaseInteractable.cc:132
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:3774
Basic class for walls.
Definition: BaseWall.h:48
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
void addNewParticle(BaseParticle *particle)
Adds a new particle to the periodic list.
Definition: PeriodicBoundaryHandler.cc:333
virtual void hGridRemoveParticle(BaseParticle *obj UNUSED)
Definition: DPMBase.cc:1702
virtual void checkInteractionWithBoundaries()
There are a range of boundaries one could implement depending on ones' problem. This methods checks f...
Definition: DPMBase.cc:3177
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1390
void read(std::istream &is)
Definition: RNG.cc:58
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1431
unsigned int numberOfTimeSteps_
Stores the number of time steps.
Definition: DPMBase.h:1276
virtual Mdouble getInfo(const BaseParticle &P) const
A virtual function that returns some user-specified information about a particle.
Definition: DPMBase.cc:1633
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:1315
Mdouble X
the vector components
Definition: Vector.h:65
Vec3D getMassTimesPosition() const
Definition: ParticleHandler.cc:632
BaseInteraction * addInteraction(BaseInteractable *P, BaseInteractable *I, unsigned timeStamp)
Definition: InteractionHandler.cc:117
PeriodicBoundaryHandler periodicBoundaryHandler
Internal handler that deals with periodic boundaries, especially in a parallel build.
Definition: DPMBase.h:1415
void setMeanVelocity(Vec3D V_mean_goal)
This function will help you set a fixed kinetic energy and mean velocity in your system.
Definition: DPMBase.cc:5141
static Mdouble dot(const Vec3D &a, const Vec3D &b)
Calculates the dot product of two Vec3D: .
Definition: Vector.cc:76
unsigned int getCounter() const
In case of multiple files, File::getCounter() returns the the number (FILE::Counter_) of the next fil...
Definition: File.cc:223
void synchroniseParticle(BaseParticle *, unsigned fromProcessor=0)
Definition: DPMBase.cc:4946
DPMBase()
Constructor that calls the "void constructor()".
Definition: DPMBase.cc:193
void updateStatus(std::set< BaseParticle * > &ghostParticlesToBeDeleted)
Updates the positions/velocity of ghost particles and accordingly the status of these particles.
Definition: PeriodicBoundaryHandler.cc:151
void actionsAfterParticleGhostUpdate()
Calls the method actionsAfterParticleGhostUpdate of every wall in the handler.
Definition: WallHandler.cc:479
virtual void outputStatistics()
Definition: DPMBase.cc:1884
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 constructor()
A function which initialises the member variables to default values, so that the problem can be solve...
Definition: DPMBase.cc:206
WallVTKWriter wallVTKWriter_
Definition: DPMBase.h:1327
void initialiseMPI()
Inialises the MPI library.
Definition: MpiContainer.cc:137
void read(std::istream &is)
Reads all objects from restart data.
Definition: BaseHandler.h:543
void setFStatData(std::fstream &fstat, BaseParticle *P, BaseWall *I)
Definition: BaseInteraction.cc:947
void copyDataFromMPIParticleToParticle(MPIParticle *bP, BaseParticle *p, ParticleHandler *particleHandler)
Copies data from an MPIParticle class to a BaseParticle and sets the particleHandler and species.
Definition: MpiDataClass.cc:105
const std::string getSVNURL()
Definition: CMakeDefinitions.cc:46
ReadOptions
Definition: DPMBase.h:243
void splitDomain(DomainSplit domainSplit)
Definition: DPMBase.cc:5059
void initialise()
Definition: DomainHandler.cc:434
unsigned int getSize() const
Gets the size of the particleHandler (including mpi and periodic particles)
Definition: BaseHandler.h:655
void copyDataFromParticleToMPIParticle(BaseParticle *p)
Definition: MpiDataClass.cc:131
virtual void writeXBallsScript() const
This writes a script which can be used to load the xballs problem to display the data just generated.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
Definition: File.cc:273
void integrateBeforeForceComputation(double time, double timeStep)
First step of Velocity Verlet integration.
Definition: BaseParticle.cc:708
void cleanCommunicationLists()
Removes nullptrs from boundaryParticleList_ and boundaryParticleListNeighbour_.
Definition: Domain.cc:1742
bool restarted_
A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run an...
Definition: DPMBase.h:1298
Container to store all Domain.
Definition: DomainHandler.h:47
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:4738
int getNumberOfOMPThreads() const
Definition: DPMBase.cc:1277
void outputInteractionDetails() const
Displays the interaction details corresponding to the pointer objects in the interaction handler.
Definition: DPMBase.cc:5019
virtual void writeEneTimeStep(std::ostream &os) const
Write the global kinetic, potential energy, etc. in the system.
Definition: DPMBase.cc:2095
virtual void integrateBeforeForceComputation()
Update particles' and walls' positions and velocities before force computation.
Definition: DPMBase.cc:3133
void computeForcesDueToWalls(BaseParticle *, BaseWall *)
Computes the forces on the particles due to the walls (normals are outward normals)
Definition: DPMBase.cc:3094
Definition: SphericalParticleVtkWriter.h:35
@ NO_FILE
file will not be created/read
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1451
bool readParAndIniFiles(std::string fileName)
Allows the user to read par.ini files (useful to read files produced by the MDCLR simulation code - e...
Definition: DPMBase.cc:2382
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:2854
@ PARTICLE
Definition: MpiContainer.h:67
int numberOfOMPThreads_
Definition: DPMBase.h:1240
std::size_t getProcessorID()
Reduces a scalar on all processors to one scalar on a target processor.
Definition: MpiContainer.cc:113
void closeFiles()
Closes all files (ene, data, fstat, restart, stat) that were opened to read or write.
Definition: DPMBase.cc:500
std::vector< int > get3DParametersFromRunNumber(int size_x, int size_y, int size_z) const
This turns a counter into 3 indices, which is a useful feature for performing a 3D parameter study....
Definition: DPMBase.cc:732
virtual void handleParticleRemoval(unsigned int id)
Handles the removal of particles from the particleHandler.
Definition: DPMBase.cc:5298
LL< Log::INFO > INFO
Info log level.
Definition: Logger.cc:55
void setWallsWriteVTK(FileType writeWallsVTK)
Sets whether walls are written into a VTK file.
Definition: DPMBase.cc:908
Mdouble getCPUTime()
Definition: MercuryTime.h:76
Definition: BoundaryVTKWriter.h:34
Definition: ParticleSpecies.h:37
void setStorageCapacity(const unsigned int N)
Sets the storage capacity of this BaseHandler.
Definition: BaseHandler.h:669
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:418
Definition: BaseBoundary.h:49
It's an insertion boundary which has cuboidal shape (yes, 'CuboidalInsertionBoundary' would have been...
Definition: CubeInsertionBoundary.h:42
ParticleHandler paoloParticleHandler
Fake particleHandler created by Paolo needed temporary by just Paolo.
Definition: DPMBase.h:1400
MERCURY_DEPRECATED File & getDataFile()
The non const version. Allows one to edit the File::dataFile.
Definition: DPMBase.cc:303
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
Definition: DPMBase.cc:1924
void insertParticles(DPMBase *md)
Fill a certain domain with particles.
Definition: InsertionBoundary.cc:328
void setFixedParticles(unsigned int n)
Sets a number, n, of particles in the particleHandler as "fixed particles".
Definition: DPMBase.cc:1951
virtual void checkInteractions(InteractionHandler *interactionHandler, unsigned int timeStamp)
Check if all interactions are valid.
Definition: BaseWall.h:219
virtual void setRadius(Mdouble radius)
Sets the particle's radius_ (and adjusts the mass_ accordingly, based on the particle's species)
Definition: BaseParticle.cc:542
virtual void writeOutputFiles()
Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and ....
Definition: DPMBase.cc:3881
FileType getWallsWriteVTK() const
Returns whether walls are written in a VTK file.
Definition: DPMBase.cc:965
void solve()
The work horse of the code.
Definition: DPMBase.cc:4003
File interactionFile
File class to handle in- and output into .interactions file. This file hold information about interac...
Definition: DPMBase.h:1462
void setOrientation(const Quaternion &orientation)
Sets the orientation of this BaseInteractable.
Definition: BaseInteractable.h:260
virtual void computeAdditionalForces()
A virtual function which allows to define operations to be executed prior to the OMP force collect.
Definition: DPMBase.h:1068
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1441
std::vector< unsigned > numberOfDomains_
Vector containing the number of domains in x-,y- and z-direction, required for parallel computations.
Definition: DPMBase.h:1260
bool verbose
Definition: statXZ.cpp:28
virtual void handleParticleAddition(unsigned int id, BaseParticle *p)
Definition: DPMBase.cc:5313
void evaluate()
Contains the code executed at each time step.
Definition: CGHandler.cc:97
virtual void writeFstatHeader(std::ostream &os) const
Writes a header with a certain format for FStat file.
Definition: DPMBase.cc:2034
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 ...
Stores information about interactions between two interactable objects; often particles but could be ...
Definition: BaseInteraction.h:60
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:613
Domain * getCurrentDomain()
Function that returns a pointer to the domain corresponding to the processor.
Definition: DPMBase.cc:5125
Container to store all BaseWall.
Definition: WallHandler.h:43
ParticleVtkWriter * vtkWriter_
Definition: DPMBase.h:1325
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1208
bool open()
Checks if the file stream fstream_ has any issues while opening. Alongside, it also increments the ne...
Definition: File.cc:347
int xBallsColourMode_
XBalls is a package to view the particle data. As an alternative MercuryDPM also supports ParaView....
Definition: DPMBase.h:1339
double Mdouble
Definition: GeneralDefine.h:34
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:281
void setNToWrite(int nToWrite)
set the number of elements to write to the screen
Definition: DPMBase.cc:850
void cleanCommunicationLists()
Definition: PeriodicBoundaryHandler.cc:1775
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1410
void setXBallsScale(Mdouble newScale)
Sets the scale of the view (either normal, zoom in or zoom out) to display in xballs....
Definition: DPMBase.cc:1354
int runNumber_
This stores the run number for saving.
Definition: DPMBase.h:1359
void fillDomainWithParticles(unsigned N=50)
Definition: DPMBase.cc:2899
void actionsAfterTimeStep()
Definition: InteractionHandler.cc:398
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:536
void sumForceTorqueOMP()
Definition: BaseInteractable.cc:162
Implementation of a 3D matrix.
Definition: Matrix.h:38
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance of the domain handler.
Definition: DomainHandler.cc:299
#define NUMBER_OF_PROCESSORS
For the MPI communication routines this quantity is often required. defining this macro makes the cod...
Definition: GeneralDefine.h:62
Mdouble getRadius() const
Returns the particle's radius.
Definition: BaseParticle.h:348
void setOpenMode(std::fstream::openmode openMode)
Allows the user to Sets File::openMode_.
Definition: File.cc:247
std::string name_
the name of the problem, used, e.g., for the output files
Definition: DPMBase.h:1364
Vec3D min_
These vectors are used for the XBalls domain, and occasionally people use it to add walls.
Definition: DPMBase.h:1265
void unfix()
Unfix Particle function, which required a reference to the Species vector. It unfixes a Particle by c...
Definition: BaseParticle.cc:316
void writeEneFile()
Definition: DPMBase.cc:2873
double getXBallsScale() const
Returns the scale of the view in xballs.
Definition: DPMBase.cc:1363
BaseParticle * getLargestParticle() const
Returns the pointer of the largest particle in the particle handler. When mercury is running in paral...
Definition: ParticleHandler.cc:530
void write(std::ostream &os) const
Writes the InteractionHandler to an output stream, for example a restart file.
Definition: InteractionHandler.cc:436
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:1674
void checkSettings()
Checks if the essentials are set properly to go ahead with solving the problem.
Definition: DPMBase.cc:3831
void setVelocity(const Vec3D &velocity)
set the velocity of the BaseInteractable.
Definition: BaseInteractable.cc:350
bool containsParticle(BaseParticle *particle, Mdouble offset=0.0)
Check to see if a given particle is within the current domain.
Definition: Domain.cc:400
void setFileCounter(unsigned fileCounter)
Definition: BaseVTKWriter.h:61
void boundaryActionsBeforeTimeLoop()
Definition: BoundaryHandler.cc:261
virtual BaseParticle * copy() const =0
Particle copy method. It calls to copy constructor of this Particle, useful for polymorphism.
bool saveCurrentTimeStep(unsigned int ntimeSteps)
determined if this time step has to be written; if so, opens the output file
Definition: File.cc:312
bool mpiInsertParticleCheck(BaseParticle *P)
Function that checks if the mpi particle should really be inserted by the current domain.
Definition: DPMBase.cc:1723
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:37
void randomise()
sets the random variables such that they differ for each run
Definition: RNG.cc:97
bool isMPIParticle() const
Indicates if this particle is a ghost in the MPI domain.
Definition: BaseParticle.cc:175
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:53
Vec3D getMax() const
Definition: DPMBase.h:643
void setAngularVelocity(const Vec3D &angularVelocity)
set the angular velocity of the BaseInteractble.
Definition: BaseInteractable.cc:360
unsigned int systemDimensions_
The dimensions of the simulation i.e. 2D or 3D.
Definition: DPMBase.h:1245
LL< Log::VERBOSE > VERBOSE
Verbose information.
Definition: Logger.cc:57
LL< Log::ERROR > ERROR
Error log level.
Definition: Logger.cc:53
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Definition: DPMBase.cc:3409
virtual BaseWall * readUserDefinedWall(const std::string &type) const
Allows you to read in a wall defined in a Driver directory; see USER/Luca/ScrewFiller.
Definition: DPMBase.h:282
void gather(T &send_t, T *receive_t)
Gathers a scaler from all processors to a vector of scalars on the root.
Definition: MpiContainer.h:428
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1535
void readNextFStatFile()
Reads the next fstat file.
Definition: DPMBase.cc:2779
#define MERCURY_DEPRECATED
Definition: GeneralDefine.h:37
MERCURY_DEPRECATED File & getFStatFile()
The non const version. Allows to edit the File::fStatFile.
Definition: DPMBase.cc:319
void setSpecies(const ParticleSpecies *species)
Definition: BaseParticle.cc:804
void finish()
Contains the code executed after the last time step.
Definition: CGHandler.cc:113
Mdouble & z()
RW reference to Z.
Definition: Vector.h:368
void addObject(ParticleSpecies *S) override
Adds a new ParticleSpecies to the SpeciesHandler.
Definition: SpeciesHandler.cc:797
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1089
Domain * getCurrentDomain()
Gets the domain assigned to the processor.
Definition: DomainHandler.cc:250
void writeVTK() const override
writes a vtk file
Definition: BoundaryVTKWriter.cc:29
void read(std::istream &is)
Definition: InteractionHandler.cc:457
@ XAXIS
Definition: GeneralDefine.h:78
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Definition: File.cc:198
Mdouble getWallTime()
Definition: MercuryTime.h:84
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:805
Mdouble & x()
RW reference to X.
Definition: Vector.h:344
unsigned int getSaveCount() const
Gets File::saveCount_.
Definition: File.cc:255
Mdouble timeMax_
Stores the duration of the simulation.
Definition: DPMBase.h:1286
void setTime(Mdouble time)
Sets a new value for the current simulation time.
Definition: DPMBase.cc:833
void initialise()
Initialises the communication list vectors as they can not be determined on compile time.
Definition: PeriodicBoundaryHandler.cc:1790
FileType getWriteVTK() const
Definition: InteractionHandler.cc:558
void setRestartVersion(std::string newRV)
Sets restart_version.
Definition: DPMBase.cc:1475
DomainSplit
Definition: DPMBase.h:937
void writeVTK() const override
Definition: WallVTKWriter.cc:52
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1156
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:54
void flushParticles(std::set< BaseParticle * > &particlesToBeFlushed)
Removes particles from the periodiocParticleList_ and periociGhostList_.
Definition: PeriodicBoundaryHandler.cc:1708
void clear() override
Empties the whole ParticleHandler by removing all BaseParticle.
Definition: ParticleHandler.cc:973
void setOpenMode(std::fstream::openmode openMode)
Sets File::openMode_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:487
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Definition: DPMBase.cc:2005
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1385
Mdouble xBallsVectorScale_
sets the xballs argument vscale (see XBalls/xballs.txt)
Definition: DPMBase.h:1344
Mdouble getDistance(const BaseParticle &p) const override
Returns the distance of the edge to the particle.
Definition: PeriodicBoundary.cc:197
Mdouble round(const Mdouble value, unsigned precision)
Definition: Helpers.cc:598
DomainHandler domainHandler
An object of the class DomainHandler which deals with parallel code.
Definition: DPMBase.h:1420
void writeVTKFiles() const
Definition: DPMBase.cc:2119
Matrix3D getKineticStress() const
Calculate the kinetic stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5215
void writeFStatFile()
Definition: DPMBase.cc:2883
unsigned int getNumberOfRealObjectsLocal() const
Returns the number of real objects on a local domain. MPI particles and periodic particles are neglec...
Definition: ParticleHandler.cc:1273
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1521
void setMPIParticle(bool flag)
Flags the mpi particle status.
Definition: BaseParticle.cc:185
bool getWriteVTK() const
Definition: BoundaryHandler.h:90
bool isTimeEqualTo(Mdouble time) const
Checks whether the input variable "time" is the current time in the simulation.
Definition: DPMBase.cc:5039
void setInteractionsWriteVTK(bool)
Sets whether interactions are written into a VTK file.
Definition: DPMBase.cc:924
virtual bool readNextArgument(int &i, int argc, char *argv[])
Interprets the i^th command-line argument.
Definition: DPMBase.cc:4350
void readAndAddObject(std::istream &is) override
Definition: ParticleHandler.cc:1084
void addForce(const Vec3D &addForce)
Adds an amount to the force on this BaseInteractable.
Definition: BaseInteractable.cc:116
void resetForceTorque(int numberOfOMPthreads)
Definition: BaseInteractable.cc:141
virtual void write(std::ostream &os) const
Write all the species and mixed species to an output stream.
Definition: SpeciesHandler.cc:836
virtual bool continueSolve() const
A virtual function for deciding whether to continue the simulation, based on a user-specified criteri...
Definition: DPMBase.cc:1981
A spherical particle is the most simple particle used in MercuryDPM.
Definition: SphericalParticle.h:37
The simulation can be subdivided into Domain's used in parallel code.
Definition: Domain.h:64
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1405
void initialiseMercuryMPITypes(const SpeciesHandler &speciesHandler)
Creates the MPI types required for communication of Mercury data through the MPI interface.
Definition: MpiContainer.cc:74
@ ZAXIS
Definition: GeneralDefine.h:78
const std::string getVersion()
Definition: CMakeDefinitions.cc:51
void integrateAfterForceComputation(double time, double timeStep)
This is part of the integration routine for objects with infinite mass.
Definition: BaseInteractable.cc:611
Mdouble getTotalEnergy() const
Definition: DPMBase.cc:1582
virtual unsigned int getNumberOfObjects() const
Gets the number of real Object in this BaseHandler. (i.e. no mpi or periodic particles)
Definition: BaseHandler.h:648
void addParticle(BaseParticle *particle)
Initialises a single particle which is added during the simulation.
Definition: Domain.cc:1610
Mdouble time_
Stores the current simulation time.
Definition: DPMBase.h:1271
void setLastSavedTimeStep(unsigned int lastSavedTimeStep)
Sets File::nextSavedTimeStep_.
Definition: File.cc:302
void sync()
Process all pending asynchronous communication requests before continuing.
Definition: MpiContainer.h:152
void setDimension(unsigned int newDim)
Sets both the system dimensions and the particle dimensionality.
Definition: DPMBase.cc:1394
int getNToWrite() const
get the number of elements to write to the
Definition: DPMBase.cc:861
This class contains all information and functions required for communication between processors.
Definition: MpiContainer.h:130
BaseParticle * getSmallestParticleLocal() const
Gets a pointer to the smallest BaseParticle (by interactionRadius) in this ParticleHandler of the loc...
Definition: ParticleHandler.cc:498
double getXBallsVectorScale() const
Returns the scale of vectors used in xballs.
Definition: DPMBase.cc:1321
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:870
void integrateAfterForceComputation(double time, double timeStep)
Second step of Velocity Verlet integration.
Definition: BaseParticle.cc:748
void updateGhostGrid(BaseParticle *P)
Checks if the Domain/periodic interaction distance needs to be updated and updates it accordingly.
Definition: DPMBase.cc:1828
Mdouble Y
Definition: Vector.h:65
virtual bool getHGridUpdateEachTimeStep() const
Definition: DPMBase.cc:1709
Vec3D getCentreOfMass() const
JMFT: Return the centre of mass of the system, excluding fixed particles.
Definition: DPMBase.cc:1605
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1374
Data class to send a particle over MPI.
Definition: MpiDataClass.h:81
Mdouble getRotationalEnergy() const
JMFT Returns the global rotational energy stored in the system.
Definition: DPMBase.cc:1568
void resetFileCounter()
Resets the file counter for each file i.e. for ene, data, fstat, restart, stat)
Definition: DPMBase.cc:469
const unsigned NEVER
Definition: File.h:35
void flushParticles(std::set< BaseParticle * > &toBeDeletedList)
Particles that are going to be deleted from the simulation are flushed out of the communication bound...
Definition: Domain.cc:1698
Vec3D getCentreOfMass() const
Definition: ParticleHandler.cc:650
A infinite wall fills the half-space {point: (position_-point)*normal_<=0}.
Definition: InfiniteWall.h:48
LL< Log::FATAL > FATAL
Definition of the different loglevels by its wrapper class LL. These are used as tags in template met...
Definition: Logger.cc:52
Mdouble getGravitationalEnergy() const
Returns the global gravitational potential energy stored in the system.
Definition: DPMBase.cc:1552
void getLineFromStringStream(std::istream &in, std::stringstream &out)
Reads a line from one stringstream into another, and prepares the latter for reading in.
Definition: Helpers.cc:423
void createMesh(std::vector< Mdouble > &simulationMin, std::vector< Mdouble > &simulationMax, std::vector< unsigned > &numberOfDomains, bool open)
Creates a Cartesian square mesh in 3D.
Definition: DomainHandler.cc:93
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:397
int getRunNumber() const
This returns the current value of the counter (runNumber_)
Definition: DPMBase.cc:614
void writeDataFile()
Definition: DPMBase.cc:2864
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
void setRotation(bool rotation)
Sets whether particle rotation is enabled or disabled.
Definition: DPMBase.h:552
void setSpecies(const ParticleSpecies *species)
Defines the species of the current wall.
Definition: BaseWall.cc:171
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:625
This class contains the 4 components of a quaternion and the standard operators and functions needed ...
Definition: Quaternion.h:63
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1025
bool fileExists(std::string strFilename)
Function to check if a file exists, is used to check if a run has already need done.
Definition: Helpers.cc:502
File statFile
An instance of class File to handle in- and output into a .stat file.
Definition: DPMBase.h:1456
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:457
bool findNextExistingDataFile(Mdouble tMin, bool verbose=true)
Finds and opens the next data file, if such a file exists.
Definition: DPMBase.cc:2563
virtual void decompose()
Sends particles from processorId to the root processor.
Definition: DPMBase.cc:3920
T * getLastObject()
Gets a pointer to the last Object in this BaseHandler.
Definition: BaseHandler.h:634
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5049
std::vector< int > get1DParametersFromRunNumber(int size_x) const
This turns a counter into 1 index, which is a useful feature for performing 1D parameter study....
Definition: DPMBase.cc:667
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DPMBase.cc:1989
std::vector< unsigned > getNumberOfDomains()
returns the number of domains
Definition: DPMBase.cc:5116
virtual void initialiseStatistics()
Definition: DPMBase.cc:1876
void setSuperquadricParticlesWriteVTK(bool writeSuperquadricParticlesVTK)
Definition: DPMBase.cc:948
virtual void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
Definition: DPMBase.cc:1862
void setOrientationViaEuler(Vec3D eulerAngle)
Sets the orientation of this BaseInteractable by defining the euler angles.
Definition: BaseInteractable.cc:204
T * getObject(const unsigned int id)
Gets a pointer to the Object at the specified index in the BaseHandler.
Definition: BaseHandler.h:613
bool checkParticleForInteractionLocalPeriodic(const BaseParticle &P)
Definition: DPMBase.cc:4688
bool openWrite(unsigned)
First sets openmode to write (and append in some cases), then calls open().
Definition: File.cc:381
void write(std::ostream &os) const
Definition: RNG.cc:77
unsigned int getId() const
Returns the unique identifier of any particular object.
Definition: BaseObject.h:125
Mdouble & y()
RW reference to Y.
Definition: Vector.h:356
Definition: SuperQuadricParticleVtkWriter.h:34
void forceWriteOutputFiles()
Writes output files immediately, even if the current time step was not meant to be written....
Definition: DPMBase.cc:3860
void setNumberOfOMPThreads(int numberOfOMPThreads)
Definition: DPMBase.cc:1248
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1446
void setCounter(unsigned int counter)
Allows the user to set the file counter according to his need. Sets File::counter_.
Definition: File.cc:231
Definition: BaseParticle.h:54
static Mdouble getLengthSquared(const Vec3D &a)
Calculates the squared length of a Vec3D: .
Definition: Vector.h:316
InteractionVTKWriter interactionVTKWriter_
Definition: DPMBase.h:1329
const std::vector< BaseInteraction * > & getInteractions() const
Returns a list of interactions which belong to this interactable.
Definition: BaseInteractable.h:277
#define UNUSED
Definition: GeneralDefine.h:39
Vec3D getMin() const
Definition: DPMBase.h:637
bool quick
Definition: LongPeriodicChute.cpp:36
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1421
std::enable_if<!std::is_pointer< U >::value, U * >::type copyAndAddObject(const U &object)
Creates a copy of a Object and adds it to the BaseHandler.
Definition: BaseHandler.h:379
double getWallTime()
Definition: DPMBase.h:876
virtual void computeAllForces()
Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseIntera...
Definition: DPMBase.cc:3302
Mdouble getMaxInteractionRadius() const
Returns the particle's interaction radius, which might be different from radius_ (e....
Definition: BaseParticle.h:362
Mdouble getKineticEnergy() const
Definition: ParticleHandler.cc:553
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
Allows for timing the algorithms; accurate up to 0.01 sec.
Definition: MercuryTime.h:44
Mdouble timeStep_
Stores the simulation time step.
Definition: DPMBase.h:1281
virtual void integrateAfterForceComputation()
Update particles' and walls' positions and velocities after force computation.
Definition: DPMBase.cc:3219
bool getAppend() const
Returns whether the "append" option is on or off.
Definition: DPMBase.cc:1501
static Vec3D cross(const Vec3D &a, const Vec3D &b)
Calculates the cross product of two Vec3D: .
Definition: Vector.cc:163
virtual void computeWallForces(BaseWall *w)
Definition: DPMBase.cc:5263
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:52
void addNewParticles()
Adds new particles to the periodic particle lists.
Definition: PeriodicBoundaryHandler.cc:300
bool writeParticlesVTK_
A flag to turn on/off the vtk writer for particles.
Definition: DPMBase.h:1321
void setCurrentDomainIndex(unsigned int index)
This sets a domain to the processor.
Definition: DomainHandler.cc:240
const std::vector< T * >::const_iterator begin() const
Gets the begin of the const_iterator over all Object in this BaseHandler.
Definition: BaseHandler.h:690
int getXBallsColourMode() const
Get the xballs colour mode (CMode).
Definition: DPMBase.cc:1301
void setEuler(const Vec3D &e)
Convert Euler angles to a quaternion. See Wikipedia for details.
Definition: Quaternion.cc:473
@ ReadNoParticlesAndInteractions
std::string getRestartVersion() const
This is to take into account for different Mercury versions. Returns the version of the restart file.
Definition: DPMBase.cc:1466
Mdouble getTotalMass() const
JMFT: Return the total mass of the system, excluding fixed particles.
Definition: DPMBase.cc:1589
const int getSVNRevision()
Definition: CMakeDefinitions.cc:41
MERCURY_DEPRECATED File & getEneFile()
The non const version. Allows to edit the File::eneFile.
Definition: DPMBase.cc:311
Mdouble toc()
This is like a stop button of a stopwatch. Assigns the variable finish to the current value of ticks ...
Definition: MercuryTime.h:66
Mdouble getRandomNumber()
This is a random generating routine can be used for initial positions.
Definition: RNG.cc:142
void checkAndDuplicatePeriodicParticles()
For simulations using periodic boundaries, checks and adds particles when necessary into the particle...
Definition: DPMBase.cc:4865
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1338
std::vector< int > get2DParametersFromRunNumber(int size_x, int size_y) const
This turns a counter into 2 indices which is a very useful feature for performing a 2D study....
Definition: DPMBase.cc:695
void initialise()
Contains the code executed before the first time step.
Definition: CGHandler.cc:90
virtual void finishStatistics()
Definition: DPMBase.cc:1916
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1492
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: Helpers.cc:445
Defines a pair of periodic walls. Inherits from BaseBoundary.
Definition: PeriodicBoundary.h:41
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1382
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:619
void performGhostVelocityUpdate()
updates the final time-step velocity of the ghost particles
Definition: DPMBase.cc:4964
virtual void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0.
Definition: BaseHandler.h:528
const Mdouble NaN
Definition: GeneralDefine.h:43
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:631
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:2268
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1001
Mdouble getMass() const
Definition: ParticleHandler.cc:607
void set(Vec3D normal, Mdouble distanceLeft, Mdouble distanceRight)
Defines a PeriodicBoundary by its normal and positions.
Definition: PeriodicBoundary.cc:84
std::enable_if< std::is_scalar< T >::value, void >::type broadcast(T &t, int fromProcessor=0)
Broadcasts a scalar from the root to all other processors.
Definition: MpiContainer.h:441
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
static Mdouble getDistanceSquared(const Vec3D &a, const Vec3D &b)
Calculates the squared distance between two Vec3D: .
Definition: Vector.h:295
void setInteractionDistance(Mdouble interactionDistance)
Sets the interaction distance.
Definition: PeriodicBoundaryHandler.cc:128
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:3393
bool writeSuperquadricParticlesVTK_
Definition: DPMBase.h:1323
virtual void printTime() const
Displays the current simulation time and the maximum simulation duration.
Definition: DPMBase.cc:1961
BaseParticle * getLargestParticleLocal() const
Gets a pointer to the largest BaseParticle (by interactionRadius) in the ParticleHandler of the local...
Definition: ParticleHandler.cc:522
virtual void hGridGetInteractingParticleList(BaseParticle *obj, std::vector< BaseParticle * > &list)
Creates a list of neighbour particles obtained from the hgrid.
Definition: DPMBase.h:961
bool isFixed() const override
Is fixed Particle function. It returns whether a Particle is fixed or not, by checking its inverse Ma...
Definition: BaseParticle.h:93
#define PROCESSOR_ID
Definition: GeneralDefine.h:63
void removeObject(unsigned int index) override
Removes a BaseParticle from the ParticleHandler.
Definition: ParticleHandler.cc:390
Mdouble getInteractionDistance()
Gets the interaction distance of the domain handler.
Definition: DomainHandler.cc:324
bool getRotation() const
Indicates whether particle rotation is enabled or disabled.
Definition: DPMBase.h:559
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1395
void readSpeciesFromDataFile(bool read=true)
Definition: DPMBase.h:341
void importParticlesAs(ParticleHandler &particleHandler, InteractionHandler &interactionHandler, const ParticleSpecies *species)
Copies particles, interactions assigning species from a local simulation to a global one....
Definition: DPMBase.cc:4788
Mdouble Z
Definition: Vector.h:65
Vec3D gravity_
Gravity vector.
Definition: DPMBase.h:1255
void performGhostParticleUpdate()
When the Verlet scheme updates the positions and velocities of particles, ghost particles will need a...
Definition: DPMBase.cc:4899
bool isPeriodicGhostParticle() const
Indicates if this particle is a ghost in the periodic boundary.
Definition: BaseParticle.cc:291
void removeDuplicatePeriodicParticles()
Removes periodic duplicate Particles.
Definition: DPMBase.cc:4822
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:406
FileType
With FileType options, one is able to choose if data is to be read/written from/into no or single or ...
Definition: File.h:41
std::string getPath()
Definition: Helpers.cc:931
virtual void writeVTK() const =0
unsigned int particleDimensions_
determines if 2D or 3D particle volume is used for mass calculations
Definition: DPMBase.h:1250
virtual bool isInContactWith(const BaseParticle *P) const
Get whether or not this particle is in contact with the given particle.
Definition: BaseParticle.cc:851
void insertGhostParticle(BaseParticle *P)
This function inserts a particle in the mpi communication boundaries.
Definition: DPMBase.cc:1802
void setXBallsVectorScale(double newVScale)
Set the scale of vectors in xballs.
Definition: DPMBase.cc:1311
std::string xBallsAdditionalArguments_
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt)....
Definition: DPMBase.h:1354
void updateStatus(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DomainHandler.cc:419
void removeOldFiles() const
Definition: DPMBase.cc:4256
void integrateBeforeForceComputation(double time, double timeStep)
This is part of integrate routine for objects with infinite mass.
Definition: BaseInteractable.cc:538
void gatherContactStatistics()
Definition: DPMBase.cc:1889
Mdouble getSumOfInteractionRadii(const BaseParticle *particle) const
returns the sum of the radii plus the interactionDistance
Definition: BaseParticle.h:379
Mdouble getMass() const
Returns the particle's mass.
Definition: BaseParticle.h:322
void set(Vec3D normal, Vec3D point)
Defines a standard wall, given an outward normal vector s.t. normal*x=normal*point for all x of the w...
Definition: InfiniteWall.cc:118
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
Definition: File.cc:153
Definition: WallVTKWriter.h:34
bool compare(std::istream &is, std::string s)
Checks if the next argument in the input stream is a certain string.
Definition: Helpers.cc:858
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1436
void writeVTK() const override
writes a vtk file
Definition: InteractionVTKWriter.cc:29
const std::vector< T * >::const_iterator end() const
Gets the end of the const_iterator over all BaseBoundary in this BaseHandler.
Definition: BaseHandler.h:704
void write(std::ostream &os) const
std::string name
Definition: MercuryProb.h:48
void eraseOldInteractions(unsigned)
erases interactions which have an old timestamp.
Definition: InteractionHandler.cc:380
void setPeriodicGhostParticle(bool flag)
Flags the status of the particle to be a ghost in periodic boundary or not.
Definition: BaseParticle.cc:296
virtual void hGridActionsAfterIntegration()
This function has to be called after integrateBeforeForceComputation.
Definition: DPMBase.cc:1938
virtual ~DPMBase()
virtual destructor
Definition: DPMBase.cc:295
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:821
static bool areInContact(const BaseParticle *pI, const BaseParticle *pJ)
Checks if two particle are in contact or is there any positive overlap.
Definition: DPMBase.cc:1652
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:2600
void set(BaseParticle *particleToCopy, unsigned int maxFailed, Vec3D posMin, Vec3D posMax, Vec3D velMin, Vec3D velMax)
Sets the properties of the InsertionBoundary for mutliple different particle types.
Definition: CubeInsertionBoundary.cc:107
Vec3D getTotalMomentum() const
JMFT: Return the total momentum of the system, excluding fixed particles.
Definition: DPMBase.cc:1615
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1049
Definition: InteractionVTKWriter.h:34
Matrix3D getTotalStress() const
Calculate the total stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5257
virtual Mdouble getInfo() const
Returns some user-defined information about this object (by default, species ID).
Definition: BaseParticle.cc:352
FileType getFileType() const
Gets the file type e.g. NOFILE, ONEFILE and MULTIPLE FILES. File::fileType_.
Definition: File.cc:207
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:516
void deleteGhostParticles(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DPMBase.cc:4922
std::string to_string(const T &n)
Definition: Helpers.h:227
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:600
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: DPMBase.cc:1855
BaseInteraction * getInteractionWith(BaseParticle *p, unsigned timeStamp, InteractionHandler *interactionHandler) override
Returns the interaction between this wall and a given particle, nullptr if there is no interaction.
Definition: BaseWall.cc:369
void setWriteVTK(FileType f)
Definition: InteractionHandler.cc:553
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.
Definition: DPMBase.cc:5158
virtual void hGridInsertParticle(BaseParticle *obj UNUSED)
Definition: DPMBase.cc:1688
MERCURY_DEPRECATED void logWriteAndDie(const std::string &module, std::string message)
todo strcmp relies on this, should be changed to more modern version
Definition: DPMBase.cc:79
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1425
std::ostream & operator<<(std::ostream &os, DPMBase &md)
Definition: DPMBase.cc:96
void removeObjectKeepingPeriodics(unsigned int id)
Removes interactions of periodic particles when the periodic particles get deleted (see DPMBase::remo...
Definition: InteractionHandler.cc:319
static volatile sig_atomic_t continueFlag_
Definition: DPMBase.h:1237
const Vec3D & getPosition() const
Returns the position of this BaseInteractable.
Definition: BaseInteractable.h:218
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:885
MERCURY_DEPRECATED File & getRestartFile()
The non const version. Allows to edit the File::restartFile.
Definition: DPMBase.cc:327
static Matrix3D dyadic(const Vec3D &a, const Vec3D &b)
Calculates the dyadic product of a two Vec3D: .
Definition: Matrix.cc:323
unsigned getFileCounter() const
Definition: BaseVTKWriter.h:56
virtual bool checkParticleForInteraction(const BaseParticle &P)
Checks whether a particle P has any interaction with walls or other particles.
Definition: DPMBase.cc:4639
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:3019
virtual void hGridActionsBeforeTimeStep()
A virtual function that allows one to set or execute hGrid parameters or operations before every simu...
Definition: DPMBase.cc:1681
const std::string getFullName() const
Also allows to access the file name, however with additional information which is the file counter,...
Definition: File.cc:170
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:76
void computeAllMasses(unsigned int indSpecies)
Computes the mass for all BaseParticle of the given species in this ParticleHandler.
Definition: ParticleHandler.cc:1205
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1513
static MPIContainer & Instance()
fetch the instance to be used for communication
Definition: MpiContainer.h:134
Vec3D max_
Definition: DPMBase.h:1266
BoundaryVTKWriter boundaryVTKWriter_
Definition: DPMBase.h:1331
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4225
Mdouble getTotalVolume() const
Get the total volume of the cuboid system.
Definition: DPMBase.cc:5206
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1408