215 is >> dummy >>
name_;
231 os <<
" name " <<
name_<< std::endl;
232 os <<
"dataFile " <<
dataFile << std::endl;
233 os <<
"fStatFile " <<
fStatFile << std::endl;
234 os <<
"eneFile " <<
eneFile << std::endl;
236 os <<
"statFile " <<
statFile << std::endl;
Every simulation requires data files to store all the information necessary for visualisation and ana...
void setNextSavedTimeStep(unsigned int nextSavedTimeStep)
Sets the next time step for all the files (ene, data, fstat, restart, stat) at which the data is to b...
void setCounter(unsigned int counter)
Allows the user to set the file counter according to his need. Sets File::counter_.
MERCURY_DEPRECATED File & getDataFile()
The non const version. Allows one to edit the File::dataFile.
File restartFile
An instance of class File to handle in- and output into a .restart file.
void closeFiles()
Closes all files (ene, data, fstat, restart, stat) that were opened to read or write.
MERCURY_DEPRECATED File & getStatFile()
The non const version. Allows to edit the File::statFile.
void setFileType(FileType fileType)
Sets File::fileType_ for all files (ene, data, fstat, restart, stat)
FileType
With FileType options, one is able to choose if data is to be read/written from/into no or single or ...
void setOpenMode(std::fstream::openmode openMode)
Sets File::openMode_ for all files (ene, data, fstat, restart, stat)
void close()
Closes the file by calling fstream_.close()
MERCURY_DEPRECATED File & getFStatFile()
The non const version. Allows to edit the File::fStatFile.
virtual ~Files()
A destructor, watch out its a virtual destructor.
std::string name_
the name of the problem, used, e.g., for the files
File eneFile
An instance of class File to handle in- and output into a .ene file.
void openFiles()
Opens all the files (ene, data, fstat, restart, stat) for reading and writing purposes.
std::fstream & getFstream()
Allows to access the member variable File::fstream_.
void setName(const std::string &name)
Allows to set the name of all the files (ene, data, fstat, restart, stat)
void resetFileCounter()
Resets the file counter for each file i.e. for ene, data, fstat, restart, stat)
void setNextSavedTimeStep(unsigned int nextSavedTimeStep)
Sets File::nextSavedTimeStep_.
MERCURY_DEPRECATED File & getEneFile()
The non const version. Allows to edit the File::eneFile.
File fStatFile
An instance of class File to handle in- and output into a .fstat file.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_ for all files (ene, data, fstat, restart, stat)
File dataFile
An instance of class File to handle in- and output into a .data file.
void setSaveCount(unsigned int saveCount)
Sets File::saveCount_.
void setFileType(FileType fileType)
Sets the type of file needed to write into or read from. File::fileType_.
void write(std::ostream &os) const
Writes data into a file from the member variables name_, restartFile, dataFile etc.
bool open()
Checks if the file stream fstream_ has any issues while opening. Alongside, it also increments the ne...
void read(std::istream &is)
Extracts data from the input stream (which is basically a file you want to read from) into name_...
void setName(const std::string &name)
Sets the file name, e.g. "Name.data".
File statFile
An instance of class File to handle in- and output into a .stat file.
const std::string & getName() const
Returns the name of the file. Does not allow to change it though.
MERCURY_DEPRECATED File & getRestartFile()
The non const version. Allows to edit the File::restartFile.
void setOpenMode(std::fstream::openmode openMode)
Allows the user to Sets File::openMode_.