11#ifndef BELFEM_CL_FEM_DOF_HPP
12#define BELFEM_CL_FEM_DOF_HPP
38 const uint mIndexOnEntity ;
46 real mDirichletValue = 0.0 ;
49 bool mFixedFlag =
false;
54 uint mNumberOfSources = 0 ;
55 Dof ** mSources = nullptr ;
56 real * mCoefficients = nullptr ;
70 const uint aIndexOnEdge,
71 const index_t aDofIndexOnField );
79 const index_t aDofIndexOnField );
86 const uint aIndexOnElement,
87 const index_t aDofIndexOnField );
94 const uint aIndexOnFacet,
95 const index_t aDofIndexOnField );
149 fix(
const real aDirichletValue );
351 return mMeshBasis->is_flagged() ;
367 "Tried to access DOF %lu as node, but it is not a node ",
368 (
long unsigned int ) mMyIndex );
370 return reinterpret_cast< mesh::Node *
>( mMeshBasis ) ;
379 "Tried to access DOF %lu as edge, but it is not an edge",
380 (
long unsigned int ) mMyIndex );
382 return reinterpret_cast< mesh::Edge *
>( mMeshBasis ) ;
391 "Tried to access DOF %lu as face, but it is not a Face",
392 (
long unsigned int ) mMyIndex );
394 return reinterpret_cast< mesh::Face *
>( mMeshBasis ) ;
403 "Tried to access DOF %lu as element, but it is not an element ",
404 (
long unsigned int ) mMyIndex );
415 mDirichletValue = aDirichletValue;
440 return mNumberOfSources > 0 ;
448 return mMeshBasis->is_hanging() ;
464 return mMeshBasis->entity_type() ;
505 return mDirichletValue;
514 "Index %u for DOF %lu out of bounds. ( must be less than %u )",
515 (
unsigned int ) aIndex,
516 (
long unsigned int ) this->
id(),
519 return reinterpret_cast< Dof *
>(
mVertices[ aIndex ] );
551 return mIndexOnEntity ;
559 mFieldIndex = aIndex ;
567 return mIndexOnField ;
591 return mNumberOfSources ;
600 "Source index %u out of range for dof %lu (must be < %u).",
601 (
unsigned int ) aIndex,
602 (
long unsigned int ) this->
id(),
603 (
unsigned int ) mNumberOfSources );
605 return mSources[ aIndex ];
614 "Source index %u out of range for dof %lu (must be < %u).",
615 (
unsigned int ) aIndex,
616 (
long unsigned int ) this->
id(),
617 (
unsigned int ) mNumberOfSources );
618 return mCoefficients[ aIndex ];
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Definition cl_FEM_Dof.hpp:28
void fix(const real aDirichletValue)
impose a Diriclet boundary condition on this node
Definition cl_FEM_Dof.hpp:412
Dof * source(const uint aIndex)
Definition cl_FEM_Dof.hpp:597
void reset_sources()
Definition cl_FEM_Dof.cpp:190
void set_sources(Cell< Dof * > &aSources, Vector< real > &aWeights)
Definition cl_FEM_Dof.cpp:114
real & value()
return the Dirichlet value
Definition cl_FEM_Dof.hpp:503
bool basis_is_hanging() const
tells if basis of dof is hanging, needed during initialization
Definition cl_FEM_Dof.hpp:446
void free()
free this dof ( remove Diriclet condition )
Definition cl_FEM_Dof.hpp:421
bool is_cell() const
returns true if this dof is linked to a cell ( element-interior dof )
Definition cl_FEM_Dof.hpp:487
uint number_of_dofs() const
how many dofs are connected to this dof
Definition cl_FEM_Dof.hpp:541
void set_field_index(const index_t aIndex)
Definition cl_FEM_Dof.hpp:557
bool is_node() const
returns true if this dof is linked to a node
Definition cl_FEM_Dof.hpp:454
bool mesh_basis_is_flagged()
Definition cl_FEM_Dof.hpp:349
mesh::Face * face()
expose the face that is linked to this dof
Definition cl_FEM_Dof.hpp:388
bool is_fixed() const
tells if this dof is fixed
Definition cl_FEM_Dof.hpp:430
size_t memory() const
Definition cl_FEM_Dof.cpp:204
index_t field_index() const
returns the index of the field on the mesh
Definition cl_FEM_Dof.hpp:573
real weight(const uint aIndex) const
Definition cl_FEM_Dof.hpp:611
void set_my_index(const index_t aIndex)
set proc local index
Definition cl_FEM_Dof.hpp:533
EntityType entity_type() const
Definition cl_FEM_Dof.hpp:462
index_t dof_index_on_field() const
returns the corresponding index of the dof on the field
Definition cl_FEM_Dof.hpp:565
index_t my_index() const
get proc local index
Definition cl_FEM_Dof.hpp:581
bool is_hanging() const
tells if this dof is hanging
Definition cl_FEM_Dof.hpp:438
bool is_face() const
returns true if this dof is linked to a face
Definition cl_FEM_Dof.hpp:479
Dof * dof(const uint aIndex)
access a dof
Definition cl_FEM_Dof.hpp:511
mesh::Edge * edge()
expose the edge that is linked to this dof
Definition cl_FEM_Dof.hpp:376
uint type_id() const
return the type of this dof
Definition cl_FEM_Dof.hpp:525
void set_source(Dof *aSource, const real aWeight)
Definition cl_FEM_Dof.cpp:176
mesh::Basis * mesh_basis()
Definition cl_FEM_Dof.hpp:357
bool is_edge() const
returns true if this dof is linked to an edge
Definition cl_FEM_Dof.hpp:471
Dof(const id_t aID, const uint aType, mesh::Node *aNode)
Definition cl_FEM_Dof.cpp:20
bool is_lambda() const
returns true if this dof is linked to a facet
Definition cl_FEM_Dof.hpp:495
mesh::Node * node()
expose the node that is linked to this dof
Definition cl_FEM_Dof.hpp:364
uint index_on_entity() const
local index on mesh entity
Definition cl_FEM_Dof.hpp:549
mesh::Element * element()
expose the element that is linked to this dof
Definition cl_FEM_Dof.hpp:400
uint number_of_sources() const
Definition cl_FEM_Dof.hpp:589
Graph node with an adjacency list; the vertex type the graph algorithms operate on.
Definition cl_Graph_Vertex.hpp:32
Vertex ** mVertices
Definition cl_Graph_Vertex.hpp:58
uint32_t mVertexCounter
Definition cl_Graph_Vertex.hpp:55
uint number_of_vertices() const
Definition cl_Graph_Vertex.hpp:321
Definition cl_Mesh_Basis.hpp:33
Special Edge class for NEDELEC-Type elements.
Definition cl_Edge.hpp:30
Definition cl_Face.hpp:29
Definition cl_Facet.hpp:24
Definition cl_IFB_LINE3.hpp:21
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
unsigned int id_t
Definition typedefs.hpp:41
EntityType
Definition Mesh_Enums.hpp:116
@ NODE
Definition Mesh_Enums.hpp:117
@ FACE
Definition Mesh_Enums.hpp:119
@ EDGE
Definition Mesh_Enums.hpp:118
@ FACET
Definition Mesh_Enums.hpp:121
@ CELL
Definition Mesh_Enums.hpp:120
constexpr index_t gNoIndex
Definition typedefs.hpp:57
uint32_t index_t
Definition typedefs.hpp:52
double real
Definition typedefs.hpp:36
#define BELFEM_QUIET_NAN
Definition typedefs.hpp:87