Note: this is documentation for an old release. View the latest documentation at docs.fenicsproject.org/dolfinx/v0.9.0/cpp/doxygen/df/dcf/namespacedolfinx_1_1io_1_1cells.html
DOLFINx 0.7.3
DOLFINx C++ interface
Loading...
Searching...
No Matches
Functions
dolfinx::io::cells Namespace Reference

Functions for the re-ordering of input mesh topology to the DOLFINx ordering, and transpose orderings for file output. More...

Functions

std::vector< std::uint8_t > perm_vtk (mesh::CellType type, int num_nodes)
 Permutation array to map from VTK to DOLFINx node ordering.
 
std::vector< std::uint8_t > perm_gmsh (mesh::CellType type, int num_nodes)
 Permutation array to map from Gmsh to DOLFINx node ordering.
 
std::vector< std::uint8_t > transpose (const std::vector< std::uint8_t > &map)
 Compute the transpose of a re-ordering map.
 
std::vector< std::int64_t > apply_permutation (const std::span< const std::int64_t > &cells, std::array< std::size_t, 2 > shape, const std::span< const std::uint8_t > &p)
 Permute cell topology by applying a permutation array for each cell.
 
std::int8_t get_vtk_cell_type (mesh::CellType cell, int dim)
 Get VTK cell identifier.
 

Detailed Description

Functions for the re-ordering of input mesh topology to the DOLFINx ordering, and transpose orderings for file output.

Function Documentation

◆ apply_permutation()

std::vector< std::int64_t > apply_permutation ( const std::span< const std::int64_t > &  cells,
std::array< std::size_t, 2 >  shape,
const std::span< const std::uint8_t > &  p 
)

Permute cell topology by applying a permutation array for each cell.

Parameters
[in]cellsArray of cell topologies, with each row representing a cell (row-major storage)
[in]shapeThe shape of the cells array
[in]pThe permutation array that maps a_p[i] = a[p[i]], where a_p is the permuted array
Returns
Permuted cell topology, where for a cell v_new[i] = v_old[map[i]]. The storage is row-major and the shape is the same as cells.

◆ get_vtk_cell_type()

std::int8_t get_vtk_cell_type ( mesh::CellType  cell,
int  dim 
)

Get VTK cell identifier.

Parameters
[in]cellThe cell type
[in]dimThe topological dimension of the cell
Returns
The VTK cell identifier

◆ perm_gmsh()

std::vector< std::uint8_t > perm_gmsh ( mesh::CellType  type,
int  num_nodes 
)

Permutation array to map from Gmsh to DOLFINx node ordering.

Parameters
[in]typeThe cell shape
[in]num_nodes
Returns
Permutation array for permuting from Gmsh ordering to DOLFINx ordering, i.e. a_dolfin[i] = a_gmsh[p[i]] @details Ifp = [0, 2, 1, 3]anda = [10, 3, 4, 7], thena_p =[a[p[0]], a[p[1]], a[p[2]], a[p[3]]] = [10, 4, 3, 7]`

◆ perm_vtk()

std::vector< std::uint8_t > perm_vtk ( mesh::CellType  type,
int  num_nodes 
)

Permutation array to map from VTK to DOLFINx node ordering.

Parameters
[in]typeThe cell shape
[in]num_nodesThe number of cell 'nodes'
Returns
Permutation array for permuting from VTK ordering to DOLFINx ordering, i.e. a_dolfin[i] = a_vtk[p[i]] @details Ifp = [0, 2, 1, 3]anda = [10, 3, 4, 7], thena_p =[a[p[0]], a[p[1]], a[p[2]], a[p[3]]] = [10, 4, 3, 7]`

◆ transpose()

std::vector< std::uint8_t > transpose ( const std::vector< std::uint8_t > &  map)

Compute the transpose of a re-ordering map.

Parameters
[in]mapA re-ordering map
Returns
Transpose of the map. E.g., is map = {1, 2, 3, 0}, the transpose will be {3 , 0, 1, 2 }.