00001 #pragma once 00002 00003 #include "basics.hh" 00004 #include "function.hh" 00005 #include "geometry.hh" 00006 #include "graphics.hh" 00007 #include "integration.hh" 00008 #include "operator.hh" 00009 #include "space.hh" 00010 #include "toolbox.hh" 00011 #include "linearFEM.hh" 00012 00013 00014 class Rectangle : public concepts::Mesh2 { 00015 public: 00016 Rectangle(); 00017 virtual ~Rectangle(); 00018 unsigned int ncell() const { return 4; } 00019 concepts::Scan2* scan() { return new S(cell_); } 00020 virtual std::ostream& info(std::ostream& os) const; 00021 00022 private: 00023 concepts::Vertex *vtx_[6]; 00024 concepts::Edge *edg_[9]; 00025 concepts::Triangle *tri_[4]; 00026 concepts::Cell2 *cell_[4]; 00027 00028 class S : public concepts::Scan<concepts::Cell2> { 00029 unsigned int idx_; 00030 concepts::Cell2 *(&cell_)[4]; 00031 public: 00032 S(concepts::Cell2 *(&cell)[4]) : idx_(0), cell_(cell) {} 00033 S(const S& scan) : idx_(scan.idx_), cell_(scan.cell_) {} 00034 bool eos() const { return idx_ == 4; } 00035 concepts::Cell2& operator++(int) { return *cell_[idx_++]; } 00036 concepts::Scan2* clone() const { return new S(*this); } 00037 }; 00038 }; 00039