44 template<
typename ExprT>
49 static const size_type context = ExprT::context;
50 static const bool is_terminal =
false;
52 static const uint16_type imorder = ExprT::imorder;
53 static const bool imIsPoly = ExprT::imIsPoly;
55 template<
typename Func>
56 struct HasTestFunction
58 static const bool result = ExprT::template HasTestFunction<Func>::result;
61 template<
typename Func>
62 struct HasTrialFunction
64 static const bool result = ExprT::template HasTrialFunction<Func>::result;
72 typedef ExprT expression_type;
73 typedef typename expression_type::value_type value_type;
74 typedef Trace<ExprT> this_type;
83 explicit Trace( expression_type
const & __expr )
87 Trace( Trace
const & te )
121 expression_type
const& expression()
const
129 template<
typename Geo_t,
typename Basis_i_t,
typename Basis_j_t>
132 typedef typename expression_type::template tensor<Geo_t, Basis_i_t, Basis_j_t> tensor_expr_type;
133 typedef typename tensor_expr_type::value_type value_type;
135 typedef typename tensor_expr_type::shape expr_shape;
136 BOOST_MPL_ASSERT_MSG( ( boost::is_same<mpl::int_<expr_shape::M>,mpl::int_<expr_shape::N> >::value ), INVALID_TENSOR_SHOULD_BE_RANK_2_OR_0, ( mpl::int_<expr_shape::M>, mpl::int_<expr_shape::N> ) );
137 typedef Shape<expr_shape::nDim,Scalar,false,false> shape;
140 template <
class Args>
struct sig
142 typedef value_type type;
147 static const bool value = tensor_expr_type::is_zero::value;
150 tensor( this_type
const& expr,
151 Geo_t
const& geom, Basis_i_t
const& fev, Basis_j_t
const& feu )
153 M_tensor_expr( expr.expression(), geom, fev, feu )
157 tensor( this_type
const& expr,
158 Geo_t
const& geom, Basis_i_t
const& fev )
160 M_tensor_expr( expr.expression(), geom, fev )
164 tensor( this_type
const& expr, Geo_t
const& geom )
166 M_tensor_expr( expr.expression(), geom )
169 template<
typename IM>
170 void init( IM
const& im )
172 M_tensor_expr.init( im );
174 void update( Geo_t
const& geom, Basis_i_t
const& fev, Basis_j_t
const& feu )
176 M_tensor_expr.update( geom, fev, feu );
178 void update( Geo_t
const& geom, Basis_i_t
const& fev )
180 M_tensor_expr.update( geom, fev );
182 void update( Geo_t
const& geom )
184 M_tensor_expr.update( geom );
186 void update( Geo_t
const& geom, uint16_type face )
188 M_tensor_expr.update( geom, face );
193 evalij( uint16_type i, uint16_type j )
const
195 return M_tensor_expr.evalij( i, j );
200 evalijq( uint16_type i, uint16_type j, uint16_type , uint16_type , uint16_type q )
const
202 value_type res = value_type( 0 );
204 for ( uint16_type l = 0; l < expr_shape::M; ++l )
205 res += M_tensor_expr.evalijq( i, j, l, l, q );
209 template<
int PatternContext>
211 evalijq( uint16_type i, uint16_type j, uint16_type , uint16_type , uint16_type q,
212 mpl::int_<PatternContext> )
const
214 value_type res = value_type( 0 );
216 for ( uint16_type l = 0; l < expr_shape::M; ++l )
217 res += M_tensor_expr.evalijq( i, j, l, l, q, mpl::int_<PatternContext>() );
223 evaliq( uint16_type i, uint16_type , uint16_type , uint16_type q )
const
225 value_type res = value_type( 0 );
227 for ( uint16_type l = 0; l < expr_shape::M; ++l )
228 res += M_tensor_expr.evaliq( i, l, l, q );
234 evalq( uint16_type , uint16_type , uint16_type q )
const
236 value_type res = value_type( 0 );
238 for ( uint16_type l = 0; l < expr_shape::M; ++l )
239 res += M_tensor_expr.evalq( l, l, q );
244 tensor_expr_type M_tensor_expr;
248 mutable expression_type M_expr;
255 template<
typename ExprT>
260 typedef Trace<ExprT> trace_t;
261 return Expr< trace_t >( trace_t( v ) );