Flow123d  release_2.2.1-10-gb9fad4d
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...
 
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_loc_dof_indices (const CellIterator &cell, unsigned int 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...
 
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
 Returns finite element object for given space dimension. More...
 
 ~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...
 
Distributiondistr () const
 
Meshmesh () 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...
 
Distributionel_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...
 
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 248 of file dofhandler.hh.

Member Typedef Documentation

Alias for iterator over cells.

TODO: Notation to be fixed: element or cell

Definition at line 262 of file dofhandler.hh.

Constructor & Destructor Documentation

DOFHandlerMultiDim::DOFHandlerMultiDim ( Mesh _mesh)

Constructor.

Parameters
_meshThe mesh.

Definition at line 232 of file dofhandler.cc.

DOFHandlerMultiDim::~DOFHandlerMultiDim ( )
override

Destructor.

Definition at line 401 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 245 of file dofhandler.cc.

Here is the caller graph for this function:

int DOFHandlerMultiDim::edge_index ( int  loc_edg) const
inline

Returns the global index of local edge.

Parameters
loc_edgLocal index of edge.

Definition at line 320 of file dofhandler.hh.

Here is the caller graph for this function:

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 313 of file dofhandler.hh.

Here is the caller graph for this function:

bool DOFHandlerMultiDim::el_is_local ( int  index) const

Returns true if element is on local process.

Parameters
indexGlobal element index.

Definition at line 450 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.

Here is the caller graph for this function:

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

Definition at line 461 of file dofhandler.cc.

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

Definition at line 459 of file dofhandler.cc.

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

Definition at line 460 of file dofhandler.cc.

void DOFHandlerMultiDim::get_dof_indices ( const CellIterator cell,
unsigned int  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 334 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 378 of file dofhandler.cc.

void DOFHandlerMultiDim::get_loc_dof_indices ( const CellIterator cell,
unsigned int  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 356 of file dofhandler.cc.

Here is the caller graph for this function:

void DOFHandlerMultiDim::make_elem_partitioning ( )
private

Prepare parallel distribution of elements, edges and neighbours.

Definition at line 417 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 332 of file dofhandler.hh.

Here is the caller graph for this function:

unsigned int DOFHandlerMultiDim::n_loc_nb ( ) const
inline

Returns number of local neighbours.

Definition at line 337 of file dofhandler.hh.

Here is the caller graph for this function:

int DOFHandlerMultiDim::nb_index ( int  loc_nb) const
inline

Returns the global index of local neighbour.

Parameters
loc_nbLocal index of neighbour.

Definition at line 327 of file dofhandler.hh.

Here is the caller graph for this function:

Member Data Documentation

vector<int> DOFHandlerMultiDim::edg_4_loc
private

Local edge index -> global edge index.

Definition at line 385 of file dofhandler.hh.

int* DOFHandlerMultiDim::el_4_loc
private

Local element index -> global element index.

Definition at line 380 of file dofhandler.hh.

Distribution* DOFHandlerMultiDim::el_ds_
private

Distribution of elements.

Definition at line 382 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 363 of file dofhandler.hh.

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

Definition at line 364 of file dofhandler.hh.

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

Definition at line 365 of file dofhandler.hh.

vector<int> DOFHandlerMultiDim::nb_4_loc
private

Local neighbour index -> global neighbour index.

Definition at line 388 of file dofhandler.hh.

int*** 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 374 of file dofhandler.hh.

int* DOFHandlerMultiDim::row_4_el
private

Global element index -> index according to partitioning.

Definition at line 378 of file dofhandler.hh.


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