LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Public Member Functions | Protected Member Functions | Related Functions | List of all members
lf::assemble::DofHandler Class Referenceabstract

A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4.13. More...

#include <lf/assemble/dofhandler.h>

Inheritance diagram for lf::assemble::DofHandler:
lf::assemble::DynamicFEDofHandler lf::assemble::UniformFEDofHandler projects::dpg::ProductUniformFEDofHandler

Public Member Functions

virtual ~DofHandler ()=default
 virtual Destructor More...
 
virtual size_type NumDofs () const =0
 total number of dof's handled by the object More...
 
virtual size_type NumLocalDofs (const lf::mesh::Entity &entity) const =0
 tells the number of degrees of freedom subordinate/_belonging_ to to an entity More...
 
virtual size_type NumInteriorDofs (const lf::mesh::Entity &entity) const =0
 provides number of shape functions associated with an entity More...
 
virtual nonstd::span< const gdof_idx_tGlobalDofIndices (const lf::mesh::Entity &entity) const =0
 access to indices of global dof's belonging to an entity More...
 
virtual nonstd::span< const gdof_idx_tInteriorGlobalDofIndices (const lf::mesh::Entity &entity) const =0
 global indices of shape functions associated with an entity_ More...
 
virtual const lf::mesh::EntityEntity (gdof_idx_t dofnum) const =0
 retrieve unique entity at which a basis function is located More...
 
virtual std::shared_ptr< const lf::mesh::MeshMesh () const =0
 Acess to underlying mesh object. More...
 

Protected Member Functions

 DofHandler ()=default
 Default constructor, can only be called from derived class. More...
 
Protected constructors

Copying and assignment do not make sense for DofHandler objects, but derived classes may be copied/assigned

 DofHandler (const DofHandler &)=default
 
 DofHandler (DofHandler &&)=default
 
DofHandleroperator= (const DofHandler &)=default
 
DofHandleroperator= (DofHandler &&)=default
 

Related Functions

(Note that these are not member functions.)

void PrintInfo (std::ostream &stream, const DofHandler &dof_handler, unsigned int ctrl=0)
 Output information about the given dof handler to the given stream object. More...
 

Detailed Description

A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4.13.

Objects of this class provide the local-to-global map for indices of local/global shape functions.

Some terminology

Definition at line 109 of file dofhandler.h.

Constructor & Destructor Documentation

◆ DofHandler() [1/3]

lf::assemble::DofHandler::DofHandler ( )
protecteddefault

Default constructor, can only be called from derived class.

◆ DofHandler() [2/3]

lf::assemble::DofHandler::DofHandler ( const DofHandler )
protecteddefault

◆ DofHandler() [3/3]

lf::assemble::DofHandler::DofHandler ( DofHandler &&  )
protecteddefault

◆ ~DofHandler()

virtual lf::assemble::DofHandler::~DofHandler ( )
virtualdefault

virtual Destructor

Member Function Documentation

◆ Entity()

virtual const lf::mesh::Entity & lf::assemble::DofHandler::Entity ( gdof_idx_t  dofnum) const
pure virtual

retrieve unique entity at which a basis function is located

Parameters
dofnumglobal index of the basis function/degree of freedom

This function returns the unique geometric entity to which a particular basis function = degree of freedom is associated.

This function is hardly ever needed in finite element codes and is supplied for debugging purposes.

See also
GlobalDofIndices()

Implemented in lf::assemble::UniformFEDofHandler, lf::assemble::DynamicFEDofHandler, and projects::dpg::ProductUniformFEDofHandler.

Referenced by projects::ipdg_stokes::assemble::buildSystemMatrixInOutFlow(), projects::ipdg_stokes::assemble::buildSystemMatrixNoFlow(), and lf::assemble::PrintInfo().

◆ GlobalDofIndices()

virtual nonstd::span< const gdof_idx_t > lf::assemble::DofHandler::GlobalDofIndices ( const lf::mesh::Entity entity) const
pure virtual

access to indices of global dof's belonging to an entity

Parameters
entityreference to the entity for which the dof's are to be fetched. This entity must belong to the underlying mesh.
Returns
cardinal number range of global dof indices, see std::span data type documentation.

The basis functions of every finite element space must be associated with a unique geometric entity. Conversely, every entity can possess a finite number of basis functions = degrees of freedom. This member function returns the global indices of all basis functions associated with the entity and its sub-entitites (the covering local shape functions).

The size of the returned range must agree with the value returned by NumLocalDofs() when supplied with the same arguments.

