diff options
author | pollney <pollney@1d96b42b-98df-4a6a-9d84-1b24288d4588> | 2000-03-02 10:28:40 +0000 |
---|---|---|
committer | pollney <pollney@1d96b42b-98df-4a6a-9d84-1b24288d4588> | 2000-03-02 10:28:40 +0000 |
commit | de838bd25496c2d2524b07194d81f7698aeb6e78 (patch) | |
tree | fbcc8c1a4f1b0b54cc61662adc2844210ba3f828 /src | |
parent | d9e9c11d343adb35ea877a74fcacc0866c5ec895 (diff) |
Switch signs for M and N in the EllBase interface so that it now solves
L\phi + M\phi + N\phi = 0
(in line with BAM_Elliptic).
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllPETSc/trunk@34 1d96b42b-98df-4a6a-9d84-1b24288d4588
Diffstat (limited to 'src')
-rw-r--r-- | src/petsc_confmetric.c | 4 | ||||
-rw-r--r-- | src/petsc_confmetric_solver.c | 6 | ||||
-rw-r--r-- | src/petsc_flat_solver.c | 6 |
3 files changed, 8 insertions, 8 deletions
diff --git a/src/petsc_confmetric.c b/src/petsc_confmetric.c index e50cb13..ea78b3c 100644 --- a/src/petsc_confmetric.c +++ b/src/petsc_confmetric.c @@ -626,7 +626,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, } /* M phi */ - a(0,0,0) = a(0,0,0) - Mlin[ijk]; + a(0,0,0) = a(0,0,0) + Mlin[ijk]; /* Great now set the values of the matrix. This is really painful due to the boundaries (here we force @@ -708,7 +708,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, } } - rhsval = -rhsval + Nlin[ijk] / ac; + rhsval = -rhsval - Nlin[ijk] / ac; /* printf("RHS(%d %d %d)+N: %f",i,j,k,rhsval);*/ ierr = VecSetValues(b,1,&I,&rhsval,INSERT_VALUES); diff --git a/src/petsc_confmetric_solver.c b/src/petsc_confmetric_solver.c index e3fe482..39958db 100644 --- a/src/petsc_confmetric_solver.c +++ b/src/petsc_confmetric_solver.c @@ -300,7 +300,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, endpoint = startpoint; /* ...and continue running over our own region to get our endpoint */ - for (k=imin;k<kmax;k++) + for (k=kmin;k<kmax;k++) for (j=jmin;j<jmax;j++) for (i=imin;i<imax;i++) wsp[DATINDEX(pughGH,i,j,k)] = endpoint++; @@ -735,7 +735,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, /* M phi */ if (Mstorage) - a(0,0,0) = a(0,0,0) - Mlin[ijk]; + a(0,0,0) = a(0,0,0) + Mlin[ijk]; /* Great now set the values of the matrix. This is really painful due to the boundaries (here we force @@ -826,7 +826,7 @@ void petsc_confmetric_solver(cGH *GH, int *MetricPsiI, int MetricPsiISize, } if (Nstorage) - rhsval = -rhsval + Nlin[ijk] / ac; + rhsval = -rhsval - Nlin[ijk] / ac; ierr = VecSetValues(b,1,&I,&rhsval,INSERT_VALUES); CHKERRA(ierr); diff --git a/src/petsc_flat_solver.c b/src/petsc_flat_solver.c index 173c9f1..6501d9c 100644 --- a/src/petsc_flat_solver.c +++ b/src/petsc_flat_solver.c @@ -227,7 +227,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, endpoint = startpoint; /* ...and continue running over our own region to get our endpoint */ - for (k=imin;k<kmax;k++) + for (k=kmin;k<kmax;k++) for (j=jmin;j<jmax;j++) for (i=imin;i<imax;i++) wsp[DATINDEX(pughGH,i,j,k)] = endpoint++; @@ -349,7 +349,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, I = wsp[ijk]; /* M phi */ - if (Mstorage) a(0,0,0) = a(0,0,0) - Mlin[ijk]; + if (Mstorage) a(0,0,0) = a(0,0,0) + Mlin[ijk]; /* Great now set the values of the matrix. Here we force dirichlet. */ VecSetValues(soln,1,&I,&(ell_field[ijk]),INSERT_VALUES); @@ -414,7 +414,7 @@ void petsc_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, } } - if (Nstorage) rhsval = -rhsval + Nlin[ijk] / ac; + if (Nstorage) rhsval = -rhsval - Nlin[ijk] / ac; ierr = VecSetValues(b,1,&I,&rhsval,INSERT_VALUES); CHKERRA(ierr); |