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[])
 [T10:main] More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T10:main]

30 {
31  //writeToFile is used here to create a restart and a data file, which will be loaded below.
32  helpers::writeToFile("Tutorial10MPI.ini.restart",
33  "restart_version 1.0 name Tutorial10MPI\n"
34  "dataFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
35  "fStatFile fileType NO_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
36  "eneFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
37  "restartFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
38  "statFile fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
39  "xMin 0 xMax 2 yMin 0 yMax 2 zMin 0 zMax 2\n"
40  "timeStep 1e-03 time 0 ntimeSteps 0 timeMax 10\n"
41  "systemDimensions 3 particleDimensions 3 gravity 0 0 -1\n"
42  "Species 1\n"
43  "LinearViscoelasticSpecies id 0 density 1.9098593 stiffness 2000 dissipation 1\n"
44  "Walls 1\n"
45  "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"
46  "Boundaries 0\n"
47  "Particles 0\n"
48  "Interactions 0\n"
49  );
50 
51  helpers::writeToFile("Tutorial10MPI.ini.data",
52  "1 0 0 0 0 2 2 2\n"
53  "1 1 1.5 0 0 0 0.5 0 0 0 0 0 0 0\n"
54  //"1 1 0.5 0 0 0 0.5 0 0 0 0 0 0 0\n"
55  );
56 
57  DPM Tutorial10;
58  Tutorial10.setNumberOfDomains({1,1,2});
59 
60  //use readRestartFile to load information from a restart file
61  Tutorial10.readRestartFile("Tutorial10MPI.ini.restart");
62  Tutorial10.setRestarted(false);
63 
64  //now start the calculations
65  Tutorial10.solve();
66 
67  return 0;
68 }
void setNumberOfDomains(std::vector< unsigned > direction)
Sets the number of domains in x-,y- and z-direction. Required for parallel computations.
Definition: DPMBase.cc:5302
void setRestarted(bool newRestartedFlag)
Allows to set the flag stating if the simulation is to be restarted or not.
Definition: DPMBase.cc:1492
void solve()
The work horse of the code.
Definition: DPMBase.cc:4334
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:3043
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:9
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29

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