Skip to content

XDFM meets HighFive: Write XDFM files to interpret HDF5 files

License

Notifications You must be signed in to change notification settings

tdegeus/XDMFWrite_HighFive

Repository files navigation

CI Doxygen -> gh-pages Conda Version

XDMFWrite_HighFive

Getting started

XDMF meets HighFive: Write XDMF files to interpret HDF5 files.

To get started consider the examples:

Fields

Geometry (nodal-coordinates or vertices)

Interpret a DataSet as a Geometry (a.k.a. nodal-coordinates or vertices).

Topology (connectivity)

Interpret a DataSet as a Topology (a.k.a. connectivity).

Attribute

Interpret a DataSet as an Attribute.

Short-hand

Unstructured

Interpret a DataSets as Unstructured. The call

Structured(file, "/path/to/geometry", "/path/to/topology", type);

Is simply short for

concatenate({
    Geometry(file, "/path/to/geometry"), // nodal-coordinates / vertices
    Topology(file, "/path/to/topology", type) // connectivity
});

Structured

Interpret a DataSets as Structured (individual points). Use is made of a mock Topology arange(N), with N the number of nodes (vertices). The call

Structured(file, "/path/to/geometry", "/path/to/topology");

Is simply short for

concatenate({
    Geometry(file, "/path/to/geometry"), // nodal-coordinates / vertices
    Topology(file, "/path/to/topology", ElementType::Polyvertex) // mock connectivity
});

Grids

Grid

Combine fields (e.g. Geometry, Topology, and Attribute) to a single grid.

TimeSeries

Combine a series of fields (e.g. Geometry, Topology, and Attribute) to a time-series. The syntax is as follows:

TimeSeries series;
series.push_back(...);
series.push_back(...);

To then write a file simply pass series to write. To alternatively get the sequence of strings of TimeSeries use series.get().

Output

write

Write a complete XDMF-file, e.g. from Grid or TimeSeries.

Miscellaneous

Join sequence of strings

Join a sequence of strings:

std::vector<std::string> lines = {"foo", "bar"};
std::string single = join(lines);
std::cout << single << std::endl;

Concatenate vectors

Concatenate an arbitrary number of vectors:

concatenate({...});

Change the indentation

The indentation can be changed by specifying

#define XDMFWRITE_HIGHFIVE_INDENT 4

before

#include <XDMFWrite_HighFive.hpp>

About

XDFM meets HighFive: Write XDFM files to interpret HDF5 files

Resources

License

Stars

Watchers

Forks

Packages

No packages published