FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
element.hpp
1// FEAT3: Finite Element Analysis Toolbox, Version 3
2// Copyright (C) 2010 by Stefan Turek & the FEAT group
3// FEAT3 is released under the GNU General Public License version 3,
4// see the file 'copyright.txt' in the top level directory for details.
5
6#pragma once
7
8// includes, FEAT
9#include <kernel/space/element_base.hpp>
10#include <kernel/space/dof_assignment_base.hpp>
11#include <kernel/space/dof_mapping_common.hpp>
12#include <kernel/space/cro_rav_ran_tur/dof_traits.hpp>
13#include <kernel/space/cro_rav_ran_tur/evaluator.hpp>
14#include <kernel/space/cro_rav_ran_tur/node_functional.hpp>
15
16namespace FEAT
17{
18 namespace Space
19 {
23 namespace CroRavRanTur
24 {
26 namespace Intern
27 {
28 template<typename Shape_>
29 struct LocalDegree;
30
31 template<int dim_>
32 struct LocalDegree<Shape::Simplex<dim_>>
33 {
34 static constexpr int value = 1;
35 };
36
37 template<int dim_>
38 struct LocalDegree<Shape::Hypercube<dim_>>
39 {
40 static constexpr int value = 2;
41 };
42 } // namespace Intern
44
62 template<typename Trafo_>
63 class Element :
64 public ElementBase<Trafo_>
65 {
66 public:
70 typedef Trafo_ TrafoType;
72 typedef typename TrafoType::MeshType MeshType;
74 typedef typename TrafoType::ShapeType ShapeType;
75
77 static constexpr bool have_node_func = true;
78
80 static constexpr int local_degree = Intern::LocalDegree<ShapeType>::value;
81
83 template<
84 typename TrafoEvaluator_,
85 typename DataType_ = typename TrafoEvaluator_::DataType>
87 {
88 private:
90 typedef typename TrafoEvaluator_::EvalPolicy EvalPolicy;
91
93 static constexpr int num_loc_dofs = Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::count;
94
97
98 public:
101 };
102
105
107 template<
108 int shape_dim_,
109 typename DataType_ = Real>
111 {
112 public:
115 };
116
118 template<
119 int shape_dim_,
120 typename DataType_ = Real>
122 {
123 private:
125 static constexpr int codim = ShapeType::dimension - shape_dim_;
126
127 public:
130 };
131
132 public:
139 explicit Element(TrafoType& trafo)
140 : BaseClass(trafo)
141 {
142 }
143
145 virtual ~Element()
146 {
147 }
148
151 {
152 // number of DOFs = number of facets in the mesh
153 return this->get_mesh().get_num_entities(ShapeType::dimension - 1);
154 }
155
157 static String name()
158 {
159 return "CroRavRanTur";
160 }
161 }; // class Element
162 } // namespace CroRavRanTur
163 } // namespace Space
164} // namespace FEAT
Dof-Assignment class wrapper template.
Definition: element.hpp:111
DofAssignmentUniform< Element, shape_dim_, DataType_, DofTraits, ShapeType > Type
Dof-Assignment type.
Definition: element.hpp:114
Space evaluator class wrapper template.
Definition: element.hpp:87
StandardScalarEvalTraits< EvalPolicy, num_loc_dofs, DataType_ > Traits
space evaluation traits
Definition: element.hpp:96
TrafoEvaluator_::EvalPolicy EvalPolicy
evaluation policy
Definition: element.hpp:90
static constexpr int num_loc_dofs
number of local dofs := number of facets per cell
Definition: element.hpp:93
CroRavRanTur::Evaluator< Element, TrafoEvaluator_, Traits > Type
space evaluator type
Definition: element.hpp:100
Node-Functional class wrapper template.
Definition: element.hpp:122
static constexpr int codim
co-dimension
Definition: element.hpp:125
CroRavRanTur::NodeFunctional< Element, ShapeType, codim, DataType_ > Type
node functional type
Definition: element.hpp:129
Crouzeix-Raviart / Rannacher-Turek element class template.
Definition: element.hpp:65
virtual ~Element()
virtual destructor
Definition: element.hpp:145
Trafo_ TrafoType
transformation type
Definition: element.hpp:70
static constexpr int local_degree
Local Polynomial degree count.
Definition: element.hpp:80
DofMappingSingleEntity< Element, 1 > DofMappingType
Dof-Mapping class.
Definition: element.hpp:104
ElementBase< Trafo_ > BaseClass
base-class typedef
Definition: element.hpp:68
TrafoType::MeshType MeshType
mesh type
Definition: element.hpp:72
TrafoType::ShapeType ShapeType
shape type
Definition: element.hpp:74
static constexpr bool have_node_func
node functionals available
Definition: element.hpp:77
static String name()
Returns the name of the element.
Definition: element.hpp:157
Index get_num_dofs() const
Returns the number of dofs.
Definition: element.hpp:150
Element(TrafoType &trafo)
Constructor.
Definition: element.hpp:139
Crouzeix-Raviart / Rannacher-Turek Element Evaluator class template declaration.
Definition: evaluator.hpp:34
Uniform Dof-Assignment class template.
Single-Entity Dof-Mapping class template.
Finite-Element base class.
MeshType & get_mesh()
Returns a reference to the underlying mesh.
Standard scalar evaluator traits class template.
Definition: base.hpp:44
String class implementation.
Definition: string.hpp:46
FEAT namespace.
Definition: adjactor.hpp:12
double Real
Real data type.
@ value
specifies whether the space should supply basis function values
std::uint64_t Index
Index data type.
Face traits tag struct template.
Definition: shape.hpp:106