DPMBase.h
Go to the documentation of this file.
1 //Copyright (c) 2013-2023, The MercuryDPM Developers Team. All rights reserved.
2 //For the list of developers, see <http://www.MercuryDPM.org/Team>.
3 //
4 //Redistribution and use in source and binary forms, with or without
5 //modification, are permitted provided that the following conditions are met:
6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above copyright
9 // notice, this list of conditions and the following disclaimer in the
10 // documentation and/or other materials provided with the distribution.
11 // * Neither the name MercuryDPM nor the
12 // names of its contributors may be used to endorse or promote products
13 // derived from this software without specific prior written permission.
14 //
15 //THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
16 //ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 //WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18 //DISCLAIMED. IN NO EVENT SHALL THE MERCURYDPM DEVELOPERS TEAM BE LIABLE FOR ANY
19 //DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 //(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 //LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22 //ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 //(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 //SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 
26 #ifndef DPMBase_H
27 #define DPMBase_H
28 
29 //so that the user doesn't have to include string/io manipulations:
30 #include <string>
31 #include <iomanip>
32 // include file for signal handler types
33 #include <csignal>
34 //The vector class contains a 3D vector class.
35 #include "Math/Vector.h"
36 //This class defines the particle handler
37 #include "ParticleHandler.h"
38 //This class defines the base particle (such that not every Driver has to include it)
39 #include "Particles/BaseParticle.h"
41 //This class defines the wall handler
42 #include "WallHandler.h"
43 //This class defines the boundary handler
44 #include "BoundaryHandler.h"
46 #include "DomainHandler.h"
47 //This class defines the interaction handler
48 #include "InteractionHandler.h"
49 //This class defines the Species handler
50 #include "SpeciesHandler.h"
51 //This class defines the cg handler
52 #include "CG/CGHandler.h"
53 //This class defines the possibleContact lists
54 #ifdef CONTACT_LIST_HGRID
55 #include "PossibleContactList.h"
56 #endif
57 //This class defines the random number generator
58 #include "Math/RNG.h"
59 #include "Domain.h"
65 #include "MercuryTime.h"
66 
67 
76 class DPMBase
77 {
82 public:
83 
89  void constructor();
90 
94  DPMBase();
95 
99  DPMBase(const DPMBase& other);
100 
104  virtual ~DPMBase();
105 
110  static void incrementRunNumberInFile();
111 
115  static int readRunNumberFromFile();
116 
121  void autoNumber();
122 
127  std::vector<int> get1DParametersFromRunNumber(int size_x) const;
128 
133  std::vector<int> get2DParametersFromRunNumber(int size_x, int size_y) const;
134 
139  std::vector<int> get3DParametersFromRunNumber(int size_x, int size_y, int size_z) const;
140 
144  int launchNewRun(const char* name, bool quick = false);
145 
146  //setters and getters
147 
151  void setRunNumber(int runNumber);
152 
156  int getRunNumber() const;
157 
161 // void sendParticlesToRoot(unsigned int &numberOfLocalParticles, unsigned int processorId, ParticleHandler &tempParticleHandler) const;
162 
166  virtual void decompose();
167 
172  void solve();
173 
177  void initialiseSolve();
178 
182  void finaliseSolve();
183 
188  virtual void computeOneTimeStep();
189 
194  void checkSettings();
195 
199  void forceWriteOutputFiles();
200 
205  virtual void writeOutputFiles();
206 
210  void solve(int argc, char* argv[]);
211 
222  virtual void setupInitialConditions();
223 
228  virtual void writeXBallsScript() const;
229 
233  virtual Mdouble getInfo(const BaseParticle& P) const;
234 
236 
244  virtual void writeRestartFile();
245 
246  void writeDataFile();
247 
248  void writeEneFile();
249 
250  void writeFStatFile();
251 
252  void fillDomainWithParticles(unsigned N=50);
253 
254  enum class ReadOptions : int {
255  ReadAll,
258  };
259 
266 
271  int readRestartFile(std::string fileName, ReadOptions opt = ReadOptions::ReadAll);
272 
273 // /*!
274 // * \brief Loads all MD data and plots statistics for all time steps in the .data file
275 // */
276 // void statisticsFromRestartData(const char *name);
278 
282  virtual void write(std::ostream& os, bool writeAllParticles = true) const;
283 
288  virtual void read(std::istream& is, ReadOptions opt = ReadOptions::ReadAll);
289 
293  virtual BaseWall* readUserDefinedWall(const std::string& type) const
294  { return nullptr; }
295 
300  virtual void readOld(std::istream& is);
301 
305  bool readDataFile(std::string fileName = "", unsigned int format = 0);
306 
310  bool readParAndIniFiles(std::string fileName);
311 
317  bool readNextDataFile(unsigned int format = 0);
318 
322  void readNextFStatFile();
323 
327  bool findNextExistingDataFile(Mdouble tMin, bool verbose = true);
328 
333  bool readArguments(int argc, char* argv[]);
334 
338  virtual bool readNextArgument(int& i, int argc, char* argv[]);
339 
343  virtual bool checkParticleForInteraction(const BaseParticle& P);
344 
348  virtual bool checkParticleForInteractionLocal(const BaseParticle& P);
349 
351 
353 
359 
360  //getters and setters
361 
368  File& getDataFile();
369 
376  File& getEneFile();
377 
384  File& getFStatFile();
385 
392  File& getRestartFile();
393 
400  File& getStatFile();
401 
406 
413  const File& getDataFile() const;
414 
421  const File& getEneFile() const;
422 
429  const File& getFStatFile() const;
430 
437  const File& getRestartFile() const;
438 
445  const File& getStatFile() const;
446 
450  const File& getInteractionFile() const;
451 
455  const std::string& getName() const;
456 
460  void setName(const std::string& name);
461 
465  void setName(const char* name);
466 
470  void setSaveCount(unsigned int saveCount);
471 
475  void setFileType(FileType fileType);
476 
480  void setOpenMode(std::fstream::openmode openMode);
481 
482 
483  //other member functions
484 
488  void resetFileCounter();
489 
493  void closeFiles();
494 
498  void setLastSavedTimeStep(unsigned int nextSavedTimeStep);
499 
503  Mdouble getTime() const;
504 
508  Mdouble getNextTime() const;
509 
514  unsigned int getNumberOfTimeSteps() const;
515 
519  void setTime(Mdouble time);
520 
524  void setTimeMax(Mdouble newTMax);
525 
529  Mdouble getTimeMax() const;
530 
534  void setLogarithmicSaveCount(Mdouble logarithmicSaveCountBase);
535 
539  void setNToWrite(int nToWrite);
540 
544  int getNToWrite() const;
545 
546 #ifdef CONTACT_LIST_HGRID
550  PossibleContactList& getPossibleContactList();
551 #endif
552 
563  void setRotation(bool rotation)
564  { rotation_ = rotation; }
565 
570  bool getRotation() const
571  { return rotation_; }
572 
578  void setWallsWriteVTK(FileType writeWallsVTK);
579 
585  void setWallsWriteVTK(bool);
586 
592  void setInteractionsWriteVTK(bool);
593 
597  void setParticlesWriteVTK(bool writeParticlesVTK);
598 
599  void setSuperquadricParticlesWriteVTK(bool writeSuperquadricParticlesVTK);
600 
606  FileType getWallsWriteVTK() const;
607 
611  bool getParticlesWriteVTK() const;
612 
614 
619  Mdouble getXMin() const
620  { return min_.x(); }
621 
626  Mdouble getXMax() const
627  { return max_.x(); }
628 
632  Mdouble getYMin() const
633  { return min_.y(); }
634 
638  Mdouble getYMax() const
639  { return max_.y(); }
640 
644  Mdouble getZMin() const
645  { return min_.z(); }
646 
650  Mdouble getZMax() const
651  { return max_.z(); }
652 
654  { return 0.5*(max_.X+min_.X); }
655 
657  { return 0.5*(max_.Y+min_.Y); }
658 
660  { return 0.5*(max_.Z+min_.Z); }
661  /*
662  * \brief Returns the minimum coordinates of the problem domain.
663  */
664  Vec3D getMin() const
665  { return min_; }
666 
667  /*
668  * \brief Returns the maximum coordinates of the problem domain.
669  */
670  Vec3D getMax() const
671  { return max_; }
672 
677  void setXMin(Mdouble newXMin);
678 
683  void setYMin(Mdouble newYMin);
684 
689  void setZMin(Mdouble newZMin);
690 
695  void setXMax(Mdouble newXMax);
696 
701  void setYMax(Mdouble newYMax);
702 
707  void setZMax(Mdouble newZMax);
708 
712  void setMax(const Vec3D& max);
713 
717  void setMax(Mdouble, Mdouble, Mdouble);
718 
722  void setDomain(const Vec3D& min, const Vec3D& max);
723 
727  void setMin(const Vec3D& min);
728 
732  void setMin(Mdouble, Mdouble, Mdouble);
733 
734 
738  void setTimeStep(Mdouble newDt);
739 
743  Mdouble getTimeStep() const;
744 
745  /* Sets the number of omp threads */
746  void setNumberOfOMPThreads(int numberOfOMPThreads);
747 
748  /* Returns the number of omp threads */
749  int getNumberOfOMPThreads() const;
750 
754  void setXBallsColourMode(int newCMode);
755 
759  int getXBallsColourMode() const;
760 
764  void setXBallsVectorScale(double newVScale);
765 
769  double getXBallsVectorScale() const;
770 
774  void setXBallsAdditionalArguments(std::string newXBArgs);
775 
779  std::string getXBallsAdditionalArguments() const;
780 
785  void setXBallsScale(Mdouble newScale);
786 
790  double getXBallsScale() const;
791 
795  void setGravity(Vec3D newGravity);
796 
800  Vec3D getGravity() const;
801 
806  void setBackgroundDrag(Mdouble backgroundDrag){backgroundDrag_=backgroundDrag;}
807 
812  const Mdouble getBackgroundDrag() const {return backgroundDrag_;}
813 
817  void setDimension(unsigned int newDim);
818 
822  void setSystemDimensions(unsigned int newDim);
823 
827  unsigned int getSystemDimensions() const;
828 
832  void setParticleDimensions(unsigned int particleDimensions);
833 
837  unsigned int getParticleDimensions() const;
838 
843  std::string getRestartVersion() const;
844 
848  void setRestartVersion(std::string newRV);
849 
853  bool getRestarted() const;
854 
858  void setRestarted(bool newRestartedFlag);
859 
863  bool getAppend() const;
864 
868  void setAppend(bool newAppendFlag);
869 
873  Mdouble getElasticEnergy() const;
874 
878  Mdouble getKineticEnergy() const;
879 
884 
889 
890  Mdouble getTotalEnergy() const;
891 
895  Mdouble getTotalMass() const;
896 
900  Vec3D getCentreOfMass() const;
901 
905  Vec3D getTotalMomentum() const;
906 
910  double getCPUTime() { return clock_.getCPUTime(); }
911 
915  double getWallTime() { return clock_.getWallTime(); }
916 
917 
921  static bool areInContact(const BaseParticle* pI, const BaseParticle* pJ);
922 
924 
927  virtual void hGridInsertParticle(BaseParticle* obj UNUSED);
928 
932  virtual void hGridUpdateParticle(BaseParticle* obj UNUSED);
933 
937  virtual void hGridRemoveParticle(BaseParticle* obj UNUSED);
938 
942  virtual void hGridUpdateMove(BaseParticle*, Mdouble);
943 
947  bool mpiIsInCommunicationZone(BaseParticle* particle);
948 
953 
958 
963 
968  virtual void gatherContactStatistics(unsigned int index1, int index2, Vec3D Contact, Mdouble delta, Mdouble ctheta,
969  Mdouble fdotn, Mdouble fdott, Vec3D P1_P2_normal_, Vec3D P1_P2_tangential);
970 
974  void setNumberOfDomains(std::vector<unsigned> direction);
975 
976  enum class DomainSplit {X, Y, Z, XY, XZ, YZ, XYZ};
977 
983  void splitDomain(DomainSplit domainSplit);
984 
988  std::vector<unsigned> getNumberOfDomains();
989 
994 
995  void removeOldFiles() const;
996 
1000  virtual void hGridGetInteractingParticleList(BaseParticle* obj, std::vector<BaseParticle*>& list)
1001  {};
1002 
1003  virtual void computeWallForces(BaseWall* w);
1004 
1008  virtual bool getHGridUpdateEachTimeStep() const;
1009 
1011  void setMeanVelocity(Vec3D V_mean_goal);
1012 
1014  void setMeanVelocityAndKineticEnergy(Vec3D V_mean_goal, Mdouble Ek_goal);
1015 
1017  Mdouble getTotalVolume() const;
1018 
1020  Matrix3D getKineticStress() const;
1021 
1023  Matrix3D getStaticStress() const;
1024 
1026  Matrix3D getTotalStress() const;
1027 
1031  virtual void handleParticleRemoval(unsigned int id);
1032 
1036  virtual void handleParticleAddition(unsigned int id, BaseParticle* p);
1037 
1038  //functions that should only be used in the class definitions
1039 protected:
1040 
1045  virtual void computeAllForces();
1046 
1051  virtual void computeInternalForces(BaseParticle*);
1052 
1058 
1062  virtual void computeExternalForces(BaseParticle*);
1063 
1068 
1073  virtual void actionsOnRestart();
1074 
1079  virtual void actionsBeforeTimeLoop();
1080 
1085  virtual void hGridActionsBeforeTimeLoop();
1086 
1091  virtual void hGridActionsBeforeTimeStep();
1092 
1097  virtual void actionsBeforeTimeStep();
1098 
1107  virtual void computeAdditionalForces() {}
1108 
1113  virtual void actionsAfterSolve();
1114 
1119  virtual void actionsAfterTimeStep();
1120 
1121  void writeVTKFiles() const;
1122 
1127  virtual void outputXBallsData(std::ostream& os) const;
1128 
1133  virtual void outputXBallsDataParticle(unsigned int i, unsigned int format, std::ostream& os) const;
1134 
1138  virtual void writeEneHeader(std::ostream& os) const;
1139 
1143  virtual void writeFstatHeader(std::ostream& os) const;
1144 
1148  virtual void writeEneTimeStep(std::ostream& os) const;
1149 
1150  // Functions for statistics
1154  virtual void initialiseStatistics();
1155 
1159  virtual void outputStatistics();
1160 
1164  void gatherContactStatistics();
1165 
1169  virtual void processStatistics(bool);
1170 
1174  virtual void finishStatistics();
1175 
1182  virtual void integrateBeforeForceComputation();
1183 
1187  virtual void integrateAfterForceComputation();
1188 
1194  virtual void checkInteractionWithBoundaries();
1195 
1199  virtual void hGridActionsBeforeIntegration();
1200 
1204  virtual void hGridActionsAfterIntegration();
1205 
1209  void setFixedParticles(unsigned int n);
1210 
1214  virtual void printTime() const;
1215 
1219  virtual bool continueSolve() const;
1220 
1225  void outputInteractionDetails() const;
1226 
1230  bool isTimeEqualTo(Mdouble time) const;
1231 
1236 
1243 
1250 
1251  void deleteGhostParticles(std::set<BaseParticle*>& particlesToBeDeleted);
1252 
1253  void synchroniseParticle(BaseParticle*, unsigned fromProcessor = 0);
1254 
1259 
1260 
1264  static void signalHandler(int signal);
1265 
1269  void setSoftStop();
1270 
1271 private:
1272 
1276  static volatile sig_atomic_t continueFlag_;
1277 
1278  /*The number of openmp (symmetric multiprocessing threads)*/
1280 
1284  unsigned int systemDimensions_;
1285 
1289  unsigned int particleDimensions_;
1290 
1295 
1301 
1305  std::vector<unsigned> numberOfDomains_;
1306 
1312 
1317 
1321  unsigned int numberOfTimeSteps_;
1322 
1327 
1332 
1338  std::string restartVersion_;
1339 
1344 
1349  bool append_;
1350 
1357 
1362 
1364 
1366 
1368 
1370 
1372 
1374 
1375  //This is the private data that is only used by the xballs output
1376 
1382 
1387 
1392 
1397 
1402 
1406  std::string name_;
1407 
1408  // defines a Macro for creating an instance of class PossibleContactList. See PossibleContactList.h
1409 #ifdef CONTACT_LIST_HGRID
1410  PossibleContactList possibleContactList;
1411 #endif
1412 
1417 
1422 
1423 public:
1428 
1433 
1438 
1443 
1448 
1453 
1458 
1463 
1468 
1469 
1474 
1479 
1484 
1489 
1494 
1499 
1505 
1510 
1512 
1513  void setWritePythonFileForVTKVisualisation(bool forceWritePythonFileForVTKVisualisation);
1515 
1517 
1518 private:
1520 };
1521 
1522 #endif
const unsigned n
Definition: CG3DPackingUnitTest.cpp:32
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
double Mdouble
Definition: GeneralDefine.h:34
#define MERCURYDPM_DEPRECATED
Definition: GeneralDefine.h:37
#define UNUSED
Definition: GeneralDefine.h:39
bool quick
Definition: LongPeriodicChute.cpp:36
Definition: BaseParticle.h:54
Basic class for walls.
Definition: BaseWall.h:49
Container to store pointers to all BaseBoundary objects.
Definition: BoundaryHandler.h:39
Definition: BoundaryVTKWriter.h:34
Container that stores all CG objects.
Definition: CGHandler.h:65
Definition: SpeedTestParticleInteractions.cpp:36
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:77
ParticleVtkWriter * vtkWriter_
Definition: DPMBase.h:1365
int getNumberOfOMPThreads() const
Definition: DPMBase.cc:1286
void setRotation(bool rotation)
Sets whether particle rotation is enabled or disabled.
Definition: DPMBase.h:563
bool getAppend() const
Returns whether the "append" option is on or off.
Definition: DPMBase.cc:1510
virtual void writeEneTimeStep(std::ostream &os) const
Write the global kinetic, potential energy, etc. in the system.
Definition: DPMBase.cc:2104
int getXBallsColourMode() const
Get the xballs colour mode (CMode).
Definition: DPMBase.cc:1310
Mdouble getRotationalEnergy() const
JMFT Returns the global rotational energy stored in the system.
Definition: DPMBase.cc:1577
Mdouble getXMin() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMin() returns XMin.
Definition: DPMBase.h:619
void setLastSavedTimeStep(unsigned int nextSavedTimeStep)
Sets the next time step for all the files (ene, data, fstat, restart, stat) at which the data is to b...
Definition: DPMBase.cc:519
virtual void computeInternalForce(BaseParticle *, BaseParticle *)
Computes the forces between two particles (internal in the sense that the sum over all these forces i...
Definition: DPMBase.cc:3104
InteractionVTKWriter interactionVTKWriter_
Definition: DPMBase.h:1369
void checkSettings()
Checks if the essentials are set properly to go ahead with solving the problem.
Definition: DPMBase.cc:3999
Mdouble getXMax() const
If the length of the problem domain in x-direction is XMax - XMin, then getXMax() returns XMax.
Definition: DPMBase.h:626
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:408
Vec3D max_
Definition: DPMBase.h:1311
virtual ~DPMBase()
virtual destructor
Definition: DPMBase.cc:297
virtual void outputStatistics()
Definition: DPMBase.cc:1893
virtual void readOld(std::istream &is)
Reads all data from a restart file, e.g. domain data and particle data; old version.
Definition: DPMBase.cc:3942
MERCURYDPM_DEPRECATED void setWallsWriteVTK(FileType writeWallsVTK)
Sets whether walls are written into a VTK file.
Definition: DPMBase.cc:911
void writeVTKFiles() const
Definition: DPMBase.cc:2128
virtual void initialiseStatistics()
Definition: DPMBase.cc:1885
virtual void computeForcesDueToWalls(BaseParticle *, BaseWall *)
Computes the forces on the particles due to the walls (normals are outward normals)
Definition: DPMBase.cc:3179
File eneFile
An instance of class File to handle in- and output into a .ene file.
Definition: DPMBase.h:1488
virtual bool readNextArgument(int &i, int argc, char *argv[])
Interprets the i^th command-line argument.
Definition: DPMBase.cc:4516
void synchroniseParticle(BaseParticle *, unsigned fromProcessor=0)
Definition: DPMBase.cc:5110
void initialiseSolve()
Beginning of the solve routine, before time stepping.
Definition: DPMBase.cc:4171
virtual void writeEneHeader(std::ostream &os) const
Writes a header with a certain format for ENE file.
Definition: DPMBase.cc:2014
DomainSplit
Definition: DPMBase.h:976
bool getParticlesWriteVTK() const
Returns whether particles are written in a VTK file.
Definition: DPMBase.cc:985
SpeciesHandler speciesHandler
A handler to that stores the species type i.e. LinearViscoelasticSpecies, etc.
Definition: DPMBase.h:1427
virtual void hGridUpdateParticle(BaseParticle *obj UNUSED)
Definition: DPMBase.cc:1704
virtual void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
Definition: DPMBase.cc:1998
double getXBallsVectorScale() const
Returns the scale of vectors used in xballs.
Definition: DPMBase.cc:1330
virtual void computeWallForces(BaseWall *w)
Definition: DPMBase.cc:5427
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:5305
void removeOldFiles() const
Definition: DPMBase.cc:4422
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
Definition: DPMBase.h:1483
Mdouble getTotalEnergy() const
Definition: DPMBase.cc:1591
void setYMin(Mdouble newYMin)
Sets the value of YMin, the lower bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1034
void fillDomainWithParticles(unsigned N=50)
Definition: DPMBase.cc:2987
Matrix3D getKineticStress() const
Calculate the kinetic stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5379
void setOpenMode(std::fstream::openmode openMode)
Sets File::openMode_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:490
Vec3D min_
These vectors are used for the XBalls domain, and occasionally people use it to add walls.
Definition: DPMBase.h:1310
virtual void writeOutputFiles()
Writes simulation data to all the main Mercury files: .data, .ene, .fstat, .xballs and ....
Definition: DPMBase.cc:4049
void setDomain(const Vec3D &min, const Vec3D &max)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1098
void insertGhostParticle(BaseParticle *P)
This function inserts a particle in the mpi communication boundaries.
Definition: DPMBase.cc:1811
virtual void integrateAfterForceComputation()
Update particles' and walls' positions and velocities after force computation.
Definition: DPMBase.cc:3305
Mdouble getYMin() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMin() returns YMin.
Definition: DPMBase.h:632
std::vector< unsigned > getNumberOfDomains()
returns the number of domains
Definition: DPMBase.cc:5280
const Mdouble getBackgroundDrag() const
Return the background drag.
Definition: DPMBase.h:812
virtual void computeOneTimeStep()
Performs everything needed for one time step, used in the time-loop of solve().
Definition: DPMBase.cc:4305
void setFixedParticles(unsigned int n)
Sets a number, n, of particles in the particleHandler as "fixed particles".
Definition: DPMBase.cc:1960
Mdouble getTotalVolume() const
Get the total volume of the cuboid system.
Definition: DPMBase.cc:5370
unsigned int getNumberOfTimeSteps() const
Returns the current counter of time-steps, i.e. the number of time-steps that the simulation has unde...
Definition: DPMBase.cc:824
void autoNumber()
The autoNumber() function calls three functions: setRunNumber(), readRunNumberFromFile() and incremen...
Definition: DPMBase.cc:539
bool findNextExistingDataFile(Mdouble tMin, bool verbose=true)
Finds and opens the next data file, if such a file exists.
Definition: DPMBase.cc:2654
virtual void hGridGetInteractingParticleList(BaseParticle *obj, std::vector< BaseParticle * > &list)
Creates a list of neighbour particles obtained from the hgrid.
Definition: DPMBase.h:1000
int xBallsColourMode_
XBalls is a package to view the particle data. As an alternative MercuryDPM also supports ParaView....
Definition: DPMBase.h:1381
int getRunNumber() const
This returns the current value of the counter (runNumber_)
Definition: DPMBase.cc:617
static void incrementRunNumberInFile()
Increment the run Number (counter value) stored in the file_counter (COUNTER_DONOTDEL) by 1 and store...
Definition: DPMBase.cc:628
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:422
unsigned int getParticleDimensions() const
Returns the particle dimensionality.
Definition: DPMBase.cc:1467
void deleteGhostParticles(std::set< BaseParticle * > &particlesToBeDeleted)
Definition: DPMBase.cc:5086
void setBackgroundDrag(Mdouble backgroundDrag)
Simple access function to turn on a background drag. The force of particleVelocity*drag is applied (n...
Definition: DPMBase.h:806
bool readDataFile(std::string fileName="", unsigned int format=0)
This allows particle data to be reloaded from data files.
Definition: DPMBase.cc:2437
bool getSuperquadricParticlesWriteVTK() const
Definition: DPMBase.cc:993
std::string getRestartVersion() const
This is to take into account for different Mercury versions. Returns the version of the restart file.
Definition: DPMBase.cc:1475
virtual void outputXBallsData(std::ostream &os) const
This function writes the location of the walls and particles in a format the XBalls program can read....
Definition: DPMBase.cc:2359
void setDimension(unsigned int newDim)
Sets both the system dimensions and the particle dimensionality.
Definition: DPMBase.cc:1403
MERCURYDPM_DEPRECATED FileType getWallsWriteVTK() const
Returns whether walls are written in a VTK file.
Definition: DPMBase.cc:973
Mdouble getTimeStep() const
Returns the simulation time step.
Definition: DPMBase.cc:1250
unsigned int systemDimensions_
The dimensions of the simulation i.e. 2D or 3D.
Definition: DPMBase.h:1284
std::vector< unsigned > numberOfDomains_
Vector containing the number of domains in x-,y- and z-direction, required for parallel computations.
Definition: DPMBase.h:1305
void removeDuplicatePeriodicParticles()
Removes periodic duplicate Particles.
Definition: DPMBase.cc:4986
PeriodicBoundaryHandler periodicBoundaryHandler
Internal handler that deals with periodic boundaries, especially in a parallel build.
Definition: DPMBase.h:1457
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5213
ReadOptions
Definition: DPMBase.h:254
bool isTimeEqualTo(Mdouble time) const
Checks whether the input variable "time" is the current time in the simulation.
Definition: DPMBase.cc:5203
WallVTKWriter wallVTKWriter_
Definition: DPMBase.h:1367
void setParticleDimensions(unsigned int particleDimensions)
Sets the particle dimensionality.
Definition: DPMBase.cc:1448
bool getRestarted() const
Returns the flag denoting if the simulation was restarted or not.
Definition: DPMBase.cc:1493
virtual void hGridActionsBeforeIntegration()
This function has to be called before integrateBeforeForceComputation.
Definition: DPMBase.cc:1940
WallDetailsVTKWriter wallDetailsVTKWriter_
Definition: DPMBase.h:1373
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
Definition: DPMBase.cc:399
bool readArguments(int argc, char *argv[])
Can interpret main function input arguments that are passed by the driver codes.
Definition: DPMBase.cc:4391
virtual void actionsBeforeTimeStep()
A virtual function which allows to define operations to be executed before the new time step.
Definition: DPMBase.cc:1864
Mdouble getTime() const
Returns the current simulation time.
Definition: DPMBase.cc:808
int numberOfOMPThreads_
Definition: DPMBase.h:1279
virtual void handleParticleAddition(unsigned int id, BaseParticle *p)
Definition: DPMBase.cc:5477
Mdouble getKineticEnergy() const
Returns the global kinetic energy stored in the system.
Definition: DPMBase.cc:1544
virtual void hGridRemoveParticle(BaseParticle *obj UNUSED)
Definition: DPMBase.cc:1711
std::string getXBallsAdditionalArguments() const
Returns the additional arguments for xballs.
Definition: DPMBase.cc:1355
File dataFile
An instance of class File to handle in- and output into a .data file.
Definition: DPMBase.h:1478
File interactionFile
File class to handle in- and output into .interactions file. This file hold information about interac...
Definition: DPMBase.h:1504
Mdouble timeMax_
Stores the duration of the simulation.
Definition: DPMBase.h:1331
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
Definition: DPMBase.h:1447
virtual bool checkParticleForInteractionLocal(const BaseParticle &P)
Checks if a particle P has any interaction with walls or other particles in the local domain.
Definition: DPMBase.cc:4904
Mdouble getNextTime() const
Returns the current simulation time.
Definition: DPMBase.cc:816
void setYMax(Mdouble newYMax)
Sets the value of YMax, the upper bound of the problem domain in the y-direction.
Definition: DPMBase.cc:1191
int getNToWrite() const
get the number of elements to write to the
Definition: DPMBase.cc:864
virtual void computeInternalForces(BaseParticle *)
Computes the internal forces on particle i (internal in the sense that the sum over all these forces ...
Definition: DPMBase.cc:3525
void outputInteractionDetails() const
Displays the interaction details corresponding to the pointer objects in the interaction handler.
Definition: DPMBase.cc:5183
virtual void checkInteractionWithBoundaries()
There are a range of boundaries one could implement depending on ones' problem. This methods checks f...
Definition: DPMBase.cc:3263
Domain * getCurrentDomain()
Function that returns a pointer to the domain corresponding to the processor.
Definition: DPMBase.cc:5289
ParticleVtkWriter * getVtkWriter() const
Definition: DPMBase.cc:5294
Vec3D getMax() const
Definition: DPMBase.h:670
virtual void hGridActionsBeforeTimeLoop()
A virtual function that allows one to carry out hGrid operations before the start of the time loop.
Definition: DPMBase.cc:1676
void writeEneFile()
Definition: DPMBase.cc:2961
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:459
File & getInteractionFile()
Return a reference to the file InteractionsFile.
Definition: DPMBase.cc:345
DPMBase()
Constructor that calls the "void constructor()".
Definition: DPMBase.cc:194
virtual void writeXBallsScript() const
This writes a script which can be used to load the xballs problem to display the data just generated.
void updateGhostGrid(BaseParticle *P)
Checks if the Domain/periodic interaction distance needs to be updated and updates it accordingly.
Definition: DPMBase.cc:1837
virtual void actionsOnRestart()
A virtual function where the users can add extra code which is executed only when the code is restart...
Definition: DPMBase.cc:1683
void setMin(const Vec3D &min)
Sets the minimum coordinates of the problem domain.
Definition: DPMBase.cc:1118
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:1661
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
Matrix3D getStaticStress() const
Calculate the static stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5401
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:735
int runNumber_
This stores the run number for saving.
Definition: DPMBase.h:1401
bool restarted_
A bool to check if the simulation was restarted or not, ie. if setupInitialConditionsShould be run an...
Definition: DPMBase.h:1343
virtual void writeFstatHeader(std::ostream &os) const
Writes a header with a certain format for FStat file.
Definition: DPMBase.cc:2043
void setNToWrite(int nToWrite)
set the number of elements to write to the screen
Definition: DPMBase.cc:853
void setZMin(Mdouble newZMin)
Sets the value of ZMin, the lower bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1058
virtual void processStatistics(bool)
Definition: DPMBase.cc:1918
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 ...
Mdouble xBallsScale_
sets the xballs argument scale (see XBalls/xballs.txt)
Definition: DPMBase.h:1391
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:670
bool readNextDataFile(unsigned int format=0)
Reads the next data file with default format=0. However, one can modify the format based on whether t...
Definition: DPMBase.cc:2691
CGHandler cgHandler
Object of the class cgHandler.
Definition: DPMBase.h:1473
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: DPMBase.h:1493
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:698
void finaliseSolve()
End of the solve routine, after time stepping.
Definition: DPMBase.cc:4287
BoundaryHandler boundaryHandler
An object of the class BoundaryHandler which concerns insertion and deletion of particles into or fro...
Definition: DPMBase.h:1452
void setSuperquadricParticlesWriteVTK(bool writeSuperquadricParticlesVTK)
Definition: DPMBase.cc:956
void gatherContactStatistics()
Definition: DPMBase.cc:1898
void setSoftStop()
function for setting sigaction constructor.
Definition: DPMBase.cc:5167
void resetFileCounter()
Resets the file counter for each file i.e. for ene, data, fstat, restart, stat)
Definition: DPMBase.cc:471
MERCURYDPM_DEPRECATED void setInteractionsWriteVTK(bool)
Sets whether interactions are written into a VTK file.
Definition: DPMBase.cc:930
Vec3D getMin() const
Definition: DPMBase.h:664
virtual void computeAllForces()
Computes all the forces acting on the particles using the BaseInteractable::setForce() and BaseIntera...
Definition: DPMBase.cc:3388
virtual bool getHGridUpdateEachTimeStep() const
Definition: DPMBase.cc:1718
MERCURYDPM_DEPRECATED File & getEneFile()
The non const version. Allows to edit the File::eneFile.
Definition: DPMBase.cc:313
virtual Mdouble getInfo(const BaseParticle &P) const
A virtual function that returns some user-specified information about a particle.
Definition: DPMBase.cc:1642
void splitDomain(DomainSplit domainSplit)
Definition: DPMBase.cc:5223
void setXBallsAdditionalArguments(std::string newXBArgs)
Set the additional arguments for xballs.
Definition: DPMBase.cc:1347
virtual void writeRestartFile()
Stores all the particle data for current save time step to a "restart" file, which is a file simply i...
Definition: DPMBase.cc:2942
Mdouble backgroundDrag_
This is a global background drag to help retard particles, or to do a simple fluid drag....
Definition: DPMBase.h:1300
Mdouble xBallsVectorScale_
sets the xballs argument vscale (see XBalls/xballs.txt)
Definition: DPMBase.h:1386
virtual void hGridActionsAfterIntegration()
This function has to be called after integrateBeforeForceComputation.
Definition: DPMBase.cc:1947
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:2473
std::string name_
the name of the problem, used, e.g., for the output files
Definition: DPMBase.h:1406
Mdouble getTotalMass() const
JMFT: Return the total mass of the system, excluding fixed particles.
Definition: DPMBase.cc:1598
void setXMax(Mdouble newXMax)
Sets the value of XMax, the upper bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1165
void readSpeciesFromDataFile(bool read=true)
Definition: DPMBase.h:352
InteractionHandler interactionHandler
An object of the class InteractionHandler.
Definition: DPMBase.h:1467
static volatile sig_atomic_t continueFlag_
Definition: DPMBase.h:1276
Vec3D getGravity() const
Returns the gravitational acceleration.
Definition: DPMBase.cc:1391
virtual void actionsBeforeTimeLoop()
A virtual function. Allows one to carry out any operations before the start of the time loop.
Definition: DPMBase.cc:1669
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created.
Definition: DPMBase.h:1437
void setZMax(Mdouble newZMax)
Sets the value of ZMax, the upper bound of the problem domain in the z-direction.
Definition: DPMBase.cc:1217
std::string restartVersion_
Previous versions of MercuryDPM had a different restart file format, the below member variable allows...
Definition: DPMBase.h:1338
bool writeParticlesVTK_
A flag to turn on/off the vtk writer for particles.
Definition: DPMBase.h:1361
void setParticlesWriteVTK(bool writeParticlesVTK)
Sets whether particles are written in a VTK file.
Definition: DPMBase.cc:942
WallVTKWriter & getWallVTKWriter()
Definition: DPMBase.cc:5505
virtual void handleParticleRemoval(unsigned int id)
Handles the removal of particles from the particleHandler.
Definition: DPMBase.cc:5462
void readNextFStatFile()
Reads the next fstat file.
Definition: DPMBase.cc:2869
bool mpiInsertParticleCheck(BaseParticle *P)
Function that checks if the mpi particle should really be inserted by the current domain.
Definition: DPMBase.cc:1732
RNG random
This is a random generator, often used for setting up the initial conditions etc.....
Definition: DPMBase.h:1432
double getWallTime()
Definition: DPMBase.h:915
virtual void computeAdditionalForces()
A virtual function which allows to define operations to be executed prior to the OMP force collect.
Definition: DPMBase.h:1107
void checkAndDuplicatePeriodicParticles()
For simulations using periodic boundaries, checks and adds particles when necessary into the particle...
Definition: DPMBase.cc:5029
virtual void printTime() const
Displays the current simulation time and the maximum simulation duration.
Definition: DPMBase.cc:1970
Mdouble getZCenter() const
Definition: DPMBase.h:659
MERCURYDPM_DEPRECATED File & getStatFile()
The non const version. Allows to edit the File::statFile.
Definition: DPMBase.cc:337
Matrix3D getTotalStress() const
Calculate the total stress tensor in the system averaged over the whole volume.
Definition: DPMBase.cc:5421
double getXBallsScale() const
Returns the scale of the view in xballs.
Definition: DPMBase.cc:1372
virtual void integrateBeforeForceComputation()
Update particles' and walls' positions and velocities before force computation.
Definition: DPMBase.cc:3219
void setNumberOfOMPThreads(int numberOfOMPThreads)
Definition: DPMBase.cc:1257
void closeFiles()
Closes all files (ene, data, fstat, restart, stat) that were opened to read or write.
Definition: DPMBase.cc:503
Mdouble getYMax() const
If the length of the problem domain in y-direction is YMax - YMin, then getYMax() returns XMax.
Definition: DPMBase.h:638
void setTimeStep(Mdouble newDt)
Sets a new value for the simulation time step.
Definition: DPMBase.cc:1234
File statFile
An instance of class File to handle in- and output into a .stat file.
Definition: DPMBase.h:1498
void setTimeMax(Mdouble newTMax)
Sets a new value for the maximum simulation duration.
Definition: DPMBase.cc:873
virtual void hGridUpdateMove(BaseParticle *, Mdouble)
Definition: DPMBase.cc:1933
void setSystemDimensions(unsigned int newDim)
Sets the system dimensionality.
Definition: DPMBase.cc:1417
virtual void computeExternalForces(BaseParticle *)
Computes the external forces, such as gravity, acting on particles.
Definition: DPMBase.cc:3159
void performGhostParticleUpdate()
When the Verlet scheme updates the positions and velocities of particles, ghost particles will need a...
Definition: DPMBase.cc:5063
bool rotation_
A flag to turn on/off particle rotation. true will enable particle rotation. false will disable parti...
Definition: DPMBase.h:1356
void writeFStatFile()
Definition: DPMBase.cc:2971
MERCURYDPM_DEPRECATED File & getFStatFile()
The non const version. Allows to edit the File::fStatFile.
Definition: DPMBase.cc:321
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:4954
void setRestartVersion(std::string newRV)
Sets restart_version.
Definition: DPMBase.cc:1484
Mdouble getXCenter() const
Definition: DPMBase.h:653
Vec3D getCentreOfMass() const
JMFT: Return the centre of mass of the system, excluding fixed particles.
Definition: DPMBase.cc:1614
virtual void hGridActionsBeforeTimeStep()
A virtual function that allows one to set or execute hGrid parameters or operations before every simu...
Definition: DPMBase.cc:1690
bool mpiIsInCommunicationZone(BaseParticle *particle)
Checks if the position of the particle is in an mpi communication zone or not.
Definition: DPMBase.cc:1764
void setXBallsScale(Mdouble newScale)
Sets the scale of the view (either normal, zoom in or zoom out) to display in xballs....
Definition: DPMBase.cc:1363
void performGhostVelocityUpdate()
updates the final time-step velocity of the ghost particles
Definition: DPMBase.cc:5128
virtual void decompose()
Sends particles from processorId to the root processor.
Definition: DPMBase.cc:4088
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
DomainHandler domainHandler
An object of the class DomainHandler which deals with parallel code.
Definition: DPMBase.h:1462
void forceWriteOutputFiles()
Writes output files immediately, even if the current time step was not meant to be written....
Definition: DPMBase.cc:4028
void setRunNumber(int runNumber)
This sets the counter/Run number, overriding the defaults.
Definition: DPMBase.cc:606
virtual void finishStatistics()
Definition: DPMBase.cc:1925
double getCPUTime()
Definition: DPMBase.h:910
bool checkParticleForInteractionLocalPeriodic(const BaseParticle &P)
Definition: DPMBase.cc:4854
ParticleHandler paoloParticleHandler
Fake particleHandler created by Paolo needed temporary by just Paolo.
Definition: DPMBase.h:1442
bool getWritePythonFileForVTKVisualisation() const
Definition: DPMBase.cc:5500
static int readRunNumberFromFile()
Read the run number or the counter from the counter file (COUNTER_DONOTDEL)
Definition: DPMBase.cc:553
Mdouble getGravitationalEnergy() const
Returns the global gravitational potential energy stored in the system.
Definition: DPMBase.cc:1561
void setXMin(Mdouble newXMin)
Sets the value of XMin, the lower bound of the problem domain in the x-direction.
Definition: DPMBase.cc:1010
MERCURYDPM_DEPRECATED File & getRestartFile()
The non const version. Allows to edit the File::restartFile.
Definition: DPMBase.cc:329
bool readSpeciesFromDataFile_
Determines if the last column of the data file is interpreted as the info parameter during restart.
Definition: DPMBase.h:1416
void writeDataFile()
Definition: DPMBase.cc:2952
virtual bool checkParticleForInteraction(const BaseParticle &P)
Checks whether a particle P has any interaction with walls or other particles.
Definition: DPMBase.cc:4805
bool writeSuperquadricParticlesVTK_
Definition: DPMBase.h:1363
std::string xBallsAdditionalArguments_
A string of additional arguments for xballs can be specified (see XBalls/xballs.txt)....
Definition: DPMBase.h:1396
bool append_
A flag to determine if the file has to be appended or not. See DPMBase::Solve() for example.
Definition: DPMBase.h:1349
void writePythonFileForVTKVisualisation() const
Definition: DPMBase.cc:2171
void setMax(const Vec3D &max)
Sets the maximum coordinates of the problem domain.
Definition: DPMBase.cc:1082
unsigned int getSystemDimensions() const
Returns the system dimensionality.
Definition: DPMBase.cc:1430
void setTime(Mdouble time)
Sets a new value for the current simulation time.
Definition: DPMBase.cc:836
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:293
Vec3D getTotalMomentum() const
JMFT: Return the total momentum of the system, excluding fixed particles.
Definition: DPMBase.cc:1624
Mdouble getYCenter() const
Definition: DPMBase.h:656
Time clock_
record when the simulation started
Definition: DPMBase.h:1509
virtual void hGridInsertParticle(BaseParticle *obj UNUSED)
Definition: DPMBase.cc:1697
Mdouble timeStep_
Stores the simulation time step.
Definition: DPMBase.h:1326
Vec3D gravity_
Gravity vector.
Definition: DPMBase.h:1294
Mdouble getTimeMax() const
Returns the maximum simulation duration.
Definition: DPMBase.cc:888
void setGravity(Vec3D newGravity)
Sets a new value for the gravitational acceleration.
Definition: DPMBase.cc:1383
Mdouble getElasticEnergy() const
Returns the global elastic energy within the system.
Definition: DPMBase.cc:1530
void constructor()
A function which initialises the member variables to default values, so that the problem can be solve...
Definition: DPMBase.cc:208
void setXBallsVectorScale(double newVScale)
Set the scale of vectors in xballs.
Definition: DPMBase.cc:1320
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:5322
virtual void actionsAfterSolve()
A virtual function which allows to define operations to be executed after the solve().
Definition: DPMBase.cc:1871
bool forceWritePythonFileForVTKVisualisation_
Definition: DPMBase.h:1519
unsigned int numberOfTimeSteps_
Stores the number of time steps.
Definition: DPMBase.h:1321
void setXBallsColourMode(int newCMode)
Set the xballs output mode.
Definition: DPMBase.cc:1300
void setAppend(bool newAppendFlag)
Sets whether the "append" option is on or off.
Definition: DPMBase.cc:1522
void setWritePythonFileForVTKVisualisation(bool forceWritePythonFileForVTKVisualisation)
Definition: DPMBase.cc:5495
bool getRotation() const
Indicates whether particle rotation is enabled or disabled.
Definition: DPMBase.h:570
Mdouble getZMax() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMax() returns ZMax.
Definition: DPMBase.h:650
BoundaryVTKWriter boundaryVTKWriter_
Definition: DPMBase.h:1371
unsigned int particleDimensions_
determines if 2D or 3D particle volume is used for mass calculations
Definition: DPMBase.h:1289
Mdouble getZMin() const
If the length of the problem domain in z-direction is ZMax - ZMin, then getZMin() returns ZMin.
Definition: DPMBase.h:644
virtual void actionsAfterTimeStep()
A virtual function which allows to define operations to be executed after time step.
Definition: DPMBase.cc:1878
Mdouble time_
Stores the current simulation time.
Definition: DPMBase.h:1316
void setLogarithmicSaveCount(Mdouble logarithmicSaveCountBase)
Sets File::logarithmicSaveCount_ for all files (ene, data, fstat, restart, stat)
Definition: DPMBase.cc:5447
virtual void read(std::istream &is, ReadOptions opt=ReadOptions::ReadAll)
Reads all data from a restart file, e.g. domain data and particle data.
Definition: DPMBase.cc:3679
MERCURYDPM_DEPRECATED File & getDataFile()
The non const version. Allows one to edit the File::dataFile.
Definition: DPMBase.cc:305
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Definition: DPMBase.cc:3541
bool readRestartFile(ReadOptions opt=ReadOptions::ReadAll)
Reads all the particle data corresponding to a given, existing . restart file (for more details regar...
Definition: DPMBase.cc:3006
int nToWrite_
number of elements to write to a screen
Definition: DPMBase.h:1421
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:775
static void signalHandler(int signal)
signal handler function.
Definition: DPMBase.cc:5141
virtual bool continueSolve() const
A virtual function for deciding whether to continue the simulation, based on a user-specified criteri...
Definition: DPMBase.cc:1990
Container to store all Domain.
Definition: DomainHandler.h:47
The simulation can be subdivided into Domain's used in parallel code.
Definition: Domain.h:64
Definition: File.h:81
Container to store Interaction objects.
Definition: InteractionHandler.h:45
Definition: InteractionVTKWriter.h:34
Implementation of a 3D matrix.
Definition: Matrix.h:38
Container to store all BaseParticle.
Definition: ParticleHandler.h:48
Definition: ParticleSpecies.h:37
Definition: ParticleVtkWriter.h:34
Container to store pointers to all BasePeriodicBoundary objects.
Definition: PeriodicBoundaryHandler.h:46
Manages the linked list of PossibleContact.
Definition: PossibleContactList.h:44
This is a class that generates random numbers i.e. named the Random Number Generator (RNG).
Definition: RNG.h:53
Container to store all ParticleSpecies.
Definition: SpeciesHandler.h:37
Allows for timing the algorithms; accurate up to 0.01 sec.
Definition: MercuryTime.h:46
Mdouble getWallTime()
Definition: MercuryTime.h:88
Mdouble getCPUTime() const
Definition: MercuryTime.h:80
Definition: Vector.h:51
Mdouble & y()
RW reference to Y.
Definition: Vector.h:372
Mdouble Y
Definition: Vector.h:66
Mdouble Z
Definition: Vector.h:66
Mdouble & z()
RW reference to Z.
Definition: Vector.h:384
Mdouble X
the vector components
Definition: Vector.h:66
Mdouble & x()
RW reference to X.
Definition: Vector.h:360
Definition: WallDetailsVTKWriter.h:35
Container to store all BaseWall.
Definition: WallHandler.h:44
Definition: WallVTKWriter.h:34
double P
Uniform pressure.
Definition: TwenteMeshGluing.cpp:73
const std::complex< Mdouble > i
Definition: ExtendedMath.h:51
std::string name
Definition: MercuryProb.h:48
bool verbose
Definition: statXZ.cpp:28