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/q1tbnp/dof_traits.hpp>
13#include <kernel/space/q1tbnp/evaluator.hpp>
14#include <kernel/space/q1tbnp/node_functional.hpp>
15
16namespace FEAT
17{
18 namespace Space
19 {
23 namespace Q1TBNP
24 {
26 namespace Intern
27 {
28 template<typename Shape_>
29 struct LocalDegree;
30
31 template<int dim_>
32 struct LocalDegree<Shape::Hypercube<dim_>>
33 {
34 static constexpr int value = 2;
35 };
36 } // namespace Intern
38
47 template<typename Trafo_>
48 class Element :
49 public ElementBase<Trafo_>
50 {
51 public:
55 typedef Trafo_ TrafoType;
57 typedef typename TrafoType::MeshType MeshType;
59 typedef typename TrafoType::ShapeType ShapeType;
60
62 static constexpr bool have_node_func = true;
63
65 static constexpr int local_degree = Intern::LocalDegree<ShapeType>::value;
66
68 template<
69 typename TrafoEvaluator_,
70 typename DataType_ = typename TrafoEvaluator_::DataType>
72 {
73 private:
75 typedef typename TrafoEvaluator_::EvalPolicy EvalPolicy;
76
78 static constexpr int num_loc_dofs = Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::count + 2*ShapeType::dimension - 3;
79
82
83 public:
86 };
87
90
92 template<
93 int shape_dim_,
94 typename DataType_ = Real>
96 {
97 public:
100 };
101
103 template<
104 int shape_dim_,
105 typename DataType_ = Real>
107 {
108 private:
110 static constexpr int codim = ShapeType::dimension - shape_dim_;
111
112 public:
115 };
116
117 public:
124 explicit Element(TrafoType& trafo) :
125 BaseClass(trafo)
126 {
127 }
128
130 virtual ~Element()
131 {
132 }
133
136 {
137 // number of DOFs = number of facets in the mesh
138 return this->get_mesh().get_num_entities(ShapeType::dimension - 1)
139 + Index(ShapeType::dimension == 3 ? 3 : 1) * this->get_mesh().get_num_elements();
140 }
141
143 static String name()
144 {
145 return "Q1TBNP";
146 }
147 }; // class Element
148 } // namespace Q1TBNP
149 } // namespace Space
150} // namespace FEAT
Uniform Dof-Assignment class template.
Uniform Dof-Mapping class template.
Finite-Element base class.
MeshType & get_mesh()
Returns a reference to the underlying mesh.
Dof-Assignment class wrapper template.
Definition: element.hpp:96
DofAssignmentUniform< Element, shape_dim_, DataType_, DofTraits, ShapeType > Type
Dof-Assignment type.
Definition: element.hpp:99
Space evaluator class wrapper template.
Definition: element.hpp:72
static constexpr int num_loc_dofs
number of local dofs := number of facets per cell + 2*dim - 3 = 5 in 3D; 9 in 3D
Definition: element.hpp:78
Q1TBNP::Evaluator< Element, TrafoEvaluator_, Traits > Type
space evaluator type
Definition: element.hpp:85
StandardScalarEvalTraits< EvalPolicy, num_loc_dofs, DataType_ > Traits
space evaluation traits
Definition: element.hpp:81
TrafoEvaluator_::EvalPolicy EvalPolicy
evaluation policy
Definition: element.hpp:75
Node-Functional class wrapper template.
Definition: element.hpp:107
static constexpr int codim
co-dimension
Definition: element.hpp:110
Q1TBNP::NodeFunctional< Element, ShapeType, codim, DataType_ > Type
node functional type
Definition: element.hpp:114
Q1TBNP element class template.
Definition: element.hpp:50
TrafoType::ShapeType ShapeType
shape type
Definition: element.hpp:59
Element(TrafoType &trafo)
Constructor.
Definition: element.hpp:124
static constexpr int local_degree
Local Polynomial degree count.
Definition: element.hpp:65
TrafoType::MeshType MeshType
mesh type
Definition: element.hpp:57
static constexpr bool have_node_func
node functionals available
Definition: element.hpp:62
Trafo_ TrafoType
transformation type
Definition: element.hpp:55
ElementBase< Trafo_ > BaseClass
base-class typedef
Definition: element.hpp:53
Index get_num_dofs() const
Returns the number of dofs.
Definition: element.hpp:135
virtual ~Element()
virtual destructor
Definition: element.hpp:130
DofMappingUniform< Element, Q1TBNP::DofTraits, ShapeType > DofMappingType
Dof-Mapping class.
Definition: element.hpp:89
static String name()
Returns the name of the element.
Definition: element.hpp:143
Q1TBNP Element Evaluator class template declaration.
Definition: evaluator.hpp:34
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