Commits

Rio Yokota committed bb9207f

Added eps2 control to FMM.

Comments (0)

Files changed (3)

   PetscFunctionBegin;
   PetscValidHeaderSpecific(iga,IGA_CLASSID,2);
   if (iga) fmm->iga = iga;
-  FMM_Init(0);
   PetscFunctionReturn(0);
 }
 
 #endif
   ierr = MatSetFromOptions(fmm->G);CHKERRQ(ierr);
   ierr = MatSetUp(fmm->G);CHKERRQ(ierr);
+
+  PetscReal eps = .2 / (1<<((int)(log2(sqrt(fmm->ni+fmm->nb)-1)))); // bitshift
+  FMM_Init(eps*eps, 0);
   PetscFunctionReturn(0);
 }
 
   PetscReal *ui  = fmm->ui;
 
   PetscInt i, j, ic = 0;
-  PetscReal eps = .2 / (1<<((int)(log2(sqrt(ni+nb)-1)))); // bitshift
-  for (i=info.xs; i<info.xs+info.xm; i++) { // Loop over interior points
+   for (i=info.xs; i<info.xs+info.xm; i++) { // Loop over interior points
     for (j=info.ys; j<info.ys+info.ym; j++) {
       if (i != 0 && i != info.mx-1 && j != 0 && j != info.my-1) {
 	xi[ic] = (PetscReal)i / ( (PetscReal)(info.mx-1) );
   }
   assert( ni == ic );
 
+  /*
   ic = 0;
   j = 0;
   PetscInt q;
   for (i=0; i<nb; i++) {
     un[i] = -un[i];
   }
+  */
   for (i=0; i<ni; i++) {
     ui[i] = 0;
   }
   FMM(ni,xi,yi,ui,ni,xi,yi,ri);
-  FMM(ni,xi,yi,ui,nb,xm,ym,un);
+  //FMM(ni,xi,yi,ui,nb,xm,ym,un);
   //nbodyGn(ni,xi,yi,ui,nb,xm,ym,um,dxe,dye,re,eps);
 
   ic = 0;
 
 PETSC_EXTERN PetscErrorCode PCFMMSetIGA(PC pc,IGA iga);
 
-extern "C" void FMM_Init(int verbose);
+extern "C" void FMM_Init(double eps2, int verbose);
 extern "C" void FMM(int ni, double * xi, double * yi, double * vi,
   	            int nj, double * xj, double * yj, double * vj);
 #endif
 Poisson2D: Poisson2D.o fmm.o
 	${CLINKER} $^ -o $@ ${PETIGA_LIB} -L../../exafmm2d/wrappers -lfmm -ltbb
 	${RM} -f $<
-	mpirun -np 2 ./Poisson2D -ksp_monitor -ksp_norm_type UNPRECONDITIONED -ksp_max_it 100 -draw_pause 1
+	mpirun -np 1 ./Poisson2D -ksp_monitor -ksp_norm_type UNPRECONDITIONED -ksp_max_it 100 -draw_pause 1 -pc_type fmm
 
 clean::
 	-@${RM} ${TARGETS}