3#ifndef DUNE_PDELAB_FUNCTION_PRODUCT_HH
4#define DUNE_PDELAB_FUNCTION_PRODUCT_HH
11#include <dune/pdelab/common/function.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,
45 : gf1(gf1_), gf2(gf2_)
48 void evaluate(
const typename Traits::ElementType &e,
49 const typename Traits::DomainType &x,
50 typename Traits::RangeType &y)
const {
51 typename GF1::Traits::RangeType y1;
53 typename GF2::Traits::RangeType y2;
58 const typename Traits::GridViewType& getGridView()
const {
59 return gf1.getGridView();
62 template<
typename Time>
63 void setTime(Time 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;
101 const typename Traits::GridViewType& getGridView()
const {
102 return gf1.getGridView();
105 template<
typename Time>
106 void setTime(Time time) {
113 template<
typename GF1,
typename GF2>
116 typename
std::enable_if<
117 GF1::Traits::dimRange != 1 && GF2::Traits::dimRange == 1
vector space out of a tensor product of fields.
Definition: fvector.hh:91
leaf of a function tree
Definition: function.hh:302
T Traits
Export type traits.
Definition: function.hh:193
Product of two GridFunctions.
Definition: product.hh:25
Traits for type conversions and type information.
Implements a vector constructed from a given type representing a field and a compile-time given size.
Dune namespace.
Definition: alignedallocator.hh:13
traits class holding the function signature, same as in local function
Definition: function.hh:183