refinedp0localcoefficients.hh

Go to the documentation of this file.
00001 // -*- tab-width: 8; indent-tabs-mode: nil -*-
00002 // vi: set ts=8 sw=2 et sts=2:
00003 #ifndef DUNE_REFINED_P0_LOCALCOEFFICIENTS_HH
00004 #define DUNE_REFINED_P0_LOCALCOEFFICIENTS_HH
00005 
00006 #include <cstddef>
00007 #include <iostream>
00008 #include <vector>
00009 
00010 #include <dune/localfunctions/common/localkey.hh>
00011 
00012 namespace Dune 
00013 {
00014 
00021   template<unsigned int k>
00022   class RefinedP0LocalCoefficients
00023   {
00024       // 2 to the k-th power
00025       enum {N = 1<<k};
00026 
00027   public:
00028     RefinedP0LocalCoefficients () :
00029       localKeys_(N)
00030     {
00031       // All functions are associated to the element
00032       for (int i = 0; i < N; ++i) 
00033         localKeys_[i] = LocalKey(0,0,i);
00034     }
00035 
00037     std::size_t size () const
00038     {
00039       return N;
00040     }
00041 
00043     const LocalKey& localKey (std::size_t i) const
00044     {
00045       return localKeys_[i];
00046     } 
00047 
00048   private:
00049     std::vector<LocalKey> localKeys_;
00050 
00051   };
00052 
00053 }
00054 
00055 #endif
Generated on Sat Apr 24 11:15:35 2010 for dune-localfunctions by  doxygen 1.6.3