finiteelement.hh
Go to the documentation of this file.00001
00002
00003 #ifndef DUNE_FINITEELEMENT_HH
00004 #define DUNE_FINITEELEMENT_HH
00005
00006 #include <vector>
00007
00008 #include <dune/common/geometrytype.hh>
00009
00010 namespace Dune {
00011
00013
00025 template<typename Imp>
00026 struct FiniteElementTraits
00027 {
00029
00032 typedef typename Imp::Traits::BasisType BasisType;
00033
00035
00042 typedef typename Imp::Traits::CoefficientsType CoefficientsType;
00043
00045
00048 typedef typename Imp::Traits::InterpolationType InterpolationType;
00049 };
00050
00052 template<typename Imp, typename T = FiniteElementTraits<Imp> >
00053 class FiniteElementInterface
00054 {
00055 public:
00057 typedef T Traits;
00058
00060
00064 const typename Traits::BasisType& basis () const
00065 {
00066 return asImp().basis();
00067 }
00068
00070
00074 const typename Traits::CoefficientsType& coefficients () const
00075 {
00076 return asImp().coefficients();
00077 }
00078
00080
00084 const typename Traits::InterpolationType& interpolation () const
00085 {
00086 return asImp().interpolation();
00087 }
00088
00090 GeometryType type () const
00091 {
00092 return asImp().type();
00093 }
00094
00095 private:
00096 Imp& asImp () {return static_cast<Imp &> (*this);}
00097 const Imp& asImp () const {return static_cast<const Imp &>(*this);}
00098 };
00099
00100 }
00101
00102 #endif // DUNE_FINITEELEMENT_HH