15#include "dofhandler.h"
17#include "lf/mesh/entity.h"
35 stream <<
"DofHandler(" << dof_handler.
NumDofs() <<
" dofs)";
48 const std::span<const gdof_idx_t> doflist(
51 stream << *e <<
' ' << e_idx <<
": " << no_dofs <<
" dofs = [";
58 const std::span<const gdof_idx_t> intdoflist(
62 stream << int_dof <<
' ';
75 stream <<
"dof " << dof_idx <<
" -> " << e <<
" " <<
mesh->Index(e)
88 bool check_edge_orientation)
92 LF_ASSERT_MSG((
mesh_->DimMesh() == 2),
"Can handle 2D meshes only");
95 auto map_end = dofmap.end();
99 if (map_el_pt != map_end) {
105 if (map_el_ed != map_end) {
111 if (map_el_tr != map_end) {
117 if (map_el_qd != map_end) {
153 for (
glb_idx_t node_idx = 0; node_idx < no_nodes; node_idx++) {
155 LF_ASSERT_MSG(
mesh_->Index(*node_p) == node_idx,
"Node index mismatch");
175 for (
glb_idx_t edge_idx = 0; edge_idx < no_edges; edge_idx++) {
178 LF_ASSERT_MSG(
mesh_->Index(*edge_p) == edge_idx,
"Edge index mismatch");
213 for (
glb_idx_t cell_idx = 0; cell_idx < no_cells; cell_idx++) {
216 LF_ASSERT_MSG(cell_idx ==
mesh_->Index(*cell_p),
"cell index mismatch");
233 const std::span<const lf::mesh::Orientation> edge_orientations =
234 cell_p->RelativeOrientations();
235 auto edges = cell_p->SubEntities(1);
237 const size_type no_edges_cell = cell_p->RefEl().NumSubEntities(1);
238 for (
int ed_sub_idx = 0; ed_sub_idx < no_edges_cell; ed_sub_idx++) {
249 for (
int j = 0; j < no_int_dof_edge; j++) {
256 for (
int j =
static_cast<int>(no_int_dof_edge - 1); j >= 0; j--) {
272 false,
"Illegal cell type; only triangles and quads are supported");
276 for (
unsigned j = 0; j < num_int_dofs_cell; j++) {
292 LF_ASSERT_MSG((
mesh_->NumEntities(codim) > entity_index),
293 "Index " << entity_index <<
" out of range");
296 dofs_[codim].data() +
297 (
static_cast<std::size_t
>(
num_dofs_[codim]) * entity_index);
298 const gdof_idx_t *end = begin + no_covered_dofs;
314 LF_ASSERT_MSG((
mesh_->NumEntities(codim) > entity_index),
315 "Index " << entity_index <<
" out of range");
318 dofs_[codim].data() +
319 (
static_cast<std::size_t
>(
num_dofs_[codim]) * entity_index);
320 const gdof_idx_t *end = begin + no_covered_dofs;
321 begin += (no_covered_dofs - no_loc_dofs);
356 offsets_[codim][entity_index + 1] - idx_offset;
359 const gdof_idx_t *end = begin + no_covered_dofs;
375 offsets_[codim][entity_index + 1] - idx_offset;
380 const gdof_idx_t *end = begin + no_covered_dofs;
383 begin += (no_covered_dofs - no_loc_dofs);
A general (interface) class for DOF handling, see Lecture Document Paragraph 2.7.4....
virtual std::shared_ptr< const lf::mesh::Mesh > Mesh() const =0
Acess to underlying mesh object.
virtual const lf::mesh::Entity & Entity(gdof_idx_t dofnum) const =0
retrieve unique entity at which a basis function is located
virtual std::span< const gdof_idx_t > GlobalDofIndices(const lf::mesh::Entity &entity) const =0
access to indices of global dof's belonging to an entity
virtual std::span< const gdof_idx_t > InteriorGlobalDofIndices(const lf::mesh::Entity &entity) const =0
global indices of shape functions associated with an entity_
virtual size_type NumLocalDofs(const lf::mesh::Entity &entity) const =0
tells the number of degrees of freedom subordinate/_belonging_ to to an entity
virtual size_type NumDofs() const =0
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
std::shared_ptr< const lf::mesh::Mesh > mesh_p_
std::span< const gdof_idx_t > InteriorGlobalDofIndices(const lf::mesh::Entity &entity) const override
global indices 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::array< std::vector< size_type >, 3 > offsets_
size_type NumLocalDofs(const lf::mesh::Entity &entity) const override
tells the number of degrees of freedom subordinate/_belonging_ to to an entity
std::array< std::vector< gdof_idx_t >, 3 > dofs_
std::array< std::vector< size_type >, 3 > num_int_dofs_
Represents a reference element with all its properties.
static constexpr RefEl kSegment()
Returns the (1-dimensional) reference segment.
constexpr dim_t Dimension() const
Return the dimension of this reference element.
static constexpr RefEl kPoint()
Returns the (0-dimensional) reference point.
static constexpr RefEl kTria()
Returns the reference triangle.
static constexpr RefEl kQuad()
Returns the reference quadrilateral.
Interface class representing a topological entity in a cellular complex
virtual std::span< const Entity *const > SubEntities(unsigned rel_codim) const =0
Return all sub entities of this entity that have the given codimension (w.r.t. this entity!...
virtual base::RefEl RefEl() const =0
Describes the reference element type of this entity.
unsigned int dim_t
type for dimensions and co-dimensions and numbers derived from them
unsigned int glb_idx_t
type for global index of mesh entities (nodes, edges, cells)
D.o.f. index mapping and assembly facilities.
lf::base::glb_idx_t glb_idx_t
lf::base::size_type size_type
void PrintInfo(std::ostream &stream, const DofHandler &dof_handler, unsigned ctrl)
std::ostream & operator<<(std::ostream &o, const COOMatrix< SCALARTYPE > &mat)
Defines a set of interface classes that define a mesh manager and provides mesh-related tools that bu...