DUBeat  1.0.1
High-order discontinuous Galerkin methods and applications to cardiac electrophysiology
DoFHandlerDG< basis > Class Template Reference

Class to work with global and local degrees of freedom and their mapping. More...

#include <dof_handler_DG.hpp>

Inheritance diagram for DoFHandlerDG< basis >:
Collaboration diagram for DoFHandlerDG< basis >:

Public Member Functions

 DoFHandlerDG ()
 Constructor. More...
 
 DoFHandlerDG (DoFHandlerDG< basis > &DoFHandlerDG)=default
 Default copy constructor. More...
 
 DoFHandlerDG (const DoFHandlerDG< basis > &DOFHandlerDG)=default
 Default const copy constructor. More...
 
 DoFHandlerDG (DoFHandlerDG< basis > &&DoFHandlerDG)=default
 Default move constructor. More...
 
unsigned int n_dofs_per_cell () const
 Return copy of n_dofs_per_cell. More...
 
unsigned int n_dofs () const
 Return copy of n_dofs. More...
 
void distribute_dofs (const dealii::FE_SimplexDGP< lifex::dim > &fe)
 Distribute dofs through the elements. More...
 
void distribute_dofs (const unsigned int degree)
 Same method but avoids to use FiniteElement classes that might be invalid with higher order polynomials. More...
 
std::vector< lifex::types::global_dof_index > get_dof_indices (active_cell_iterator cell) const
 Returns the global dofs referred to the input cell. More...
 
dealii::IndexSet locally_owned_dofs () const
 Return a set of all the locally owned dofs (for the time being, it is equivalent to return all the dofs). More...
 
void distribute_dofs (const dealii::FE_SimplexDGP< lifex::dim > &fe)
 Specialized version for Lagrangian basis, it does not use dof_map but exploits instead the deal.II original distribute_dofs. More...
 
void distribute_dofs (const dealii::FE_SimplexDGP< lifex::dim > &fe)
 Specialized version for Dubiner basis, this version uses instead the internal dof_map. More...
 
void distribute_dofs (const unsigned int degree)
 Specialized version for Lagrangian basis, it exploits the original distribute_dofs and so it is limited to space order at most 2. More...
 
void distribute_dofs (const unsigned int degree)
 Specialized version for Dubiner basis. More...
 
std::vector< lifex::types::global_dof_index > get_dof_indices (active_cell_iterator cell) const
 Specialized version for Lagrangian basis. More...
 
std::vector< lifex::types::global_dof_index > get_dof_indices (active_cell_iterator cell) const
 Specialized version for Dubiner basis. More...
 

Private Attributes

unsigned int degree
 Polynomial space degree. More...
 
std::map< active_cell_iterator, std::vector< unsigned int > > dof_map
 Local to global dof map. More...
 

Detailed Description

template<class basis>
class DoFHandlerDG< basis >

Class to work with global and local degrees of freedom and their mapping.

DUBeat exploits this class instead of the deal.II DoFHandler class because the latter, at the moment, cannot distribute dofs on tethraedra with polynomial orders greater than 2. This implementation permits to overcome this issue thanks to the use of an internal dof_map and the definition of Dubiner basis of every order (even >2) from DUBValues. On the other hand, it is not possible to do the same with nodal basis functions since they come directly from the deal.II FiniteElement classes. From the previous observations, it is then clear that Dubiner basis can be used with every order while Lagrangian basis with order at most 2.

Definition at line 65 of file dof_handler_DG.hpp.

Constructor & Destructor Documentation

◆ DoFHandlerDG() [1/4]

template<class basis >
DoFHandlerDG< basis >::DoFHandlerDG ( )
inline

Constructor.

Definition at line 72 of file dof_handler_DG.hpp.

◆ DoFHandlerDG() [2/4]

template<class basis >
DoFHandlerDG< basis >::DoFHandlerDG ( DoFHandlerDG< basis > &  DoFHandlerDG)
default

Default copy constructor.

◆ DoFHandlerDG() [3/4]

template<class basis >
DoFHandlerDG< basis >::DoFHandlerDG ( const DoFHandlerDG< basis > &  DOFHandlerDG)
default

Default const copy constructor.

◆ DoFHandlerDG() [4/4]

template<class basis >
DoFHandlerDG< basis >::DoFHandlerDG ( DoFHandlerDG< basis > &&  DoFHandlerDG)
default

