/*@@ @file jacobi_wrapper.c @date Tue Aug 24 12:50:07 1999 @author Gerd Lanfermann @desc The C wrapper, which calles the core Fortran routine, which performs the actual solve. We cannot derive the pointers to the GF data from the indeces in Fortran. So we do this here in C and then pass the everything over to the Fortran routine. This wrapper is registers with the Elliptic solver registry (not the Fortran file) , as coded up in ./CactusElliptic/EllBase @enddesc @@*/ #include #include #include #include "cctk.h" #include "cctk_Parameters.h" #include "cctk_FortranString.h" #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, CCTK_REAL *AbsTol, CCTK_REAL *RelTol); /*@@ @routine sor_confmetric @date Tue Sep 26 11:31:42 2000 @author Gerd Lanfermann @desc elliptic solver wrapper which provides a interface to the different n-dimensional SOR solvers for the conformal metric, of which only 3D is coded currently. 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. @enddesc @calls @calledby @history @endhistory @@*/ 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,"sor_confmetric: No 1D SOR solver implemented"); break; case 2: CCTK_WARN(0,"sor_confmetric: No 2D SOR solver implemented"); break; case 3: retval = sor_confmetric_3d(GH, MetricPsiI, 1, FieldIndex, MIndex, NIndex, AbsTol, RelTol); break; default: CCTK_WARN(1,"sor_confmetric: Requested SOR solver for dimension equal " "zero or gt. three not implemented!"); break; } return retval; } /*@@ @routine sor_flat @date Tue Sep 26 11:31:42 2000 @author Gerd Lanfermann @desc elliptic solver wrapper which provides a interface to the different n-dimensional SOR solvers (flat case), of which only 3D is coded currently. 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 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 @history @endhistory @@*/ 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,"sor_flat: No 1D SOR solver implemented"); break; case 2: CCTK_WARN(1,"sor_flat: No 2D SOR solver implemented"); break; case 3: retval = sor_flat_3d(GH, FieldIndex, MIndex, NIndex, AbsTol, RelTol); break; default: CCTK_WARN(1,"sor_flat: Requested SOR solver for dimension equal" "zero or gt. three not implemented!"); break; } return retval; }