From 807694cf761565a445e325c1cba2b751c3726d33 Mon Sep 17 00:00:00 2001 From: lanfer Date: Thu, 20 Jul 2000 10:26:43 +0000 Subject: removing unused variables from EllPETSc. This one i still there: Macro HAVE_SYS_TIME_H incompatible redefinition. git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllPETSc/trunk@46 1d96b42b-98df-4a6a-9d84-1b24288d4588 --- src/petsc_confmetric_solver.c | 45 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 30 deletions(-) diff --git a/src/petsc_confmetric_solver.c b/src/petsc_confmetric_solver.c index 08f0d1b..2b1be33 100644 --- a/src/petsc_confmetric_solver.c +++ b/src/petsc_confmetric_solver.c @@ -21,6 +21,8 @@ static char *rcsid = "$Header$"; +CCTK_FILEVERSION(CactusElliptic_EllPETSc_petsc_confmetric_solver_c) + /*#define DEBUG*/ /*Don't know what these actually mean! FIXME */ @@ -54,6 +56,7 @@ static SLES sles; /* linear solver context */ void *GetDataPtr_NextTL(cGH *GH, const char *field) { int index; + char *err; index = CCTK_VarIndex(field); @@ -83,21 +86,18 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, KSP ksp; /* Krylov subspace method context */ int num_A; /* Number of A-arrays as needed ny Dan's MG */ - - double norm; /* norm of solution error */ int ierr; /* Check the return status of petsc */ int retcode; /* Check the return status of CCTK */ double a[27]; /* The stencil array */ - int idx[27]; /* The column of the stencil array */ int rank; /* Rank of the matrix/vector */ int its; /* Number of iterations */ /* Loopers */ - int i,j,k,l,m,n,ll; + int i,j,k,l,m,n; /* loop limits put in for stencil_w !=1 Ed Evans 1/19/98 */ - int imin,imax,jmin,jmax,kmin,kmax,interior; + int imin,imax,jmin,jmax,kmin,kmax; pGH *pughGH; /* The pugh Extension handle */ pGExtras *pEx; @@ -130,11 +130,8 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, int octant; /* Apply octant BCs inside */ int conformal; /* Do we have conformal metric ? */ int nabla_form; /* Which form of the nable */ - int reuse; /* Do PETSc reuse tricks? */ int matnormalize; /* Normalize the central mat value to one? */ CCTK_REAL ac; /* Storage for a(0,0,0) for renorm */ - int pctype, ksptype; /* Which PC and KSP to use. See below for - monster nested if statement. */ int PetscTolStyle; /* For the upper metric form of nabla */ @@ -158,7 +155,6 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, verbose = CCTK_Equals(petsc_verbose,"yes")|| CCTK_Equals(petsc_verbose,"debug"); debug = CCTK_Equals(petsc_verbose,"debug"); - reuse = 0; matnormalize = 0; if (MetricPsiISize==7) conformal=1; @@ -183,10 +179,14 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, int argc; char **argv; + if (debug) { #ifdef DEBUG - if (debug) printf("PETSc: initial trip: %d \n",trips); #endif + } + + + /* Get the commandline arguments */ argc = CCTK_CommandLine(&argv); @@ -312,6 +312,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, in the ghost zones (eg, on its neighbors) in a FD stencil of 1 */ retcode = PUGH_SyncGroup(GH,"ellpetsc::petscworkspace"); + if (retcode<0) CCTK_WARN(1,"Synchronization failed\n"); /* So woohoo. Now for each point in our ijk space, we have @@ -353,7 +354,6 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, by PAUL, using some inofficical petsc code, check if this is "official", yet */ - /*$if (trips == 0 || reuse == 0) {$*/ if (verbose) CCTK_INFO("Creating Matrices and Vectors ...."); ierr = MatCreateMPIAIJ(pughGH->PUGH_COMM_WORLD, @@ -368,16 +368,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, CHKERRA(ierr); ierr = VecCreateMPI(pughGH->PUGH_COMM_WORLD,(endpoint-startpoint),rank,&b); CHKERRA(ierr); - /*$}$*/ - /*$else {$*/ - /* ierr = MatRestoreValuesMemory(A); */ - /*$CCTK_WARN(0,"no reuse"); - CHKERRA(ierr); - }$*/ - - - - + /* Compare the PETSc layout to Cactus, this better be a match */ ierr = VecGetOwnershipRange(soln,&pvstart,&pvend); ierr = MatGetOwnershipRange(A[0],&pstart,&pend); @@ -531,7 +522,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, tdzgzz = (gzz[ijkp] - gzz[ijkm])/(2.0*dz); /* great ... so start hacking away at the coefficients. - /* Form upper metric - compute determinant */ + Form upper metric - compute determinant */ det= -(SQR(gxz[ijk])*gyy[ijk]) + 2*gxy[ijk]*gxz[ijk]*gyz[ijk] - gxx[ijk]*SQR(gyz[ijk]) - @@ -1026,18 +1017,12 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, for (i=imin;i= 0) { - ig = i + GH->cctk_lbnd[0]; - jg = j + GH->cctk_lbnd[1]; - kg = k + GH->cctk_lbnd[2]; - + /* Now this one. "Fortran-order" the matrix. But remember we have stripped off the ghost zones. Hence ig-1 and nxs... */ -- cgit v1.2.3