LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
lf::assemble::DynamicFEDofHandler Class Reference

Dof handler allowing variable local dof layouts. More...

#include <lf/assemble/dofhandler.h>

Inheritance diagram for lf::assemble::DynamicFEDofHandler:
lf::assemble::DofHandler

Public Member Functions

 DynamicFEDofHandler (DynamicFEDofHandler &&)=default
 A DynamicFEDofHandler can be move constructed.
 
 DynamicFEDofHandler (const DynamicFEDofHandler &)=delete
 It doesn't make much sense to copy construct a DynamicFEDofHandler.
 
DynamicFEDofHandleroperator= (DynamicFEDofHandler &&)=default
 A DynamicFEDofHandler can be moved into.
 
DynamicFEDofHandleroperator= (const DynamicFEDofHandler &)=delete
 Copy assignment is forbidden.
 
 ~DynamicFEDofHandler () override=default
 Virtual destructor.
 
template<typename LOCALDOFINFO >
 DynamicFEDofHandler (std::shared_ptr< const lf::mesh::Mesh > mesh_p, LOCALDOFINFO &&locdof)
 Set-up of dof handler.
 
size_type NumDofs () const override
 total number of dof's handled by the object
 
size_type NumInteriorDofs (const lf::mesh::Entity &entity) const override
 provides number of shape functions associated with an entity
 
size_type NumLocalDofs (const lf::mesh::Entity &entity) const override
 tells the number of degrees of freedom subordinate/_belonging_ to to an entity
 
std::span< const gdof_idx_tGlobalDofIndices (const lf::mesh::Entity &entity) const override
 access to indices of global dof's belonging to an entity
 
std::span< const gdof_idx_tInteriorGlobalDofIndices (const lf::mesh::Entity &entity) const override
 global indices of shape functions associated with an entity_
 
const lf::mesh::EntityEntity (gdof_idx_t dofnum) const override
 retrieve unique entity at which a basis function is located
 
std::shared_ptr< const lf::mesh::MeshMesh () const override
 Acess to underlying mesh object.
 
- Public Member Functions inherited from lf::assemble::DofHandler
virtual ~DofHandler ()=default
 virtual Destructor
 

Private Attributes

std::shared_ptr< const lf::mesh::Meshmesh_p_
 
size_type num_dof_ {0}
 
std::vector< const lf::mesh::Entity * > dof_entities_
 
std::array< std::vector< size_type >, 3 > num_int_dofs_
 
std::array< std::vector< size_type >, 3 > offsets_
 
std::array< std::vector< gdof_idx_t >, 3 > dofs_
 

Additional Inherited Members

- Protected Member Functions inherited from lf::assemble::DofHandler
 DofHandler ()=default
 Default constructor, can only be called from derived class.
 
 DofHandler (const DofHandler &)=default
 
 DofHandler (DofHandler &&)=default
 
DofHandleroperator= (const DofHandler &)=default
 
DofHandleroperator= (DofHandler &&)=default
 

Detailed Description

Dof handler allowing variable local dof layouts.

This dof handler can accommodate cases where entities of the mesh have different numbers of local shape functions attached to them, see Paragraph 2.7.4.16. This is relevant, for instance, for hp-FEM.

Definition at line 514 of file dofhandler.h.

Constructor & Destructor Documentation

◆ DynamicFEDofHandler() [1/3]

lf::assemble::DynamicFEDofHandler::DynamicFEDofHandler ( DynamicFEDofHandler && )
default

A DynamicFEDofHandler can be move constructed.

◆ DynamicFEDofHandler() [2/3]

lf::assemble::DynamicFEDofHandler::DynamicFEDofHandler ( const DynamicFEDofHandler & )
delete

It doesn't make much sense to copy construct a DynamicFEDofHandler.

◆ ~DynamicFEDofHandler()

lf::assemble::DynamicFEDofHandler::~DynamicFEDofHandler ( )
overridedefault

Virtual destructor.

◆ DynamicFEDofHandler() [3/3]

template<typename LOCALDOFINFO >
lf::assemble::DynamicFEDofHandler::DynamicFEDofHandler ( std::shared_ptr< const lf::mesh::Mesh > mesh_p,
LOCALDOFINFO && locdof )
inline

Set-up of dof handler.

Template Parameters
LOCALDOFINFOtype for object telling number of interior local shape functions
Parameters
mesh_ppointer to underlying mesh
locdoffunctor object telling number of interior dofs for every entity of the mesh.

This constructor performs the initialization of all internal index arrays.

Type requirements for LOCALDOFINFO

This type must provide method

 size_type operator (const lf::mesh::Entity &);

that returns the number of local shape functions associated with an entity. Note that this gives the number of so-called interior local shape functions belonging to an entity and not the number of local shape functions whose supports will include the entity. Also refer to the documentation of DynamicFEDofHandler::NumLocalDofs() and DynamicFEDofHandler::NumInteriorDofs().

Definition at line 566 of file dofhandler.h.

References lf::assemble::AssembleMatrixLocally(), dof_entities_, dofs_, mesh_p_, lf::mesh::negative, num_dof_, num_int_dofs_, offsets_, and lf::mesh::positive.

Member Function Documentation

◆ Entity()

const lf::mesh::Entity & lf::assemble::DynamicFEDofHandler::Entity ( gdof_idx_t dofnum) const
inlineoverridevirtual

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()
GlobalDofIndices()

