p23dlocalinterpolation.hh
Go to the documentation of this file.00001
00002
00003 #ifndef DUNE_P2_3DLOCALINTERPOLATION_HH
00004 #define DUNE_P2_3DLOCALINTERPOLATION_HH
00005
00006 #include <vector>
00007
00008 namespace Dune
00009 {
00010 template<class LB>
00011 class P23DLocalInterpolation
00012 {
00013 public:
00014
00016 template<typename F, typename C>
00017 void interpolate (const F& f, std::vector<C>& out) const
00018 {
00019 typename LB::Traits::RangeType y;
00020
00021 out.resize(10);
00022 typename LB::Traits::DomainType x;
00023
00024 x[0] = 0.0; x[1] = 0.0; x[2] = 0.0;
00025 f.evaluate(x,y); out[0] = y;
00026
00027 x[0] = 1.0; x[1] = 0.0; x[2] = 0.0;
00028 f.evaluate(x,y); out[1] = y;
00029
00030 x[0] = 0.0; x[1] = 1.0; x[2] = 0.0;
00031 f.evaluate(x,y); out[2] = y;
00032
00033 x[0] = 0.0; x[1] = 0.0; x[2] = 1.0;
00034 f.evaluate(x,y); out[3] = y;
00035
00036 x[0] = 0.5; x[1] = 0.0; x[2] = 0.0;
00037 f.evaluate(x,y); out[4] = y;
00038
00039 x[0] = 0.5; x[1] = 0.5; x[2] = 0.0;
00040 f.evaluate(x,y); out[5] = y;
00041
00042 x[0] = 0.0; x[1] = 0.5; x[2] = 0.0;
00043 f.evaluate(x,y); out[6] = y;
00044
00045 x[0] = 0.0; x[1] = 0.0; x[2] = 0.5;
00046 f.evaluate(x,y); out[7] = y;
00047
00048 x[0] = 0.5; x[1] = 0.0; x[2] = 0.5;
00049 f.evaluate(x,y); out[8] = y;
00050
00051 x[0] = 0.0; x[1] = 0.5; x[2] = 0.5;
00052 f.evaluate(x,y); out[9] = y;
00053
00054 }
00055
00056 private:
00057 typename LB::Traits::DomainType x[4];
00058 };
00059 }
00060
00061 #endif