diff options
author | allen <allen@fa3da13c-9f13-4301-a575-cf5b8c5e1907> | 2002-05-31 08:42:57 +0000 |
---|---|---|
committer | allen <allen@fa3da13c-9f13-4301-a575-cf5b8c5e1907> | 2002-05-31 08:42:57 +0000 |
commit | 6d4ed8b60f1f0841849020a201d784c3fd27040e (patch) | |
tree | 85d0ed09b9f37fd012f03b329dd1f8eb3a988a18 | |
parent | 7237cdcea55b9f78df621a257afdc3fb2e20ab0b (diff) |
Sorting out problems with keys
git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@83 fa3da13c-9f13-4301-a575-cf5b8c5e1907
-rw-r--r-- | src/ConfMetric.c | 60 |
1 files changed, 47 insertions, 13 deletions
diff --git a/src/ConfMetric.c b/src/ConfMetric.c index 31dbe27..e4accc5 100644 --- a/src/ConfMetric.c +++ b/src/ConfMetric.c @@ -156,25 +156,49 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, { if (Ell_GetStrKey(&robin, "EllLinConfMetric::Bnd::Robin")< 0) { - CCTK_WARN(1,"SORConfMetric3D: Robin keys not set for LinConfMetric solver"); + CCTK_WARN(2,"SORConfMetric3D: Robin keys not set for LinConfMetric solver"); } } else { if (Ell_GetStrKey(&robin, "EllLinMetric::Bnd::Robin")< 0) { - CCTK_WARN(1,"SORConfMetric3D: Robin keys not set for LinMetric solver"); + CCTK_WARN(2,"SORConfMetric3D: Robin keys not set for LinMetric solver"); } } - if (CCTK_EQUALS(robin,"yes")) + if (robin && CCTK_EQUALS(robin,"yes")) { sw[0]=1; sw[1]=1; sw[2]=1; - ierr = Ell_GetRealKey(&finf, "EllLinConfMetric::Bnd::Robin::inf"); - ierr = Ell_GetIntKey (&npow, "EllLinConfMetric::Bnd::Robin::falloff"); + if (conformal) + { + ierr = Ell_GetRealKey(&finf, "EllLinConfMetric::Bnd::Robin::inf"); + if (ierr < 0) + { + CCTK_WARN(1,"EllLinConfMetric::Bnd::Robin::inf is not set"); + } + ierr = Ell_GetIntKey (&npow, "EllLinConfMetric::Bnd::Robin::falloff"); + if (ierr < 0) + { + CCTK_WARN(1,"EllLinConfMetric::Bnd::Robin::falloff is not set"); + } + } + else + { + ierr = Ell_GetRealKey(&finf, "EllLinMetric::Bnd::Robin::inf"); + if (ierr < 0) + { + CCTK_WARN(1,"EllLinMetric::Bnd::Robin::inf is not set"); + } + ierr = Ell_GetIntKey (&npow, "EllLinMetric::Bnd::Robin::falloff"); + if (ierr < 0) + { + CCTK_WARN(1,"EllLinMetric::Bnd::Robin::falloff is not set"); + } + } } /* Get the maximum number of iterations allowed. */ @@ -197,7 +221,19 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, sor_accel = strdup(tmpstr); } - /* Things to do only once! */ + if (CCTK_Equals(elliptic_verbose, "yes")) + { + if (conformal) + { + CCTK_VInfo(CCTK_THORNSTRING,"SOR solver for linear conformal metric (to tolerance %f)",tol); + } + else + { + CCTK_VInfo(CCTK_THORNSTRING,"SOR solver for linear metric (to tolerance %f)",tol); + } + } + + /* Things to do only once! if (firstcall==1) { if (CCTK_Equals(elliptic_verbose, "yes")) @@ -220,7 +256,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, } } firstcall = 0; - } + }*/ /* Get the data ptr of these GFs. @@ -506,7 +542,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, } /* apply Robin boundary conditions within loop */ - if (CCTK_EQUALS(robin,"yes")) + if (robin && CCTK_EQUALS(robin,"yes")) { if (BndRobinVI(GH, sw, finf, npow, FieldIndex)<0) { @@ -551,15 +587,13 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, if (CCTK_Equals(elliptic_verbose,"yes")) { - CCTK_VInfo(CCTK_THORNSTRING,"Required SOR tolerence was set at %f",tol); - CCTK_VInfo(CCTK_THORNSTRING,"Achieved SOR residual was %f",glob_residual); - CCTK_VInfo(CCTK_THORNSTRING, - "Number of iterations was %d (max: %d)",sorit,maxit); + CCTK_VInfo(CCTK_THORNSTRING," ... achieved SOR residual %f (at %d iterations)",glob_residual,sorit); } if (glob_residual>tol) { - CCTK_WARN(1, "SORConfMetric3D: SOR Solver did not converge"); + CCTK_VWarn(1, __LINE__, __FILE__, CCTK_THORNSTRING, + "SOR Solver did not converge (reached tol:%f at %d iterations, requested tol:%f",glob_residual,sorit,tol); retval = ELL_NOCONVERGENCE; } |