OGS
ProcessLib::OutputXDMFHDF5Format Struct Referencefinal

Detailed Description

Definition at line 94 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, 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) 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) 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 96 of file OutputFormat.h.

100 : OutputFormat(directory, std::move(prefix), std::move(suffix),
104 {
105 }
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.

Member Function Documentation

◆ constructFilename()

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

Implements ProcessLib::OutputFormat.

Definition at line 104 of file OutputFormat.cpp.

107{
108 return BaseLib::constructFormattedFileName(prefix, mesh_name, timestep, t,
109 iteration) +
110 ".xdmf";
111}
std::string constructFormattedFileName(std::string const &format_specification, std::string const &mesh_name, int const timestep, double const t, int const iteration)

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

Referenced by outputMeshXdmf().

◆ outputMeshes()

void ProcessLib::OutputXDMFHDF5Format::outputMeshes ( const int timestep,
const double t,
const int iteration,
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 107 of file OutputFormat.h.

111 {
112 outputMeshXdmf(output_variables, meshes, timestep, t, iteration);
113 }
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) 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 ) const

Definition at line 113 of file OutputFormat.cpp.

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

Referenced by outputMeshXdmf().

◆ mesh_xdmf_hdf_writer

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

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

Referenced by outputMeshXdmf().


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