OGS
ProcessLib::OutputXDMFHDF5Format Struct Referencefinal

Detailed Description

Definition at line 90 of file OutputFormat.h.

#include <OutputFormat.h>

Inheritance diagram for ProcessLib::OutputXDMFHDF5Format:
[legend]
Collaboration diagram for ProcessLib::OutputXDMFHDF5Format:
[legend]

Public Member Functions

 OutputXDMFHDF5Format (std::string const &directory, std::string prefix, std::string suffix, bool const compression, unsigned int const n_files, unsigned int const chunk_size_bytes)
void outputMeshes (const int timestep, const double t, const int iteration, bool const converged, std::vector< std::reference_wrapper< const MeshLib::Mesh > > const &meshes, std::set< std::string > const &output_variables) const override
std::string constructFilename (std::string const &mesh_name, int const timestep, double const t, int const iteration, bool const converged) const override
void outputMeshXdmf (std::set< std::string > const &output_variables, std::vector< std::reference_wrapper< const MeshLib::Mesh > > const &meshes, int const timestep, double const t, int const iteration, bool const converged) const
Public Member Functions inherited from ProcessLib::OutputFormat
 OutputFormat (std::string const &directory, std::string prefix, std::string suffix, bool const compression)
virtual ~OutputFormat ()=default
 OutputFormat (OutputFormat const &other)=delete
 OutputFormat (OutputFormat &&other)=default
OutputFormatoperator= (OutputFormat &other)=delete
OutputFormatoperator= (OutputFormat &&other)=default

Public Attributes

std::unique_ptr< MeshLib::IO::XdmfHdfWritermesh_xdmf_hdf_writer
unsigned int n_files
 Specifies the number of hdf5 output files.
unsigned int const chunk_size_bytes
 Specifies the chunks size in bytes per hdf5 output file.
Public Attributes inherited from ProcessLib::OutputFormat
std::string directory
std::string prefix
std::string suffix
bool compression
 Enables or disables zlib-compression of the output files.

Constructor & Destructor Documentation

◆ OutputXDMFHDF5Format()

ProcessLib::OutputXDMFHDF5Format::OutputXDMFHDF5Format ( std::string const & directory,
std::string prefix,
std::string suffix,
bool const compression,
unsigned int const n_files,
unsigned int const chunk_size_bytes )
inline

Definition at line 92 of file OutputFormat.h.

96 : OutputFormat(directory, std::move(prefix), std::move(suffix),
100 {
101 }
OutputFormat(std::string const &directory, std::string prefix, std::string suffix, bool const compression)
bool compression
Enables or disables zlib-compression of the output files.
unsigned int const chunk_size_bytes
Specifies the chunks size in bytes per hdf5 output file.
unsigned int n_files
Specifies the number of hdf5 output files.

References ProcessLib::OutputFormat::OutputFormat(), chunk_size_bytes, ProcessLib::OutputFormat::compression, ProcessLib::OutputFormat::directory, n_files, ProcessLib::OutputFormat::prefix, and ProcessLib::OutputFormat::suffix.

Member Function Documentation

◆ constructFilename()

std::string ProcessLib::OutputXDMFHDF5Format::constructFilename ( std::string const & mesh_name,
int const timestep,
double const t,
int const iteration,
bool const converged ) const
overridevirtual

Implements ProcessLib::OutputFormat.

Definition at line 99 of file OutputFormat.cpp.

102{
103 return BaseLib::constructFormattedFileName(prefix, mesh_name, timestep, t,
104 iteration, converged) +
105 ".xdmf";
106}
std::string constructFormattedFileName(std::string const &format_specification, std::string const &mesh_name, int const timestep, double const t, int const iteration, bool const converged)

References BaseLib::constructFormattedFileName(), and ProcessLib::OutputFormat::prefix.

Referenced by outputMeshXdmf().

◆ outputMeshes()

void ProcessLib::OutputXDMFHDF5Format::outputMeshes ( const int timestep,
const double t,
const int iteration,
bool const converged,
std::vector< std::reference_wrapper< const MeshLib::Mesh > > const & meshes,
std::set< std::string > const & output_variables ) const
inlineoverridevirtual

Implements ProcessLib::OutputFormat.

Definition at line 103 of file OutputFormat.h.

108 {
109 outputMeshXdmf(output_variables, meshes, timestep, t, iteration,
110 converged);
111 }
void outputMeshXdmf(std::set< std::string > const &output_variables, std::vector< std::reference_wrapper< const MeshLib::Mesh > > const &meshes, int const timestep, double const t, int const iteration, bool const converged) const

References outputMeshXdmf().

◆ outputMeshXdmf()

void ProcessLib::OutputXDMFHDF5Format::outputMeshXdmf ( std::set< std::string > const & output_variables,
std::vector< std::reference_wrapper< const MeshLib::Mesh > > const & meshes,
int const timestep,
double const t,
int const iteration,
bool const converged ) const

Definition at line 108 of file OutputFormat.cpp.

113{
114 // \TODO The XdmfOutput will create on construction the XdmfHdfWriter
116 {
117 auto name = constructFilename(meshes[0].get().getName(), timestep, t,
118 iteration, converged);
119 std::filesystem::path path(BaseLib::joinPaths(directory, name));
120 mesh_xdmf_hdf_writer = std::make_unique<MeshLib::IO::XdmfHdfWriter>(
121 meshes, path, timestep, t, output_variables, compression, n_files,
123 }
124 else
125 {
126 mesh_xdmf_hdf_writer->writeStep(t);
127 };
128}
std::string getName(std::string const &line)
Returns the name/title from the "Zone"-description.
std::string joinPaths(std::string const &pathA, std::string const &pathB)
auto & get(Tuples &... ts)
Definition Get.h:53
std::string constructFilename(std::string const &mesh_name, int const timestep, double const t, int const iteration, bool const converged) const override
std::unique_ptr< MeshLib::IO::XdmfHdfWriter > mesh_xdmf_hdf_writer

References chunk_size_bytes, ProcessLib::OutputFormat::compression, constructFilename(), ProcessLib::OutputFormat::directory, getName(), BaseLib::joinPaths(), mesh_xdmf_hdf_writer, and n_files.

Referenced by outputMeshes().

Member Data Documentation

◆ chunk_size_bytes

unsigned int const ProcessLib::OutputXDMFHDF5Format::chunk_size_bytes

Specifies the chunks size in bytes per hdf5 output file.

Definition at line 122 of file OutputFormat.h.

Referenced by OutputXDMFHDF5Format(), and outputMeshXdmf().

◆ mesh_xdmf_hdf_writer

std::unique_ptr<MeshLib::IO::XdmfHdfWriter> ProcessLib::OutputXDMFHDF5Format::mesh_xdmf_hdf_writer
mutable

Definition at line 118 of file OutputFormat.h.

Referenced by outputMeshXdmf().

◆ n_files

unsigned int ProcessLib::OutputXDMFHDF5Format::n_files

Specifies the number of hdf5 output files.

Definition at line 120 of file OutputFormat.h.

Referenced by OutputXDMFHDF5Format(), and outputMeshXdmf().


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