12#include "ElementDofLayout.h"
13#include <basix/mdspan.hpp>
16#include <dolfinx/common/MPI.h>
17#include <dolfinx/graph/AdjacencyList.h>
18#include <dolfinx/graph/ordering.h>
65 MDSPAN_IMPL_STANDARD_NAMESPACE::dextents<std::size_t, 2>>
67 std::int32_t num_cells);
91 template <
typename E,
typename U>
92 requires std::is_convertible_v<std::remove_cvref_t<E>,
94 and std::is_convertible_v<std::remove_cvref_t<U>,
95 std::vector<std::int32_t>>
99 _element_dof_layout(std::forward<E>(element)),
100 _dofmap(std::forward<U>(dofmap)), _bs(
bs),
101 _shape1(_element_dof_layout.num_dofs()
102 * _element_dof_layout.block_size() / _bs)
130 std::span<const std::int32_t>
cell_dofs(std::int32_t c)
const
132 return std::span<const std::int32_t>(_dofmap.data() + _shape1 * c, _shape1);
136 int bs() const noexcept;
150 MPI_Comm comm, const mesh::Topology& topology,
151 const std::function<std::vector<
int>(
152 const graph::AdjacencyList<std::int32_t>&)>& reorder_fn
153 = [](const graph::AdjacencyList<std::int32_t>& g)
158 MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan<
160 MDSPAN_IMPL_STANDARD_NAMESPACE::dextents<std::size_t, 2>>
166 return _element_dof_layout;
178 int _index_map_bs = -1;
184 std::vector<std::int32_t> _dofmap;
Degree-of-freedom map.
Definition DofMap.h:76
DofMap(DofMap &&dofmap)=default
Move constructor.
DofMap & operator=(DofMap &&dofmap)=default
Move assignment.
std::shared_ptr< const common::IndexMap > index_map
Index map that describes the parallel distribution of the dofmap.
Definition DofMap.h:171
DofMap extract_sub_dofmap(std::span< const int > component) const
Extract subdofmap component.
Definition DofMap.cpp:191
std::pair< DofMap, std::vector< std::int32_t > > collapse(MPI_Comm comm, const mesh::Topology &topology, const std::function< std::vector< int >(const graph::AdjacencyList< std::int32_t > &)> &reorder_fn=[](const graph::AdjacencyList< std::int32_t > &g) { return graph::reorder_gps(g);}) const
Create a "collapsed" dofmap (collapses a sub-dofmap)
Definition DofMap.cpp:225
MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan< const std::int32_t, MDSPAN_IMPL_STANDARD_NAMESPACE::dextents< std::size_t, 2 > > map() const
Get dofmap data.
Definition DofMap.cpp:290
std::span< const std::int32_t > cell_dofs(std::int32_t c) const
Local-to-global mapping of dofs on a cell.
Definition DofMap.h:130
const ElementDofLayout & element_dof_layout() const
Layout of dofs on an element.
Definition DofMap.h:164
and std::is_convertible_v< std::remove_cvref_t< U >, std::vector< std::int32_t > > DofMap(E &&element, std::shared_ptr< const common::IndexMap > index_map, int index_map_bs, U &&dofmap, int bs)
Create a DofMap from the layout of dofs on a reference element, an IndexMap defining the distribution...
Definition DofMap.h:96
int index_map_bs() const
Block size associated with the index_map.
Definition DofMap.cpp:298
bool operator==(const DofMap &map) const
Equality operator.
Definition DofMap.cpp:183
int bs() const noexcept
Return the block size for the dofmap.
Definition DofMap.cpp:189
The class represents the degree-of-freedom (dofs) for an element. Dofs are associated with a mesh ent...
Definition ElementDofLayout.h:31
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition AdjacencyList.h:28
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition Topology.h:44
Miscellaneous classes, functions and types.
Definition dolfinx_common.h:8
Finite element method functionality.
Definition assemble_matrix_impl.h:25
graph::AdjacencyList< std::int32_t > transpose_dofmap(MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan< const std::int32_t, MDSPAN_IMPL_STANDARD_NAMESPACE::dextents< std::size_t, 2 > > dofmap, std::int32_t num_cells)
Create an adjacency list that maps a global index (process-wise) to the 'unassembled' cell-wise contr...
Definition DofMap.cpp:134
std::vector< std::int32_t > reorder_gps(const graph::AdjacencyList< std::int32_t > &graph)
Re-order a graph using the Gibbs-Poole-Stockmeyer algorithm.
Definition ordering.cpp:360
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32