Implements lf::assemble::DofHandler.

Definition at line 750 of file dofhandler.h.

References lf::assemble::AssembleMatrixLocally(), dof_entities_, and num_dof_.

◆ GlobalDofIndices()

std::span< const gdof_idx_t > lf::assemble::DynamicFEDofHandler::GlobalDofIndices ( const lf::mesh::Entity & entity) const
overridevirtual

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.

Implements lf::assemble::DofHandler.

Definition at line 344 of file dofhandler.cc.

References lf::assemble::AssembleMatrixLocally(), dofs_, mesh_p_, offsets_, and lf::base::RefEl::RefEl().

◆ InteriorGlobalDofIndices()

std::span< const gdof_idx_t > lf::assemble::DynamicFEDofHandler::InteriorGlobalDofIndices ( const lf::mesh::Entity & entity) const
overridevirtual

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()

Implements lf::assemble::DofHandler.

Definition at line 363 of file dofhandler.cc.

References lf::assemble::AssembleMatrixLocally(), dofs_, mesh_p_, num_int_dofs_, offsets_, and lf::base::RefEl::RefEl().

◆ Mesh()

std::shared_ptr< const lf::mesh::Mesh > lf::assemble::DynamicFEDofHandler::Mesh ( ) const
inlineoverridevirtual

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.

Implements lf::assemble::DofHandler.

Definition at line 759 of file dofhandler.h.

References mesh_p_.

◆ NumDofs()

size_type lf::assemble::DynamicFEDofHandler::NumDofs ( ) const
inlineoverridevirtual

total number of dof's handled by the object

Implements lf::assemble::DofHandler.

Definition at line 718 of file dofhandler.h.

References num_dof_.

◆ NumInteriorDofs()

size_type lf::assemble::DynamicFEDofHandler::NumInteriorDofs ( const lf::mesh::Entity & entity) const
overridevirtual

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()
InteriorGlobalDofIndices

Implements lf::assemble::DofHandler.

Definition at line 395 of file dofhandler.cc.

References lf::assemble::AssembleMatrixLocally(), mesh_p_, num_int_dofs_, and lf::base::RefEl::RefEl().

◆ NumLocalDofs()

size_type lf::assemble::DynamicFEDofHandler::NumLocalDofs ( const lf::mesh::Entity & entity) const
overridevirtual

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()
GlobalDofIndices()

Implements lf::assemble::DofHandler.

Definition at line 387 of file dofhandler.cc.

References lf::assemble::AssembleMatrixLocally(), mesh_p_, offsets_, and lf::base::RefEl::RefEl().

◆ operator=() [1/2]

DynamicFEDofHandler & lf::assemble::DynamicFEDofHandler::operator= ( const DynamicFEDofHandler & )
delete

Copy assignment is forbidden.

◆ operator=() [2/2]

DynamicFEDofHandler & lf::assemble::DynamicFEDofHandler::operator= ( DynamicFEDofHandler && )
default

A DynamicFEDofHandler can be moved into.

Member Data Documentation

◆ dof_entities_

std::vector<const lf::mesh::Entity *> lf::assemble::DynamicFEDofHandler::dof_entities_
private

Vector of entities to which global basis functions are associated

Definition at line 769 of file dofhandler.h.

Referenced by DynamicFEDofHandler(), and Entity().

◆ dofs_

std::array<std::vector<gdof_idx_t>, 3> lf::assemble::DynamicFEDofHandler::dofs_
private

Vectors of global indices of dofs belonging to entities of different co-dimension

Definition at line 787 of file dofhandler.h.

Referenced by DynamicFEDofHandler(), GlobalDofIndices(), and InteriorGlobalDofIndices().

◆ mesh_p_

std::shared_ptr<const lf::mesh::Mesh> lf::assemble::DynamicFEDofHandler::mesh_p_
private

The mesh on which the degrees of freedom are defined

Definition at line 765 of file dofhandler.h.

Referenced by DynamicFEDofHandler(), GlobalDofIndices(), InteriorGlobalDofIndices(), Mesh(), NumInteriorDofs(), and NumLocalDofs().

◆ num_dof_

size_type lf::assemble::DynamicFEDofHandler::num_dof_ {0}
private

The total number of degrees of freedom

Definition at line 767 of file dofhandler.h.

Referenced by DynamicFEDofHandler(), Entity(), and NumDofs().

◆ num_int_dofs_

std::array<std::vector<size_type>, 3> lf::assemble::DynamicFEDofHandler::num_int_dofs_
private

Internal indexing helper arrays

The indices of global shape functions are stored in a long array dofs_[codim] for each co-dimension codim. The entries in the offsets_[codim] array point to the beginning of the dof indices for a particular entity identified via its index in the mesh.

Note
the length offsets_[codim] vectors must exceed the number of corresponding entities by 1. Vector of number of interior dofs for entities

Definition at line 782 of file dofhandler.h.

Referenced by DynamicFEDofHandler(), InteriorGlobalDofIndices(), and NumInteriorDofs().

◆ offsets_

std::array<std::vector<size_type>, 3> lf::assemble::DynamicFEDofHandler::offsets_
private

Offsets of dof index arrays in dofs_ vectors

Definition at line 784 of file dofhandler.h.

Referenced by DynamicFEDofHandler(), GlobalDofIndices(), InteriorGlobalDofIndices(), and NumLocalDofs().


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