Flow123d  jenkins-Flow123d-windows-release-multijob-285
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_dof_values (const CellIterator &cell, const Vec &values, double local_values[]) const override
 Returns the dof values associated to the cell. More...
 
Distributionel_ds () const
 Returns the distribution of number of element to local processes. More...
 
int * get_el_4_loc () const
 
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...
 
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 251 of file dofhandler.hh.

Member Typedef Documentation

Alias for iterator over cells.

TODO: Notation to be fixed: element or cell

Definition at line 265 of file dofhandler.hh.

Constructor & Destructor Documentation

DOFHandlerMultiDim::DOFHandlerMultiDim ( Mesh _mesh)

Constructor.

Parameters
_meshThe mesh.

Definition at line 244 of file dofhandler.cc.

DOFHandlerMultiDim::~DOFHandlerMultiDim ( )
override

Destructor.

Definition at line 389 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 257 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 322 of file dofhandler.hh.

Distribution* DOFHandlerMultiDim::el_ds ( ) const
inline

Returns the distribution of number of element to local processes.

Definition at line 306 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 315 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 440 of file dofhandler.cc.

Here is the caller graph for this function:

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

Here is the caller graph for this function:

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

Definition at line 451 of file dofhandler.cc.

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

Definition at line 450 of file dofhandler.cc.

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

Definition at line 449 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 346 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 366 of file dofhandler.cc.

int* DOFHandlerMultiDim::get_el_4_loc ( ) const
inline

Definition at line 308 of file dofhandler.hh.

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

unsigned int DOFHandlerMultiDim::n_loc_nb ( ) const
inline

Returns number of local neighbours.

Definition at line 339 of file dofhandler.hh.

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

Member Data Documentation

vector<int> DOFHandlerMultiDim::edg_4_loc
private

Local edge index -> global edge index.

Definition at line 386 of file dofhandler.hh.

int* DOFHandlerMultiDim::el_4_loc
private

Local element index -> global element index.

Definition at line 381 of file dofhandler.hh.

Distribution* DOFHandlerMultiDim::el_ds_
private

Distribution of elements.

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

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

Definition at line 365 of file dofhandler.hh.

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

Definition at line 366 of file dofhandler.hh.

vector<int> DOFHandlerMultiDim::nb_4_loc
private

Local neighbour index -> global neighbour index.

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

int* DOFHandlerMultiDim::row_4_el
private

Global element index -> index according to partitioning.

Definition at line 379 of file dofhandler.hh.


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