![]() |
00001 // Copyright (C) 2003 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __METHOD_H 00005 #define __METHOD_H 00006 00007 #include <dolfin/constants.h> 00008 00009 namespace dolfin { 00010 00011 class Lagrange; 00012 00015 00016 class Method { 00017 public: 00018 00020 Method(unsigned int q); 00021 00023 virtual ~Method(); 00024 00026 inline unsigned int size() const { return n; } 00027 00029 inline unsigned int degree() const { return q; } 00030 00032 inline real point(unsigned int i) const { return points[i]; } 00033 00035 inline real weight(unsigned int i, unsigned int j) const { return weights[i][j]; } 00036 00038 inline real weight(unsigned int i) const { return qweights[i]; } 00039 00041 inline real basis(unsigned int i, real t) const { return trial->eval(i, t); } 00042 00044 inline real derivative(unsigned int i, real t) const { return trial->ddx(i, t); } 00045 00047 inline real derivative(unsigned int i) const { return derivatives[i]; } 00048 00050 virtual void show() const = 0; 00051 00052 protected: 00053 00054 void init(); 00055 00056 virtual void computeQuadrature () = 0; 00057 virtual void computeBasis () = 0; 00058 virtual void computeWeights () = 0; 00059 00060 void computeDerivatives(); 00061 00062 unsigned int q; // Polynomial order 00063 unsigned int n; // Number of nodal points 00064 00065 real* points; 00066 real** weights; 00067 real* qweights; 00068 real* derivatives; 00069 00070 Lagrange* trial; 00071 Lagrange* test; 00072 00073 }; 00074 00075 } 00076 00077 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.