From 6d4ed8b60f1f0841849020a201d784c3fd27040e Mon Sep 17 00:00:00 2001 From: allen Date: Fri, 31 May 2002 08:42:57 +0000 Subject: Sorting out problems with keys git-svn-id: http://svn.cactuscode.org/arrangements/CactusElliptic/EllSOR/trunk@83 fa3da13c-9f13-4301-a575-cf5b8c5e1907 --- src/ConfMetric.c | 60 ++++++++++++++++++++++++++++++++++++++++++++------------ 1 file 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; } -- cgit v1.2.3