Flow123d  release_2.2.0-914-gf1a3a4f
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
DOFHandlerMultiDim Class Reference

Provides the numbering of the finite element degrees of freedom on the computational mesh. More...

#include <dofhandler.hh>

Inheritance diagram for DOFHandlerMultiDim:
Inheritance graph
[legend]
Collaboration diagram for DOFHandlerMultiDim:
Collaboration graph
[legend]

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...
 
Distributiondistr () const
 Returns the parallel distribution of dofs. More...
 
Meshmesh () 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...
 
IdxIntrow_4_el
 Global element index -> index according to partitioning. More...
 
IdxIntel_4_loc
 Local element index -> global element index. More...
 
Distributionel_ds_
 Distribution of elements. More...
 
vector< IdxIntedg_4_loc
 Local edge index -> global edge index. More...
 
vector< IdxIntnb_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...
 
Meshmesh_
 Pointer to the mesh to which the dof handler is associated. More...
 
Distributionds_
 Distribution of dofs associated to local process. More...
 

Detailed Description

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.

Parameters
_meshThe 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.

Parameters
feThe finite element.
offsetThe 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.

Parameters
cellThe cell.
indicesArray of dof indices on the cell. Returns the dof values associated to the cell.
cellThe cell.
valuesThe global vector of values.
local_valuesArray 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.

Member Typedef Documentation

Alias for iterator over cells.

TODO: Notation to be fixed: element or cell

Definition at line 282 of file dofhandler.hh.

Constructor & Destructor Documentation

DOFHandlerMultiDim::DOFHandlerMultiDim ( Mesh _mesh)

Constructor.

Parameters
_meshThe mesh.

Definition at line 231 of file dofhandler.cc.

DOFHandlerMultiDim::~DOFHandlerMultiDim ( )
override

Destructor.

Definition at line 404 of file dofhandler.cc.

Member Function Documentation

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.

Parameters
fe1dThe 1D finite element.
fe2dThe 2D finite element.
fe3dThe 3D finite element.
offsetThe offset.

Definition at line 244 of file dofhandler.cc.

IdxInt DOFHandlerMultiDim::edge_index ( int  loc_edg) const
inline

Returns the global index of local edge.

Parameters
loc_edgLocal index of edge.

Definition at line 340 of file dofhandler.hh.

int DOFHandlerMultiDim::el_index ( int  loc_el) const
inline

Returns the global index of local element.

Parameters
loc_elLocal 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.

Parameters
indexGlobal element index.

Definition at line 453 of file dofhandler.cc.

Here is the caller graph for this function:

template<unsigned int dim>
FiniteElement<dim,3>* DOFHandlerMultiDim::fe ( ) const

Returns finite element object for given space dimension.

template<>
FiniteElement<3,3>* DOFHandlerMultiDim::fe ( ) const

Definition at line 469 of file dofhandler.cc.

template<>
FiniteElement<1,3>* DOFHandlerMultiDim::fe ( ) const

Definition at line 467 of file dofhandler.cc.

template<>
FiniteElement<2,3>* DOFHandlerMultiDim::fe ( ) const

Definition at line 468 of file dofhandler.cc.

unsigned int DOFHandlerMultiDim::get_dof_indices ( const CellIterator cell,
std::vector< IdxInt > &  indices 
) const
overridevirtual

Returns the global indices of dofs associated to the cell.

Parameters
cellThe cell.
indicesArray of dof indices on the cell.

Implements DOFHandlerBase.

Definition at line 325 of file dofhandler.cc.

Here is the caller graph for this function:

void DOFHandlerMultiDim::get_dof_values ( const CellIterator cell,
const Vec &  values,
double  local_values[] 
) const
overridevirtual

Returns the dof values associated to the cell.

Parameters
cellThe cell.
valuesThe global vector of values.
local_valuesArray of values at local dofs.

Implements DOFHandlerBase.

Definition at line 381 of file dofhandler.cc.

unsigned int DOFHandlerMultiDim::get_loc_dof_indices ( const CellIterator cell,
std::vector< IdxInt > &  indices 
) const
overridevirtual

Returns the indices of dofs associated to the cell on the local process.

Parameters
cellThe cell.
indicesArray of dof indices on the cell.

Implements DOFHandlerBase.

Definition at line 351 of file dofhandler.cc.

std::size_t DOFHandlerMultiDim::hash ( ) const
overridevirtual

Implements DOFHandlerBase::hash.

Implements DOFHandlerBase.

Definition at line 459 of file dofhandler.cc.

void DOFHandlerMultiDim::make_elem_partitioning ( )
private

Prepare parallel distribution of elements, edges and neighbours.

Definition at line 420 of file dofhandler.cc.

Here is the caller graph for this function:

unsigned int DOFHandlerMultiDim::n_loc_edges ( ) const
inline

Returns number of local edges.

Definition at line 352 of file dofhandler.hh.

unsigned int DOFHandlerMultiDim::n_loc_nb ( ) const
inline

Returns number of local neighbours.

Definition at line 357 of file dofhandler.hh.

IdxInt DOFHandlerMultiDim::nb_index ( int  loc_nb) const
inline

Returns the global index of local neighbour.

Parameters
loc_nbLocal index of neighbour.

Definition at line 347 of file dofhandler.hh.

Member Data Documentation

vector<IdxInt> DOFHandlerMultiDim::edg_4_loc
private

Local edge index -> global edge index.

Definition at line 410 of file dofhandler.hh.

IdxInt* DOFHandlerMultiDim::el_4_loc
private

Local element index -> global element index.

Definition at line 405 of file dofhandler.hh.

Distribution* DOFHandlerMultiDim::el_ds_
private

Distribution of elements.

Definition at line 407 of file dofhandler.hh.

FiniteElement<1,3>* DOFHandlerMultiDim::fe1d_
private

Pointer to the finite element class for which the handler distributes dofs.

Definition at line 388 of file dofhandler.hh.

FiniteElement<2,3>* DOFHandlerMultiDim::fe2d_
private

Definition at line 389 of file dofhandler.hh.

FiniteElement<3,3>* DOFHandlerMultiDim::fe3d_
private

Definition at line 390 of file dofhandler.hh.

vector<IdxInt> DOFHandlerMultiDim::nb_4_loc
private

Local neighbour index -> global neighbour index.

Definition at line 413 of file dofhandler.hh.

IdxInt*** DOFHandlerMultiDim::object_dofs
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.

IdxInt* DOFHandlerMultiDim::row_4_el
private

Global element index -> index according to partitioning.

Definition at line 403 of file dofhandler.hh.


The documentation for this class was generated from the following files: