30 #if !defined( __FEELPP_VF_OPERATORS2_HPP )
31 #define __FEELPP_VF_OPERATORS2_HPP 1
33 # include <boost/preprocessor/stringize.hpp>
40 template <
class Element1,
class Element2>
45 static const size_type context = vm::JACOBIAN;
47 static const uint16_type imorder = Element1::functionspace_type::basis_type::nOrder+Element2::functionspace_type::basis_type::nOrder;
48 static const bool imIsPoly =
true;
50 typedef Element1 test_element_type;
51 typedef Element2 trial_element_type;
52 typedef OpMass<test_element_type, trial_element_type> this_type;
53 typedef this_type self_type;
55 typedef typename test_element_type::return_value_type return_value_type;
56 typedef typename strongest_numeric_type<
typename test_element_type::value_type,
57 typename trial_element_type::value_type>::type value_type;
59 typedef ublas::matrix<value_type> matrix_type;
61 OpMass ( test_element_type
const& v,
62 trial_element_type
const& u )
66 M_exact_mass( M_v.functionSpace()->basis()->coeff() )
68 DVLOG(2) <<
"[" BOOST_PP_STRINGIZE( OpMass )
"] default constructorn";
70 M_exact_mass = ublas::prod( return_value_type::toMatrix( M_v.functionSpace()->basis()->coeff() ),
71 ublas::trans( return_value_type::toMatrix( M_v.functionSpace()->basis()->coeff() ) ) );
74 OpMass( OpMass
const& op )
78 M_exact_mass( op.M_exact_mass )
81 DVLOG(2) <<
"[" BOOST_PP_STRINGIZE( OpMass )
"] copy constructorn";
85 test_element_type
const& testFunction()
const
89 trial_element_type
const& trialFunction()
const
94 value_type exactMass( uint16_type i, uint16_type j )
const
96 return M_exact_mass( i, j );
98 matrix_type exactMass()
const
103 template<
typename Geo_t,
typename Basis_i_t,
typename Basis_j_t = Basis_i_t>
106 typedef this_type expression_type;
107 typedef Basis_i_t test_basis_context_type;
108 typedef Basis_j_t trial_basis_context_type;
110 typedef typename test_basis_context_type::value_type value_type;
111 typedef typename test_basis_context_type::polyset_type return_value_type;
113 static const uint16_type nComponents = return_value_type::nComponents;
115 tensor( this_type
const& expr,
117 Basis_i_t
const& fev,
118 Basis_j_t
const& feu )
120 M_mat( expr.exactMass() ),
125 void update( Geo_t
const& geom, Basis_i_t
const& fev, Basis_j_t
const& feu )
132 operator()( uint16_type i, uint16_type j )
const
134 return M_mat( i, j );
139 operator()( uint16_type i, uint16_type j,
int q )
const
141 return M_mat( i, j );
145 test_basis_context_type
const& M_fev;
146 trial_basis_context_type
const& M_feu;
148 matrix_type
const& M_mat;
154 test_element_type
const& M_v;
155 trial_element_type
const& M_u;
156 ublas::matrix<value_type> M_exact_mass;
162 template <
class Element1,
class Element2>
163 inline Expr< OpMass< Element1, Element2> >
164 mass( Element1
const& el1, Element2
const& el2 )
166 typedef OpMass< Element1, Element2> expr_t;
167 return Expr< expr_t >( expr_t( el1, el2 ) );