43 std::string prefix = argv[1];
44 std::string::size_type pos = prefix.find(
".restart");
46 if (pos == std::string::npos) {
49 m.
setName(prefix.substr(0,pos-1));
55 m.
setName(
"../Drivers/MercuryCG/NewtonsCradleSelfTest");
58 " This program converts MercuryDPM files into ParaView data files,\n"
59 " which can then be used to visualize your particles.\n"
61 " prefix: Prefix to prepend to the i/o files.\n"
63 " The following files will be generated:\n"
68 " - prefix_987654321.vtu\n"
69 " depending on the amount of timesteps.", argv[0]);
74 std::string::size_type pos = m.
getName().find_last_of(
"/");
75 std::string path = m.
getName().substr(0,pos+1);
void writeVTK() const
Writes all particles into a vtk file format (unstructured grid), consisting of particle positions...
Logger< MERCURY_LOGLEVEL > logger("MercuryKernel")
bool readRestartFile(bool restarted=true)
Reads all the particle data corresponding to the current saved time step. Which is what the restart f...
LL< Log::INFO > INFO
Info log level.
void setCounter(unsigned int counter)
Allows the user to set the file counter according to his need. Sets File::counter_.
File restartFile
An instance of class File to handle in- and output into a .restart file.
LL< Log::WARN > WARN
Warning log level.
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
ParticleHandler particleHandler
An object of the class ParticleHandler, contains the pointers to all the particles created...
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
LL< Log::FATAL > FATAL
Fatal log level.
File dataFile
An instance of class File to handle in- and output into a .data file.
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...
unsigned int getNumberOfObjects() const
Gets the number of Object in this BaseHandler.
InteractionHandler interactionHandler
An object of the class InteractionHandler.
WallHandler wallHandler
An object of the class WallHandler. Contains pointers to all the walls created.
void setWriteVTK(FileType f)
bool open()
Checks if the file stream fstream_ has any issues while opening. Alongside, it also increments the ne...
each time-step will be written into/read from separate files numbered consecutively: name_...
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
Mdouble getTime() const
Access function for the time.
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
const std::string & getName() const
Allows to access the file name, e.g., "problem.data".
void writeVTK() const
Writes all walls into a vtk format, consisting of points (edges) and cells (faces).
void clear()
Empties the whole BaseHandler by removing all Objects and setting all other variables to 0...