1 #ifndef DUNE_FEM_LOCALRESTRICTPROLONG_HH 2 #define DUNE_FEM_LOCALRESTRICTPROLONG_HH 15 template<
class DiscreteFunctionSpace >
23 template<
class DiscreteFunctionSpace >
49 template<
class LFFather,
class LFSon,
class LocalGeometry >
51 const LocalGeometry &geometryInFather,
bool initialize )
const 55 assert( weight > 0.0 );
58 const int numDofs = lfFather.numDofs();
59 assert( lfFather.numDofs() == lfSon.numDofs() );
62 for(
int i = 0; i < numDofs; ++i )
63 lfFather[ i ] = weight * lfSon[ i ];
67 for(
int i = 0; i < numDofs; ++i )
68 lfFather[ i ] += weight * lfSon[ i ];
73 template<
class LFFather,
class LFSon,
class LocalGeometry >
75 const LocalGeometry &geometryInFather,
bool initialize )
const 77 const int numDofs = lfFather.numDofs();
78 assert( lfFather.numDofs() == lfSon.numDofs() );
79 for(
int i = 0; i < numDofs; ++i )
80 lfSon[ i ] = lfFather[ i ];
87 template<
class Entity >
88 static DomainFieldType
calcWeight (
const Entity &father,
const Entity &son )
90 return son.geometry().volume() / father.geometry().volume();
102 template<
class DiscreteFunctionSpace >
121 template<
class LFFather,
class LFSon,
class LocalGeometry >
123 const LocalGeometry &geometryInFather,
bool initialize )
const 127 template<
class LFFather,
class LFSon,
class LocalGeometry >
129 const LocalGeometry &geometryInFather,
bool initialize )
const 140 #endif // #ifndef DUNE_FEM_LOCALRESTRICTPROLONG_HH
bool needCommunication() const
do discrete functions need a communication after restriction / prolongation?
Definition: common/localrestrictprolong.hh:133
DiscreteFunctionSpace DiscreteFunctionSpaceType
Definition: common/localrestrictprolong.hh:29
DomainFieldType weight_
Definition: common/localrestrictprolong.hh:94
DiscreteFunctionSpaceType::DomainFieldType DomainFieldType
Definition: common/localrestrictprolong.hh:110
void setFatherChildWeight(const DomainFieldType &weight)
explicit set volume ratio of son and father
Definition: common/localrestrictprolong.hh:43
DiscreteFunctionSpaceType::DomainFieldType DomainFieldType
Definition: common/localrestrictprolong.hh:31
void prolongLocal(const LFFather &lfFather, LFSon &lfSon, const LocalGeometry &geometryInFather, bool initialize) const
prolong data to children
Definition: common/localrestrictprolong.hh:74
Definition: common/localrestrictprolong.hh:24
bool needCommunication() const
do discrete functions need a communication after restriction / prolongation?
Definition: common/localrestrictprolong.hh:84
void setFatherChildWeight(const DomainFieldType &weight)
explicit set volume ratio of son and father
Definition: common/localrestrictprolong.hh:118
Definition: coordinate.hh:4
Definition: common/localrestrictprolong.hh:103
static DomainFieldType calcWeight(const Entity &father, const Entity &son)
Definition: common/localrestrictprolong.hh:88
void restrictLocal(LFFather &lfFather, const LFSon &lfSon, const LocalGeometry &geometryInFather, bool initialize) const
restrict data to father
Definition: common/localrestrictprolong.hh:50
void prolongLocal(const LFFather &lfFather, LFSon &lfSon, const LocalGeometry &geometryInFather, bool initialize) const
prolong data to children
Definition: common/localrestrictprolong.hh:128
ConstantLocalRestrictProlong()
Definition: common/localrestrictprolong.hh:33
Definition: common/localrestrictprolong.hh:16
void restrictLocal(LFFather &lfFather, const LFSon &lfSon, const LocalGeometry &geometryInFather, bool initialize) const
restrict data to father
Definition: common/localrestrictprolong.hh:122
DiscreteFunctionSpace DiscreteFunctionSpaceType
Definition: common/localrestrictprolong.hh:108