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>
63 md::mdspan<
const std::int32_t, md::dextents<std::size_t, 2>> dofmap,
64 std::int32_t num_cells);
88 template <
typename E,
typename U>
89 requires std::is_convertible_v<std::remove_cvref_t<E>,
91 and std::is_convertible_v<std::remove_cvref_t<U>,
92 std::vector<std::int32_t>>
96 _element_dof_layout(std::forward<E>(element)),
97 _dofmap(std::forward<U>(dofmap)), _bs(
bs),
98 _shape1(_element_dof_layout.num_dofs()
99 * _element_dof_layout.block_size() / _bs)
127 std::span<const std::int32_t>
cell_dofs(std::int32_t c)
const
129 return std::span<const std::int32_t>(_dofmap.data() + _shape1 * c, _shape1);
133 int bs() const noexcept;
146 std::pair<
DofMap, std::vector<std::int32_t>>
148 std::function<std::vector<
int>(
149 const
graph::AdjacencyList<std::int32_t>&)>&& reorder_fn
154 md::mdspan<const std::int32_t, md::dextents<std::
size_t, 2>>
map() const;
159 return _element_dof_layout;
171 int _index_map_bs = -1;
177 std::vector<std::int32_t> _dofmap;
Degree-of-freedom map.
Definition DofMap.h:73
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:164
DofMap extract_sub_dofmap(std::span< const int > component) const
Extract subdofmap component.
Definition DofMap.cpp:170
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:93
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:204
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:127
const ElementDofLayout & element_dof_layout() const
Layout of dofs on an element.
Definition DofMap.h:157
md::mdspan< const std::int32_t, md::dextents< std::size_t, 2 > > map() const
Get dofmap data.
Definition DofMap.cpp:270
int index_map_bs() const
Block size associated with the index_map.
Definition DofMap.cpp:276
bool operator==(const DofMap &map) const
Equality operator.
Definition DofMap.cpp:162
int bs() const noexcept
Return the block size for the dofmap.
Definition DofMap.cpp:168
Definition ElementDofLayout.h:30
Definition AdjacencyList.h:27
Topology stores the topology of a mesh, consisting of mesh entities and connectivity (incidence relat...
Definition Topology.h:46
Miscellaneous classes, functions and types.
Definition dolfinx_common.h:8
Finite element method functionality.
Definition assemble_expression_impl.h:23
graph::AdjacencyList< std::int32_t > transpose_dofmap(md::mdspan< const std::int32_t, md::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
Graph data structures and algorithms.
Definition dofmapbuilder.h:26
Mesh data structures and algorithms on meshes.
Definition DofMap.h:32