LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Dofhandler for uniform finite element spaces. More...
#include <lf/assemble/dofhandler.h>
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... | |
UniformFEDofHandler & | operator= (UniformFEDofHandler &&)=default |
Uniform FEDofHandler can be move assigned to. More... | |
UniformFEDofHandler & | operator= (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_t > | GlobalDofIndices (const lf::mesh::Entity &entity) const override |
access to indices of global dof's belonging to an entity More... | |
nonstd::span< const gdof_idx_t > | InteriorGlobalDofIndices (const lf::mesh::Entity &entity) const override |
global indices of shape functions associated with an entity_ More... | |
const lf::mesh::Entity & | Entity (gdof_idx_t dofnum) const override |
retrieve unique entity at which a basis function is located More... | |
std::shared_ptr< const lf::mesh::Mesh > | Mesh () const override |
Acess to underlying mesh object. More... | |
![]() | |
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_t > | GlobalDofIndices (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_t > | InteriorGlobalDofIndices (const lf::mesh::Entity &entity) const =0 |
global indices of shape functions associated with an entity_ More... | |
virtual const lf::mesh::Entity & | Entity (gdof_idx_t dofnum) const =0 |
retrieve unique entity at which a basis function is located More... | |
virtual std::shared_ptr< const lf::mesh::Mesh > | Mesh () 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_t > | GlobalDofIndices (lf::base::RefEl ref_el_type, glb_idx_t entity_index) const |
nonstd::span< const gdof_idx_t > | InteriorGlobalDofIndices (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::Mesh > | mesh_ |
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 | |
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 | |
![]() | |
DofHandler ()=default | |
Default constructor, can only be called from derived class. More... | |
DofHandler (const DofHandler &)=default | |
DofHandler (DofHandler &&)=default | |
DofHandler & | operator= (const DofHandler &)=default |
DofHandler & | operator= (DofHandler &&)=default |
![]() | |
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... | |
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.
using lf::assemble::UniformFEDofHandler::dof_map_t = std::map<lf::base::RefEl, base::size_type> |
Construction from a map object.
dofmap | map 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.
lf::assemble::UniformFEDofHandler::UniformFEDofHandler | ( | std::shared_ptr< const lf::mesh::Mesh > | mesh, |
dof_map_t | dofmap | ||
) |
Definition at line 83 of file dofhandler.cc.
References initIndexArrays(), InitTotalNumDofs(), lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), mesh_, num_loc_dof_point_, num_loc_dof_quad_, num_loc_dof_segment_, and num_loc_dof_tria_.
|
default |
UniformFEDofHandler can be moved.
|
delete |
Copy Construction doesn't make much sense for UniformFEDofHandler.
|
overridedefault |
Virtual Destructor.
|
inlineoverridevirtual |
retrieve unique entity at which a basis function is located
dofnum | global 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.
Implements lf::assemble::DofHandler.
Definition at line 336 of file dofhandler.h.
References dof_entities_, and num_dof_.
|
inlineprivate |
Definition at line 371 of file dofhandler.h.
References NumCoveredDofs().
Referenced by NumLocalDofs().
|
overridevirtual |
access to indices of global dof's belonging to an entity
entity | reference to the entity for which the dof's are to be fetched. This entity must belong to the underlying mesh. |
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().
|
private |
Definition at line 277 of file dofhandler.cc.
References lf::base::RefEl::Dimension(), dofs_, mesh_, num_dofs_, and NumCoveredDofs().
|
private |
initialization of internal index arrays
Definition at line 135 of file dofhandler.cc.
References dof_entities_, dofs_, kCellOrd, kEdgeOrd, kNodeOrd, lf::base::RefEl::kQuad(), lf::base::RefEl::kTria(), mesh_, lf::mesh::negative, num_dof_, num_dofs_, num_loc_dof_point_, num_loc_dof_quad_, num_loc_dof_segment_, num_loc_dof_tria_, lf::mesh::positive, and lf::mesh::Entity::SubEntities().
Referenced by UniformFEDofHandler().
|
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.
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().
|
overridevirtual |
global indices of shape functions associated with an entity_
entity | entity for which shape functin indices are queried |
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.
Implements lf::assemble::DofHandler.
Definition at line 314 of file dofhandler.cc.
References InteriorGlobalDofIndices(), mesh_, and lf::mesh::Entity::RefEl().
Referenced by InteriorGlobalDofIndices().
|
private |
Definition at line 297 of file dofhandler.cc.
References lf::base::RefEl::Dimension(), dofs_, mesh_, num_dofs_, NumCoveredDofs(), and NumInteriorDofs().
|
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().
|
inlineprivate |
Number of covered dofs for an entity type
Definition at line 384 of file dofhandler.h.
References kEdgeOrd, kNodeOrd, lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), num_dofs_, num_dofs_quad_, and num_dofs_tria_.
Referenced by GetNumLocalDofs(), GlobalDofIndices(), and InteriorGlobalDofIndices().
|
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_.
|
overridevirtual |
provides number of shape functions associated with an entity
entity | entity 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().
Implements lf::assemble::DofHandler.
Definition at line 324 of file dofhandler.cc.
References NumInteriorDofs(), and lf::mesh::Entity::RefEl().
Referenced by InteriorGlobalDofIndices(), and NumInteriorDofs().
|
inlineprivate |
Number of interior shape functions for an entity type
Definition at line 412 of file dofhandler.h.
References lf::base::RefEl::kPoint(), lf::base::RefEl::kQuad(), lf::base::RefEl::kSegment(), lf::base::RefEl::kTria(), num_loc_dof_point_, num_loc_dof_quad_, num_loc_dof_segment_, and num_loc_dof_tria_.
|
overridevirtual |
tells the number of degrees of freedom subordinate/_belonging_ to to an entity
entity | reference to an entity of the underlying mesh |
This method informs about the length of the vector returned by GlobalDofIndices().
Implements lf::assemble::DofHandler.
Definition at line 319 of file dofhandler.cc.
References GetNumLocalDofs(), and lf::mesh::Entity::RefEl().
|
delete |
Copy assigning a UniformFEDofHandler doesn't make much sense.
|
default |
Uniform FEDofHandler can be move assigned to.
|
private |
Vector of entities to which global basis functions are associated
Definition at line 444 of file dofhandler.h.
Referenced by Entity(), and initIndexArrays().
|
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().
|
private |
Definition at line 380 of file dofhandler.h.
Referenced by initIndexArrays(), and InitTotalNumDofs().
|
private |
Definition at line 379 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), and NumCoveredDofs().
|
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().
|
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().
|
private |
The total number of degrees of freedom
Definition at line 442 of file dofhandler.h.
Referenced by Entity(), initIndexArrays(), and NumDofs().
|
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().
|
private |
Definition at line 452 of file dofhandler.h.
Referenced by InitTotalNumDofs(), and NumCoveredDofs().
|
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().
|
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().
|
private |
Definition at line 459 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().
|
private |
Definition at line 457 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().
|
private |
Definition at line 458 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().