diff options
author | pollney <pollney@1d96b42b-98df-4a6a-9d84-1b24288d4588> | 2000-03-23 17:45:16 +0000 |
---|---|---|
committer | pollney <pollney@1d96b42b-98df-4a6a-9d84-1b24288d4588> | 2000-03-23 17:45:16 +0000 |
commit | b01787c3843f02dc3e65f883510de895fd211876 (patch) | |
tree | 2775e8f2a45ac9230046cab98a13231f09e4b35c /src/petsc_confmetric_solver.c | |
parent | de838bd25496c2d2524b07194d81f7698aeb6e78 (diff) |
Allow compilation on the origin.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllPETSc/trunk@35 1d96b42b-98df-4a6a-9d84-1b24288d4588
Diffstat (limited to 'src/petsc_confmetric_solver.c')
-rw-r--r-- | src/petsc_confmetric_solver.c | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/src/petsc_confmetric_solver.c b/src/petsc_confmetric_solver.c index 39958db..54b4002 100644 --- a/src/petsc_confmetric_solver.c +++ b/src/petsc_confmetric_solver.c @@ -25,7 +25,7 @@ static char *rcsid = "$Header$"; -#define DEBUG +/*#define DEBUG*/ /*Don't know what these actually mean! FIXME */ #define ELLCONV_ABSOLUTE 0 @@ -251,7 +251,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, /* We fix the lower and upper boundary indices, that actually "active" in the sense that they are no ghostzones: */ imin=((pughGH->neighbors[pughGH->myproc][XDM]<0) && !(octant) ? 1 : - pughGH->nghostzones[0]); + GH->cctk_nghostzones[0]); imax=((pughGH->neighbors[pughGH->myproc][XDP]<0) ? pughGH->lnsize[0]-1 : pughGH->lnsize[0]-GH->cctk_nghostzones[0]); @@ -356,6 +356,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, /*$if (trips == 0 || reuse == 0) {$*/ if (verbose) CCTK_INFO("Creating Matrices and Vectors ...."); + ierr = MatCreateMPIAIJ(pughGH->PUGH_COMM_WORLD, (endpoint-startpoint), /* # of rows */ (endpoint-startpoint), /* This is confusing */ @@ -381,13 +382,14 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, /* Compare the PETSc layout to Cactus, this better be a match */ ierr = VecGetOwnershipRange(soln,&pvstart,&pvend); ierr = MatGetOwnershipRange(A[0],&pstart,&pend); +#ifdef DEBUG printf("CAC M-Layout: %d %d \n",startpoint, endpoint); printf("PET M-Layout: %d %d \n",pstart, pend); printf("PET V-Layout: %d %d \n",pvstart,pvend); +#endif if (pstart != startpoint && pend != endpoint) CCTK_WARN(1,"WARNING: PETSC and data layouts differ! (why??)\n"); - /* Decide on the nabla form in PETSc: */ if (CCTK_EQUALS(petsc_nablaform,"down")) { if (verbose) @@ -457,7 +459,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, for (i=imin;i<imax;i++) { if (wsp[DATINDEX(pughGH,i,j,k)] >= 0) { - + CCTK_REAL tdxgxx, tdxgxy, tdxgxz, tdxgyy, tdxgyz, tdxgzz; CCTK_REAL tdygxx, tdygxy, tdygxz, tdygyy, tdygyz, tdygzz; CCTK_REAL tdzgxx, tdzgxy, tdzgxz, tdzgyy, tdzgyz, tdzgzz; @@ -491,7 +493,6 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, psiyp = 0.0; psizp = 0.0; } - if (nabla_form == 2) { /* Use finite differences of g for the d's */ int ijkp, ijkm; @@ -858,7 +859,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, if (trips==0) OptionsSetValue("-ksp_monitor",""); - CCTK_INFO("CREATING SLES"); + if (verbose) CCTK_INFO("CREATING SLES"); ierr = SLESCreate(pughGH->PUGH_COMM_WORLD,&sles); CHKERRA(ierr); @@ -871,14 +872,14 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, using A to precondition itself. Since I don't know what this means, we'll leave it for now. */ - CCTK_INFO("CREATING SLES OPERATOR"); + if (verbose) CCTK_INFO("CREATING SLES OPERATOR"); ierr = SLESSetOperators(sles,A[0],A[0],DIFFERENT_NONZERO_PATTERN); CHKERRA(ierr); /* Set linear solver defaults for this problem. Later this should be replaced/modified with appropriate parsing from the parameter parser. For now it is not. These defaults are reasonable, I hope. */ - CCTK_INFO("SLESGet KSP/PC"); + if (verbose) CCTK_INFO("SLESGet KSP/PC"); ierr = SLESGetKSP(sles,&ksp); CHKERRA(ierr); ierr = SLESGetPC(sles,&pc); CHKERRA(ierr); @@ -989,7 +990,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, ierr = KSPSetInitialGuessNonzero(KSP ksp); */ - CCTK_INFO("KSPSetInitialGuess\n"); + if (verbose) CCTK_INFO("KSPSetInitialGuess\n"); ierr = KSPSetInitialGuessNonzero(ksp); CHKERRA(ierr); /* @@ -1006,7 +1007,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Solve the linear system - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - CCTK_INFO("SLES solve..."); + if (verbose) CCTK_INFO("SLES solve..."); ierr = SLESSolve(sles,b,soln,&its); CHKERRA(ierr); /* Here we can form a "res = Ax - b" and find its norm to get |