q4.h

Go to the documentation of this file.
00001 #ifndef __Q4_h
00002 #define __Q4_h
00003 
00004 #include "patchdiscretization.h"
00005 #include "hnstructureq1.h"
00006 
00007 namespace Gascoigne
00008 {
00009 
00010 /**********************************************************/
00011 
00012   class Q4 : public PatchDiscretization
00013   {
00014     protected:
00015       HNStructureQ1 *HN;
00016 
00017       void GlobalToLocalCell(LocalVector& U, const GlobalVector& u, int iq) const;
00018       void LocalToGlobal(MatrixInterface& A, EntryMatrix& E, int iq, double s) const;
00019       void Transformation(FemInterface::Matrix& T, int iq) const;
00020 
00021       nvector<int> GetLocalIndices(int iq) const
00022       {
00023         return *GetPatchMesh()->IndicesOfQ4Patch(iq);
00024       }
00025 
00026     public:
00027       Q4() : PatchDiscretization(), HN(NULL) { }
00028       virtual ~Q4() { }
00029 
00030       void ReInit(const MeshInterface* MP);
00031       void Structure(SparseStructureInterface* S) const;
00032 
00033       void Form(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const;
00034       void AdjointForm(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const;
00035       void BoundaryForm(GlobalVector& f, const GlobalVector& u, const IntSet& Colors, const BoundaryEquation& BE, double d) const;
00036       void Matrix(MatrixInterface& A, const GlobalVector& u, const Equation& EQ, double d) const;
00037       void BoundaryMatrix(MatrixInterface& A, const GlobalVector& u, const IntSet& Colors, const BoundaryEquation& BE, double d) const;
00038       void MassMatrix(MatrixInterface& A) const;
00039       void MassForm(GlobalVector& f, const GlobalVector& u, const TimePattern& TP, double s) const;
00040 
00041       void ComputeError(const GlobalVector& u, LocalVector& err, const ExactSolution* ES) const;
00042 
00043       void Rhs(GlobalVector& f, const DomainRightHandSide& RHS, double s) const;
00044       void BoundaryRhs(GlobalVector& f, const IntSet& Colors,  const BoundaryRightHandSide& NRHS, double s) const;
00045 
00046       void InitFilter(nvector<double>&) const;
00047 
00048       double ComputeBoundaryFunctional(const GlobalVector& u, const IntSet& Colors, const BoundaryFunctional& BF) const;
00049       double ComputeDomainFunctional(const GlobalVector& u, const DomainFunctional& F) const;
00050 
00051       void HNAverage   (GlobalVector& x) const { HN->Average(x); }
00052       void HNDistribute(GlobalVector& x) const { HN->Distribute(x); }
00053       void HNZero      (GlobalVector& x) const { HN->Zero(x); }
00054       bool HNZeroCheck (const GlobalVector& x) const { return HN->ZeroCheck(x); }
00055 
00056       int n() const                { return GetMesh()->nnodes(); }
00057       int nc() const               { return GetMesh()->ncells(); }
00058       int n_withouthanging() const { return GetMesh()->nnodes()-HN->nhnodes(); }
00059 
00060       std::string GetName() const {return "Q4";}
00061   };
00062 
00063 /**********************************************************/
00064 
00065 }
00066 
00067 #endif

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