36 #ifndef EXPRESSION_PRODUCT_HPP 37 #define EXPRESSION_PRODUCT_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> 44 #include <lifev/eta/expression/ExpressionMatrix.hpp> 49 namespace ExpressionAssembly
71 template <
typename LExpressionType,
typename RExpressionType>
72 class ExpressionProduct :
public ExpressionBase< ExpressionProduct<LExpressionType, RExpressionType> >
80 typedef ExpressionBase< ExpressionProduct <LExpressionType, RExpressionType> > base_Type;
88 ExpressionProduct (
const LExpressionType& l,
const RExpressionType& r)
89 : base_Type(), M_l (l), M_r (r) {}
92 ExpressionProduct (
const ExpressionProduct<LExpressionType, RExpressionType>& expression)
93 : base_Type(), M_l (expression.M_l), M_r (expression.M_r) {}
96 ~ExpressionProduct() {}
105 static void display (std::ostream& out = std::cout)
107 LExpressionType::display (out);
109 RExpressionType::display (out);
119 const LExpressionType& left()
const 125 const RExpressionType& right()
const 171 template<
typename LExpressionType,
typename RExpressionType >
172 ExpressionProduct<LExpressionType, RExpressionType>
175 return ExpressionProduct<LExpressionType, RExpressionType> (l.cast(), r.cast() );
179 template<
typename RExpressionType >
180 ExpressionProduct<ExpressionScalar, RExpressionType>
183 return ExpressionProduct<ExpressionScalar, RExpressionType> (ExpressionScalar (l), r.cast() );
187 template<
typename LExpressionType >
188 ExpressionProduct<LExpressionType, ExpressionScalar>
191 return ExpressionProduct<LExpressionType, ExpressionScalar> (l.cast(), ExpressionScalar (r) );
195 template<
typename RExpressionType,
UInt Vdim >
196 ExpressionProduct<ExpressionVector<Vdim>, RExpressionType>
199 return ExpressionProduct<ExpressionVector<Vdim>, RExpressionType> (ExpressionVector<Vdim> (l), r.cast() );
203 template<
typename LExpressionType,
UInt Vdim>
204 ExpressionProduct<LExpressionType, ExpressionVector<Vdim> >
207 return ExpressionProduct<LExpressionType, ExpressionVector<Vdim> > (l.cast(), ExpressionVector<Vdim> (r) );
211 template<
typename RExpressionType,
UInt Dim1 ,
UInt Dim2 >
212 ExpressionProduct<ExpressionMatrix<Dim1, Dim2>, RExpressionType>
213 operator* (
const MatrixSmall<Dim1, Dim2>& l,
const ExpressionBase<RExpressionType>& r)
215 return ExpressionProduct<ExpressionMatrix<Dim1, Dim2>, RExpressionType> (ExpressionMatrix<Dim1, Dim2> (l), r.cast() );
219 template<
typename LExpressionType,
UInt Dim1,
UInt Dim2 >
220 ExpressionProduct<LExpressionType, ExpressionMatrix<Dim1, Dim2> >
221 operator* (
const ExpressionBase<LExpressionType>& l,
const MatrixSmall<Dim1, Dim2>& r)
223 return ExpressionProduct<LExpressionType, ExpressionMatrix<Dim1, Dim2> > (l.cast(), ExpressionMatrix<Dim1, Dim2> (r) );
void updateInverseJacobian(const UInt &iQuadPt)
double Real
Generic real data.
class ExpressionBase Base class (static polymorphism, CRTP sense) for all the expressions used in ass...
uint32_type UInt
generic unsigned integer (used mainly for addressing)