p0localbasis.hh
Go to the documentation of this file.00001
00002 #ifndef DUNE_P0LOCALBASIS_HH
00003 #define DUNE_P0LOCALBASIS_HH
00004
00005 #include <dune/grid/common/referenceelements.hh>
00006
00007 #include <dune/common/fmatrix.hh>
00008
00009 #include <dune/localfunctions/common/localbasis.hh>
00010
00011 namespace Dune
00012 {
00025 template<class D, class R, int d>
00026 class P0LocalBasis
00027 {
00028 public:
00030 typedef LocalBasisTraits<D,d,Dune::FieldVector<D,d>,R,1,Dune::FieldVector<R,1>,
00031 Dune::FieldMatrix<R,1,d>, 0> Traits;
00032
00034 unsigned int size () const
00035 {
00036 return 1;
00037 }
00038
00040 inline void evaluateFunction (const typename Traits::DomainType& in,
00041 std::vector<typename Traits::RangeType>& out) const
00042 {
00043 out.resize(1);
00044 out[0] = 1;
00045 }
00046
00048 inline void
00049 evaluateJacobian (const typename Traits::DomainType& in,
00050 std::vector<typename Traits::JacobianType>& out) const
00051 {
00052 out.resize(1);
00053 for (int i=0; i<d; i++)
00054 out[0][0][i] = 0;
00055 }
00056
00058 unsigned int order () const
00059 {
00060 return 0;
00061 }
00062 };
00063
00064 }
00065
00066 #endif