boundarymanager.h

Go to the documentation of this file.
00001 #ifndef  __boundarymanager_h
00002 #define  __boundarymanager_h
00003 
00004 #include  <map>
00005 #include  <string>
00006 #include  "stlio.h"
00007 #include  "gascoigne.h"
00008 #include  "paramfile.h"
00009 
00010 
00011 namespace Gascoigne
00012 {
00013 
00015 //
00018 
00024 //
00026 
00027 class BoundaryManager
00028 {
00029  protected:
00030 
00031   IntSet                   _colsDirichlet, _colsRightHandSide, _colsEquation, _colsFunctional;
00032   std::map<int,IntVector>  _compsDirichlet;
00033 
00034  public:
00035 
00036   BoundaryManager() {}
00037   virtual ~BoundaryManager() {}
00038 
00039   virtual void BasicInit(const ParamFile* pf);
00040 
00041   virtual std::string GetName() const {return "Std";}
00042 
00043   void AddDirichletData(int col, int c)    
00044     {
00045       _colsDirichlet.insert(col);
00046       _compsDirichlet[col].push_back(c);
00047     }
00048   void AddBoundaryRightHandSide(int col)    
00049     {
00050       _colsRightHandSide.insert(col);
00051     }
00052   void AddBoundaryEquation(int col)    
00053     {
00054       _colsEquation.insert(col);
00055     }
00056   void AddBoundaryFunctional(int col)    
00057     {
00058       _colsFunctional.insert(col);
00059     }
00060 
00061   std::ostream& print(std::ostream& s) const;
00062 
00063   virtual const IntSet& GetBoundaryRightHandSideColors() const { return _colsRightHandSide; }
00064   virtual const IntSet& GetBoundaryEquationColors     () const { return _colsEquation; }
00065   virtual const IntSet& GetBoundaryFunctionalColors   () const { return _colsFunctional; }
00066   virtual const IntSet& GetDirichletDataColors        () const { return _colsDirichlet; }
00067 
00068   virtual const IntVector& GetDirichletDataComponents(int c) const 
00069     { 
00070       std::map<int,IntVector>::const_iterator p = _compsDirichlet.find(c);
00071       if(p==_compsDirichlet.end())
00072         {
00073           std::cerr << "BoundaryManager::GetDirichletComponents()" << std::endl;
00074           std::cerr << "No such color " << c <<std::endl;
00075           std::cerr << "components = " << _compsDirichlet << std::endl;
00076           abort();
00077         }
00078       return p->second;
00079     }
00080 };
00081 }
00082 
00083 #endif

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