DOLFINx 0.10.0.0
DOLFINx C++ interface
Loading...
Searching...
No Matches
dolfinx::io Namespace Reference

Support for file IO. More...

Namespaces

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

Classes

class  VTKFile
 Output of meshes and functions in VTK/ParaView format. More...
 
class  XDMFFile
 Read and write mesh::Mesh, fem::Function and other objects in XDMF. More...
 

Functions

template<typename T >
std::tuple< std::vector< T >, 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< T > &V)
 Given a FunctionSpace, create a topology and geometry based on the dof coordinates.
 
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > extract_vtk_connectivity (MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan< const std::int32_t, MDSPAN_IMPL_STANDARD_NAMESPACE::dextents< std::size_t, 2 > > dofmap_x, mesh::CellType cell_type)
 Extract the cell topology (connectivity) in VTK ordering for all cells the mesh. The 'topology' includes higher-order 'nodes'.
 

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 ( MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan< const std::int32_t, MDSPAN_IMPL_STANDARD_NAMESPACE::dextents< std::size_t, 2 > > dofmap_x,
mesh::CellType cell_type )

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]dofmap_xGeometry dofmap.
[in]cell_typeCell type.
Returns
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), VTX requires int64 as local input.

◆ vtk_mesh_from_space()

template<typename T >
std::tuple< std::vector< T >, 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< T > & 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)})