Consult Lecture Document Paragraph 2.7.4.13 for more information.

Implemented in lf::assemble::UniformFEDofHandler, lf::assemble::DynamicFEDofHandler, and projects::dpg::ProductUniformFEDofHandler.

Referenced by lf::assemble::AssembleMatrixLocally(), lf::assemble::AssembleVectorLocally(), projects::ipdg_stokes::assemble::createOffsetFunction(), projects::ipdg_stokes::post_processing::extractBasisFunctionCoefficients(), projects::ipdg_stokes::post_processing::extractVelocity(), lf::fe::InitEssentialConditionFromFunction(), and lf::assemble::PrintInfo().

◆ InteriorGlobalDofIndices()

virtual nonstd::span< const gdof_idx_t > lf::assemble::DofHandler::InteriorGlobalDofIndices ( const lf::mesh::Entity entity) const
pure virtual

global indices of shape functions associated with an entity_

Parameters
entityentity for which shape functin indices are queried
Returns
cardinal number range of global indices of shape functions, see std::span data type documentation.

Each global shape function is associated with a unique mesh entity. This method provides all the global indices of the shape function associated to the entity specified by the function arguments, see Lecture Document Paragraph 2.7.4.13 for additional explanations.

Note
Be aware of the difference of GlobalDofIndices() and InteriorGlobalDofIndices()

Implemented in lf::assemble::UniformFEDofHandler, lf::assemble::DynamicFEDofHandler, and projects::dpg::ProductUniformFEDofHandler.

Referenced by lf::assemble::PrintInfo().

◆ Mesh()

virtual std::shared_ptr< const lf::mesh::Mesh > lf::assemble::DofHandler::Mesh ( ) const
pure virtual

Acess to underlying mesh object.

Every DofHandler object has to be associated with a unique mesh. All entities passed to the DofHandler object must belong to that mesh.

Implemented in lf::assemble::UniformFEDofHandler, lf::assemble::DynamicFEDofHandler, and projects::dpg::ProductUniformFEDofHandler.

Referenced by FisherKPP::assembleGalerkinMatrices(), lf::assemble::AssembleMatrixLocally(), lf::assemble::AssembleVectorLocally(), and lf::assemble::PrintInfo().

◆ NumDofs()

virtual size_type lf::assemble::DofHandler::NumDofs ( ) const
pure virtual

◆ NumInteriorDofs()

virtual size_type lf::assemble::DofHandler::NumInteriorDofs ( const lf::mesh::Entity entity) const
pure virtual

provides number of shape functions associated with an entity

Parameters
entityentity of underlying mesh whose number of shape functions is queried

The return value of this method must be equal to the length of the range built by InteriorGlobalDofIndices().

See also
InteriorGlobalDofIndices()

Implemented in lf::assemble::UniformFEDofHandler, lf::assemble::DynamicFEDofHandler, and projects::dpg::ProductUniformFEDofHandler.

◆ NumLocalDofs()

virtual size_type lf::assemble::DofHandler::NumLocalDofs ( const lf::mesh::Entity entity) const
pure virtual

tells the number of degrees of freedom subordinate/_belonging_ to to an entity

Parameters
entityreference to an entity of the underlying mesh

This method informs about the length of the vector returned by GlobalDofIndices().

See also
GlobalDofIndices()

Implemented in lf::assemble::UniformFEDofHandler, lf::assemble::DynamicFEDofHandler, and projects::dpg::ProductUniformFEDofHandler.

Referenced by lf::assemble::AssembleMatrixLocally(), lf::assemble::AssembleVectorLocally(), lf::fe::InitEssentialConditionFromFunction(), and lf::assemble::PrintInfo().

◆ operator=() [1/2]

DofHandler & lf::assemble::DofHandler::operator= ( const DofHandler )
protecteddefault

◆ operator=() [2/2]

DofHandler & lf::assemble::DofHandler::operator= ( DofHandler &&  )
protecteddefault

Friends And Related Function Documentation

◆ PrintInfo()

void PrintInfo ( std::ostream &  stream,
const DofHandler dof_handler,
unsigned int  ctrl = 0 
)
related

Output information about the given dof handler to the given stream object.

Parameters
streamThe stream to which we should print
dof_handlerThe dof handler that should be printed
ctrlcontrols the level of detail of the printed output (see below)

The following output levels are supported

  • if = 0: minimal out: just prints global no of dofs
  • if > 0 and divisible by 2: print dofs associated with all entities
  • if > 0 and divisible by 3: print entities belonging to dofs
  • if > 0 and divisible by 10: also print interior dof indices

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