Flow123d
jenkins-Flow123d-windows32-release-multijob-51
|
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... | |
void | get_dof_indices (const CellIterator &cell, unsigned int indices[]) const override |
Returns the global indices of dofs associated to the cell . 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... | |
Distribution * | el_ds () const |
Returns the distribution of number of element to local processes. More... | |
int | el_index (int loc_el) const |
Returns the global index of local element. More... | |
int | edge_index (int loc_edg) const |
Returns the global index of local edge. More... | |
int | 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 |
~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... | |
Distribution * | distr () const |
Mesh * | mesh () const |
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_ |
int *** | object_dofs |
Number of dofs associated to geometrical entities. More... | |
int * | row_4_el |
Global element index -> index according to partitioning. More... | |
int * | el_4_loc |
Local element index -> global element index. More... | |
Distribution * | el_ds_ |
Distribution of elements. More... | |
vector< int > | edg_4_loc |
Local edge index -> global edge index. More... | |
vector< int > | 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... | |
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 251 of file dofhandler.hh.
Alias for iterator over cells.
TODO: Notation to be fixed: element or cell
Definition at line 265 of file dofhandler.hh.
DOFHandlerMultiDim::DOFHandlerMultiDim | ( | Mesh & | _mesh | ) |
|
override |
Destructor.
Definition at line 389 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 257 of file dofhandler.cc.
|
inline |
Returns the global index of local edge.
loc_edg | Local index of edge. |
Definition at line 320 of file dofhandler.hh.
|
inline |
Returns the distribution of number of element to local processes.
Definition at line 306 of file dofhandler.hh.
|
inline |
Returns the global index of local element.
loc_el | Local index of element. |
Definition at line 313 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 440 of file dofhandler.cc.
FiniteElement<dim,3>* DOFHandlerMultiDim::fe | ( | ) | const |
FiniteElement<3,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Definition at line 451 of file dofhandler.cc.
FiniteElement<1,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Definition at line 449 of file dofhandler.cc.
FiniteElement<2,3>* DOFHandlerMultiDim::fe | ( | ) | const |
Definition at line 450 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 346 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 366 of file dofhandler.cc.
|
private |
Prepare parallel distribution of elements, edges and neighbours.
Definition at line 405 of file dofhandler.cc.
|
inline |
Returns number of local edges.
Definition at line 332 of file dofhandler.hh.
|
inline |
Returns number of local neighbours.
Definition at line 337 of file dofhandler.hh.
|
inline |
Returns the global index of local neighbour.
loc_nb | Local index of neighbour. |
Definition at line 327 of file dofhandler.hh.
|
private |
Local edge index -> global edge index.
Definition at line 384 of file dofhandler.hh.
|
private |
Local element index -> global element index.
Definition at line 379 of file dofhandler.hh.
|
private |
Distribution of elements.
Definition at line 381 of file dofhandler.hh.
|
private |
Pointer to the finite element class for which the handler distributes dofs.
Definition at line 362 of file dofhandler.hh.
|
private |
Definition at line 363 of file dofhandler.hh.
|
private |
Definition at line 364 of file dofhandler.hh.
|
private |
Local neighbour index -> global neighbour index.
Definition at line 387 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 373 of file dofhandler.hh.
|
private |
Global element index -> index according to partitioning.
Definition at line 377 of file dofhandler.hh.