Tutorial10_LoadingDataRestart.cpp File Reference

Functions

int main (int argc, char *argv[])
 [T10:headers] More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

[T10:headers]

[T10:headers] [T10:main]

25 {
26 
27  //writeToFile is used here to create a restart and a data file, which will be loaded below.
28  helpers::writeToFile("Tutorial10.ini.restart",
29  "restart_version 1.0 name Tutorial10\n"
30  "dataFile name Tutorial10.data fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
31  "fStatFile name Tutorial10.fstat fileType NO_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
32  "eneFile name Tutorial10.ene fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
33  "restartFile name Tutorial10.restart fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
34  "statFile name Tutorial10.stat fileType ONE_FILE saveCount 10 counter 0 nextSavedTimeStep 0\n"
35  "xMin 0 xMax 2 yMin 0 yMax 2 zMin 0 zMax 2\n"
36  "timeStep 1e-03 time 0 ntimeSteps 0 timeMax 10\n"
37  "systemDimensions 3 particleDimensions 3 gravity 0 0 -1\n"
38  "Species 1\n"
39  "LinearViscoelasticSpecies id 0 density 1.9098593 stiffness 2000 dissipation 10\n"
40  "Walls 1\n"
41  "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"
42  "Boundaries 0\n"
43  "Particles 0\n"
44  "Interactions 0\n"
45  );
46 
47  helpers::writeToFile("Tutorial10.ini.data",
48  "1 0 0 0 0 2 2 2\n"
49  "1 1 1.5 0 0 0 0.5 0 0 0 0 0 0 0\n"
50  );
51 
52 
53  DPMBase Tutorial10;
54  //use readRestartFile to load information from a restart file
55  Tutorial10.readRestartFile("Tutorial10.ini.restart");
56 
57  //use readDataFile to load information from a data file
58  Tutorial10.readDataFile("Tutorial10.ini.data");
59 
60  //now start the calculations
61  Tutorial10.solve();
62 
63  return 0;
64 }
The DPMBase header includes quite a few header files, defining all the handlers, which are essential....
Definition: DPMBase.h:56
bool readDataFile(std::string fileName="", unsigned int format=0)
This allows particle data to be reloaded from data files.
Definition: DPMBase.cc:2457
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
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29

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