36 #ifndef EXPRESSION_FUNCTOR_HPP 37 #define EXPRESSION_FUNCTOR_HPP 39 #include <lifev/core/LifeV.hpp> 41 #include <lifev/eta/expression/ExpressionBase.hpp> 42 #include <lifev/eta/expression/ExpressionScalar.hpp> 43 #include <lifev/eta/expression/ExpressionVector.hpp> 45 #include <boost/shared_ptr.hpp> 52 namespace ExpressionAssembly
86 template<
typename FunctorType,
typename ArgumentType >
87 class ExpressionFunctor1 :
public ExpressionBase<ExpressionFunctor1<FunctorType, ArgumentType> >
95 typedef ExpressionBase<ExpressionFunctor1<FunctorType, ArgumentType> > base_Type;
104 ExpressionFunctor1 (std::shared_ptr<FunctorType> fct,
const ArgumentType& arg)
111 ExpressionFunctor1 (
const ExpressionFunctor1<FunctorType, ArgumentType>& expr)
113 M_functor (expr.M_functor),
114 M_argument (expr.M_argument)
118 ~ExpressionFunctor1() {}
127 static void display (std::ostream& out = std::cout)
130 ArgumentType::display (out);
141 std::shared_ptr<FunctorType> functor()
const 147 const ArgumentType& argument()
const 160 ExpressionFunctor1();
165 std::shared_ptr<FunctorType> M_functor;
168 ArgumentType M_argument;
192 template<
typename FunctorType,
typename ArgumentType>
193 inline ExpressionFunctor1<FunctorType, ArgumentType>
194 eval (std::shared_ptr<FunctorType> fct,
const ExpressionBase<ArgumentType>& argument)
196 return ExpressionFunctor1<FunctorType, ArgumentType> (fct, argument.cast() );
199 template<
typename FunctorType>
200 inline ExpressionFunctor1<FunctorType, ExpressionScalar>
201 eval (std::shared_ptr<FunctorType> fct,
const Real& argument)
203 return ExpressionFunctor1<FunctorType, ExpressionScalar> (fct, ExpressionScalar (argument) );
206 template<
typename FunctorType, UInt Vdim>
207 inline ExpressionFunctor1<FunctorType, ExpressionVector<Vdim> >
208 eval (std::shared_ptr<FunctorType> fct,
const VectorSmall<Vdim>& argument)
210 return ExpressionFunctor1<FunctorType, ExpressionVector<Vdim> > (fct, ExpressionVector<Vdim> (argument) );
245 template<
typename FunctorType,
typename ArgumentType1,
typename ArgumentType2 >
246 class ExpressionFunctor2 :
public ExpressionBase<ExpressionFunctor2<FunctorType, ArgumentType1, ArgumentType2> >
254 typedef ExpressionBase<ExpressionFunctor2<FunctorType, ArgumentType1, ArgumentType2> > base_Type;
263 ExpressionFunctor2 (std::shared_ptr<FunctorType> fct,
const ArgumentType1& arg1,
const ArgumentType2& arg2)
271 ExpressionFunctor2 (
const ExpressionFunctor2<FunctorType, ArgumentType1, ArgumentType2>& expr)
273 M_functor (expr.M_functor),
274 M_argument1 (expr.M_argument1),
275 M_argument2 (expr.M_argument2)
279 ~ExpressionFunctor2() {}
288 static void display (std::ostream& out = std::cout)
291 ArgumentType1::display (out);
292 out <<
" , " << ArgumentType2::display (out);
303 std::shared_ptr<FunctorType> functor()
const 309 const ArgumentType1& argument1()
const 315 const ArgumentType2& argument2()
const 328 ExpressionFunctor2();
333 std::shared_ptr<FunctorType> M_functor;
336 ArgumentType1 M_argument1;
337 ArgumentType2 M_argument2;
366 template<
typename FunctorType,
typename ArgumentType1,
typename ArgumentType2>
367 inline ExpressionFunctor2<FunctorType, ArgumentType1, ArgumentType2>
368 eval (std::shared_ptr<FunctorType> fct,
const ArgumentType1& arg1,
const ArgumentType2& arg2)
370 return ExpressionFunctor2<FunctorType, ArgumentType1, ArgumentType2> (fct, arg1, arg2);
void updateInverseJacobian(const UInt &iQuadPt)
class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in ass...