10#include <kernel/space/node_functional_base.hpp>
16 namespace CaiDouSanSheYe
47 static constexpr int max_assigned_dofs = 1;
49 template<
typename Function_>
56 typedef typename Space_::TrafoType TrafoType;
57 typedef typename Space_::ShapeType ShapeType;
58 typedef typename Shape::FaceTraits<ShapeType, ShapeType::dimension-1>::ShapeType FacetType;
60 typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
61 typedef typename TrafoEvalTraits::DataType
DataType;
62 typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
64 static constexpr int image_dim = TrafoEvalTraits::image_dim;
66 typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point>::EvalDataType TrafoEvalData;
68 TrafoEvalType _trafo_eval;
69 DomainPointType _barycentre;
74 _trafo_eval(space.get_trafo())
82 _trafo_eval.prepare(cell_index);
93 return max_assigned_dofs;
96 template<
typename NodeData_,
typename Function_>
97 void operator()(NodeData_& node_data,
const Function_& function)
const
99 static_assert(std::is_base_of<Analytic::Function, Function_>::value,
"invalid function object");
102 typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
105 typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
108 TrafoEvalData trafo_data;
109 _trafo_eval(trafo_data, _barycentre);
112 node_data[0] = func_eval.value(trafo_data.img_point);
131 static constexpr int max_assigned_dofs = 1;
133 template<
typename Function_>
140 typedef typename Space_::TrafoType TrafoType;
141 typedef typename Space_::ShapeType ShapeType;
143 typedef typename TrafoEvalType::EvalTraits TrafoEvalTraits;
144 typedef typename TrafoEvalTraits::DataType
DataType;
145 typedef typename TrafoEvalTraits::DomainPointType DomainPointType;
149 typedef typename TrafoEvalType::template ConfigTraits<TrafoTags::img_point>::EvalDataType TrafoEvalData;
151 TrafoEvalType _trafo_eval;
156 _trafo_eval(space.get_trafo())
163 _trafo_eval.prepare(cell_index);
168 _trafo_eval.finish();
174 return max_assigned_dofs;
177 template<
typename NodeData_,
typename Function_>
178 void operator()(NodeData_& node_data,
const Function_& function)
const
180 static_assert(std::is_base_of<Analytic::Function, Function_>::value,
"invalid function object");
183 typedef Analytic::EvalTraits<DataType_, Function_> FuncEvalTraits;
186 typename Function_::template Evaluator<FuncEvalTraits> func_eval(function);
187 typename FuncEvalTraits::ValueType
value(DataType_(0));
189 TrafoEvalData trafo_data;
192 const DataType g2 =
DataType(FEAT_F128C(0.57735026918962576450914878050195745564760175127));
197 for(
int i(0); i < (1 << shape_dim_); ++i)
201 for(
int j(0); j < shape_dim_; ++j)
202 aux *= (
dom_point[j] = Shape::ReferenceCell<ShapeType>::template vertex<DataType>(i, j) * g2);
204 value += aux * func_eval.value(trafo_data.img_point);
208 node_data[0] = (DataType_(1) / DataType_(1 << shape_dim_)) *
value;
Cai-Douglas-Santos-Sheen-Ye Element Evaluator class template declaration.
Node-functional base class template.
void finish()
Releases the node-functional from the current cell.
DataType_ DataType
data type
void prepare(Index cell_index)
Prepares the node-functional for a given cell.
Null-Node-Functional class template.
int get_num_assigned_dofs() const
Returns the number of assigned dofs on the current cell.
NodeFunctionalBase< Space_, DataType_ > BaseClass
base-class typedef
void operator()(NodeData_ &node_data, const Function_ &function) const
Evaluation operator.
@ value
specifies whether the space should supply basis function values
std::uint64_t Index
Index data type.
@ dom_point
specifies whether the trafo should supply domain point coordinates
Face traits tag struct template.