int MatMgnt3d::samPosCal int  n,
double  R,
DblNumMat &  ret
 

calculate various grids

Definition at line 398 of file matmgnt3d.cpp.

References dim().

Referenced by setup().

00399 {
00400   int n = np*np*np - (np-2)*(np-2)*(np-2);
00401   positions.resize(dim(),n);
00402   double step = 2.0/(np-1);
00403   double init = -1.0;
00404   int cnt = 0;
00405   for(int i=0; i<np; i++)
00406          for(int j=0; j<np; j++)
00407                 for(int k=0; k<np; k++) {
00408                   if(i==0 || i==np-1 || j==0 || j==np-1 || k==0 || k==np-1) {
00409                          double x = init + i*step;
00410                          double y = init + j*step;
00411                          double z = init + k*step;
00412                          positions(0,cnt) = R*x;
00413                          positions(1,cnt) = R*y;
00414                          positions(2,cnt) = R*z;
00415                          cnt++;
00416                   }
00417                 }
00418   iA(cnt==n);
00419   return 0;
00420 }


Generated on Sun Dec 4 19:24:41 2005 for fmm3d by  doxygen 1.4.5