10 #include <dolfinx/common/MPI.h>
11 #include <dolfinx/graph/AdjacencyList.h>
12 #include <dolfinx/graph/scotch.h>
17 #include <xtl/xspan.hpp>
31 class ElementDofLayout;
56 graph::AdjacencyList<std::int32_t>
58 std::int32_t num_cells);
83 typename = std::enable_if_t<std::is_same<
85 DofMap(std::shared_ptr<const ElementDofLayout> element,
89 _index_map_bs(
index_map_bs), _dofmap(std::forward<U>(dofmap)), _bs(
bs)
115 return _dofmap.links(cell);
119 int bs() const noexcept;
133 std::pair<std::unique_ptr<
DofMap>, std::vector<std::int32_t>>
collapse(
134 MPI_Comm comm, const mesh::Topology& topology,
135 const std::function<std::vector<
int>(
136 const graph::AdjacencyList<std::int32_t>&)>& reorder_fn
137 = [](const graph::AdjacencyList<std::int32_t>& g)
155 int _index_map_bs = -1;
Degree-of-freedom map.
Definition: DofMap.h:68
xtl::span< const std::int32_t > cell_dofs(int cell) const
Local-to-global mapping of dofs on a cell.
Definition: DofMap.h:113
std::shared_ptr< const ElementDofLayout > element_dof_layout
Layout of dofs on an element.
Definition: DofMap.h:145
int index_map_bs() const
Block size associated with the index_map.
Definition: DofMap.cpp:298
std::shared_ptr< const common::IndexMap > index_map
Index map that describes the parallel distribution of the dofmap.
Definition: DofMap.h:148
DofMap(std::shared_ptr< const ElementDofLayout > 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:85
DofMap & operator=(DofMap &&dofmap)=default
Move assignment.
const graph::AdjacencyList< std::int32_t > & list() const
Get dofmap data.
Definition: DofMap.cpp:293
virtual ~DofMap()=default
Destructor.
DofMap(DofMap &&dofmap)=default
Move constructor.
std::pair< std::unique_ptr< 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::scotch::compute_gps(g, 2).first;}) const
Create a "collapsed" dofmap (collapses a sub-dofmap)
Definition: DofMap.cpp:229
int bs() const noexcept
Return the block size for the dofmap.
Definition: DofMap.cpp:190
DofMap extract_sub_dofmap(const std::vector< int > &component) const
Extract subdofmap component.
Definition: DofMap.cpp:192
This class provides a static adjacency list data structure. It is commonly used to store directed gra...
Definition: AdjacencyList.h:47
Miscellaneous classes, functions and types.
Finite element method functionality.
Definition: assemble_matrix_impl.h:23
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:148
std::pair< std::vector< int >, std::vector< int > > compute_gps(const AdjacencyList< std::int32_t > &graph, std::size_t num_passes=5)
Compute reordering (map[old] -> new) using Gibbs-Poole-Stockmeyer (GPS) re-ordering.
Definition: scotch.cpp:28
Mesh data structures and algorithms on meshes.
Definition: DirichletBC.h:20