prismp1localinterpolation.hh

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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].