discretizationinterface.h

Go to the documentation of this file.
00001 #ifndef  __DiscretizationInterface_h
00002 #define  __DiscretizationInterface_h
00003 
00004 
00005 #include  <string>
00006 #include  "meshinterface.h"
00007 #include  "gascoigne.h"
00008 #include  "equation.h"
00009 #include  "matrixinterface.h"
00010 #include  "dirichletdata.h"
00011 #include  "boundaryrighthandside.h"
00012 #include  "boundaryequation.h"
00013 #include  "exactsolution.h"
00014 #include  "boundaryfunctional.h"
00015 #include  "domainfunctional.h"
00016 #include  "mginterpolatorinterface.h"
00017 #include  "meshtransferinterface.h"
00018 #include  "datacontainer.h"
00019 #include  "paramfile.h"
00020 #include  "pointfunctional.h"
00021 #include  "domainrighthandside.h"
00022 #include  "diracrighthandside.h"
00023 #include  "domainfunction.h"
00024 
00025 namespace Gascoigne
00026 {
00027   
00032 
00036 
00037   class DiscretizationInterface
00038   {
00039     private:
00040 
00041     protected:
00042 
00043     public:
00044       DiscretizationInterface() {}
00045       virtual ~DiscretizationInterface() {}
00046 
00047       virtual const DataContainer& GetDataContainer() const=0;
00048       virtual void SetDataContainer(const DataContainer& q) const=0;
00049 
00050       //
00052       //
00053       virtual std::string GetName() const=0;
00054 
00055       virtual void AddNodeVector(const std::string& name, const GlobalVector* q) const=0;
00056       virtual void DeleteNodeVector(const std::string& name) const=0;
00057 
00058       virtual void AddCellVector(const std::string& name, const GlobalVector* q) const=0;
00059       virtual void DeleteCellVector(const std::string& name) const=0;
00060 
00061       virtual void AddParameterVector(const std::string& name, const GlobalParameterVector* q) const=0;
00062       virtual void DeleteParameterVector(const std::string& name) const=0;
00063 
00064       virtual void BasicInit(const ParamFile* pf)=0;
00065       virtual void ReInit   (const MeshInterface* M)=0;
00066 
00067       virtual int n() const=0;
00068       virtual int nc() const=0;
00069       virtual int n_withouthanging()const {
00070         return n();
00071       }
00072 
00073       virtual void Structure(SparseStructureInterface* S) const=0;
00074       virtual void Form(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const=0;
00075       virtual void Rhs(GlobalVector& f, const DomainRightHandSide& RHS, double s) const=0;
00076       virtual void Matrix(MatrixInterface& A, const GlobalVector& u, const Equation& EQ, double) const=0;
00077 
00078       virtual void AdjointForm(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const {
00079         std::cerr << "\"DiscretizationInterface::AdjointForm\" not written!" << std::endl;
00080         abort();
00081       }
00082       virtual void BoundaryForm(GlobalVector& f, const GlobalVector& u, const IntSet& Colors, 
00083           const BoundaryEquation& BE, double d) const {
00084         std::cerr << "\"DiscretizationInterface::BoundaryForm\" not written!" << std::endl;
00085         abort();
00086       }
00087       virtual void BoundaryMatrix(MatrixInterface& A, const GlobalVector& u, const IntSet& Colors, 
00088           const BoundaryEquation& BE, double d) const {
00089         std::cerr << "\"DiscretizationInterface::BoundaryMatrix\" not written!" << std::endl;
00090         abort();
00091       }
00092       virtual void MassMatrix(MatrixInterface& M) const {
00093         std::cerr << "\"DiscretizationInterface::MassMatrix\" not written!" << std::endl;
00094         abort();
00095       }
00096       virtual void MassForm(GlobalVector& f, const GlobalVector& u, const TimePattern& TP, double s) const {
00097         std::cerr << "\"DiscretizationInterface::MassForm\" not written!" << std::endl;
00098         abort();
00099       }
00100       virtual void DiracRhs(GlobalVector& f, const DiracRightHandSide& DRHS, double s) const {
00101         std::cerr << "\"DiscretizationInterface::DiracRhs\" not written!" << std::endl;
00102         abort();
00103       }         
00104       virtual void BoundaryRhs(GlobalVector& f, const IntSet& Colors,  const BoundaryRightHandSide& NRHS, 
00105           double s) const{
00106         std::cerr << "\"DiscretizationInterface::BoundaryRhs\" not written!" << std::endl;
00107         abort();
00108       }
00109       virtual void HNAverage   (GlobalVector& x) const {}
00110       virtual void HNDistribute(GlobalVector& x) const {}
00111       virtual void HNZero      (GlobalVector& x) const {}
00112       virtual bool HNZeroCheck (const GlobalVector& x) const {
00113         return false;
00114       }
00115       virtual void HNAverageData() const {}
00116       virtual void HNZeroData   () const {}
00117       virtual void Interpolate(GlobalVector& u, const DomainInitialCondition& U) const {
00118         std::cerr << "\"DiscretizationInterface::Interpolate\" not written!" << std::endl;
00119         abort();
00120       }
00121       virtual void InterpolateSolution(GlobalVector& u, const GlobalVector& uold)const {
00122         std::cerr << "\"DiscretizationInterface::InterpolateSolution\" not written!" << std::endl;
00123         abort();
00124       }
00125       virtual void StrongDirichletMatrix(MatrixInterface& A, int col, const std::vector<int>& comp) const {
00126         std::cerr << "\"DiscretizationInterface::StrongDirichletmatrix\" not written!" << std::endl;
00127         abort();
00128       }
00129       virtual void StrongDirichletMatrixOnlyRow(MatrixInterface& A, int col, const std::vector<int>& comp) const {
00130         std::cerr << "\"DiscretizationInterface::StrongDirichletMatrixOnlyRow\" not written!" << std::endl;
00131         abort();
00132       }
00133       virtual void StrongDirichletVector(GlobalVector& u, const DirichletData& BF, int col, const std::vector<int>& comp, double d=1.) const {
00134         std::cerr << "\"DiscretizationInterface::StronDirichletVector\" not written!" << std::endl;
00135         abort();
00136       }
00137       virtual void StrongDirichletVectorZero(GlobalVector& u, int col, const std::vector<int>& comp) const {
00138         std::cerr << "\"DiscretizationInterface::StrongDirichletVectorZero\" not written!" << std::endl;
00139         abort();
00140       }
00141 
00142       virtual void InitFilter(DoubleVector&) const {
00143         std::cerr << "\"DiscretizationInterface::InitFilter\" not written!" << std::endl;
00144         abort();
00145       }
00146                         
00147       virtual void StabForm(GlobalVector& f, const GlobalVector& u, const Equation& EQ, double d) const {
00148         std::cerr << "\"DiscretizationInterface::StabForm\" not written!" << std::endl;
00149         abort();
00150       }
00151 
00152       // Functionals
00153       virtual void ComputeError(const GlobalVector& u, LocalVector& err, const ExactSolution* ES) const{
00154         std::cerr << "\"DiscretizationInterface::ComputeError\" not written!" << std::endl;
00155         abort();
00156       }
00157       virtual void AssembleError(GlobalVector& eta, const GlobalVector& u, LocalVector& err, const ExactSolution* ES) const{
00158         std::cerr << "\"DiscretizationInterface::AssembleError\" not written!" << std::endl;
00159         abort();
00160       }
00161       virtual double ComputeBoundaryFunctional(const GlobalVector& u, const IntSet& Colors, const BoundaryFunctional& BF) const{
00162         std::cerr << "\"DiscretizationInterface::ComputeBoundaryFunctional\" not written!" << std::endl;
00163         abort();
00164       }
00165       virtual double ComputeDomainFunctional(const GlobalVector& u, const DomainFunctional& F) const{
00166         std::cerr << "\"DiscretizationInterface::ComputeDomainFunctional\" not written!" << std::endl;
00167         abort();
00168       }
00169                         
00170       virtual double ComputePointFunctional(const GlobalVector& u, const PointFunctional& FP) const{
00171         std::cerr << "\"DiscretizationInterface::ComputePointFunctional\" not written!" << std::endl;
00172         abort();
00173       }
00174 
00175       virtual void EvaluateCellRightHandSide(GlobalVector& f, const DomainRightHandSide& CF, double d = 1.) const{
00176         std::cerr << "\"DiscretizationInterface::EvaluateCellRighthandside\" not written!" << std::endl;
00177         abort();
00178       }
00179 
00180       virtual void InterpolateDomainFunction(GlobalVector& f, const DomainFunction& DF) const{
00181         std::cerr << "\"DiscretizationInterface::InterpolateDomainFunction\" not written!" << std::endl;
00182         abort();
00183       }
00184 
00185       virtual void InterpolateCellDomainFunction(GlobalVector& f, const DomainFunction& DF) const{
00186         std::cerr << "\"DiscretizationInterface::InterpolateCellDomainFunction\" not written!" << std::endl;
00187         abort();
00188       }
00189                         
00190       virtual void ConstructInterpolator(MgInterpolatorInterface* I, const MeshTransferInterface* MT) {
00191         std::cerr << "\"DiscretizationInterface::ConstructInterpolator\" not written!" << std::endl;
00192         abort();
00193       }
00194 
00195       virtual void GetVolumes(DoubleVector& a) const {
00196         std::cerr << "\"DiscretizationInterface::GetVolumes\" not written!" << std::endl;
00197         abort();
00198       }
00199 
00200       virtual void GetMassDiag(DoubleVector& a) const{
00201         std::cerr << "\"DiscretizationInterface::GetMassDiag\" not written!" << std::endl;
00202         abort();
00203       }
00204 
00205       virtual void GetBoundaryMassDiag(DoubleVector& a) const{
00206         std::cerr << "\"DiscretizationInterface::GetBoundaryMassDiag\" not written!" << std::endl;
00207         abort();
00208       }
00209   };
00210 }
00211 
00212 #endif

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