12#ifndef BELFEM_CL_MESH_BASIS_HPP
13#define BELFEM_CL_MESH_BASIS_HPP
38 uint16_t mNumberOfSources = 0 ;
39 Basis ** mSources = nullptr ;
40 real * mWeights = nullptr ;
42 uint8_t mNumberOfDofs = 0 ;
234 return mNumberOfSources > 0 ;
242 return mNumberOfSources ;
253 BELFEM_ERROR( mNumberOfDofs < std::numeric_limits<
decltype( mNumberOfDofs ) >
::max(),
254 "Dof counter of basis %lu is full ( max %lu )",
255 (
long unsigned int ) this->
id(),
256 (
long unsigned int ) std::numeric_limits<
decltype( mNumberOfDofs ) >
::max() );
266 if( mNumberOfDofs > 0 )
269 std::fill( mDofs, mDofs + mNumberOfDofs,
nullptr );
279 if( mNumberOfDofs > 0 )
292 BELFEM_ERROR( mNumberOfDofs < std::numeric_limits<
decltype( mNumberOfDofs ) >
::max(),
293 "Dof counter of basis %lu is full ( max %lu )",
294 (
long unsigned int ) this->
id(),
295 (
long unsigned int ) std::numeric_limits<
decltype( mNumberOfDofs ) >
::max() );
297 mDofs[ mNumberOfDofs++ ] = aDof ;
305 return mNumberOfDofs ;
313 BELFEM_ASSERT( aIndex < (
uint ) mNumberOfDofs,
"Index %u out of bounds for basis %lu (expect < %u).",
314 (
unsigned int ) aIndex,
315 (
long unsigned int ) this->
id(),
316 (
unsigned int ) mNumberOfDofs );
318 return mDofs[ aIndex ];
326 BELFEM_ASSERT( aIndex < (
uint ) mNumberOfSources,
"Index %u out of bounds for basis %lu (must be < %u).",
327 (
unsigned int ) aIndex,
328 (
long unsigned int ) this->
id(),
329 (
unsigned int ) mNumberOfSources );
331 return mSources[ aIndex ];
339 BELFEM_ASSERT( aIndex < (
uint ) mNumberOfSources,
"Index %u out of bounds for basis %lu (must be < %u).",
340 (
unsigned int ) aIndex,
341 (
long unsigned int ) this->
id(),
342 (
unsigned int ) mNumberOfSources );
344 return mSources[ aIndex ];
352 BELFEM_ASSERT( aIndex < mNumberOfSources,
"Index %u out of bounds for basis %lu (must be < %u).",
353 (
unsigned int ) aIndex,
354 (
long unsigned int ) this->
id(),
355 (
unsigned int ) mNumberOfSources );
357 return mWeights[ aIndex ];
365 BELFEM_ASSERT( aIndex < (
uint ) mNumberOfSources,
"Index %u out of bounds for basis %lu (must be < %u).",
366 (
unsigned int ) aIndex,
367 (
long unsigned int ) this->
id(),
368 (
unsigned int ) mNumberOfSources );
370 mWeights[ aIndex ] = aValue ;
#define BELFEM_ERROR(aCheck,...)
Definition assert.hpp:264
#define BELFEM_ASSERT(aCheck,...)
Definition assert.hpp:244
Cell is a wrapper around the standard vector.
Definition cl_Cell.hpp:42
Graph node with an adjacency list; the vertex type the graph algorithms operate on.
Definition cl_Graph_Vertex.hpp:32
Definition cl_Mesh_Basis.hpp:33
virtual Edge * edge(const uint aIndex)
Definition cl_Mesh_Basis.cpp:124
virtual uint number_of_nodes() const
Definition cl_Mesh_Basis.cpp:76
graph::Vertex * dof(const uint aIndex)
Definition cl_Mesh_Basis.hpp:311
void set_weight(const uint aIndex, const real aValue)
Definition cl_Mesh_Basis.hpp:363
bool is_hanging() const
Definition cl_Mesh_Basis.hpp:232
void insert_dof(graph::Vertex *aDof)
Definition cl_Mesh_Basis.hpp:290
void reset_source_container()
Definition cl_Mesh_Basis.cpp:290
void flag_sources()
Definition cl_Mesh_Basis.cpp:398
void add_source(Basis *aSource, const real aWeight=1.0)
Definition cl_Mesh_Basis.cpp:331
uint number_of_dofs() const
Definition cl_Mesh_Basis.hpp:303
uint number_of_sources() const
Definition cl_Mesh_Basis.hpp:240
void set_sources(Cell< Basis * > &aSources, const Vector< real > &aCoefficients)
Definition cl_Mesh_Basis.cpp:192
virtual Face * face(const uint aIndex=0)
Definition cl_Mesh_Basis.cpp:146
virtual EntityType entity_type() const
returns the type of this vertex
Definition cl_Mesh_Basis.cpp:67
Basis()
Definition cl_Mesh_Basis.cpp:21
void allocate_source_container(uint aNumSources)
Definition cl_Mesh_Basis.cpp:308
virtual Node * node(const uint aIndex)
Definition cl_Mesh_Basis.cpp:103
Node * source_node(const uint aIndex)
Definition cl_Mesh_Basis.cpp:166
virtual uint number_of_elements() const
Definition cl_Mesh_Basis.cpp:49
void reset_dof_container()
Definition cl_Mesh_Basis.hpp:277
virtual uint number_of_edges() const
Definition cl_Mesh_Basis.cpp:85
real weight(const uint aIndex) const
Definition cl_Mesh_Basis.hpp:350
virtual uint number_of_faces() const
Definition cl_Mesh_Basis.cpp:94
Basis * source(const uint aIndex)
Definition cl_Mesh_Basis.hpp:324
virtual Element * element(const uint aIndex)
Definition cl_Mesh_Basis.cpp:58
void increment_dof_counter()
Definition cl_Mesh_Basis.hpp:249
void allocate_dof_container()
Definition cl_Mesh_Basis.hpp:264
Special Edge class for NEDELEC-Type elements.
Definition cl_Edge.hpp:30
Lagrange Element baseclass.
Definition cl_Element.hpp:35
Definition cl_Face.hpp:29
Definition cl_Node.hpp:30
Definition cl_EF_EdgeFunction.hpp:17
USER GUIDES:
Definition cl_Capacitor.cpp:16
unsigned int uint
Definition typedefs.hpp:30
T max(const Vector< T > &aVector)
Definition fn_AR_max.hpp:24
EntityType
Definition Mesh_Enums.hpp:116
double real
Definition typedefs.hpp:36