DOLFINx 0.10.0.0
DOLFINx C++ interface
|
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::pair< std::vector< std::int32_t >, std::vector< T > > | distribute_entity_data (const mesh::Topology &topology, std::span< const std::int64_t > nodes_g, std::int64_t num_nodes_g, const fem::ElementDofLayout &cmap_dof_layout, md::mdspan< const std::int32_t, md::dextents< std::size_t, 2 > > xdofmap, int entity_dim, md::mdspan< const std::int64_t, md::dextents< std::size_t, 2 > > entities, std::span< const T > data) |
Get owned entities and associated data from input entities defined by global 'node' indices. | |
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 (md::mdspan< const std::int32_t, md::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'. | |
Support for file IO.
IO to files for checkpointing and visualisation.
std::pair< std::vector< std::int32_t >, std::vector< T > > distribute_entity_data | ( | const mesh::Topology & | topology, |
std::span< const std::int64_t > | nodes_g, | ||
std::int64_t | num_nodes_g, | ||
const fem::ElementDofLayout & | cmap_dof_layout, | ||
md::mdspan< const std::int32_t, md::dextents< std::size_t, 2 > > | xdofmap, | ||
int | entity_dim, | ||
md::mdspan< const std::int64_t, md::dextents< std::size_t, 2 > > | entities, | ||
std::span< const T > | data ) |
Get owned entities and associated data from input entities defined by global 'node' indices.
The input entities and data can be supplied on any rank and this function will manage the communication.
[in] | topology | A mesh topology. |
[in] | nodes_g | Global 'input' indices for the mesh, as returned by Geometry::input_global_indices. |
[in] | num_nodes_g | Global number of geometry nodes, as returned by Geometry::index_map()->size_global() . |
[in] | cmap_dof_layout | Coordinate element dof layout, computed using Geometry::cmap().create_dof_layout() . |
[in] | xdofmap | Dofmap for the mesh geometry (Geometry::dofmap). |
[in] | entity_dim | Topological dimension of entities to extract. |
[in] | entities | Mesh entities defined using global input indices ('nodes'), typically from an input mesh file, e.g. [gi0, gi1, gi2] for a triangle. Let [v0, v1, v2] be the vertex indices of some triangle (using local indexing). Each vertex has a 'node' (geometry dof) index, and each node has a persistent input global index, so the triangle [gi0, gi1, gi2] could be identified with [v0, v1, v2]. The data is flattened and the shape is (num_entities, / nodes_per_entity) . |
[in] | data | Data associated with each entity in entities . |
std::pair< std::vector< std::int64_t >, std::array< std::size_t, 2 > > extract_vtk_connectivity | ( | md::mdspan< const std::int32_t, md::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'.
[in] | dofmap_x | Geometry dofmap. |
[in] | cell_type | Cell type. |
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.
V
must be a (discontinuous) Lagrange space[in] | V | The function space |