Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)

app-heier/tutorials/simpleLine.hh
Go to the documentation of this file.
00001 #ifndef simpleline_hh
00002 #define simpleline_hh
00003 
00004 #include "basics/typedefs.hh"
00005 #include "geometry/mesh.hh"
00006 #include "geometry/topology.hh"
00007 #include "geometry/cell1D.hh"
00008 #include "geometry/elementMaps.hh"
00009 namespace concepts {
00010 
00011   class SimpleLine : public Mesh1 {
00012 
00013   public:
00014     SimpleLine();
00015     virtual ~SimpleLine();
00016     uint ncell() const{return 2;}
00017     Scan1* scan() { return new S(cell_); }
00018 
00019     virtual std::ostream& info(std::ostream& os) const;
00020 
00021   private:
00022     Vertex *vtx_[3];
00023     Edge *edg_[2];
00024     Cell1 *cell_[2];
00025 
00026     class S : public Scan<Cell1> {
00027       unsigned int idx_;
00028       Cell1 *(&cell_)[2];
00029 
00030     public:
00031       S(Cell1 *(&cell)[2]) : idx_(0), cell_(cell) {}
00032       S(const S& scan) : idx_(scan.idx_),  cell_(scan.cell_) {}
00033       bool eos() const { return idx_ == 2; }
00034       Cell1& operator++(int) { return *cell_[idx_++]; }
00035       Scan1* clone() const { return new S(*this); }
00036     };
00037 
00038   };
00039 }
00040 
00041 #endif

Home | Doxygen Documentation | Tutorials | Developer Tools (restricted)