FEAT 3
Finite Element Analysis Toolbox
Loading...
Searching...
No Matches
eval_data.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
10#include <kernel/space/base.hpp>
11#ifndef __CUDA_ARCH__
12#include <kernel/util/math.hpp>
13#endif
14
15namespace FEAT
16{
17 namespace Space
18 {
33 template<
34 typename EvalTraits_,
35 SpaceTags cfg_tags_>
37 {
38 public:
40 typedef typename EvalTraits_::DataType DataType;
41
43 typename EvalTraits_::BasisHessianType hess;
45 typename EvalTraits_::BasisGradientType grad;
47 typename EvalTraits_::BasisValueType value;
48
50 typename EvalTraits_::BasisReferenceHessianType ref_hess;
52 typename EvalTraits_::BasisReferenceGradientType ref_grad;
54 typename EvalTraits_::BasisReferenceValueType ref_value;
55
56 // our space config
57 static constexpr SpaceTags config = cfg_tags_;
58
59#if defined(DEBUG) && !defined(__CUDA_ARCH__)
60 BasisData()
61 {
62 // format all values to NaN
63 const auto qnan = Math::nan<typename EvalTraits_::DataType>();
64 hess = qnan;
65 grad = qnan;
66 value = qnan;
67 ref_hess = qnan;
68 ref_grad = qnan;
69 ref_value = qnan;
70 }
71#endif // DEBUG
72
73 void format()
74 {
75 hess = DataType(0);
76 grad = DataType(0);
77 value = DataType(0);
78 ref_hess = DataType(0);
79 ref_grad = DataType(0);
81 }
82 }; // class BasisData<...>
83
95 template<
96 typename EvalTraits_,
97 SpaceTags cfg_tags_>
99 {
100 public:
101 // union
102 // {
104 typename EvalTraits_::BasisGradientType grad;
106 typename EvalTraits_::BasisReferenceGradientType ref_grad;
107 // };
108 union
109 {
111 typename EvalTraits_::BasisValueType value;
113 typename EvalTraits_::BasisReferenceValueType ref_value = value;
114 };
115
116 // our space config
117 static constexpr SpaceTags config = cfg_tags_;
118
119 BasisDataReduced() : grad(), value() {};
120
121 }; // class BasisData<...>
122
137 template<
138 typename EvalTraits_,
139 SpaceTags cfg_tags_>
141 {
142 public:
144 static constexpr int max_local_dofs = EvalTraits_::max_local_dofs;
145
148
151
152 // our space config
153 static constexpr SpaceTags config = BasisDataType::config;
154 }; // class EvalData<...>
155
170 template<
171 typename EvalTraits_,
172 SpaceTags cfg_tags_>
174 {
175 public:
177 static constexpr int max_local_dofs = EvalTraits_::max_local_dofs;
178
181
182 typedef EvalTraits_ EvalTraits;
183
186
187 // our space config
188 static constexpr SpaceTags config = BasisDataType::config;
189 }; // class EvalData<...>
190 } // namespace Space
191} // namespace FEAT
FEAT Kernel base header.
Basis function evaluation data structure.
Definition: eval_data.hpp:37
EvalTraits_::BasisValueType value
basis function value object
Definition: eval_data.hpp:47
EvalTraits_::BasisReferenceHessianType ref_hess
basis reference hessian object
Definition: eval_data.hpp:50
EvalTraits_::BasisHessianType hess
basis hessian object
Definition: eval_data.hpp:43
EvalTraits_::DataType DataType
the underlying data type
Definition: eval_data.hpp:40
EvalTraits_::BasisGradientType grad
basis gradient object
Definition: eval_data.hpp:45
EvalTraits_::BasisReferenceGradientType ref_grad
basis reference gradient object
Definition: eval_data.hpp:52
EvalTraits_::BasisReferenceValueType ref_value
basis reference value object
Definition: eval_data.hpp:54
Reduced Basis function evaluation data structure.
Definition: eval_data.hpp:99
EvalTraits_::BasisGradientType grad
basis gradient object
Definition: eval_data.hpp:104
EvalTraits_::BasisReferenceGradientType ref_grad
basis reference gradient object
Definition: eval_data.hpp:106
EvalTraits_::BasisReferenceValueType ref_value
basis reference value object
Definition: eval_data.hpp:113
EvalTraits_::BasisValueType value
basis function value object
Definition: eval_data.hpp:111
Space evaluation data structure.
Definition: eval_data.hpp:141
BasisData< EvalTraits_, cfg_tags_ > BasisDataType
basis data type
Definition: eval_data.hpp:147
BasisDataType phi[max_local_dofs]
the basis function data vector
Definition: eval_data.hpp:150
static constexpr int max_local_dofs
maximum number of local dofs
Definition: eval_data.hpp:144
Reduced Space evaluation data structure.
Definition: eval_data.hpp:174
BasisDataType phi[max_local_dofs]
the basis function data vector
Definition: eval_data.hpp:185
static constexpr int max_local_dofs
maximum number of local dofs
Definition: eval_data.hpp:177
BasisDataReduced< EvalTraits_, cfg_tags_ > BasisDataType
basis data type
Definition: eval_data.hpp:180
FEAT namespace.
Definition: adjactor.hpp:12
SpaceTags
Space configuration tags enum.
Definition: eval_tags.hpp:97