5 #ifndef MERCURYDPM_FILEIO_HELPERS_H
6 #define MERCURYDPM_FILEIO_HELPERS_H
72 const auto pos = is.tellg();
110 std::ifstream is(
fileName.c_str(), std::ios::in);
113 logger(
INFO,
"readFromFile: file % could not be opened, variable % set to default value %",
133 logger(
WARN,
"readFromFile: variable % not set in file %, using default value % ", varName,
fileName, defaultValue);
const unsigned n
Definition: CG3DPackingUnitTest.cpp:11
Logger< MERCURYDPM_LOGLEVEL > logger("MercuryKernel")
Definition of different loggers with certain modules. A user can define its own custom logger here.
LL< Log::WARN > WARN
Warning log level.
Definition: Logger.cc:33
RealScalar s
Definition: level1_cplx_impl.h:130
int * m
Definition: level2_cplx_impl.h:294
#define INFO(i)
Definition: mumps_solver.h:54
squared absolute value
Definition: GlobalFunctions.h:87
string filename
Definition: MergeRestartFiles.py:39
const unsigned unsignedMax
Definition: GeneralDefine.h:25
Definition: CommandLineHelpers.h:11
bool readOptionalVariable(std::istream &is, const std::string &name, T &variable)
Reads optional variables in the restart file.
Definition: FileIOHelpers.h:68
void more(const std::string &filename, unsigned nLines=constants::unsignedMax)
Definition: FileIOHelpers.cc:151
void writeCommandLineToFile(const std::string &filename, const int argc, char *const argv[])
Writes a string to a file.
Definition: FileIOHelpers.cc:47
bool createDirectory(const std::string &directory, bool allowExists=false)
Creates a directory.
Definition: FileIOHelpers.cc:177
bool fileExists(const std::string &strFilename)
Function to check if a file exists, is used to check if a run has already need done.
Definition: FileIOHelpers.cc:77
bool openFile(std::fstream &file, const std::string &filename, std::fstream::openmode mode)
Provides a simple interface for opening a file.
Definition: FileIOHelpers.cc:115
T readFromFile(const std::string &fileName, const std::string &varName, const T defaultValue)
Definition: FileIOHelpers.h:107
std::string getPath()
Definition: FileIOHelpers.cc:206
std::vector< double > readArrayFromFile(const std::string &filename, int &n, int &m)
Definition: FileIOHelpers.cc:128
bool writeToFile(const std::string &filename, const std::string &filecontent)
Writes a string to a file.
Definition: FileIOHelpers.cc:29
bool addToFile(const std::string &filename, const std::string &filecontent)
Adds a string to an existing file.
Definition: FileIOHelpers.cc:59
std::string string(const unsigned &i)
Definition: oomph_definitions.cc:286
string name
Definition: plotDoE.py:33