Rodin/IO/XDMF.h file

XDMF 3 domain writer for temporal visualization output.

This file defines the IO::XDMF class, which produces XDMF 3 XML documents that reference HDF5 heavy-data files for mesh topology, geometry, and grid function attribute datasets.

The XDMF writer follows a split-file design:

  • One HDF5 file per mesh snapshot
  • One HDF5 file per grid function attribute per snapshot
  • One XDMF XML file referencing all HDF5 files

In distributed (MPI) mode, each rank writes its own rank-specific HDF5 visualization files using {rank} in the file patterns. Only the root rank (configurable, default 0) writes the master .xdmf XML file that references all rank-local piece files as a Spatial collection. For transient output, the master XDMF uses a Temporal collection of Spatial collections.

Typical Workflow

IO::XDMF xdmf("output/simulation");

xdmf.setMesh(mesh)
     .add("velocity", u, IO::XDMF::Center::Node)
     .add("pressure", p, IO::XDMF::Center::Node);

for (size_t step = 0; step < nSteps; ++step)
{
  // ... solve ...
  xdmf.write(time);
}

xdmf.close();  // writes the XDMF XML; also called by destructor

Namespaces

namespace Rodin
The Rodin library for finite element methods and shape optimization.
namespace Rodin::IO
Module for mesh and grid function input/output.

Classes

class Rodin::IO::XDMF
XDMF domain writer for static or transient visualization output.
struct Rodin::IO::XDMF::Keyword
XML element names used in the XDMF 3 document format.
struct Rodin::IO::XDMF::FilePatterns
File naming patterns used by the writer.
struct Rodin::IO::XDMF::GridOptions
Per-grid export options.
class Rodin::IO::XDMF::Grid
Handle to one named grid inside the XDMF domain.
struct Rodin::IO::XDMF::SnapshotRecord::PieceMeta
Per-rank mesh metadata cached during write().