![]() |
00001 // Copyright (C) 2004 Johan Hoffman and Anders Logg. 00002 // Licensed under the GNU GPL Version 2. 00003 00004 #ifndef __NEW_PDE_H 00005 #define __NEW_PDE_H 00006 00007 #include <dolfin/constants.h> 00008 #include <dolfin/IndexPair.h> 00009 #include <dolfin/FunctionPair.h> 00010 #include <dolfin/NewArray.h> 00011 00012 namespace dolfin 00013 { 00014 00015 class Cell; 00016 class Function; 00017 00019 00020 class NewPDE 00021 { 00022 public: 00023 00025 NewPDE(unsigned int size, bool interior, bool boundary); 00026 00028 virtual ~NewPDE(); 00029 00031 unsigned int size() const; 00032 00034 bool interior() const; 00035 00037 bool boundary() const; 00038 00040 virtual unsigned int dim() const = 0; 00041 00043 virtual unsigned int dof(unsigned int i, const Cell& cell) const = 0; 00044 00047 virtual const Point& coord(unsigned int i, const Cell& cell) const = 0; 00048 00050 virtual void update(const Cell& cell); 00051 00053 virtual void interiorElementMatrix(real** A) const; 00054 00056 virtual void boundaryElementMatrix(real** A) const; 00057 00059 virtual void interiorElementVector(NewArray<real>& b) const; 00060 00062 virtual void boundaryElementVector(NewArray<real>& b) const; 00063 00065 friend class NewFEM; 00066 00067 protected: 00068 00070 void add(NewArray<real>& w, Function& f); 00071 00073 void updateFunctions(const Cell& cell); 00074 00076 void updateTriLinMap(const Cell& cell); 00077 00079 void updateTetLinMap(const Cell& cell); 00080 00081 // List of nonzero indices 00082 NewArray<IndexPair> nonzero; 00083 00084 // Determinant of Jacobian of map 00085 real det; 00086 00087 // Jacobian of map 00088 real f00, f01, f02, f10, f11, f12, f20, f21, f22; 00089 00090 // Inverse of Jacobian of map 00091 real g00, g01, g02, g10, g11, g12, g20, g21, g22; 00092 00093 // Current time 00094 real t; 00095 00096 private: 00097 00098 // Size of element matrix 00099 unsigned int _size; 00100 00101 // True if form contains integrals over interior of domain 00102 bool _interior; 00103 00104 // True if form contains integrals over boundary of domain 00105 bool _boundary; 00106 00107 // List of function pairs 00108 NewArray<FunctionPair> functions; 00109 00110 }; 00111 00112 } 00113 00114 #endif
Documentation automatically generated with Doxygen on 10 Sep 2004.