36 #ifndef EXPRESSION_ADDITION_HPP 37 #define EXPRESSION_ADDITION_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 ExpressionAddition :
public ExpressionBase< ExpressionAddition<LExpressionType, RExpressionType> >
80 typedef ExpressionBase< ExpressionAddition <LExpressionType, RExpressionType> > base_Type;
89 ExpressionAddition (
const LExpressionType& l,
const RExpressionType& r)
90 : base_Type(), M_l (l), M_r (r) {}
93 ExpressionAddition (
const ExpressionAddition<LExpressionType, RExpressionType>& expression)
94 : base_Type(), M_l (expression.M_l), M_r (expression.M_r) {}
97 ~ExpressionAddition() {}
106 static void display (std::ostream& out = std::cout)
108 LExpressionType::display (out);
110 RExpressionType::display (out);
120 const LExpressionType& left()
const 126 const RExpressionType& right()
const 139 ExpressionAddition();
172 template<
typename LExpressionType,
typename RExpressionType >
173 ExpressionAddition<LExpressionType, RExpressionType>
176 return ExpressionAddition<LExpressionType, RExpressionType> (l.cast(), r.cast() );
180 template<
typename LExpressionType >
181 ExpressionAddition<LExpressionType, ExpressionScalar >
184 return ExpressionAddition<LExpressionType, ExpressionScalar> (l.cast(), ExpressionScalar (r) );
187 template<
typename RExpressionType >
188 ExpressionAddition<ExpressionScalar, RExpressionType>
191 return ExpressionAddition<ExpressionScalar, RExpressionType> (ExpressionScalar (l), r.cast() );
195 template<
typename RExpressionType ,
UInt Vdim>
196 ExpressionAddition<ExpressionVector<Vdim>, RExpressionType>
199 return ExpressionAddition<ExpressionVector<Vdim>, RExpressionType> (ExpressionVector<Vdim> (l), r.cast() );
202 template<
typename LExpressionType,
UInt Vdim >
203 ExpressionAddition<LExpressionType, ExpressionVector<Vdim> >
206 return ExpressionAddition<LExpressionType, ExpressionVector<Vdim> > (l.cast(), ExpressionVector<Vdim> (r) );
210 template<
typename RExpressionType ,
UInt Dim1,
UInt Dim2>
211 ExpressionAddition<ExpressionMatrix<Dim1, Dim2>, RExpressionType>
212 operator+ (
const MatrixSmall<Dim1, Dim2>& l,
const ExpressionBase<RExpressionType>& r)
214 return ExpressionAddition<ExpressionMatrix<Dim1, Dim2>, RExpressionType> (ExpressionMatrix<Dim1, Dim2> (l), r.cast() );
217 template<
typename LExpressionType,
UInt Dim1,
UInt Dim2 >
218 ExpressionAddition<LExpressionType, ExpressionMatrix<Dim1, Dim2> >
219 operator+ (
const ExpressionBase<LExpressionType>& l,
const MatrixSmall<Dim1, Dim2>& r)
221 return ExpressionAddition<LExpressionType, ExpressionMatrix<Dim1, Dim2> > (l.cast(), ExpressionMatrix<Dim1, Dim2> (r) );
225 ExpressionAddition< ExpressionMatrix<Dim1, Dim2>, ExpressionMatrix<Dim1, Dim2> >
226 operator+ (
const MatrixSmall<Dim1, Dim2>& l,
const MatrixSmall<Dim1, Dim2>& r)
228 return ExpressionAddition< ExpressionMatrix<Dim1, Dim2>, ExpressionMatrix<Dim1, Dim2> > (ExpressionMatrix<Dim1, Dim2> (l), 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)