finiteelement.h

Go to the documentation of this file.
00001 #ifndef __FiniteElement_h
00002 #define __FiniteElement_h
00003 
00004 #include  "feminterface.h"
00005 
00006 /*-----------------------------------------------------*/
00007 
00008 namespace Gascoigne
00009 {
00010 
00015 
00019 
00020 template<int DIM, int BDIM, class TRAFO, class BASE>
00021 class FiniteElement : public FemInterface
00022 {
00023  protected:
00024 
00025   TRAFO                   T;
00026   BASE                    B;
00027   mutable std::vector<Vertex<DIM> >    grad;
00028   mutable double                  det;
00029 
00030   virtual void ComputeGrad() const;
00031 
00032  public:
00033 
00034   FiniteElement();
00035 
00036   std::string GetName() const {return "FiniteElement";}
00037 
00038   int    n()          const { return B.n(); }
00039   double N   (int i)  const { return B.phi(i); }
00040   double N_x (int i)  const { return grad[i].x(); }
00041   double N_y (int i)  const { return grad[i].y(); }
00042   double N_z (int i)  const { return grad[i].z(); }
00043   double J()          const { return det;}
00044   double G()          const { return T.G();}
00045 
00046   void x     (Vertex<DIM>& v) const { v = T.x();}
00047   void normal(Vertex<DIM>& v) const { v = T.normal();};
00048 
00049   void point(const Vertex<DIM>&) const;
00050   void point_boundary(int ie, const Vertex<BDIM>& s1) const;
00052   void ReInit(const Matrix& M) const { T.ReInit(M); }
00053 
00054   void  init_test_functions(TestFunction& Phi, double w, int i) const;
00055 
00056   void Anisotropy(DoubleMatrix& A) const;
00057 };
00058 }
00059 
00060 /*-----------------------------------------------------*/
00061 
00062 #endif

Generated on Thu Sep 14 10:34:35 2006 for Gascoigne by  doxygen 1.4.7