LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
|
Dofhandler for uniform finite element spaces. More...
#include <lf/assemble/dofhandler.h>
Public Types | |
using | dof_map_t = std::map<lf::base::RefEl, base::size_type> |
Map data type for telling number of global shape functions associated with every topological kind of mesh entity. | |
Public Member Functions | |
UniformFEDofHandler (UniformFEDofHandler &&)=default | |
UniformFEDofHandler can be moved. | |
UniformFEDofHandler (const UniformFEDofHandler &)=delete | |
Copy Construction doesn't make much sense for UniformFEDofHandler. | |
UniformFEDofHandler & | operator= (UniformFEDofHandler &&)=default |
Uniform FEDofHandler can be move assigned to. | |
UniformFEDofHandler & | operator= (const UniformFEDofHandler &)=delete |
Copy assigning a UniformFEDofHandler doesn't make much sense. | |
~UniformFEDofHandler () override=default | |
Virtual Destructor. | |
size_type | NumDofs () const override |
total number of dof's handled by the object | |
size_type | NumLocalDofs (const lf::mesh::Entity &entity) const override |
tells the number of degrees of freedom subordinate/_belonging_ to to an entity | |
size_type | NumInteriorDofs (const lf::mesh::Entity &entity) const override |
provides number of shape functions associated with an entity | |
std::span< const gdof_idx_t > | GlobalDofIndices (const lf::mesh::Entity &entity) const override |
access to indices of global dof's belonging to an entity | |
std::span< const gdof_idx_t > | InteriorGlobalDofIndices (const lf::mesh::Entity &entity) const override |
global indices of shape functions associated with an entity_ | |
const lf::mesh::Entity & | Entity (gdof_idx_t dofnum) const override |
retrieve unique entity at which a basis function is located | |
std::shared_ptr< const lf::mesh::Mesh > | Mesh () const override |
Acess to underlying mesh object. | |
Constructors | |
Construction from local dof layout | |
UniformFEDofHandler (std::shared_ptr< const lf::mesh::Mesh > mesh, dof_map_t dofmap, bool check_edge_orientation=true) | |
Construction from a map object. | |
![]() | |
virtual | ~DofHandler ()=default |
virtual Destructor | |
Private Member Functions | |
void | initIndexArrays () |
initialization of internal index arrays | |
void | InitTotalNumDofs () |
compute number of shape functions covering an entity type | |
std::span< const gdof_idx_t > | GlobalDofIndices (lf::base::RefEl ref_el_type, glb_idx_t entity_index) const |
std::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} |
bool | check_edge_orientation_ |
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} |
Additional Inherited Members | |
![]() | |
DofHandler ()=default | |
Default constructor, can only be called from derived class. | |
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. | |
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 260 of file dofhandler.h.
Map data type for telling number of global shape functions associated with every topological kind of mesh entity.
Ddetailed explanations with examples are given in Paragraph 2.7.4.16 of the Lecture Document.
Definition at line 269 of file dofhandler.h.
lf::assemble::UniformFEDofHandler::UniformFEDofHandler | ( | std::shared_ptr< const lf::mesh::Mesh > | mesh, |
dof_map_t | dofmap, | ||
bool | check_edge_orientation = true ) |
Construction from a map object.
mesh | (shared) pointer to underlying mesh |
dofmap | map telling number of interior dofs for every type of entity |
check_edge_orientation | if true, reverse ordering of local d.o.f.s in case of negative orientation of the edge. |
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.
In the case of Lagrangian fintie element space of polynomial degree \(\geq 3\) several global shape functions are associated with every edge. Conveniently, they are numbered based on the orientation/direction of the edge. In case the local and global orientations do not match, this will lead to a wrong local -> global index mapping.
The following example demonstrates this for a mesh consisting of two triangles and cubic Lagrangian finite elements. the indices of global shape functions are written in red, those of the local shape functions in light blue for the left triangle, in dark blue for the right triangle. The ordering of the shape functions associated with the common edge id different for the two triangles.
If the flag check_edge_orientation is set, then the member functions GlobalDofIndices and InteriorGlobalDofIndices (when called for a cell) will reverse the ordering of edge-internal d.o.f.s, if the relative orientation of the edge is negative.
Definition at line 86 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), 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 376 of file dofhandler.h.
References lf::assemble::AssembleMatrixLocally(), dof_entities_, and num_dof_.
|
inlineprivate |
Definition at line 411 of file dofhandler.h.
References lf::assemble::AssembleMatrixLocally(), and 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 302 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), GlobalDofIndices(), and mesh_.
Referenced by GlobalDofIndices().
|
private |
Definition at line 286 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), dofs_, mesh_, num_dofs_, and NumCoveredDofs().
|
private |
initialization of internal index arrays
Definition at line 142 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), check_edge_orientation_, dof_entities_, dofs_, kCellOrd, kEdgeOrd, kNodeOrd, lf::base::RefEl::kQuad(), lf::base::RefEl::kTria(), mesh_, num_dof_, num_dofs_, num_loc_dof_point_, num_loc_dof_quad_, num_loc_dof_segment_, num_loc_dof_tria_, and lf::mesh::positive.
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 131 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 325 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), InteriorGlobalDofIndices(), and mesh_.
Referenced by InteriorGlobalDofIndices().
|
private |
Definition at line 307 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), 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 385 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 424 of file dofhandler.h.
References lf::assemble::AssembleMatrixLocally(), 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 336 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 335 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), and NumInteriorDofs().
Referenced by InteriorGlobalDofIndices(), and NumInteriorDofs().
|
inlineprivate |
Number of interior shape functions for an entity type
Definition at line 452 of file dofhandler.h.
References lf::assemble::AssembleMatrixLocally(), 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 330 of file dofhandler.cc.
References lf::assemble::AssembleMatrixLocally(), and GetNumLocalDofs().
|
delete |
Copy assigning a UniformFEDofHandler doesn't make much sense.
|
default |
Uniform FEDofHandler can be move assigned to.
|
private |
Flag for reversing numbering of internal edge d.o.f.s
Definition at line 502 of file dofhandler.h.
Referenced by initIndexArrays().
|
private |
Vector of entities to which global basis functions are associated
Definition at line 484 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 487 of file dofhandler.h.
Referenced by GlobalDofIndices(), initIndexArrays(), and InteriorGlobalDofIndices().
|
private |
Definition at line 420 of file dofhandler.h.
Referenced by initIndexArrays(), and InitTotalNumDofs().
|
private |
Definition at line 419 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), and NumCoveredDofs().
|
private |
co-dimensions of different geometric entities in a 2D mesh
Definition at line 418 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), and NumCoveredDofs().
|
private |
The mesh on which the degrees of freedom are defined
Definition at line 480 of file dofhandler.h.
Referenced by GlobalDofIndices(), GlobalDofIndices(), initIndexArrays(), InteriorGlobalDofIndices(), InteriorGlobalDofIndices(), Mesh(), and UniformFEDofHandler().
|
private |
The total number of degrees of freedom
Definition at line 482 of file dofhandler.h.
Referenced by Entity(), initIndexArrays(), and NumDofs().
|
private |
Number of dofs covering entities of a particular type
Definition at line 489 of file dofhandler.h.
Referenced by GlobalDofIndices(), initIndexArrays(), InitTotalNumDofs(), InteriorGlobalDofIndices(), and NumCoveredDofs().
|
private |
Definition at line 492 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 492 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 496 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().
|
private |
Definition at line 499 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().
|
private |
Definition at line 497 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().
|
private |
Definition at line 498 of file dofhandler.h.
Referenced by initIndexArrays(), InitTotalNumDofs(), NumInteriorDofs(), and UniformFEDofHandler().