LehrFEM++ 1.0.0
A simple Finite Element Library for teaching
product_dofhandler.h
1#ifndef PROJECTS_DPG_PRODUCT_DOFHANDLER
2#define PROJECTS_DPG_PRODUCT_DOFHANDLER
3
12#include <lf/assemble/assemble.h>
13#include <lf/mesh/mesh.h>
14
15#include "dpg.h"
16
17namespace projects::dpg {
18
23
75 public:
83 ProductUniformFEDofHandler(std::shared_ptr<const lf::mesh::Mesh> mesh_p,
84 std::vector<dof_map_t> dofmaps);
85
87 [[nodiscard]] size_type NumDofs() const override;
88
95 [[nodiscard]] size_type NumDofs(size_type component) const;
96
97 [[nodiscard]] size_type NumLocalDofs(
98 const lf::mesh::Entity& entity) const override;
99
108 [[nodiscard]] size_type NumLocalDofs(const lf::mesh::Entity& entity,
109 size_type component) const;
110
111 [[nodiscard]] size_type NumInteriorDofs(
112 const lf::mesh::Entity& entity) const override;
113
122 [[nodiscard]] size_type NumInteriorDofs(const lf::mesh::Entity& entity,
123 size_type component) const;
124
126 const lf::mesh::Entity& entity) const override;
127
129 const lf::mesh::Entity& entity) const override;
130
131 [[nodiscard]] const lf::mesh::Entity& Entity(
132 gdof_idx_t dofnum) const override;
133
142 [[nodiscard]] size_type Component(glb_idx_t dofnum) const;
143
144 [[nodiscard]] std::shared_ptr<const lf::mesh::Mesh> Mesh() const override;
145
160 size_type component) const {
161 return *component_dof_handlers_[component];
162 }
163
185 [[nodiscard]] ldof_idx_t LocalStartIndex(const lf::mesh::Entity& entity,
186 size_type component) const;
187
191 [[nodiscard]] size_type NumComponents() const { return num_components_; }
192
208 [[nodiscard]] size_type Offset(size_type component) const {
209 return offsets_[component];
210 }
211
212 private:
216 void initIndexArrays();
217
219 std::shared_ptr<const lf::mesh::Mesh> mesh_p_;
220
222 std::vector<std::shared_ptr<lf::assemble::UniformFEDofHandler>>
224
227
230 // access via dof_[codim][entity_idx][local_idx].
231 std::array<std::vector<std::vector<gdof_idx_t>>, 3> dofs_;
232
235 // access via dof_[codim][entity_idx][local_idx].
236 std::array<std::vector<std::vector<gdof_idx_t>>, 3> internal_dofs_;
237
239 std::vector<glb_idx_t> offsets_;
240};
241
242} // namespace projects::dpg
243
244#endif // PROJECTS_DPG_PRODUCT_DOFHANDLER
A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4....
Definition: dofhandler.h:109
Dofhandler for uniform finite element spaces.
Definition: dofhandler.h:257
std::map< lf::base::RefEl, base::size_type > dof_map_t
Construction from a map object.
Definition: dofhandler.h:274
Interface class representing a topological entity in a cellular complex
Definition: entity.h:39
Dofhandler for uniform finite element spaces that discretizes a cartesian/product space.
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 Offset(size_type component) const
Returns the first/smallest index of a global shape function belonging to a certain component.
std::array< std::vector< std::vector< gdof_idx_t > >, 3 > dofs_
size_type NumInteriorDofs(const lf::mesh::Entity &entity) const override
provides number of shape functions associated with an entity
std::shared_ptr< const lf::mesh::Mesh > Mesh() const override
Acess to underlying mesh object.
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
std::vector< std::shared_ptr< lf::assemble::UniformFEDofHandler > > component_dof_handlers_
const lf::mesh::Entity & Entity(gdof_idx_t dofnum) const override
retrieve unique entity at which a basis function is located
size_type NumComponents() const
returns the number of components of the product space.
void initIndexArrays()
initialization of internal index arrays.
const lf::assemble::UniformFEDofHandler & ComponentDofHandler(size_type component) const
Returns a DofHandler object, that handles degrees of freedoms belonging to a component.
size_type Component(glb_idx_t dofnum) const
retrive the unique index of the component to which a global basis function belongs.
nonstd::span< const gdof_idx_t > InteriorGlobalDofIndices(const lf::mesh::Entity &entity) const override
global indices of shape functions associated with an entity_
std::shared_ptr< const lf::mesh::Mesh > mesh_p_
ldof_idx_t LocalStartIndex(const lf::mesh::Entity &entity, size_type component) const
Returns the first/smallest index of a local shape functions that is associated/subordinate and that b...
ProductUniformFEDofHandler(std::shared_ptr< const lf::mesh::Mesh > mesh_p, std::vector< dof_map_t > dofmaps)
Construction from a vector of map objects.
Contains functionality for the implementation of DPG methods.
Definition: primal_dpg.h:33
lf::uscalfe::gdof_idx_t gdof_idx_t
Type for indices into global matrices/vectors.
Definition: dpg.h:11
lf::uscalfe::ldof_idx_t ldof_idx_t
Type for indices referring to entity matrices/vectors.
Definition: dpg.h:14
lf::uscalfe::size_type size_type
Type for vector length/matrix sizes.
Definition: dpg.h:17
lf::assemble::UniformFEDofHandler::dof_map_t dof_map_t
see lf::assemble
lf::uscalfe::glb_idx_t glb_idx_t
Type for global index of entities.
Definition: dpg.h:23