LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
Public Member Functions | Private Member Functions | Private Attributes | List of all members
lf::assemble::UniformFEDofHandler Class Reference

Dofhandler for uniform finite element spaces. More...

#include <lf/assemble/dofhandler.h>

Inheritance diagram for lf::assemble::UniformFEDofHandler:
lf::assemble::DofHandler

Public Member Functions

 UniformFEDofHandler (UniformFEDofHandler &&)=default
 UniformFEDofHandler can be moved. More...
 
 UniformFEDofHandler (const UniformFEDofHandler &)=delete
 Copy Construction doesn't make much sense for UniformFEDofHandler. More...
 
UniformFEDofHandleroperator= (UniformFEDofHandler &&)=default
 Uniform FEDofHandler can be move assigned to. More...
 
UniformFEDofHandleroperator= (const UniformFEDofHandler &)=delete
 Copy assigning a UniformFEDofHandler doesn't make much sense. More...
 
 ~UniformFEDofHandler () override=default
 Virtual Destructor. More...
 
size_type NumDofs () const override
 total number of dof's handled by the object More...
 
size_type NumLocalDofs (const lf::mesh::Entity &entity) const override
 tells the number of degrees of freedom subordinate/_belonging_ to to an entity More...
 
size_type NumInteriorDofs (const lf::mesh::Entity &entity) const override
 provides number of shape functions associated with an entity More...
 
nonstd::span< const gdof_idx_tGlobalDofIndices (const lf::mesh::Entity &entity) const override
 access to indices of global dof's belonging to an entity More...
 
nonstd::span< const gdof_idx_tInteriorGlobalDofIndices (const lf::mesh::Entity &entity) const override
 global indices of shape functions associated with an entity_ More...
 
const lf::mesh::EntityEntity (gdof_idx_t dofnum) const override
 retrieve unique entity at which a basis function is located More...
 
std::shared_ptr< const lf::mesh::MeshMesh () const override
 Acess to underlying mesh object. More...
 
- Public Member Functions inherited from lf::assemble::DofHandler
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...
 

Private Member Functions

void initIndexArrays ()
 initialization of internal index arrays More...
 
void InitTotalNumDofs ()
 compute number of shape functions covering an entity type More...
 
nonstd::span< const gdof_idx_tGlobalDofIndices (lf::base::RefEl ref_el_type, glb_idx_t entity_index) const
 
nonstd::span< const gdof_idx_tInteriorGlobalDofIndices (lf::base::RefEl ref_el_type, glb_idx_t entity_index) const
 
size_type GetNumLocalDofs (lf::base::RefEl ref_el_type, glb_idx_t) const
 
size_type NumCoveredDofs (lf::base::RefEl ref_el_type) const
 
size_type NumInteriorDofs (lf::base::RefEl ref_el_type) const
 

Private Attributes

std::shared_ptr< const lf::mesh::Meshmesh_
 
size_type num_dof_ {0}
 
std::vector< const lf::mesh::Entity * > dof_entities_
 
std::array< std::vector< gdof_idx_t >, 3 > dofs_
 
std::array< size_type, 3 > num_dofs_
 
size_type num_dofs_tria_ {0}
 
size_type num_dofs_quad_ {0}
 
size_type kNodeOrd = 2
 
size_type kEdgeOrd = 1
 
size_type kCellOrd = 0
 
size_type num_loc_dof_point_ {0}
 
size_type num_loc_dof_segment_ {0}
 
size_type num_loc_dof_tria_ {0}
 
size_type num_loc_dof_quad_ {0}
 

Constructors

Construction from local dof layout

using dof_map_t = std::map< lf::base::RefEl, base::size_type >
 Construction from a map object. More...
 
 UniformFEDofHandler (std::shared_ptr< const lf::mesh::Mesh > mesh, dof_map_t dofmap)
 

Additional Inherited Members

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

Detailed Description

Dofhandler for uniform finite element spaces.

This management class for indices of global shape functions is suitable for situations where every geometric entity of a particular type has exactly the same number of shape functions belonging to it.

Definition at line 257 of file dofhandler.h.

Member Typedef Documentation

◆ dof_map_t

Construction from a map object.

Parameters
dofmapmap telling number of interior dofs for every type of entity

