Go to Overview over all GrAL packages.
Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

test/iterators/test-cartesian-iterators.C

Go to the documentation of this file.
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 

Copyright (c) Guntram Berti 1997-2002. See the GrAL Homepage for up-to-date information.

Generated at Tue Feb 26 16:08:10 2002 for GrAL Cartesian2D by doxygen 1.2.11-20011104 written by Dimitri van Heesch, © 1997-2000