3 #ifndef DUNE_PDELAB_FUNCTION_PRODUCT_HH
4 #define DUNE_PDELAB_FUNCTION_PRODUCT_HH
8 #include <dune/common/fvector.hh>
9 #include <dune/common/static_assert.hh>
10 #include <dune/common/typetraits.hh>
18 template<
typename GF1,
typename GF2,
class =
void>
22 typename GF1::Traits::GridViewType,
23 typename GF1::Traits::RangeFieldType, 1,
24 FieldVector<typename GF1::Traits::RangeFieldType, 1> >,
25 ProductGridFunctionAdapter<GF1,GF2> >
27 dune_static_assert(
unsigned(GF1::Traits::dimRange) ==
28 unsigned(GF2::Traits::dimRange),
29 "ProductGridFunctionAdapter: Operands must have "
30 "matching range dimensions, or one operand must be "
34 typename GF1::Traits::GridViewType,
35 typename GF1::Traits::RangeFieldType, 1,
36 FieldVector<typename GF1::Traits::RangeFieldType, 1> >
T;
46 : gf1(gf1_), gf2(gf2_)
52 typename GF1::Traits::RangeType y1;
54 typename GF2::Traits::RangeType y2;
60 return gf1.getGridView();
63 template<
typename Time>
71 template<
typename GF1,
typename GF2>
75 GF1::Traits::dimRange == 1 && GF2::Traits::dimRange != 1
78 ProductGridFunctionAdapter<GF1,GF2> >
80 typedef typename GF2::Traits T;
90 : gf1(gf1_), gf2(gf2_)
93 void evaluate(
const typename Traits::ElementType &
e,
94 const typename Traits::DomainType &x,
95 typename Traits::RangeType &y)
const {
96 typename GF1::Traits::RangeType y1;
103 return gf1.getGridView();
106 template<
typename Time>
114 template<
typename GF1,
typename GF2>
118 GF1::Traits::dimRange != 1 && GF2::Traits::dimRange == 1
131 #endif // DUNE_PDELAB_FUNCTION_PRODUCT_HH
void setTime(Time time)
Definition: product.hh:107
ProductGridFunctionAdapter(GF1 &gf1_, GF2 &gf2_)
Definition: product.hh:45
GV::Traits::template Codim< 0 >::Entity ElementType
codim 0 entity
Definition: function.hh:118
Base::Traits Traits
Definition: product.hh:87
ProductGridFunctionAdapter(GF1 &gf1, GF2 &gf2)
Definition: product.hh:123
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition: product.hh:49
Dune::FieldVector< GV::Grid::ctype, GV::dimension > DomainType
domain type in dim-size coordinates
Definition: function.hh:49
const Traits::GridViewType & getGridView() const
Definition: product.hh:59
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition: product.hh:93
R RangeType
range type
Definition: function.hh:61
leaf of a function tree
Definition: function.hh:577
ProductGridFunctionAdapter(GF1 &gf1_, GF2 &gf2_)
Definition: product.hh:89
const Traits::GridViewType & getGridView() const
Definition: product.hh:102
void setTime(Time time)
Definition: product.hh:64
traits class holding the function signature, same as in local function
Definition: function.hh:176
T Traits
Export type traits.
Definition: function.hh:192
GV GridViewType
The type of the grid view the function lives on.
Definition: function.hh:115
Product of two GridFunctions.
Definition: product.hh:19
Base::Traits Traits
Definition: product.hh:43
const E & e
Definition: interpolate.hh:172