curvedshapes.h

Go to the documentation of this file.
00001 #ifndef __curvedshapes_h
00002 #define __curvedshapes_h
00003 
00004 #include <map>
00005 #include <set>
00006 #include <vector>
00007 #include  <string>
00008 #include "boundaryfunction.h"
00009 #include "boundaryline.h"
00010 #include "boundaryquad.h"
00011 #include "vertex.h"
00012 
00013 /******************************************************/
00014 
00015 namespace Gascoigne
00016 {
00017 template<int DIM>
00018 class CurvedShapes : public std::map<int,BoundaryFunction<DIM>* >
00019 {
00020  public:
00021 
00022   typedef typename std::map<int,BoundaryFunction<DIM>* >::iterator iterator;
00023 
00024   ~CurvedShapes() {
00025     for (iterator p=std::map<int,BoundaryFunction<DIM>* >::begin();p!=std::map<int,BoundaryFunction<DIM>* >::end();++p)
00026     if (p->second) {
00027       std::cerr<< "not deleting shape: "<< p->second->GetName() << std::endl;
00028     }
00029   }
00030 
00031   const BoundaryFunction<DIM>& GetShape(int col) const { return *this->find(col)->second;}
00032 
00033   void AddShape(int col, BoundaryFunction<DIM>* f) {
00034     (*this)[col] = f;
00035   }
00036   
00037   void newton(int col,Vertex<DIM>& V) { GetShape(col).newton(V); }
00038 
00039     int Curved(int col) const { return (this->find(col)!=std::map<int,BoundaryFunction<DIM>* >::end());}
00040 
00041     bool empty() const {return (std::map<int,BoundaryFunction<DIM>* >::size()==0);}
00042 };
00043 }
00044 
00045 /******************************************************/
00046 
00047 #endif

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