12 #include "ElementDofLayout.h"
14 #include <dolfinx/common/MPI.h>
15 #include <dolfinx/graph/AdjacencyList.h>
16 #include <dolfinx/graph/ordering.h>
62 std::int32_t num_cells);
87 template <
typename E,
typename U,
88 typename = std::enable_if_t<std::is_same<
93 _element_dof_layout(std::forward<E>(element)),
94 _dofmap(std::forward<U>(dofmap)), _bs(
bs)
106 virtual ~
DofMap() =
default;
124 return _dofmap.links(
cell);
128 int bs() const noexcept;
143 MPI_Comm comm, const mesh::Topology& topology,
144 const std::function<std::vector<
int>(
145 const graph::AdjacencyList<std::int32_t>&)>& reorder_fn
146 = [](const graph::AdjacencyList<std::int32_t>& g)
156 return _element_dof_layout;
168 int _index_map_bs = -1;
Degree-of-freedom map.
Definition: DofMap.h:71
DofMap(DofMap &&dofmap)=default
Move constructor.
std::shared_ptr< const common::IndexMap > index_map
Index map that describes the parallel distribution of the dofmap.
Definition: DofMap.h:161
DofMap extract_sub_dofmap(const std::vector< int > &component) const
Extract subdofmap component.
Definition: DofMap.cpp:185
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:90
DofMap & operator=(DofMap &&dofmap)=default
Move assignment.
const ElementDofLayout & element_dof_layout() const
Layout of dofs on an element.
Definition: DofMap.h:154
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:220
std::span< const std::int32_t > cell_dofs(int cell) const
Local-to-global mapping of dofs on a cell.
Definition: DofMap.h:122
int index_map_bs() const
Block size associated with the index_map.
Definition: DofMap.cpp:287
bool operator==(const DofMap &map) const
Equality operator.
Definition: DofMap.cpp:177
const graph::AdjacencyList< std::int32_t > & list() const
Get dofmap data.
Definition: DofMap.cpp:282
int bs() const noexcept
Return the block size for the dofmap.
Definition: DofMap.cpp:183
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:26
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition: Topology.h:44
Miscellaneous classes, functions and types.
Finite element method functionality.
Definition: assemble_matrix_impl.h:25
graph::AdjacencyList< std::int32_t > transpose_dofmap(const graph::AdjacencyList< std::int32_t > &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:359
Mesh data structures and algorithms on meshes.
Definition: DofMap.h:30