3 #ifndef DUNE_PDELAB_FUNCTION_PRODUCT_HH 4 #define DUNE_PDELAB_FUNCTION_PRODUCT_HH 8 #include <dune/common/fvector.hh> 9 #include <dune/common/typetraits.hh> 17 template<
typename GF1,
typename GF2,
class =
void>
21 typename GF1::Traits::GridViewType,
22 typename GF1::Traits::RangeFieldType, 1,
23 FieldVector<typename GF1::Traits::RangeFieldType, 1> >,
24 ProductGridFunctionAdapter<GF1,GF2> >
26 static_assert(
unsigned(GF1::Traits::dimRange) ==
27 unsigned(GF2::Traits::dimRange),
28 "ProductGridFunctionAdapter: Operands must have " 29 "matching range dimensions, or one operand must be " 33 typename GF1::Traits::GridViewType,
34 typename GF1::Traits::RangeFieldType, 1,
35 FieldVector<typename GF1::Traits::RangeFieldType, 1> >
T;
45 : gf1(gf1_), gf2(gf2_)
51 typename GF1::Traits::RangeType y1;
53 typename GF2::Traits::RangeType y2;
59 return gf1.getGridView();
62 template<
typename Time>
70 template<
typename GF1,
typename GF2>
73 typename
std::enable_if<
74 GF1::Traits::dimRange == 1 && GF2::Traits::dimRange != 1
77 ProductGridFunctionAdapter<GF1,GF2> >
79 typedef typename GF2::Traits T;
89 : gf1(gf1_), gf2(gf2_)
92 void evaluate(
const typename Traits::ElementType &
e,
93 const typename Traits::DomainType &x,
94 typename Traits::RangeType &y)
const {
95 typename GF1::Traits::RangeType y1;
102 return gf1.getGridView();
105 template<
typename Time>
113 template<
typename GF1,
typename GF2>
116 typename
std::enable_if<
117 GF1::Traits::dimRange != 1 && GF2::Traits::dimRange == 1
130 #endif // DUNE_PDELAB_FUNCTION_PRODUCT_HH R RangeType
range type
Definition: function.hh:61
const Entity & e
Definition: localfunctionspace.hh:120
leaf of a function tree
Definition: function.hh:298
void setTime(Time time)
Definition: product.hh:106
ProductGridFunctionAdapter(GF1 &gf1_, GF2 &gf2_)
Definition: product.hh:88
void setTime(Time time)
Definition: product.hh:63
Product of two GridFunctions.
Definition: product.hh:18
const Traits::GridViewType & getGridView() const
Definition: product.hh:101
Dune::FieldVector< GV::Grid::ctype, GV::dimension > DomainType
domain type in dim-size coordinates
Definition: function.hh:49
GV::Traits::template Codim< 0 >::Entity ElementType
codim 0 entity
Definition: function.hh:118
traits class holding the function signature, same as in local function
Definition: function.hh:176
For backward compatibility – Do not use this!
Definition: adaptivity.hh:28
Base::Traits Traits
Definition: product.hh:86
const Traits::GridViewType & getGridView() const
Definition: product.hh:58
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition: product.hh:48
GV GridViewType
The type of the grid view the function lives on.
Definition: function.hh:115
void evaluate(const typename Traits::ElementType &e, const typename Traits::DomainType &x, typename Traits::RangeType &y) const
Definition: product.hh:92
Base::Traits Traits
Definition: product.hh:42
ProductGridFunctionAdapter(GF1 &gf1, GF2 &gf2)
Definition: product.hh:122
ProductGridFunctionAdapter(GF1 &gf1_, GF2 &gf2_)
Definition: product.hh:44
T Traits
Export type traits.
Definition: function.hh:192