dune-localfunctions
2.2.0
|
00001 // -*- tab-width: 4; indent-tabs-mode: nil -*- 00002 #ifndef DUNE_PYRAMID_P1_LOCALINTERPOLATION_HH 00003 #define DUNE_PYRAMID_P1_LOCALINTERPOLATION_HH 00004 00005 #include <vector> 00006 00007 00008 namespace Dune 00009 { 00010 template<class LB> 00011 class PyramidP1LocalInterpolation 00012 00013 { 00014 public: 00015 PyramidP1LocalInterpolation () 00016 { 00017 x[0][0] = 0.0; x[0][1] = 0.0; x[0][2] = 0.0; 00018 x[1][0] = 1.0; x[1][1] = 0.0; x[1][2] = 0.0; 00019 x[2][0] = 0.0; x[2][1] = 1.0; x[2][2] = 0.0; 00020 x[3][0] = 1.0; x[3][1] = 1.0; x[3][2] = 0.0; 00021 x[4][0] = 0.0; x[4][1] = 0.0; x[4][2] = 1.0; 00022 } 00023 00025 template<typename F, typename C> 00026 void interpolate (const F& f, std::vector<C>& out) const 00027 { 00028 typename LB::Traits::RangeType y; 00029 00030 out.resize(5); 00031 f.evaluate(x[0],y); out[0] = y; 00032 f.evaluate(x[1],y); out[1] = y; 00033 f.evaluate(x[2],y); out[2] = y; 00034 f.evaluate(x[3],y); out[3] = y; 00035 f.evaluate(x[4],y); out[4] = y; 00036 } 00037 private: 00038 typename LB::Traits::DomainType x[5]; 00039 }; 00040 } 00041 00042 #endif