basicloop.h

Go to the documentation of this file.
00001 #ifndef  __BasicLoop_h
00002 #define  __BasicLoop_h
00003 
00004 #include  "extrapolator.h"
00005 #include  "multilevelsolverinterface.h"
00006 #include  "adaptordata.h"
00007 #include  "meshagentinterface.h"
00008 #include  "monitor.h"
00009 #include  "visualization.h"
00010 #include  "visudatacompvector.h"
00011 #include  "visudatanvector.h"
00012 
00013 #include  "problemdescriptorinterface.h"
00014 #include  "functionalcontainer.h"
00015 #include  "stdiomanager.h"
00016 #include  "stopwatch.h"
00017 #include  "paramfile.h"
00018 #include  "vectorinterface.h"
00019 #include  "solverinfos.h"
00020 
00021 /*-----------------------------------------*/
00022 
00023 namespace Gascoigne
00024 {
00025 
00027 //
00030 
00034 
00035 class BasicLoop
00036 {
00037 private:
00038 
00039   MeshAgentInterface*        _MA;
00040   MultiLevelSolverInterface* _ML;
00041   SolverInfos*               _SI;
00042   
00043   void WriteMeshAndSolution(const std::string& filename, const VectorInterface& u) const;
00044   void WriteSolution(const VectorInterface& u) const;
00045   void WriteMesh() const;
00046   void WriteMeshInp(const std::string& name) const;
00047 
00048 protected:
00049 
00050 
00051   MeshAgentInterface*& GetMeshAgentPointer() { return _MA;}
00052   MultiLevelSolverInterface*& GetMultiLevelSolverPointer() { return _ML;}
00053 
00054   const MeshAgentInterface* GetMeshAgent() const { assert(_MA); return _MA;}
00055   const MultiLevelSolverInterface* GetMultiLevelSolver() const { assert(_ML); return _ML;}
00056 
00057   MeshAgentInterface* GetMeshAgent() { assert(_MA); return _MA;}
00058   MultiLevelSolverInterface* GetMultiLevelSolver() { assert(_ML); return _ML;}
00059 
00060         SolverInfos*& GetSolverInfosPointer() { return _SI;}
00061         SolverInfos* GetSolverInfos()         { assert(_SI); return _SI;}
00062   const SolverInfos* GetSolverInfos() const   { assert(_SI); return _SI;}
00063 
00064   mutable StopWatch   _clock_newmesh, _clock_solve, _clock_functionals, _clock_write, _clock_estimate;
00065 
00066   int    _niter, _iter;
00067   bool _writeVtk;
00068   bool _writeBupGup;
00069   bool _writeInp;
00070 
00071   std::string _reload, _initial;
00072   std::string _s_resultsdir;
00073   const ParamFile*  _paramfile;
00074   
00075 
00076   Monitor           Mon;
00077   StdIoManager      IOM;
00078 
00079   GlobalVector _GlobalErr;
00080 
00081   // new vectors
00082 
00083   virtual std::string Solve(VectorInterface& u, VectorInterface& f, std::string name);
00084   virtual std::string Solve(VectorInterface& u, VectorInterface& f){
00085      return Solve(u, f, _s_resultsdir+"/solve");
00086   }
00087 
00088   virtual void PrintMeshInformation(int outputlevel=0) const;
00089 
00090   virtual void Output(const VectorInterface& u, std::string name) const;
00091   virtual void Output(const VectorInterface& u){
00092     Output(u, _s_resultsdir+"/solve");
00093   }
00094 
00095   virtual void ComputeGlobalErrors(const VectorInterface& u);
00096 
00097   virtual void InitSolution(VectorInterface& u);
00098   virtual void CopyVector(GlobalVector& dst, VectorInterface& src);
00099   virtual void CopyVector(VectorInterface& dst, GlobalVector& src);
00100 
00101 public:
00102 
00103   BasicLoop();
00104   virtual ~BasicLoop();
00105 
00106   virtual void BasicInit(const ParamFile* paramfile,
00107                          const ProblemContainer* PC,
00108                          const FunctionalContainer* FC=NULL);
00109 
00110   void run(const std::string& problemlabel);
00111   void ClockOutput() const;
00112 };
00113 }
00114 
00115 /*-----------------------------------------*/
00116 
00117 #endif

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