00001 #include <iostream> 00002 #include <fstream> 00003 00004 #include "Gral/Grids/Cartesian2D/all.h" 00005 00006 #include "Gral/Test/test-iterators.h" 00007 00008 #include "Utility/pre-post-conditions.h" 00009 00010 int main() { 00011 using std::ofstream; 00012 00013 ofstream* out = new ofstream("vertex-iterator.out"); 00014 int NX = 4, NY = 4; 00015 for(int nx = 1; nx < NX; ++nx) { 00016 for(int ny = 1; ny < NY; ++ny) { 00017 RegGrid2D R(nx,ny); 00018 *out << "RegGrid2D(" << nx << ',' << ny << ")\n" 00019 << R.NumOfCells() << " cells\n" 00020 << R.NumOfEdges() << " edges\n" 00021 << R.NumOfVertices() << " vertices\n"; 00022 REQUIRE_ALWAYS( (R.NumOfVertices() + R.NumOfCells() == R.NumOfEdges() + 1), 00023 "Euler formula does not hold!\n",1); 00024 test_vertex_iterator(R,*out); 00025 test_vertex_on_cell_iterator(R,*out); 00026 *out << endl; 00027 } 00028 } 00029 delete out; 00030 return 0; 00031 } 00032