Detailed information about the construction from a map object is given in Lecture Document Paragraph 2.7.4.16. Also study Lecture Document Example 2.7.4.18.

Definition at line 274 of file dofhandler.h.

Constructor & Destructor Documentation

◆ UniformFEDofHandler() [1/3]

lf::assemble::UniformFEDofHandler::UniformFEDofHandler ( std::shared_ptr< const lf::mesh::Mesh mesh,
dof_map_t  dofmap 
)

◆ UniformFEDofHandler() [2/3]

lf::assemble::UniformFEDofHandler::UniformFEDofHandler ( UniformFEDofHandler &&  )
default

UniformFEDofHandler can be moved.

◆ UniformFEDofHandler() [3/3]

lf::assemble::UniformFEDofHandler::UniformFEDofHandler ( const UniformFEDofHandler )
delete

Copy Construction doesn't make much sense for UniformFEDofHandler.

◆ ~UniformFEDofHandler()

lf::assemble::UniformFEDofHandler::~UniformFEDofHandler ( )
overridedefault

Virtual Destructor.

Member Function Documentation

◆ Entity()

const lf::mesh::Entity & lf::assemble::UniformFEDofHandler::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 336 of file dofhandler.h.

References dof_entities_, and num_dof_.

◆ GetNumLocalDofs()

size_type lf::assemble::UniformFEDofHandler::GetNumLocalDofs ( lf::base::RefEl  ref_el_type,
glb_idx_t   
) const
inlineprivate

Definition at line 371 of file dofhandler.h.

References NumCoveredDofs().

Referenced by NumLocalDofs().

◆ GlobalDofIndices() [1/2]

nonstd::span< const gdof_idx_t > lf::assemble::UniformFEDofHandler::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 292 of file dofhandler.cc.

References GlobalDofIndices(), mesh_, and lf::mesh::Entity::RefEl().

Referenced by GlobalDofIndices().

◆ GlobalDofIndices() [2/2]

nonstd::span< const gdof_idx_t > lf::assemble::UniformFEDofHandler::GlobalDofIndices ( lf::base::RefEl  ref_el_type,
glb_idx_t  entity_index 
) const
private

Definition at line 277 of file dofhandler.cc.

References lf::base::RefEl::Dimension(), dofs_, mesh_, num_dofs_, and NumCoveredDofs().

◆ initIndexArrays()

void lf::assemble::UniformFEDofHandler::initIndexArrays ( )
private

◆ InitTotalNumDofs()

void lf::assemble::UniformFEDofHandler::InitTotalNumDofs ( )
private

compute number of shape functions covering an entity type

This method assumes that the variables num_loc_dof_point_, num_loc_dof_segment_, num_loc_dof_tria_, num_loc_dof_quad_ have already been set.

See also
LocalStaticDOFs2D::TotalNoLocDofs()

Definition at line 125 of file dofhandler.cc.

References kCellOrd, kEdgeOrd, kNodeOrd, num_dofs_, num_dofs_quad_, num_dofs_tria_, num_loc_dof_point_, num_loc_dof_quad_, num_loc_dof_segment_, and num_loc_dof_tria_.

Referenced by UniformFEDofHandler().

◆ InteriorGlobalDofIndices() [1/2]

nonstd::span< const gdof_idx_t > lf::assemble::UniformFEDofHandler::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 314 of file dofhandler.cc.

References InteriorGlobalDofIndices(), mesh_, and lf::mesh::Entity::RefEl().

Referenced by InteriorGlobalDofIndices().

◆ InteriorGlobalDofIndices() [2/2]

nonstd::span< const gdof_idx_t > lf::assemble::UniformFEDofHandler::InteriorGlobalDofIndices ( lf::base::RefEl  ref_el_type,
glb_idx_t  entity_index 
) const
private

◆ Mesh()

std::shared_ptr< const lf::mesh::Mesh > lf::assemble::UniformFEDofHandler::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 345 of file dofhandler.h.

References mesh_.

Referenced by lf::uscalfe::UniformScalarFESpace< SCALAR >::Mesh().

◆ NumCoveredDofs()

size_type lf::assemble::UniformFEDofHandler::NumCoveredDofs ( lf::base::RefEl  ref_el_type) const
inlineprivate

◆ NumDofs()

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