Default move constructor.

Member Function Documentation

◆ distribute_dofs() [1/6]

template<class basis >
void DoFHandlerDG< basis >::distribute_dofs ( const dealii::FE_SimplexDGP< lifex::dim > &  fe)

Distribute dofs through the elements.

It overwrites the method in dealii::DoFHandler in order to let higher order polynomials available in the case of Dubiner basis.

◆ distribute_dofs() [2/6]

void DoFHandlerDG< dealii::FE_SimplexDGP< lifex::dim > >::distribute_dofs ( const dealii::FE_SimplexDGP< lifex::dim > &  fe)

Specialized version for Lagrangian basis, it does not use dof_map but exploits instead the deal.II original distribute_dofs.

Limited to order 2.

Definition at line 168 of file dof_handler_DG.hpp.

◆ distribute_dofs() [3/6]

void DoFHandlerDG< DUBValues< lifex::dim > >::distribute_dofs ( const dealii::FE_SimplexDGP< lifex::dim > &  fe)

Specialized version for Dubiner basis, this version uses instead the internal dof_map.

Because of the input argument, the space order is still limited to 2.

Definition at line 184 of file dof_handler_DG.hpp.

◆ distribute_dofs() [4/6]

template<class basis >
void DoFHandlerDG< basis >::distribute_dofs ( const unsigned int  degree)

Same method but avoids to use FiniteElement classes that might be invalid with higher order polynomials.

◆ distribute_dofs() [5/6]

void DoFHandlerDG< dealii::FE_SimplexDGP< lifex::dim > >::distribute_dofs ( const unsigned int  degree)

Specialized version for Lagrangian basis, it exploits the original distribute_dofs and so it is limited to space order at most 2.

Definition at line 210 of file dof_handler_DG.hpp.

◆ distribute_dofs() [6/6]

void DoFHandlerDG< DUBValues< lifex::dim > >::distribute_dofs ( const unsigned int  degree)

Specialized version for Dubiner basis.

Since the input is the polynomial order and it works only with the internal dof_map (no FiniteElement classes), this version of distribute_dofs is the only one to accept every polynomial order.

Definition at line 229 of file dof_handler_DG.hpp.

◆ get_dof_indices() [1/3]

template<class basis >
std::vector<lifex::types::global_dof_index> DoFHandlerDG< basis >::get_dof_indices ( active_cell_iterator  cell) const

Returns the global dofs referred to the input cell.

◆ get_dof_indices() [2/3]

std::vector< lifex::types::global_dof_index > DoFHandlerDG< dealii::FE_SimplexDGP< lifex::dim > >::get_dof_indices ( active_cell_iterator  cell) const

Specialized version for Lagrangian basis.

Hence, it exploits the original deal.II methods.

Definition at line 252 of file dof_handler_DG.hpp.

◆ get_dof_indices() [3/3]

std::vector< lifex::types::global_dof_index > DoFHandlerDG< DUBValues< lifex::dim > >::get_dof_indices ( active_cell_iterator  cell) const

Specialized version for Dubiner basis.

Hence, the dof_indices are obtained directly from the internal dof_map.

Definition at line 266 of file dof_handler_DG.hpp.

◆ locally_owned_dofs()

template<class basis >
dealii::IndexSet DoFHandlerDG< basis >::locally_owned_dofs

Return a set of all the locally owned dofs (for the time being, it is equivalent to return all the dofs).

Definition at line 277 of file dof_handler_DG.hpp.

◆ n_dofs()

template<class basis >
unsigned int DoFHandlerDG< basis >::n_dofs

Return copy of n_dofs.

Definition at line 146 of file dof_handler_DG.hpp.

◆ n_dofs_per_cell()

template<class basis >
unsigned int DoFHandlerDG< basis >::n_dofs_per_cell

Return copy of n_dofs_per_cell.

Definition at line 121 of file dof_handler_DG.hpp.

Member Data Documentation

◆ degree

template<class basis >
unsigned int DoFHandlerDG< basis >::degree
private

Polynomial space degree.

Definition at line 69 of file dof_handler_DG.hpp.

◆ dof_map

template<class basis >
std::map<active_cell_iterator, std::vector<unsigned int> > DoFHandlerDG< basis >::dof_map
private

Local to global dof map.

Definition at line 72 of file dof_handler_DG.hpp.


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