OGS
ProcessLib::OutputXDMFHDF5Format Struct Referencefinal

Detailed Description

Definition at line 97 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 99 of file OutputFormat.h.

103 : OutputFormat(directory, std::move(prefix), std::move(suffix),
107 {
108 }
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 106 of file OutputFormat.cpp.

109{
110 return BaseLib::constructFormattedFileName(prefix, mesh_name, timestep, t,
111 iteration, converged) +
112 ".xdmf";
113}
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 110 of file OutputFormat.h.

115 {
116 outputMeshXdmf(output_variables, meshes, timestep, t, iteration,
117 converged);
118 }
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 115 of file OutputFormat.cpp.

120{
121 // \TODO The XdmfOutput will create on construction the XdmfHdfWriter
123 {
124 auto name = constructFilename(meshes[0].get().getName(), timestep, t,
125 iteration, converged);
126 std::filesystem::path path(BaseLib::joinPaths(directory, name));
127 mesh_xdmf_hdf_writer = std::make_unique<MeshLib::IO::XdmfHdfWriter>(
128 meshes, path, timestep, t, output_variables, compression, n_files,
130 }
131 else
132 {
133 mesh_xdmf_hdf_writer->writeStep(t);
134 };
135}
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:59
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 129 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 125 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 127 of file OutputFormat.h.

Referenced by OutputXDMFHDF5Format(), and outputMeshXdmf().


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