3 #ifndef DUNE_LAGRANGEBASIS_INTERPOLATION_HH
4 #define DUNE_LAGRANGEBASIS_INTERPOLATION_HH
7 #include <dune/geometry/topologyfactory.hh>
13 template<
template <
class,
unsigned int>
class LP,
14 unsigned int dim,
class F >
15 struct LagrangeInterpolationFactory;
20 template<
template <
class,
unsigned int>
class LP,
21 unsigned int dim,
class F >
28 typedef typename LagrangePointSet::Field
Field;
37 : lagrangePoints_( lagrangePoints )
41 return &lagrangePoints_;
45 template<
class Function,
class Fy >
46 void interpolate (
const Function &
function, std::vector< Fy > &coefficients )
const
48 typedef typename LagrangePointSet::iterator Iterator;
50 coefficients.resize( lagrangePoints_.size() );
52 unsigned int index = 0;
53 const Iterator end = lagrangePoints_.end();
54 for( Iterator it = lagrangePoints_.begin(); it != end; ++it )
56 typename Function::RangeType val;
57 function.evaluate( field_cast<typename Function::DomainType::field_type>(it->point()), val );
62 template<
class Matrix,
class Basis >
63 void interpolate (
const Basis &basis, Matrix &coefficients )
const
65 typedef typename LagrangePointSet::iterator Iterator;
67 coefficients.resize( lagrangePoints_.size(), basis.size( ) );
69 unsigned int index = 0;
70 const Iterator end = lagrangePoints_.end();
71 for( Iterator it = lagrangePoints_.begin(); it != end; ++it )
72 basis.template evaluate<0>( it->point(), coefficients.rowPtr( index++ ) );
77 return lagrangePoints_;
85 template<
template <
class,
unsigned int>
class LP,
86 unsigned int dim,
class F >
99 template<
template <
class,
unsigned int>
class LP,
100 unsigned int dim,
class F >
102 public TopologyFactory< LagrangeInterpolationFactoryTraits< LP,dim,F > >
108 template<
class Topology >
112 = Traits::LagrangePointSetFactory::template create< Topology >( key );
113 if ( lagrangeCoeff == 0 )
116 return new Object( *lagrangeCoeff );
118 template<
class Topology >
132 #endif // #ifndef DUNE_LAGRANGEBASIS_INTERPOLATION_HH