MercuryDPM  0.11
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FullRestartTest.cpp File Reference

Go to the source code of this file.

Classes

class  FullRestartTest
 

Functions

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

Function Documentation

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

Definition at line 129 of file FullRestartTest.cpp.

References File::close(), File::open(), DPMBase::readRestartFile(), Files::restartFile, Files::setName(), File::setOpenMode(), FullRestartTest::setupInitialConditions(), DPMBase::write(), and DPMBase::writeRestartFile().

130 {
131  FullRestartTest normal;
132  normal.setName("FullRestartTest_Normal");
133  normal.setupInitialConditions();
134  normal.restartFile.open();
135  normal.writeRestartFile();
136 
137  FullRestartTest restart;
138  restart.readRestartFile("FullRestartTest_Normal.restart");
139  restart.setName("FullRestartTest_Restart");
140  restart.restartFile.close();
141  restart.restartFile.setOpenMode(std::fstream::out);
142  restart.restartFile.open();
143  restart.writeRestartFile();
144  restart.write(std::cout);
145 }
void setupInitialConditions()
This function allows to set the initial conditions for our problem to be solved, by default particle ...
virtual void write(std::ostream &os, bool writeAllParticles=true) const
Loads all MD data and plots statistics for all timesteps in the .data file.
Definition: DPMBase.cc:1642
File restartFile
An instance of class File to handle in- and output into a .restart file.
Definition: Files.h:219
void close()
Closes the file by calling fstream_.close()
Definition: File.cc:360
int readRestartFile()
Reads all the particle data corresponding to the current saved time step. Which is what the restart f...
Definition: DPMBase.cc:1375
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
Definition: Files.cc:149
bool open()
Checks if the file stream fstream_ has any issues while opening. Alongside, it also increments the ne...
Definition: File.cc:318
virtual void writeRestartFile()
Stores all the particle data for current save time step. Calls the write function.
Definition: DPMBase.cc:1365
void setOpenMode(std::fstream::openmode openMode)
Allows the user to Sets File::openMode_.
Definition: File.cc:267