1#ifndef DUNE_FEM_SPACE_COMBINEDSPACE_INTERPOLATION_HH
2#define DUNE_FEM_SPACE_COMBINEDSPACE_INTERPOLATION_HH
23 template<
class Space,
int N >
30 RangeConverter ( std::size_t range ) : range_( range ) {}
33 FieldVector< T, 1 > operator() (
const FieldVector< T, N > &
in )
const
38 template<
class T,
int j >
39 FieldMatrix< T, 1, j > operator() (
const FieldMatrix< T, N, j > &
in )
const
48 template <
class DofVector,
class DofAlignment>
49 struct SubDofVectorWrapper
63 typedef typename Space::BasisFunctionSetType::DofAlignmentType DofAlignmentType;
69 :
interpolation_( space.containedSpace().localInterpolation( entity ) ),
70 dofAlignment_( space.basisFunctionSet( entity ).dofAlignment() )
73 template<
class LocalFunction,
class LocalDofVector >
79 template<
class LocalFunction,
class LocalDofVector >
85 for( std::size_t i = 0; i < N; ++i )
87 SubDofVectorWrapper< LocalDofVector, DofAlignmentType > subLdv( ldv, i,
dofAlignment_ );
93 typename Space::ContainedDiscreteFunctionSpaceType::InterpolationImplType
interpolation_;
104 template<
class CombineOp ,
class ... Spaces >
108 typedef std::tuple<
typename Spaces::InterpolationImplType ... > InterpolationTupleType;
110 static const int setSize =
sizeof ... ( Spaces ) -1;
116 struct SummationApply;
118 template<
int,
class CombOp >
121 template<
int counter >
122 struct ApplyBase< counter,
TupleSpaceProduct > :
public ProductApply< counter >{};
124 template<
int counter >
127 template <
int counter >
128 struct Apply :
public ApplyBase< counter, CombineOp > {};
135 "TupleSpaceInterpolation requires Spaces defined over the same grid" );
137 typedef typename std::tuple_element< 0, std::tuple< Spaces ... > >::type::EntityType
EntityType;
149 template<
class LocalFunction,
class LocalDofVector >
164 template<
class CombineOp,
class ... Spaces >
168 static const int rangeOffset = BasisFunctionSetType::RangeIndices::template offset< i >();
169 static const int thisDimRange = BasisFunctionSetType::template SubBasisFunctionSet< i >::type::FunctionSpaceType::dimRange;
175 FieldVector< T, thisDimRange > operator() (
const FieldVector< T, dimRange > &in )
const
177 FieldVector< T, thisDimRange > ret;
182 template<
class T,
int j >
183 FieldMatrix< T, thisDimRange, j > operator() (
const FieldMatrix< T, dimRange, j > &in )
const
185 FieldMatrix< T, thisDimRange, j > ret;
191 template<
class In,
class Out >
192 void apply (
const In &in, Out &out )
const
194 for( std::size_t j = 0; j < thisDimRange; ++j )
195 out[ j ] =
in[ j + rangeOffset ];
199 template<
class Tuple,
class LocalFunction,
class LocalDofVector >
209 template<
class CombineOp,
class ... Spaces >
211 struct TupleSpaceInterpolation< CombineOp, Spaces ... >::SummationApply
213 template<
class Tuple,
class LocalFunction,
class LocalDofVector >
214 static void apply (
const Tuple &tuple,
const BasisFunctionSetType &basisSet,
const LocalFunction &lv, LocalDofVector &ldv )
216 SubVector< LocalDofVector, OffsetSubMapper >
217 subLdv( ldv, OffsetSubMapper( basisSet.template subBasisFunctionSet< i >().size(), basisSet.offset( i ) ) );
218 std::get< i >( tuple ) ( lv, subLdv );
Definition: bindguard.hh:11
LocalFunctionConverter< HostLocalFunction, Converter, __InstationaryFunction::HoldCopy > localFunctionConverter(HostLocalFunction hostLocalFunction, const Converter &converter=Converter())
Definition: converter.hh:199
IteratorRange< typename DF::DofIteratorType > dofs(DF &df)
Iterates over all DOFs.
Definition: rangegenerators.hh:76
static const Point & coordinate(const Point &x)
Definition: coordinate.hh:14
static DUNE_PRIVATE void apply(Args &&... args)
Definition: forloop.hh:23
Definition: utility.hh:147
interface for local functions
Definition: localfunction.hh:77
Definition: space/basisfunctionset/tuple.hh:34
Definition: space/basisfunctionset/tuple.hh:35
Definition: space/basisfunctionset/tuple.hh:39
std::size_t offset(int i) const
return offset of the i-th subbasisfunctionSet in the whole set
Definition: space/basisfunctionset/tuple.hh:418
std::size_t size() const
return size of basis function set
Definition: space/basisfunctionset/tuple.hh:256
static const int dimRange
size of domain space
Definition: space/basisfunctionset/tuple.hh:198
Interface documentation for Dof alignment classes used in VectorialBasisFunctionSet.
Definition: basisfunctionset/vectorial.hh:34
Extract Sub dof vector for single coordinate.
Definition: basisfunctionset/vectorial.hh:179
Definition: combinedspace/interpolation.hh:25
void apply(const LocalFunction &lv, LocalDofVector &ldv) const
Definition: combinedspace/interpolation.hh:80
Space::EntityType EntityType
Definition: combinedspace/interpolation.hh:66
void operator()(const LocalFunction &lv, LocalDofVector &ldv) const
Definition: combinedspace/interpolation.hh:74
DofAlignmentType dofAlignment_
Definition: combinedspace/interpolation.hh:94
Space::ContainedDiscreteFunctionSpaceType::InterpolationImplType interpolation_
Definition: combinedspace/interpolation.hh:93
PowerSpaceInterpolation(const Space &space, const EntityType &entity)
Definition: combinedspace/interpolation.hh:68
Definition: combinedspace/interpolation.hh:106
void unbind()
Definition: combinedspace/interpolation.hh:155
InterpolationTupleType interpolation_
Definition: combinedspace/interpolation.hh:158
std::tuple_element< 0, std::tuple< Spaces... > >::type::EntityType EntityType
Definition: combinedspace/interpolation.hh:137
TupleSpaceInterpolation(std::tuple< const Spaces &... > tuple, const EntityType &entity)
Definition: combinedspace/interpolation.hh:139
void operator()(const LocalFunction &lf, LocalDofVector &ldv) const
Definition: combinedspace/interpolation.hh:150
TupleSpaceInterpolation(const Spaces &... spaces, const EntityType &entity)
Definition: combinedspace/interpolation.hh:144
BasisFunctionSetType basisFunctionSet_
Definition: combinedspace/interpolation.hh:159
Definition: combinedspace/interpolation.hh:173
void apply(const In &in, Out &out) const
Definition: combinedspace/interpolation.hh:192
An implementation of DenseVector to extract a portion, not necessarly contiguos, of a vector.
Definition: subvector.hh:161
Index mapper which simply adds an offset to the index.
Definition: subvector.hh:83