diff options
author | allen <allen@fa3da13c-9f13-4301-a575-cf5b8c5e1907> | 2001-04-13 14:30:23 +0000 |
---|---|---|
committer | allen <allen@fa3da13c-9f13-4301-a575-cf5b8c5e1907> | 2001-04-13 14:30:23 +0000 |
commit | d8f42b55c08565f64087d7c1fe54cff04207ddde (patch) | |
tree | 6654a2cf1d6153bc86e5654f7981002a0e7bbb5c /src/sor_wrapper.c | |
parent | 371749064f2bd37f05898ee66128c72e5c6bc2d4 (diff) |
Fixed a number of problems, notably that timelevels weren't being used properly, and
error codes not returned.
Still some testing to do, then I'll add a testsuite for SOR.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@69 fa3da13c-9f13-4301-a575-cf5b8c5e1907
Diffstat (limited to 'src/sor_wrapper.c')
-rw-r--r-- | src/sor_wrapper.c | 76 |
1 files changed, 42 insertions, 34 deletions
diff --git a/src/sor_wrapper.c b/src/sor_wrapper.c index 4f2a8b0..062a846 100644 --- a/src/sor_wrapper.c +++ b/src/sor_wrapper.c @@ -22,19 +22,21 @@ #include "cctk_Parameters.h" #include "cctk_FortranString.h" -void sor_flat_3d(cGH *GH, int FieldIndex, int MIndex, int NIndex, - CCTK_REAL *AbsTol, CCTK_REAL *RelTol); -void sor_confmetric_3d(cGH *GH, int *MetricPsiI, int conformal, - int FieldIndex, int MIndex, int NIndex, - CCTK_REAL *AbsTol, CCTK_REAL *RelTol); -void sor_confmetric(cGH *GH, - int *MetricPsiI, - int FieldIndex, - int MIndex, - int NIndex, - CCTK_REAL *AbsTol, - CCTK_REAL *RelTol); -void sor_flat(cGH *GH, +#include "CactusElliptic/EllBase/src/EllBase.h" + +int sor_flat_3d(cGH *GH, int FieldIndex, int MIndex, int NIndex, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol); +int sor_confmetric_3d(cGH *GH, int *MetricPsiI, int conformal, + int FieldIndex, int MIndex, int NIndex, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol); +int sor_confmetric(cGH *GH, + int *MetricPsiI, + int FieldIndex, + int MIndex, + int NIndex, + CCTK_REAL *AbsTol, + CCTK_REAL *RelTol); +int sor_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, @@ -65,32 +67,36 @@ void sor_flat(cGH *GH, @@*/ -void sor_confmetric(cGH *GH, - int *MetricPsiI, - int FieldIndex, - int MIndex, - int NIndex, - CCTK_REAL *AbsTol, - CCTK_REAL *RelTol) +int sor_confmetric(cGH *GH, + int *MetricPsiI, + int FieldIndex, + int MIndex, + int NIndex, + CCTK_REAL *AbsTol, + CCTK_REAL *RelTol) { + int retval = ELL_NOSOLVER; switch (CCTK_GroupDimFromVarI(FieldIndex)) { case 1: - CCTK_WARN(0,"No 1D SOR solver implemented"); + CCTK_WARN(0,"sor_confmetric: No 1D SOR solver implemented"); break; case 2: - CCTK_WARN(0,"No 2D SOR solver implemented"); + CCTK_WARN(0,"sor_confmetric: No 2D SOR solver implemented"); break; case 3: - sor_confmetric_3d(GH, MetricPsiI, 1, FieldIndex, MIndex, NIndex, - AbsTol, RelTol); + retval = sor_confmetric_3d(GH, MetricPsiI, 1, + FieldIndex, MIndex, NIndex, + AbsTol, RelTol); break; default: - CCTK_WARN(1,"Requested SOR solver for dimension equal " + CCTK_WARN(1,"sor_confmetric: Requested SOR solver for dimension equal " "zero or gt. three not implemented!"); break; } + + return retval; } /*@@ @@ -105,9 +111,9 @@ void sor_confmetric(cGH *GH, This wrapper is registered and if it is being called with a n-dim. grid function, it goes of and picks the correct solver. - We pass in the arguments that are neccessary for this class of elliptic eq. - this solver is intended to solve. See ./CactusElliptic/EllBase/src/ for the - classes of elliptic eq. + We pass in the arguments that are necessary for this class of + elliptic equations this solver is intended to solve. + See ./CactusElliptic/EllBase/src/ for the classes of elliptic eq. @enddesc @calls @calledby @@ -117,30 +123,32 @@ void sor_confmetric(cGH *GH, @@*/ -void sor_flat(cGH *GH, +int sor_flat(cGH *GH, int FieldIndex, int MIndex, int NIndex, CCTK_REAL *AbsTol, CCTK_REAL *RelTol) { + int retval = ELL_NOSOLVER; switch (CCTK_GroupDimFromVarI(FieldIndex)) { case 1: - CCTK_WARN(1,"No 1D SOR solver implemented"); + CCTK_WARN(1,"sor_flat: No 1D SOR solver implemented"); break; case 2: - CCTK_WARN(1,"No 2D SOR solver implemented"); + CCTK_WARN(1,"sor_flat: No 2D SOR solver implemented"); break; case 3: - printf(" wrapper: %d %d %d \n",FieldIndex, MIndex, NIndex); - sor_flat_3d(GH, FieldIndex, MIndex, NIndex, AbsTol, RelTol); + retval = sor_flat_3d(GH, FieldIndex, MIndex, NIndex, AbsTol, RelTol); break; default: - CCTK_WARN(1,"Requested SOR solver for dimension equal" + CCTK_WARN(1,"sor_flat: Requested SOR solver for dimension equal" "zero or gt. three not implemented!"); break; } + return retval; + } |