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;
149 std::pair<
DofMap, std::vector<std::int32_t>>
150 collapse(MPI_Comm comm, const mesh::Topology& topology,
151 std::function<std::vector<
int>(
152 const graph::AdjacencyList<std::int32_t>&)>&& reorder_fn
157 MDSPAN_IMPL_STANDARD_NAMESPACE::mdspan<
159 MDSPAN_IMPL_STANDARD_NAMESPACE::dextents<std::
size_t, 2>>
165 return _element_dof_layout;
177 int _index_map_bs = -1;
183 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:170
DofMap extract_sub_dofmap(std::span< const int > component) const
Extract subdofmap component.
Definition DofMap.cpp:175
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
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:278
std::pair< DofMap, std::vector< std::int32_t > > collapse(MPI_Comm comm, const mesh::Topology &topology, std::function< std::vector< int >(const graph::AdjacencyList< std::int32_t > &)> &&reorder_fn=nullptr) const
Create a "collapsed" dofmap (collapses a sub-dofmap)
Definition DofMap.cpp:209
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:163
int index_map_bs() const
Block size associated with the index_map.
Definition DofMap.cpp:286
bool operator==(const DofMap &map) const
Equality operator.
Definition DofMap.cpp:167
int bs() const noexcept
Return the block size for the dofmap.
Definition DofMap.cpp:173
Definition ElementDofLayout.h:30
Definition topologycomputation.h:24
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition Topology.h:45
Miscellaneous classes, functions and types.
Definition dolfinx_common.h:8
Finite element method functionality.
Definition assemble_matrix_impl.h:26
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:118
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32