OGS
ProcessLib::Output::OutputFile Struct Reference

Detailed Description

Definition at line 178 of file Output.cpp.

Public Member Functions

 OutputFile (std::string const &directory, OutputType const type, std::string const &prefix, std::string const &suffix, std::string const &mesh_name, int const timestep, double const t, int const iteration, int const data_mode_, bool const compression_, std::set< std::string > const &outputnames, unsigned int const n_files)
 

Static Public Member Functions

static std::string constructFilename (OutputType const type, std::string prefix, std::string suffix, std::string mesh_name, int const timestep, double const t, int const iteration)
 

Public Attributes

std::string const name
 
std::string const path
 
OutputType const type
 
int const data_mode
 
bool const compression
 Enables or disables zlib-compression of the output files. More...
 
std::set< std::string > outputnames
 
unsigned int n_files
 

Constructor & Destructor Documentation

◆ OutputFile()

ProcessLib::Output::OutputFile::OutputFile ( std::string const &  directory,
OutputType const  type,
std::string const &  prefix,
std::string const &  suffix,
std::string const &  mesh_name,
int const  timestep,
double const  t,
int const  iteration,
int const  data_mode_,
bool const  compression_,
std::set< std::string > const &  outputnames,
unsigned int const  n_files 
)
inline

Definition at line 180 of file Output.cpp.

187  : name(constructFilename(type, prefix, suffix, mesh_name, timestep, t,
188  iteration)),
189  path(BaseLib::joinPaths(directory, name)),
190  type(type),
191  data_mode(data_mode_),
192  compression(compression_),
195  {
196  }
std::string joinPaths(std::string const &pathA, std::string const &pathB)
Definition: FileTools.cpp:212
std::string const path
Definition: Output.cpp:199
bool const compression
Enables or disables zlib-compression of the output files.
Definition: Output.cpp:207
std::string const name
Definition: Output.cpp:198
static std::string constructFilename(OutputType const type, std::string prefix, std::string suffix, std::string mesh_name, int const timestep, double const t, int const iteration)
Definition: Output.cpp:210
std::set< std::string > outputnames
Definition: Output.cpp:208

Member Function Documentation

◆ constructFilename()

static std::string ProcessLib::Output::OutputFile::constructFilename ( OutputType const  type,
std::string  prefix,
std::string  suffix,
std::string  mesh_name,
int const  timestep,
double const  t,
int const  iteration 
)
inlinestatic

Definition at line 210 of file Output.cpp.

215  {
216  std::map<OutputType, std::string> filetype_to_extension = {
217  {OutputType::vtk, "vtu"}, {OutputType::xdmf, "xdmf"}};
218 
219  try
220  {
221  std::string extension = filetype_to_extension.at(type);
222  return BaseLib::constructFormattedFileName(prefix, mesh_name,
223  timestep, t, iteration) +
224  BaseLib::constructFormattedFileName(suffix, mesh_name,
225  timestep, t, iteration) +
226  "." + extension;
227  }
228  catch (std::out_of_range&)
229  {
230  OGS_FATAL(
231  "No supported file type provided. Read `{:s}' from <output><type> \
232  in prj file. Supported: VTK, XDMF.",
233  type);
234  }
235  }
#define OGS_FATAL(...)
Definition: Error.h:26
std::string constructFormattedFileName(std::string const &format_specification, std::string const &mesh_name, int const timestep, double const t, int const iteration)
Definition: FileTools.cpp:116

References BaseLib::constructFormattedFileName(), OGS_FATAL, type, ProcessLib::vtk, and ProcessLib::xdmf.

Referenced by ProcessLib::Output::doOutputNonlinearIteration().

Member Data Documentation

◆ compression

bool const ProcessLib::Output::OutputFile::compression

Enables or disables zlib-compression of the output files.

Definition at line 207 of file Output.cpp.

Referenced by ProcessLib::Output::outputMesh(), and ProcessLib::Output::outputMeshXdmf().

◆ data_mode

int const ProcessLib::Output::OutputFile::data_mode

Chooses vtk's data mode for output following the enumeration given in the vtkXMLWriter: {Ascii, Binary, Appended}. See vtkXMLWriter documentation http://www.vtk.org/doc/nightly/html/classvtkXMLWriter.html

Definition at line 205 of file Output.cpp.

Referenced by ProcessLib::Output::outputMesh().

◆ n_files

unsigned int ProcessLib::Output::OutputFile::n_files

Definition at line 209 of file Output.cpp.

Referenced by ProcessLib::Output::outputMeshXdmf().

◆ name

std::string const ProcessLib::Output::OutputFile::name

Definition at line 198 of file Output.cpp.

Referenced by ProcessLib::Output::outputMesh().

◆ outputnames

std::set<std::string> ProcessLib::Output::OutputFile::outputnames

Definition at line 208 of file Output.cpp.

◆ path

std::string const ProcessLib::Output::OutputFile::path

◆ type

OutputType const ProcessLib::Output::OutputFile::type

Definition at line 200 of file Output.cpp.

Referenced by constructFilename(), and ProcessLib::Output::outputMesh().


The documentation for this struct was generated from the following file: