DOLFINx
0.3.0
DOLFINx C++ interface
|
Degree-of-freedom map. More...
#include <DofMap.h>
Public Member Functions | |
template<typename U , typename = std::enable_if_t<std::is_same< graph::AdjacencyList<std::int32_t>, std::decay_t<U>>::value>> | |
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 of dofs across processes and a vector of indices. More... | |
DofMap (const DofMap &dofmap)=delete | |
DofMap (DofMap &&dofmap)=default | |
Move constructor. | |
virtual | ~DofMap ()=default |
Destructor. | |
DofMap & | operator= (const DofMap &dofmap)=delete |
DofMap & | operator= (DofMap &&dofmap)=default |
Move assignment. | |
xtl::span< const std::int32_t > | cell_dofs (int cell) const |
Local-to-global mapping of dofs on a cell. More... | |
int | bs () const noexcept |
Return the block size for the dofmap. | |
DofMap | extract_sub_dofmap (const std::vector< int > &component) const |
Extract subdofmap component. More... | |
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) More... | |
const graph::AdjacencyList< std::int32_t > & | list () const |
Get dofmap data. More... | |
int | index_map_bs () const |
Block size associated with the index_map. | |
Public Attributes | |
std::shared_ptr< const ElementDofLayout > | element_dof_layout |
Layout of dofs on an element. | |
std::shared_ptr< const common::IndexMap > | index_map |
Index map that describes the parallel distribution of the dofmap. | |
Degree-of-freedom map.
This class handles the mapping of degrees of freedom. It builds a dof map based on an ElementDofLayout on a specific mesh topology. It will reorder the dofs when running in parallel. Sub-dofmaps, both views and copies, are supported.
|
inline |
Create a DofMap from the layout of dofs on a reference element, an IndexMap defining the distribution of dofs across processes and a vector of indices.
[in] | element | The layout of the degrees of freedom on an element |
[in] | index_map | The map describing the parallel distribution of the degrees of freedom |
[in] | index_map_bs | The block size associated with the index_map |
[in] | dofmap | Adjacency list (graph::AdjacencyList<std::int32_t>) with the degrees-of-freedom for each cell |
[in] | bs | The block size of the dofmap |
|
inline |
Local-to-global mapping of dofs on a cell.
[in] | cell | The cell index |
std::pair< std::unique_ptr< DofMap >, std::vector< std::int32_t > > DofMap::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)
[in] | comm | MPI Communicator |
[in] | topology | The mesh topology that the dofmap is defined on |
[in] | reorder_fn | The graph re-ordering function to apply to the dof data |
DofMap DofMap::extract_sub_dofmap | ( | const std::vector< int > & | component | ) | const |
Extract subdofmap component.
[in] | component | The component indices |
const graph::AdjacencyList< std::int32_t > & DofMap::list | ( | ) | const |
Get dofmap data.