meshinterpolator.h

Go to the documentation of this file.
00001 #ifndef __MeshInterpolator_h
00002 #define __MeshInterpolator_h
00003 
00004 #include "hierarchicalmesh.h"
00005 #include "meshagent.h"
00006 #include "discretizationinterface.h"
00007 #include <cassert>
00008 #include <string>
00009 
00010 /**********************************************************/
00011 
00012 namespace Gascoigne
00013 {
00014 
00015 class MeshInterpolator
00016 {
00017   protected:
00018 
00019     HierarchicalMesh                          *_Old,*_New;
00020     IntSet                                     _BaseCells,_ToBeRef,_ToBeRefNew;
00021     IntVector                                  _NewNodeNumber,_NewCellNumber;
00022     MeshAgent                                 *_MA, *_OMA;
00023     DiscretizationInterface                   *_ODI,*_DI;
00024     nmatrix<double>                            _wq1;
00025     std::vector<nmatrix<double> >              _wq2;
00026     std::vector<std::pair<int,int> >           _iq2;
00027     std::vector<std::pair<GlobalVector,int> >  _VecInt,_VecOld,_VecNew;
00028     bool                                       _average;
00029 
00030     virtual void CheckCell (int oldNumber, int newNumber);
00031     virtual void Coarsen   (int newNumber);
00032     virtual void Distribute(int oldNumber, int newNumber);
00033     virtual void InitIndizes(int dim);
00034     virtual void InitInterpolationWeights(int dim);
00035     virtual void RefineAndInterpolate(HierarchicalMesh* Mesh, std::vector<std::pair<GlobalVector,int> >& u, const IntSet& refine, std::vector<std::vector<bool> >& done);
00036 
00037           MeshAgent* GetMeshAgent()       { assert(_MA); return _MA; }
00038     const MeshAgent* GetMeshAgent() const { assert(_MA); return _MA; }
00039 
00040           MeshAgent* GetOriginalMeshAgent()       { assert(_OMA); return _OMA; }
00041     const MeshAgent* GetOriginalMeshAgent() const { assert(_OMA); return _OMA; }
00042 
00043           DiscretizationInterface* GetOriginalDiscretization()       { assert(_ODI); return _ODI; }
00044     const DiscretizationInterface* GetOriginalDiscretization() const { assert(_ODI); return _ODI; }
00045 
00046           DiscretizationInterface* GetDiscretization()       { assert(_DI); return _DI; }
00047     const DiscretizationInterface* GetDiscretization() const { assert(_DI); return _DI; }
00048 
00049   public:
00050 
00051     MeshInterpolator();
00052     virtual ~MeshInterpolator();
00053 
00054     virtual void BasicInit(DiscretizationInterface* DI, MeshAgentInterface* MA, 
00055                            const std::string& name);
00056     virtual void InterpolateCellVector(GlobalVector& uNew, const GlobalVector& uOld);
00057     virtual void RhsForProjection(GlobalVector& gf, const GlobalVector& u);
00058 
00059     virtual void AddVectorIntermediate(const GlobalVector& u, int order);
00060     virtual void AddVectorOld         (const GlobalVector& u, int order);
00061     virtual void AddVectorNew         (const GlobalVector& u, int order);
00062 
00063     virtual void AddCellVectorOld(const GlobalVector& u);
00064     virtual void AddCellVectorNew(const GlobalVector& u);
00065 };
00066 }
00067 
00068 /**********************************************************/
00069 
00070 #endif

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