36 #ifndef EVALUTATION_FUNCTOR_HPP 37 #define EVALUTATION_FUNCTOR_HPP 40 #include <lifev/core/LifeV.hpp> 42 #include <lifev/eta/expression/ExpressionFunctor.hpp> 44 #include <lifev/core/fem/QuadratureRule.hpp> 50 namespace ExpressionAssembly
71 template <
typename FunctorType,
typename ArgumentEvaluationType>
72 class EvaluationFunctor1
80 typedef typename FunctorType::return_Type return_Type;
104 EvaluationFunctor1 (
const EvaluationFunctor1<FunctorType, ArgumentEvaluationType>& eval)
105 : M_functor (eval.M_functor),
106 M_evaluation (eval.M_evaluation)
110 template<
typename Argument>
111 explicit EvaluationFunctor1 (
const ExpressionFunctor1<FunctorType, Argument>& expression)
112 : M_functor (expression.functor() ),
113 M_evaluation (expression.argument() )
117 ~EvaluationFunctor1()
127 void update (
const UInt& iElement)
129 M_evaluation.update (iElement);
133 static void display (std::ostream& out = std::cout)
136 ArgumentEvaluationType::display (out);
147 template<
typename CFEType >
148 void setGlobalCFE (
const CFEType* globalCFE)
150 M_evaluation.setGlobalCFE (globalCFE);
154 template<
typename CFEType >
155 void setTestCFE (
const CFEType* testCFE)
157 M_evaluation.setTestCFE (testCFE);
161 template<
typename CFEType >
162 void setSolutionCFE (
const CFEType* solutionCFE)
164 M_evaluation.setSolutionCFE (solutionCFE);
170 M_evaluation.setQuadrature (qr);
180 return_Type value_q (
const UInt& q)
const 182 return (*M_functor) (M_evaluation.value_q (q) );
186 return_Type value_qi (
const UInt& q,
const UInt& i)
const 188 return (*M_functor) (M_evaluation.value_qi (q, i) );
192 return_Type value_qij (
const UInt& q,
const UInt& i,
const UInt& j)
const 194 return (*M_functor) (M_evaluation.value_qij (q, i, j) );
205 EvaluationFunctor1();
210 std::shared_ptr<FunctorType> M_functor;
211 ArgumentEvaluationType M_evaluation;
215 template<
typename FunctorType,
typename ArgumentEvaluationType>
216 const flag_Type EvaluationFunctor1<FunctorType, ArgumentEvaluationType>::S_globalUpdateFlag
217 = ArgumentEvaluationType::S_globalUpdateFlag;
219 template<
typename FunctorType,
typename ArgumentEvaluationType>
220 const flag_Type EvaluationFunctor1<FunctorType, ArgumentEvaluationType>::S_testUpdateFlag
221 = ArgumentEvaluationType::S_testUpdateFlag;
223 template<
typename FunctorType,
typename ArgumentEvaluationType>
224 const flag_Type EvaluationFunctor1<FunctorType, ArgumentEvaluationType>::S_solutionUpdateFlag
225 = ArgumentEvaluationType::S_solutionUpdateFlag;
250 template <
typename FunctorType,
typename Argument1EvaluationType,
typename Argument2EvaluationType>
251 class EvaluationFunctor2
259 typedef typename FunctorType::return_Type return_Type;
283 EvaluationFunctor2 (
const EvaluationFunctor2<FunctorType, Argument1EvaluationType, Argument2EvaluationType>& eval)
284 : M_functor (eval.M_functor),
285 M_evaluation1 (eval.M_evaluation1),
286 M_evaluation2 (eval.M_evaluation2)
290 template<
typename Argument1,
typename Argument2>
291 explicit EvaluationFunctor2 (
const ExpressionFunctor2<FunctorType, Argument1, Argument2>& expression)
292 : M_functor (expression.functor() ),
293 M_evaluation1 (expression.argument1() ),
294 M_evaluation2 (expression.argument2() ) {}
297 ~EvaluationFunctor2()
307 void update (
const UInt& iElement)
309 M_evaluation1.update (iElement);
310 M_evaluation2.update (iElement);
314 static void display (std::ostream& out = std::cout)
317 Argument1EvaluationType::display (out);
319 Argument2EvaluationType::display (out);
330 template<
typename CFEType >
331 void setGlobalCFE (
const CFEType* globalCFE)
333 M_evaluation1.setGlobalCFE (globalCFE);
334 M_evaluation2.setGlobalCFE (globalCFE);
338 template<
typename CFEType >
339 void setTestCFE (
const CFEType* testCFE)
341 M_evaluation1.setTestCFE (testCFE);
342 M_evaluation2.setTestCFE (testCFE);
346 template<
typename CFEType >
347 void setSolutionCFE (
const CFEType* solutionCFE)
349 M_evaluation1.setSolutionCFE (solutionCFE);
350 M_evaluation2.setSolutionCFE (solutionCFE);
356 M_evaluation1.setQuadrature (qr);
357 M_evaluation2.setQuadrature (qr);
367 return_Type value_q (
const UInt& q)
const 369 return (*M_functor) (M_evaluation1.value_q (q), M_evaluation2.value_q (q) );
373 return_Type value_qi (
const UInt& q,
const UInt& i)
const 375 return (*M_functor) (M_evaluation1.value_qi (q, i), M_evaluation2.value_qi (q, i) );
379 return_Type value_qij (
const UInt& q,
const UInt& i,
const UInt& j)
const 381 return (*M_functor) (M_evaluation1.value_qij (q, i, j), M_evaluation2.value_qij (q, i, j) );
393 EvaluationFunctor2();
398 std::shared_ptr<FunctorType> M_functor;
399 Argument1EvaluationType M_evaluation1;
400 Argument2EvaluationType M_evaluation2;
404 template<
typename FunctorType,
typename Argument1EvaluationType,
typename Argument2EvaluationType>
405 const flag_Type EvaluationFunctor2<FunctorType, Argument1EvaluationType, Argument2EvaluationType>::S_globalUpdateFlag
406 = Argument1EvaluationType::S_globalUpdateFlag | Argument2EvaluationType::S_globalUpdateFlag;
408 template<
typename FunctorType,
typename Argument1EvaluationType,
typename Argument2EvaluationType>
409 const flag_Type EvaluationFunctor2<FunctorType, Argument1EvaluationType, Argument2EvaluationType>::S_testUpdateFlag
410 = Argument1EvaluationType::S_testUpdateFlag | Argument2EvaluationType::S_testUpdateFlag;
412 template<
typename FunctorType,
typename Argument1EvaluationType,
typename Argument2EvaluationType>
413 const flag_Type EvaluationFunctor2<FunctorType, Argument1EvaluationType, Argument2EvaluationType>::S_solutionUpdateFlag
414 = Argument1EvaluationType::S_solutionUpdateFlag | Argument2EvaluationType::S_solutionUpdateFlag;
uint32_type flag_Type
bit-flag with up to 32 different flags
void updateInverseJacobian(const UInt &iQuadPt)
QuadratureRule - The basis class for storing and accessing quadrature rules.
uint32_type UInt
generic unsigned integer (used mainly for addressing)