Compute and distribute the DoFs and sparsity pattern associated with a mesh and a certain finite element space.
More...
|
| | DofHandler (const MeshType &mesh) |
| template<std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace> |
| void | distributeDofs (const fe::FeSpaceBase< Dim, FloatType, DofPolicy, FeSpace > &fe_space) |
| | Distribute the DoFs (that is create a cell to dof and dof to cell maps) and create a sparsity pattern for this finite element space. In parallel it also applies a preliminary renumbering to minimize intra-proc communications.
|
| void | applyRenumbering (const RenumberingFunctor< index_t > &renumbering_func, bool reversed) |
| | Apply a renumbering to the DoFs to minimize the bandwidth.
|
| std::size_t | ndofs () const |
| | Get the total number of dofs for this MPI proc.
|
| std::size_t | ndofsGlobal () const |
| | Get the total number of dofs.
|
| const auto & | dofOffset () const |
| | Get the dofs offset of each proc.
|
| const auto & | getSparsityPattern () const |
| | Get the CrsMap of the sparsity pattern.
|
| const auto & | getCellToDof () const |
| | Get the cell to dof map.
|
| const auto & | getCellToCellDof () const |
| const auto & | getCurrToRefNumbering () const |
| const auto & | getRefToCurrNumbering () const |
| const auto & | getGlobToLocNumbering () const |
| const auto & | getLocToGlobNumbering () const |
| bool | hasRenumbering () const |
| const std::vector< index_t > & | getGhostDofs () const |
| | Global dof indices of dofs living on this rank's ghost cells, i.e. dofs owned by another rank but needed locally for face terms (e.g. by la::Vector::createGhosted()). Deduplicated, in a stable order fixed by the ghost cells' local ids. Empty for a serial mesh.
|
| index_t | ghostDofLocalIndex (index_t dof_id) const |
| | Position of a ghost dof's global id within getGhostDofs(), i.e. its offset within a Vector::createGhosted() vector's ghost padding.
|
| index_t | nOwnedDofs () const |
| | Number of dofs owned by this rank (all of them, for a serial mesh).
|
| index_t | localGhostedIndex (index_t dof_id) const |
| | Local index, within a Vector built by la::Vector::createGhosted() from this DofHandler, of the given global dof id – whichever of owned or ghost it is. Owned dofs map to [0, nOwnedDofs()); this rank's ghost dofs map to [nOwnedDofs(), nOwnedDofs() + getGhostDofs().size()), in getGhostDofs() order. This is the single accessor consumer code should use instead of hand-rolling ownership-range arithmetic (see the note on la::Vector::toLocalGhostedEigenVector()).
|
| void | finalize () |
| void | renumberMpiSubdomainWise () |
| | Renumber the DoFs in order to minimize the MPI communications.
|
| auto | gatherSparsityPatternRank0 () const |
| | Compute the global sparsity pattern scattered among MPI procs.
|
| template<bool DofInteractionDistance> |
| std::pair< typename MeshType::index_t, typename MeshType::index_t > | computeSparsityForDof (typename MeshType::index_t dof_id, typename MeshType::index_t *buffer1, typename MeshType::index_t *buffer2) |
|
| template<typename FeSpace> |
| void | computeSparsityPattern () |
| | Compute the sparsity pattern of the global matrix.
|
| template<bool DofInteractionDistance> |
| std::pair< index_t, index_t > | computeSparsityForDof (index_t dof_id, index_t *buffer1, index_t *buffer2) |
| | Compute the sparsity pattern of the global matrix for a certain dof.
|
| template<std::size_t SubentityDim, std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace> |
| void | distributeSubentityDofs (const fe::FeSpaceBase< Dim, FloatType, DofPolicy, FeSpace > &fe_space, auto &dof_to_cell) |
| | Distribute the dofs associated to a certain geometric entity.
|
| template<std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace> |
| void | distributeAllSubentityDofs (const fe::FeSpaceBase< Dim, FloatType, DofPolicy, FeSpace > &fe_space, auto &dof_to_cell) |
| | Distribute the dofs associated to a all geometric entities.
|
| void | invertDofToCellMappingAndCompress (auto &dof_to_cell) |
| | Invert the dof to cell mapping.
|
| void | buildGhostDofs () |
| | Builds m_ghost_dofs/m_ghost_dof_to_local from this rank's ghost cells (mesh-level) and m_cell_to_dof (already in global numbering). Called once, from finalize(), after m_cell_to_dof's global-numbering conversion. No-op for a serial mesh.
|
| template<std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace> |
| void | computeNumDofs (const fe::FeSpaceBase< Dim, FloatType, DofPolicy, FeSpace > &fe_space) |
| | Computes the total number of DoFs.
|
| void | sortSharedDofs () |
| | Sorts shared dofs following global (geometric) enumeration.
|
| void | computeOwnedCellDofsAndBndDofs () |
| | Compute owned cell dofs and boundary dofs.
|
| auto | computeOwnedSparsityPattern () |
| | Compute the slice of the sparsity pattern that belongs to this proc.
|
| template<std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace> |
| void | buildCellToCellDof (const fe::FeSpaceBase< Dim, FloatType, DofPolicy, FeSpace > &fe_space) |
| | Build the local enumeration of the basis functions for each cell.
|
template<typename MeshType>
class vulpes::dofs::DofHandler< MeshType >
Compute and distribute the DoFs and sparsity pattern associated with a mesh and a certain finite element space.
This class implements the tools to distribute and compute the DoFs and sparsity pattern of a mesh and finite element space both in serial and in parallel. The class distinguishes between the two cases by checking the boolean value of MeshType::parallel(). The DofHandler also manages the renumbering of the DoFs to minimize the bandwidth of the sparsity pattern (to enhance cache locality and reduce the condition number of the final matrix). If the mesh is parallel the class automatically applies a preliminary renumbering in order to minimize intra-process communications at assembly time.
- Note
- : before using the class call the method finalize to apply the cell_to_cell_dof permutation to each of the rows in cell_to_dof. This is not automatically done since the user may want to apply a renumbering to the dofs.
template<typename MeshType>
Compute owned cell dofs and boundary dofs.
Find which are the DoFs that belong to cell that are owned by this proc. Moreover, find which are the DoFs that lie on the boundary on the partition, that is, DoFs that belong both to ghost cells and owned cells.
Namely, it fills m_partition_bnd_dofs and leaves it sorted
This make sense only in parallel.
template<typename MeshType>
template<typename FeSpace>
Compute the sparsity pattern of the global matrix.
The spartisity pattern is a local dof to local dof map created by composing the dof-to-cell, global-to-local-cell, and cell-to-dof maps
template<typename MeshType>
template<std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace>
Distribute the dofs associated to a all geometric entities.
It fills the uncompressed crs map passed as second input. The map links the dof (in local enumeration) to the global cell id
In parallel, it also builds:
- m_local_to_global_dof
- m_global_to_local_dof
- m_owned_dofs
- m_local_owned_dofs
- m_shared_dofs
- m_local_shared_dofs
- Parameters
-
| fe_space | the finite element space that defines the cell DoFs |
| dof_to_cell | the CrsMapUncompressed to update |
template<typename MeshType>
template<std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace>
Distribute the DoFs (that is create a cell to dof and dof to cell maps) and create a sparsity pattern for this finite element space. In parallel it also applies a preliminary renumbering to minimize intra-proc communications.
template<typename MeshType>
template<std::size_t SubentityDim, std::size_t Dim, typename FloatType, typename DofPolicy, typename FeSpace>
Distribute the dofs associated to a certain geometric entity.
- Template Parameters
-
| SubentityDim | the dimension of the entity we want to distribute
- 0: Vertices
- 1: Edges
- 2: Faces
- 3: Volumes SubentityDim must be smaller or equal to Dim
|
It fills the uncompressed crs map passed as second input. The map links the dof (in local enumeration) to the global cell id.
In parallel, it also builds:
- m_local_to_global_dof
- m_global_to_local_dof
- m_owned_dofs
- m_local_owned_dofs
- m_shared_dofs
- m_local_shared_dofs
- Parameters
-
| fe_space | the finite element space that defines the cell DoFs |
| dof_to_cell | the CrsMapUncompressed to update |