A class used to abstract away reading/writing files for visualization. More...
#include <HDF5writer.h>

Public Types | |
| enum class | DecompositionType : uint8_t { SINGLE , MULTIPLE } |
| enum class | VectorType : uint8_t { DOUBLE , SINGLE , INT } |
Public Member Functions | |
| std::string | getExtension () const |
| Function to return the file extension. | |
| WriterProperties | getProperties () const override |
| Function to get the writer properties. | |
| HDF5writer () | |
| Default constructor. | |
| HDF5writer (const HDF5writer &)=delete | |
| Delete copy constructor. | |
| void | readFile (const std::string &fname) override |
| Function to read a file. | |
| void | registerData (std::function< void(hid_t, std::string, Xdmf &)> fun) |
| Register arbitrary data. | |
| void | registerMatrix (std::shared_ptr< AMP::LinearAlgebra::Matrix > mat, const std::string &name="") |
| Function to register a matrix. | |
| void | registerMesh (std::shared_ptr< AMP::Mesh::Mesh > mesh, int level=1, const std::string &path=std::string()) |
| Function to register a mesh. | |
| void | registerVector (std::shared_ptr< AMP::LinearAlgebra::Vector > vec, const std::string &name="") |
| Function to register a vector. | |
| virtual void | registerVector (std::shared_ptr< AMP::LinearAlgebra::Vector > vec, std::shared_ptr< AMP::Mesh::Mesh > mesh, AMP::Mesh::GeomType type, const std::string &name="", VectorType precision=VectorType::DOUBLE, bool isStatic=false) |
| Function to register a vector. | |
| virtual void | setDecomposition (int decomposition) |
| Function to set the file decomposition. | |
| void | writeFile (const std::string &fname, size_t iteration, double time=0) override |
| Function to write a file. | |
| virtual | ~HDF5writer () |
| Default destructor. | |
Static Public Member Functions | |
| static std::shared_ptr< AMP::IO::Writer > | buildWriter (std::shared_ptr< AMP::Database > db) |
| Function to build a writer. | |
| static std::shared_ptr< AMP::IO::Writer > | buildWriter (std::string type, AMP_MPI comm=AMP_COMM_WORLD) |
| Function to build a writer. | |
Protected Types | |
| using | GeomType = AMP::Mesh::GeomType |
Protected Member Functions | |
| void | createDirectories (const std::string &filename) |
| GlobalID | getID (const AMP_MPI &comm) const |
| void | registerMesh2 (std::shared_ptr< AMP::Mesh::Mesh > mesh, int level, const std::string &path, std::set< GlobalID > &base_ids) |
| template<class TYPE > | |
| void | syncData (std::vector< TYPE > &data, int root) const |
| std::tuple< std::vector< multiMeshData >, std::map< GlobalID, baseMeshData > > | syncMultiMeshData (int root=-1) const |
| void | syncVectors () |
Static Protected Member Functions | |
| static std::vector< AMP::Mesh::MeshID > | getMeshIDs (std::shared_ptr< AMP::Mesh::Mesh > mesh) |
| static void | getNodeElemList (std::shared_ptr< const AMP::Mesh::Mesh > mesh, const AMP::Mesh::MeshIterator &elements, AMP::Array< double > *x, AMP::Array< int > &nodelist, std::vector< AMP::Mesh::MeshElementID > &nodelist_ids) |
Protected Attributes | |
| std::map< GlobalID, baseMeshData > | d_baseMeshes |
| AMP_MPI | d_comm = AMP_COMM_WORLD |
| DecompositionType | d_decomposition = DecompositionType::MULTIPLE |
| std::map< GlobalID, MatrixData > | d_matrices |
| std::map< GlobalID, multiMeshData > | d_multiMeshes |
| std::map< GlobalID, VectorData > | d_vectors |
| std::vector< std::shared_ptr< AMP::LinearAlgebra::Vector > > | d_vectorsMesh |
Private Member Functions | |
| Xdmf::MeshData | writeBoxMesh (hid_t fid, const std::string &filename, const baseMeshData &mesh) const |
| Xdmf::MeshData | writeDefaultMesh (hid_t fid, const std::string &filename, const baseMeshData &mesh) const |
| Xdmf::MeshData | writeMesh (hid_t fid, const std::string &filename, const baseMeshData &mesh) const |
Private Attributes | |
| std::vector< std::function< void(hid_t, std::string, Xdmf &)> > | d_fun |
A class used to abstract away reading/writing files for visualization.
This class provides routines for reading, accessing and writing meshes and vectors using HDF5. Note: for visualization an Xdmf file will also be written
Definition at line 29 of file HDF5writer.h.
|
protectedinherited |
|
stronginherited |
|
stronginherited |
| AMP::IO::HDF5writer::HDF5writer | ( | ) |
Default constructor.
|
virtual |
Default destructor.
|
delete |
Delete copy constructor.
|
staticinherited |
Function to build a writer.
This function will build a default writer for use.
| [in] | db | Input database for the writer |
|
staticinherited |
Function to build a writer.
This function will build a default writer for use.
| [in] | type | Writer type: "None" - An empty writer will be created "Silo" - A silo writer will be created if silo is configured, otherwise an empty writer will be created. "Ascii" - A simple ascii writer "HDF5" - A simple HDF5 writer "auto" - Choose the writer based on the comm size and compiled packages |
| [in] | comm | Communicator to use |
|
protectedinherited |
|
inherited |
Function to return the file extension.
|
staticprotectedinherited |
|
staticprotectedinherited |
|
overridevirtual |
Function to get the writer properties.
Implements AMP::IO::Writer.
|
overridevirtual |
Function to read a file.
Implements AMP::IO::Writer.
Register arbitrary data.
|
inherited |
Function to register a matrix.
This function will register a matrix with the writer. This version of registerMatrix only stores the raw data.. It is not associated with a mesh.
| [in] | mat | The matrix we want to write |
| [in] | name | Optional name for the vector. |
|
inherited |
Function to register a mesh.
This function will register a mesh with the writer. Note: if mesh is a MultiMesh, it will register all sub meshes.
| [in] | mesh | The mesh to register |
| [in] | level | How many sub meshes do we want? 0: Only register the local base meshes (advanced users only) 1: Register current mesh only (default) 2: Register all meshes (do not separate for the ranks) 3: Register all mesh pieces including the individual ranks |
| [in] | path | The directory path for the mesh. Default is an empty string. |
|
protectedinherited |
|
inherited |
Function to register a vector.
This function will register a vector with the writer. This version of registerVector only stores the raw data. It is not associated with a mesh.
| [in] | vec | The vector we want to write |
| [in] | name | Optional name for the vector. |
|
virtualinherited |
Function to register a vector.
This function will register a vector with the writer and register it with the given mesh. This version of registerVector allows the data to be "stored" on the mesh for visualization or mesh-based operations.
| [in] | vec | The vector we want to write |
| [in] | mesh | The mesh we want to write the vector over. Note: any writers require the vector to completely cover the mesh. Note: mesh does not have to be previously registered with registerMesh. |
| [in] | type | The entity type we want to save (vertex, face, cell, etc.) Note: some writers only supports writing one entity type. If the vector spans multiple entity type (eg cell+vertex) the user should register the vector multiple times (one for each entity type). |
| [in] | name | Optional name for the vector. |
| [in] | precision | Desired precision in output file. Note: not all types are supported by all writers. |
| [in] | isStatic | Is the vectors static (constant vs time) |
|
virtualinherited |
Function to set the file decomposition.
This function will set the method used for file IO. When writing files, there are different decompositions that affect the performance and usability of the output files. By default, this writer will generate a single file.
| [in] | decomposition | Decomposition method to use: 1: This will write all of the data to a single file. Note that this requires a serial write and will have the worst performance 2: Each processor will write a separate file and a separate summary file will be written. Note that this will have better performance at large scale, but will write many files simultaneously. |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
private |
|
private |
|
overridevirtual |
Function to write a file.
This function will write a file with all mesh/vector data that was registered. If the filename included a relative or absolute path, the directory structure will be created.
| fname | The filename to use |
| iteration | The iteration number |
| time | The current simulation time |
Implements AMP::IO::Writer.
|
private |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
Definition at line 71 of file HDF5writer.h.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
Advanced Multi-Physics (AMP) Oak Ridge National Laboratory Idaho National Laboratory Los Alamos National Laboratory |
This page automatically produced from the source code by Last updated: Tue Mar 10 2026 13:06:42. Comments on this page |