Tutorial10MPI_LoadingDataRestart.cpp File Reference
#include <Mercury3D.h>
#include <Math/Helpers.h>

Classes

class  DPM
 In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle under small gravity. After that Z statistics are calculated. More...
 

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)
40 {
41  //writeToFile is used here to create a restart and a data file, which will be loaded below.
42  helpers::writeToFile("Tutorial10MPI.ini.restart",
43  "restart_version 1.0 name Tutorial10MPI\n"
44  "dataFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
45  "fStatFile fileType NO_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
46  "eneFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
47  "restartFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
48  "statFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
49  "xMin 0 xMax 2 yMin 0 yMax 2 zMin 0 zMax 2\n"
50  "timeStep 1e-03 time 0 ntimeSteps 0 timeMax 10\n"
51  "systemDimensions 3 particleDimensions 3 gravity 0 0 -1\n"
52  "Species 1\n"
53  "LinearViscoelasticSpecies id 0 density 1.9098593 stiffness 2000 dissipation 1\n"
54  "Walls 1\n"
55  "InfiniteWall id 0 indSpecies 0 position 0 0 0 orientation 0 0 0 1 velocity 0 0 0 angularVelocity 0 0 0 0 force 0 0 0 torque 0 0 0 normal 0 0 -1 factor 1\n"
56  "Boundaries 0\n"
57  "Particles 0\n"
58  "Interactions 0\n"
59  );
60 
61  helpers::writeToFile("Tutorial10MPI.ini.data",
62  "1 0 0 0 0 2 2 2\n"
63  "1 1 1.5 0 0 0 0.5 0 0 0 0 0 0 0\n"
64  //"1 1 0.5 0 0 0 0.5 0 0 0 0 0 0 0\n"
65  );
66 
67  DPM Tutorial10;
68  Tutorial10.setNumberOfDomains({1,1,2});
69 
70  //use readRestartFile to load information from a restart file
71  Tutorial10.readRestartFile("Tutorial10MPI.ini.restart");
72  Tutorial10.setRestarted(false);
73 
74  //now start the calculations
75  Tutorial10.solve();
76 
77  return 0;
78 }
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
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1501
void solve()
The work horse of the code.
Definition: DPMBase.cc:4270
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
In this file a cubic packing of 5^3 particles in a tri-axial box is created and allowed to settle und...
Definition: HGridUpdateUnitTest.cpp:30
bool writeToFile(std::string filename, std::string filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:58

References DPMBase::readRestartFile(), DPMBase::setNumberOfDomains(), DPMBase::setRestarted(), DPMBase::solve(), and helpers::writeToFile().