Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/d6/d7a/namespacedolfinx_1_1io.html
DOLFINx  0.5.1
DOLFINx C++ interface
Namespaces | Classes | Functions
dolfinx::io Namespace Reference

Support for file IO. More...

Namespaces

 cells
 Functions for the re-ordering of input mesh topology to the DOLFINx ordering, and transpose orderings for file output.
 
 xdmf_function
 Low-level methods for reading/writing XDMF files.
 
 xdmf_mesh
 Low-level methods for reading XDMF files.
 
 xdmf_read
 Low-level methods for reading XDMF files.
 

Classes

class  ADIOS2Writer
 Base class for ADIOS2-based writers. More...
 
class  FidesWriter
 Output of meshes and functions compatible with the Fides Paraview reader, see https://fides.readthedocs.io/en/latest/paraview/paraview.html. More...
 
class  VTXWriter
 Writer for meshes and functions using the ADIOS2 VTX format, see https://adios2.readthedocs.io/en/latest/ecosystem/visualization.html#using-vtk-and-paraview. More...
 
class  HDF5Interface
 This class provides an interface to some HDF5 functionality. More...
 
class  VTKFile
 Output of meshes and functions in VTK/ParaView format. Isoparametric meshes of arbitrary degree are supported. For finite element functions, cell-based (DG0) and Lagrange (point-based) functions can be saved. For vertex-based functions the output must be isoparametic, i.e. the geometry and the finite element functions must be defined using the same basis. More...
 
class  XDMFFile
 Read and write mesh::Mesh, fem::Function and other objects in XDMF. More...
 

Functions

std::tuple< std::vector< double >, std::array< std::size_t, 2 >, std::vector< std::int64_t >, std::vector< std::uint8_t >, std::vector< std::int64_t >, std::array< std::size_t, 2 > > vtk_mesh_from_space (const fem::FunctionSpace &V)
 Given a FunctionSpace, create a topology and geometry based on the dof coordinates. More...
 
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > extract_vtk_connectivity (const mesh::Mesh &mesh)
 Extract the cell topology (connectivity) in VTK ordering for all cells the mesh. The 'topology' includes higher-order 'nodes'. The index of a 'node' corresponds to the index of DOLFINx geometry 'nodes'. More...
 

Detailed Description

Support for file IO.

IO to files for checkpointing and visualisation.

Function Documentation

◆ extract_vtk_connectivity()

std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > extract_vtk_connectivity ( const mesh::Mesh mesh)

Extract the cell topology (connectivity) in VTK ordering for all cells the mesh. The 'topology' includes higher-order 'nodes'. The index of a 'node' corresponds to the index of DOLFINx geometry 'nodes'.

Parameters
[in]meshThe mesh
Returns
The cell topology in VTK ordering and in term of the DOLFINx geometry 'nodes'
Note
The indices in the return array correspond to the point indices in the mesh geometry array
Even if the indices are local (int32), both Fides and VTX require int64 as local input

◆ vtk_mesh_from_space()

std::tuple< std::vector< double >, std::array< std::size_t, 2 >, std::vector< std::int64_t >, std::vector< std::uint8_t >, std::vector< std::int64_t >, std::array< std::size_t, 2 > > vtk_mesh_from_space ( const fem::FunctionSpace V)

Given a FunctionSpace, create a topology and geometry based on the dof coordinates.

Precondition
V must be a (discontinuous) Lagrange space
Parameters
[in]VThe function space
Returns
Mesh data
  1. node coordinates (shape={num_nodes, 3}), row-major storage
  2. node coordinates shape
  3. unique global ID for each node (a node that appears on more than one rank will have the same global ID)
  4. ghost index for each node (0=non-ghost, 1=ghost)
  5. cells (shape={num_cells, nodes_per_cell)}), row-major storage
  6. cell shape (shape={num_cells, nodes_per_cell)})