q1localinterpolation.hh
Go to the documentation of this file.00001
00002
00003 #ifndef DUNE_Q1_LOCALINTERPOLATION_HH
00004 #define DUNE_Q1_LOCALINTERPOLATION_HH
00005
00006 #include <vector>
00007
00008 namespace Dune
00009 {
00010
00012 template<int dim, class LB>
00013 class Q1LocalInterpolation
00014 {
00015 public:
00016
00018 template<typename F, typename C>
00019 void interpolate (const F& f, std::vector<C>& out) const
00020 {
00021 typename LB::Traits::DomainType x;
00022 typename LB::Traits::RangeType y;
00023
00024 out.resize(1<<dim);
00025
00026 for (int i=0; i< (1<<dim); i++) {
00027
00028
00029
00030
00031 for (int j=0; j<dim; j++)
00032 x[j] = (i & (1<<j)) ? 1.0 : 0.0;
00033
00034 f.evaluate(x,y); out[i] = y;
00035
00036 }
00037 }
00038
00039 };
00040 }
00041
00042 #endif