total number of dof's handled by the object

Implements lf::assemble::DofHandler.

Definition at line 304 of file dofhandler.h.

References num_dof_.

◆ NumInteriorDofs() [1/2]

size_type lf::assemble::UniformFEDofHandler::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 324 of file dofhandler.cc.

References NumInteriorDofs(), and lf::mesh::Entity::RefEl().

Referenced by InteriorGlobalDofIndices(), and NumInteriorDofs().

◆ NumInteriorDofs() [2/2]

size_type lf::assemble::UniformFEDofHandler::NumInteriorDofs ( lf::base::RefEl  ref_el_type) const
inlineprivate

◆ NumLocalDofs()

size_type lf::assemble::UniformFEDofHandler::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 319 of file dofhandler.cc.

References GetNumLocalDofs(), and lf::mesh::Entity::RefEl().

◆ operator=() [1/2]

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

Copy assigning a UniformFEDofHandler doesn't make much sense.

◆ operator=() [2/2]

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

Uniform FEDofHandler can be move assigned to.

Member Data Documentation

◆ dof_entities_

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

Vector of entities to which global basis functions are associated

Definition at line 444 of file dofhandler.h.

Referenced by Entity(), and initIndexArrays().

◆ dofs_

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

Vectors of global indices of dofs belonging to entities of different topological type

Definition at line 447 of file dofhandler.h.

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

◆ kCellOrd

size_type lf::assemble::UniformFEDofHandler::kCellOrd = 0
private

Definition at line 380 of file dofhandler.h.

Referenced by initIndexArrays(), and InitTotalNumDofs().

◆ kEdgeOrd

size_type lf::assemble::UniformFEDofHandler::kEdgeOrd = 1
private

Definition at line 379 of file dofhandler.h.

Referenced by initIndexArrays(), InitTotalNumDofs(), and NumCoveredDofs().

◆ kNodeOrd

size_type lf::assemble::UniformFEDofHandler::kNodeOrd = 2
private

co-dimensions of different geometric entities in a 2D mesh

Definition at line 378 of file dofhandler.h.

Referenced by initIndexArrays(), InitTotalNumDofs(), and NumCoveredDofs().

◆ mesh_

std::shared_ptr<const lf::mesh::Mesh> lf::assemble::UniformFEDofHandler::mesh_
private

The mesh on which the degrees of freedom are defined

Definition at line 440 of file dofhandler.h.

Referenced by GlobalDofIndices(), initIndexArrays(), InteriorGlobalDofIndices(), Mesh(), and UniformFEDofHandler().

◆ num_dof_

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

The total number of degrees of freedom

Definition at line 442 of file dofhandler.h.

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

◆ num_dofs_

std::array<size_type, 3> lf::assemble::UniformFEDofHandler::num_dofs_
private

Number of dofs covering entities of a particular type

Definition at line 449 of file dofhandler.h.

Referenced by GlobalDofIndices(), initIndexArrays(), InitTotalNumDofs(), InteriorGlobalDofIndices(), and NumCoveredDofs().

◆ num_dofs_quad_

size_type lf::assemble::UniformFEDofHandler::num_dofs_quad_ {0}
private

Definition at line 452 of file dofhandler.h.

Referenced by InitTotalNumDofs(), and NumCoveredDofs().

◆ num_dofs_tria_

size_type lf::assemble::UniformFEDofHandler::num_dofs_tria_ {0}
private

(Maximum) number of shape functions covering entities of a particular co-dimension

Definition at line 452 of file dofhandler.h.

Referenced by InitTotalNumDofs(), and NumCoveredDofs().

◆ num_loc_dof_point_

size_type lf::assemble::UniformFEDofHandler::num_loc_dof_point_ {0}
private

Numbers of local interior shape functions associated with different types of entities

Definition at line 456 of file dofhandler.h.

Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().

◆ num_loc_dof_quad_

size_type lf::assemble::UniformFEDofHandler::num_loc_dof_quad_ {0}
private

◆ num_loc_dof_segment_

size_type lf::assemble::UniformFEDofHandler::num_loc_dof_segment_ {0}
private

◆ num_loc_dof_tria_

size_type lf::assemble::UniformFEDofHandler::num_loc_dof_tria_ {0}
private

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