aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlanfer <lanfer@1d96b42b-98df-4a6a-9d84-1b24288d4588>2000-07-20 10:33:05 +0000
committerlanfer <lanfer@1d96b42b-98df-4a6a-9d84-1b24288d4588>2000-07-20 10:33:05 +0000
commit9e8c51f3a6764d00f40556c30d545210652be9ee (patch)
treec1f26a345aac605ed87aa93852336eac2f708bb9
parent807694cf761565a445e325c1cba2b751c3726d33 (diff)
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@47 1d96b42b-98df-4a6a-9d84-1b24288d4588
-rw-r--r--src/petsc_flat_solver.c51
1 files changed, 12 insertions, 39 deletions
diff --git a/src/petsc_flat_solver.c b/src/petsc_flat_solver.c
index 3ee013a..107da76 100644
--- a/src/petsc_flat_solver.c
+++ b/src/petsc_flat_solver.c
@@ -20,8 +20,9 @@
#include "CactusPUGH/PUGH/src/include/pugh.h"
static char *rcsid = "$Header$";
+CCTK_FILEVERSION(CactusElliptic_EllPETSc_petsc_flat_solver_c)
-#define DEBUG
+/* #define DEBUG */
/*Don't know what these actually mean! FIXME */
#define ELLCONV_ABSOLUTE 0
@@ -51,19 +52,17 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
int ierr; /* Check the return status of petsc */
int retcode; /* Check the return status of CCTK */
- int idx[27]; /* The column of the stencil array */
int rank; /* Rank of the matrix/vector */
int its; /* Number of iterations */
- CCTK_REAL norm; /* norm of solution error */
CCTK_REAL a[27]; /* The stencil array */
CCTK_REAL ac; /* Storage for a(0,0,0) for renorm */
/* 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;
@@ -73,10 +72,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
CCTK_REAL rtol, atol, tolerance;
/* Values to assemble the matrix */
- CCTK_REAL tmp, *values;
-
- /* Misc */
- CCTK_REAL dx,dy,dz;
+ CCTK_REAL *values;
int myproc;
int nxs,nys,nzs; /* Size of the grid with stencils off... */
@@ -87,12 +83,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
int verbose; /* Is the solver verbose */
int debug; /* Is the solver debug-verbose */
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? */
- int pctype, ksptype; /* Which PC and KSP to use. See below for
- monster nested if statement. */
int I,J; /* The PETSc col and row in the matrix */
int PetscTolStyle;
@@ -114,7 +105,6 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
verbose = CCTK_Equals(petsc_verbose,"yes")||
CCTK_Equals(petsc_verbose,"debug");
debug = CCTK_Equals(petsc_verbose,"debug");
- reuse = 0;
matnormalize = 0;
@@ -177,9 +167,6 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
/* Get myproc from the CCTK, get the gridspacing */
myproc = PUGH_MyProc(GH);
- dx = GH->cctk_delta_space[0];
- dy = GH->cctk_delta_space[1];
- dz = GH->cctk_delta_space[2];
/* We fix the lower and upper boundary indices, that actually "active" in
the sense that they are no ghostzones: */
@@ -240,13 +227,13 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
#ifdef DEBUG
printf("ENDPOINT: %d \n",endpoint);
-#endif DEBUG
+#endif
/* So now each point has a unique index of its own. If we
do a sync that means each processor knows the indiced
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
information about our row in the matrix (workspace->data[ijk])
@@ -287,8 +274,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
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,
(endpoint-startpoint), /* # of rows */
@@ -302,14 +288,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
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);
@@ -577,18 +556,12 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex,
for (i=imin;i<imax;i++) {
/* Set up indices */
int ijk; /* The data point for the array */
- int ig, jg, kg; /* The position in global space */
- int I,J; /* The col and row in the matrix */
+ int I; /* The col in the matrix */
- CCTK_REAL rhsval = 0;
-
- /* these guys are easy */
+ /* these guys are easy */
ijk = DATINDEX(pEx,i,j,k);
if (wsp[ijk] >= 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...
*/