Flow123d
release_2.2.0-914-gf1a3a4f
|
Provides the numbering of the finite element degrees of freedom on the computational mesh. More...
#include <dofhandler.hh>
Public Types | |
typedef ElementFullIter | CellIterator |
Alias for iterator over cells. More... | |
Public Types inherited from DOFHandlerBase | |
typedef ElementFullIter | CellIterator |
Alias for iterator over cells. More... | |
Public Member Functions | |
DOFHandlerMultiDim (Mesh &_mesh) | |
Constructor. More... | |
void | distribute_dofs (FiniteElement< 1, 3 > &fe1d, FiniteElement< 2, 3 > &fe2d, FiniteElement< 3, 3 > &fe3d, const unsigned int offset=0) |
Distributes degrees of freedom on the mesh needed for the given finite elements. More... | |
unsigned int | get_dof_indices (const CellIterator &cell, std::vector< IdxInt > &indices) const override |
Returns the global indices of dofs associated to the cell . More... | |
unsigned int | get_loc_dof_indices (const CellIterator &cell, std::vector< IdxInt > &indices) const override |
Returns the indices of dofs associated to the cell on the local process. More... | |
void | get_dof_values (const CellIterator &cell, const Vec &values, double local_values[]) const override |
Returns the dof values associated to the cell . More... | |
int | el_index (int loc_el) const |
Returns the global index of local element. More... | |
IdxInt | edge_index (int loc_edg) const |
Returns the global index of local edge. More... | |
IdxInt | nb_index (int loc_nb) const |
Returns the global index of local neighbour. More... | |
unsigned int | n_loc_edges () const |
Returns number of local edges. More... | |
unsigned int | n_loc_nb () const |
Returns number of local neighbours. More... | |
bool | el_is_local (int index) const |
template<unsigned int dim> | |
FiniteElement< dim, 3 > * | fe () const |
Returns finite element object for given space dimension. More... | |
std::size_t | hash () const override |
~DOFHandlerMultiDim () override | |
Destructor. More... | |
template<> | |
FiniteElement< 1, 3 > * | fe () const |
template<> | |
FiniteElement< 2, 3 > * | fe () const |
template<> | |
FiniteElement< 3, 3 > * | fe () const |
Public Member Functions inherited from DOFHandlerBase | |
DOFHandlerBase (Mesh &_mesh) | |
Constructor. More... | |
const unsigned int | n_global_dofs () const |
Getter for the number of all mesh dofs required by the given finite element. More... | |
const unsigned int | offset () const |
Returns the number of the first global dof handled by this DOFHandler. More... | |
const unsigned int | lsize () const |
Returns the number of dofs on the current process. More... | |
const unsigned int | loffset () const |
Returns the offset of the local part of dofs. More... | |
const unsigned int | max_elem_dofs () const |
Returns max. number of dofs on one element. More... | |
Distribution * | distr () const |
Returns the parallel distribution of dofs. More... | |
Mesh * | mesh () const |
Returns the mesh. More... | |
virtual | ~DOFHandlerBase () |
Destructor. More... | |
Private Member Functions | |
void | make_elem_partitioning () |
Prepare parallel distribution of elements, edges and neighbours. More... | |
Private Attributes | |
FiniteElement< 1, 3 > * | fe1d_ |
Pointer to the finite element class for which the handler distributes dofs. More... | |
FiniteElement< 2, 3 > * | fe2d_ |
FiniteElement< 3, 3 > * | fe3d_ |
IdxInt *** | object_dofs |
Number of dofs associated to geometrical entities. More... | |
IdxInt * | row_4_el |
Global element index -> index according to partitioning. More... | |
IdxInt * | el_4_loc |
Local element index -> global element index. More... | |
Distribution * | el_ds_ |
Distribution of elements. More... | |
vector< IdxInt > | edg_4_loc |
Local edge index -> global edge index. More... | |
vector< IdxInt > | nb_4_loc |
Local neighbour index -> global neighbour index. More... | |
Additional Inherited Members | |
Protected Attributes inherited from DOFHandlerBase | |
unsigned int | global_dof_offset |
Index of first global dof. More... | |
unsigned int | n_dofs |
Number of global dofs assigned by the handler. More... | |
unsigned int | lsize_ |
Number of dofs associated to local process. More... | |
unsigned int | loffset_ |
Index of the first dof on the local process. More... | |
unsigned int | max_elem_dofs_ |
Max. number of dofs per element. More... | |
Mesh * | mesh_ |
Pointer to the mesh to which the dof handler is associated. More... | |
Distribution * | ds_ |
Distribution of dofs associated to local process. More... | |
Provides the numbering of the finite element degrees of freedom on the computational mesh.
Class DOFHandler distributes the degrees of freedom (dof) for a particular finite element on the computational mesh and provides mappings between local and global dofs. The template parameter dim
denotes the spatial dimension of the reference finite element.
Currently the functionality is restricted to discontinuous finite elements, i.e. when the neighboring elements do not share any common dof. Constructor.
_mesh | The mesh. Alias for iterator over cells. |
TODO: Notation to be fixed: element or cell TODO: Iterator goes through cells of all dimensions, but should go only through dim-dimensional ones. Distributes degrees of freedom on the mesh needed for the given finite element.
The additional parameter offset
allows to reserve space for another finite element dofs in the beginning of the global dof vector.
fe | The finite element. |
offset | The offset. Getter for the number of dofs at a single cell. |
This value depends on the given finite element. Returns the global indices of dofs associated to the cell
.
cell | The cell. |
indices | Array of dof indices on the cell. Returns the dof values associated to the cell . |
cell | The cell. |
values | The global vector of values. |
local_values | Array of values at local dofs. Pointer to the finite element class for which the handler distributes dofs. Number of dofs associated to geometrical entities. |
Global numbers of dofs associated to nodes (object_dofs[0]), 1D edges (object_dofs[1]), 2D faces (object_difs[2]) and volumes (object_dofs[3]).
Definition at line 268 of file dofhandler.hh.
Alias for iterator over cells.
TODO: Notation to be fixed: element or cell
Definition at line 282 of file dofhandler.hh.
DOFHandlerMultiDim::DOFHandlerMultiDim | ( | Mesh & | _mesh | ) |
|
override |
Destructor.
Definition at line 404 of file dofhandler.cc.
void DOFHandlerMultiDim::distribute_dofs | ( | FiniteElement< 1, 3 > & | fe1d, |
FiniteElement< 2, 3 > & | fe2d, | ||
FiniteElement< 3, 3 > & | fe3d, | ||
const unsigned int | offset = 0 |
||
) |
Distributes degrees of freedom on the mesh needed for the given finite elements.
The additional parameter offset
allows to reserve space for another finite element dofs in the beginning of the global dof vector.
fe1d | The 1D finite element. |
fe2d | The 2D finite element. |
fe3d | The 3D finite element. |
offset | The offset. |
Definition at line 244 of file dofhandler.cc.
|
inline |
Returns the global index of local edge.
loc_edg | Local index of edge. |
Definition at line 340 of file dofhandler.hh.
|
inline |
Returns the global index of local element.
loc_el | Local index of element. |
Definition at line 333 of file dofhandler.hh.
bool DOFHandlerMultiDim::el_is_local | ( | int | index | ) | const |
Returns true if element is on local process.
index | Global element index. |
Definition at line 453 of file dofhandler.cc.
FiniteElement<dim,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Returns finite element object for given space dimension.
FiniteElement<3,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Definition at line 469 of file dofhandler.cc.
FiniteElement<1,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Definition at line 467 of file dofhandler.cc.
FiniteElement<2,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Definition at line 468 of file dofhandler.cc.
|
overridevirtual |
Returns the global indices of dofs associated to the cell
.
cell | The cell. |
indices | Array of dof indices on the cell. |
Implements DOFHandlerBase.
Definition at line 325 of file dofhandler.cc.
|
overridevirtual |
Returns the dof values associated to the cell
.
cell | The cell. |
values | The global vector of values. |
local_values | Array of values at local dofs. |
Implements DOFHandlerBase.
Definition at line 381 of file dofhandler.cc.
|
overridevirtual |
Returns the indices of dofs associated to the cell
on the local process.
cell | The cell. |
indices | Array of dof indices on the cell. |
Implements DOFHandlerBase.
Definition at line 351 of file dofhandler.cc.
|
overridevirtual |
Implements DOFHandlerBase::hash
.
Implements DOFHandlerBase.
Definition at line 459 of file dofhandler.cc.
|
private |
Prepare parallel distribution of elements, edges and neighbours.
Definition at line 420 of file dofhandler.cc.
|
inline |
Returns number of local edges.
Definition at line 352 of file dofhandler.hh.
|
inline |
Returns number of local neighbours.
Definition at line 357 of file dofhandler.hh.
|
inline |
Returns the global index of local neighbour.
loc_nb | Local index of neighbour. |
Definition at line 347 of file dofhandler.hh.
Local edge index -> global edge index.
Definition at line 410 of file dofhandler.hh.
|
private |
Local element index -> global element index.
Definition at line 405 of file dofhandler.hh.
|
private |
Distribution of elements.
Definition at line 407 of file dofhandler.hh.
|
private |
Pointer to the finite element class for which the handler distributes dofs.
Definition at line 388 of file dofhandler.hh.
|
private |
Definition at line 389 of file dofhandler.hh.
|
private |
Definition at line 390 of file dofhandler.hh.
Local neighbour index -> global neighbour index.
Definition at line 413 of file dofhandler.hh.
|
private |
Number of dofs associated to geometrical entities.
Global numbers of dofs associated to nodes (object_dofs[0]), 1D edges (object_dofs[1]), 2D faces (object_difs[2]) and volumes (object_dofs[3]).
Definition at line 399 of file dofhandler.hh.
|
private |
Global element index -> index according to partitioning.
Definition at line 403 of file dofhandler.hh.