|
DOLFINx 0.12.0.0
DOLFINx C++
|
Functions for the re-ordering of input mesh topology to the DOLFINx ordering, and transpose orderings for file output. More...
Functions | |
| int | cell_degree (mesh::CellType type, int num_nodes) |
| Get the Lagrange order of a given cell with a given number of nodes. | |
| std::vector< std::uint16_t > | perm_vtk (mesh::CellType type, int num_nodes) |
| Permutation array to map from VTK to DOLFINx node ordering. | |
| std::vector< std::uint16_t > | perm_gmsh (mesh::CellType type, int num_nodes) |
| Permutation array to map from Gmsh to DOLFINx node ordering. | |
| std::vector< std::uint16_t > | transpose (std::span< const std::uint16_t > map) |
| Compute the transpose of a re-ordering map. | |
| std::vector< std::int64_t > | apply_permutation (std::span< const std::int64_t > cells, std::array< std::size_t, 2 > shape, std::span< const std::uint16_t > p) |
| Permute cell topology by applying a permutation array for each cell. | |
| std::int8_t | get_vtk_cell_type (mesh::CellType cell, int num_nodes) |
| Get the VTK cell identifier for a cell type and node layout. | |
| std::tuple< mesh::CellType, std::int8_t > | vtk_to_dolfinx (std::int8_t vtk_cell_type) |
| Get DOLFINx cell type and degree from VTK cell type. | |
Functions for the re-ordering of input mesh topology to the DOLFINx ordering, and transpose orderings for file output.
Basix ordering is used for the geometry nodes, and is shown below for a range of cell types.
| std::vector< std::int64_t > apply_permutation | ( | std::span< const std::int64_t > | cells, |
| std::array< std::size_t, 2 > | shape, | ||
| std::span< const std::uint16_t > | p ) |
Permute cell topology by applying a permutation array for each cell.
| [in] | cells | Array of cell topologies, with each row representing a cell (row-major storage). |
| [in] | shape | Shape of the cells array. |
| [in] | p | Permutation array that maps a_p[i] = a[p[i]], where a_p is the permuted array. |
| int cell_degree | ( | mesh::CellType | type, |
| int | num_nodes ) |
Get the Lagrange order of a given cell with a given number of nodes.
Only Lagrange layouts have a degree here, so the node count and the degree determine each other. A serendipity layout is rejected, even where it has a degree of its own: reporting 2 for the 15-node wedge and the 13-node pyramid would make them indistinguishable from the 18-node wedge and the 14-node pyramid, and Basix has no element of either layout to build. The serendipity layouts Basix does have, the 8-node quadrilateral and the 20-node hexahedron, are mapped directly by ::perm_vtk without consulting a degree.
| [in] | type | Cell shape. |
| [in] | num_nodes | Number of cell 'nodes' |
| std::invalid_argument | If no Lagrange layout of type has num_nodes nodes. |
| std::int8_t get_vtk_cell_type | ( | mesh::CellType | cell, |
| int | num_nodes ) |
Get the VTK cell identifier for a cell type and node layout.
Inverse of ::vtk_to_dolfinx for the layouts that VTK can express.
| [in] | cell | Cell type to label. To label an entity of a cell, pass the entity's own cell type, e.g. from mesh::cell_entity_type. |
| [in] | num_nodes | Number of nodes in the cell. It must be a layout that VTK's type for cell can express and that round-trips through ::vtk_to_dolfinx. Quadrilaterals and hexahedra accept Lagrange layouts and the 8- and 20-node quadratic serendipity layouts, respectively. Only the linear pyramid is accepted, since VTK has no arbitrary-degree Lagrange pyramid. |
| std::invalid_argument | If VTK has no type for the layout. |
| std::vector< std::uint16_t > perm_gmsh | ( | mesh::CellType | type, |
| int | num_nodes ) |
Permutation array to map from Gmsh to DOLFINx node ordering.
| [in] | type | Cell shape. |
| [in] | num_nodes | Number of cell 'nodes' |
If p = [0, 2, 1, 3] and a = [10, 3, 4, 7], then a_p =[a[p[0]], a[p[1]], a[p[2]], a[p[3]]] = [10, 4, 3, 7].
| std::vector< std::uint16_t > perm_vtk | ( | mesh::CellType | type, |
| int | num_nodes ) |
Permutation array to map from VTK to DOLFINx node ordering.
| [in] | type | Cell shape. |
| [in] | num_nodes | Number of cell 'nodes' |
If p = [0, 2, 1, 3] and a = [10, 3, 4, 7], then a_p = [a[p[0]], a[p[1]], a[p[2]], a[p[3]]] = [10, 4, 3, 7].
| std::vector< std::uint16_t > transpose | ( | std::span< const std::uint16_t > | map | ) |
Compute the transpose of a re-ordering map.
| [in] | map | A re-ordering map. |
|
inline |
Get DOLFINx cell type and degree from VTK cell type.
| [in] | vtk_cell_type | VTK cell type identifier. |