proj home

Files   Classes   Functions   Hierarchy  

meshrect.cpp

Go to the documentation of this file.
00001 #include <cassert>
00002 #include <iomanip>
00003 using namespace std;
00004 
00005 #include <meshrect.h>
00006 
00007 meshrect::meshrect(uintc M_, uintc N_)
00008   : M(M_), N(N_)
00009 {
00010   mat = new pt3[M*N];
00011   assert(mat!=0);
00012 
00013   double const dx = 1.0/((double)M-1.0);
00014   double const dy = 1.0/((double)N-1.0);
00015 
00016   for (uint j=0; j<N; ++j)
00017   {
00018     for (uint i=0; i<M; ++i)
00019       pij(i,j) = pt3(dx*i,dy*(N-1-j),0.0);
00020   }
00021 }
00022 
00023 meshrect::~meshrect()
00024 {
00025   delete[] mat;
00026 }
00027 
00028 void meshrect::print() const
00029 {
00030   uint i;
00031   uint j=N;
00032   do
00033   {
00034     --j;
00035     for (i=0; i<M; ++i)
00036       cout << setw(10) << pij(i,j); 
00037     cout << endl;
00038   } while (j!=0);
00039 }
00040 
00041 

Generated on Fri Mar 4 00:49:25 2011 for Chelton Evans Source by  doxygen 1.5.8