celldiscretization.h

Go to the documentation of this file.
00001 #ifndef  __CellDiscretization_h
00002 #define  __CellDiscretization_h
00003 
00004 #include  "basicdiscretization.h"
00005 #include  "hierarchicalmesh.h"
00006 
00007 namespace Gascoigne
00008 {
00009 
00017 
00018 class CellDiscretization : public BasicDiscretization
00019 {
00020 protected:
00021 
00022   FemInterface*         __FEM;
00023   IntegratorInterface*  __INT;
00024 
00025   const FemInterface* GetFem() const {assert(__FEM); return __FEM;}
00026   const IntegratorInterface* GetIntegrator() const {assert(__INT); return __INT;}
00027   IntegratorInterface*& GetIntegratorPointer() {return __INT;}
00028   FemInterface*& GetFemPointer() {return __FEM;}
00029 
00030   virtual void Transformation(FemInterface::Matrix& T, int iq) const;
00031 
00032   double ComputePointValue(const GlobalVector& u, const Vertex2d& p0,int comp) const;
00033   double ComputePointValue(const GlobalVector& u, const Vertex3d& p0,int comp) const; 
00034 
00035   virtual int GetCellNumber(const Vertex2d& p0, Vertex2d& p) const { assert(0); }
00036   virtual int GetCellNumber(const Vertex3d& p0, Vertex3d& p) const { assert(0); }
00037 
00039 
00040   void Transformation_HM(FemInterface::Matrix& T, const HierarchicalMesh* HM, int iq) const;
00041   void GlobalToLocal_HM(LocalVector& U, const GlobalVector& u, const HierarchicalMesh* HM, int iq) const;
00042   void swapIndices(IntVector& indices) const;
00043   
00044   virtual void DiracRhsPoint(GlobalVector& f,const DiracRightHandSide& DRHS,const Vertex2d& p0,int i,double s) const;
00045   virtual void DiracRhsPoint(GlobalVector& f,const DiracRightHandSide& DRHS,const Vertex3d& p0,int i,double s) const;
00046 
00047 
00048 public:
00049 
00050   //
00052   //
00053 
00054   CellDiscretization() : BasicDiscretization(), __FEM(NULL), __INT(NULL) {}
00055   ~CellDiscretization(){
00056     if(__FEM) {delete __FEM; __FEM=NULL;}
00057     if(__INT) {delete __INT; __INT=NULL;}
00058   }
00059 
00060   std::string GetName() const {return "CellDiscretization";}
00061 
00062   void Structure(SparseStructureInterface* S) const;
00063 
00064   void Form(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const;
00065   void AdjointForm(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const;
00066   void BoundaryForm(GlobalVector& f, const GlobalVector& u, const IntSet& Colors, const BoundaryEquation& BE, double d) const;
00067   void Matrix(MatrixInterface& A, const GlobalVector& u, const Equation& EQ, double) const;
00068   void BoundaryMatrix(MatrixInterface& A, const GlobalVector& u, const IntSet& Colors, const BoundaryEquation& BE, double d) const;
00069   void MassMatrix(MatrixInterface& M) const;
00070   void MassForm(GlobalVector& f, const GlobalVector& u, const TimePattern& TP, double s) const;
00071 
00072   void ComputeError(const GlobalVector& u, LocalVector& err, const ExactSolution* ES) const;
00073   void AssembleError(GlobalVector& eta, const GlobalVector& u, LocalVector& err, const ExactSolution* ES) const;
00074 
00075   void Rhs(GlobalVector& f, const DomainRightHandSide& RHS, double s) const;
00076   void DiracRhs(GlobalVector& f, const DiracRightHandSide& DRHS, double s) const;
00077 
00078   void BoundaryRhs(GlobalVector& f, const IntSet& Colors,  const BoundaryRightHandSide& NRHS, double s) const;
00079 
00080   void InitFilter(DoubleVector&) const;
00081 
00082   // Functionals
00083   double ComputeBoundaryFunctional(const GlobalVector& u, const IntSet& Colors, const BoundaryFunctional& BF) const;
00084   double ComputeDomainFunctional(const GlobalVector& u, const DomainFunctional& F) const;
00085 
00086   double ComputePointFunctional(const GlobalVector& u, const PointFunctional& FP) const;
00087 
00088   void EvaluateCellRightHandSide(GlobalVector& f, const DomainRightHandSide& CF, double d) const;
00089 
00090   void InterpolateDomainFunction(GlobalVector& f, const DomainFunction& DF) const;
00091   void InterpolateCellDomainFunction(GlobalVector& f, const DomainFunction& DF) const;
00092 
00093   virtual nmatrix<double> GetLocalInterpolationWeights() const { assert(0); return nmatrix<double>();}
00094 
00095   void GetVolumes(DoubleVector& a) const;
00096   void GetMassDiag(DoubleVector& a) const;
00097   void GetBoundaryMassDiag(DoubleVector& a) const;      
00098 };
00099 }
00100 
00101 #endif

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