diff options
Diffstat (limited to 'src/ConfMetric.c')
-rw-r--r-- | src/ConfMetric.c | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/src/ConfMetric.c b/src/ConfMetric.c index e4accc5..db9fb98 100644 --- a/src/ConfMetric.c +++ b/src/ConfMetric.c @@ -36,8 +36,8 @@ CCTK_FILEVERSION(CactusElliptic_EllSOR_ConfMetric_c) ********************************************************************/ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, - int FieldIndex, int MIndex, int NIndex, - CCTK_REAL *AbsTol, CCTK_REAL *RelTol); + int FieldIndex, int MIndex, int NIndex, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol); /******************************************************************** ***************** Scheduled Routine Prototypes ********************* @@ -75,8 +75,8 @@ static int firstcall = 1; @@*/ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, - int FieldIndex, int MIndex, int NIndex, - CCTK_REAL *AbsTol, CCTK_REAL *RelTol) + int FieldIndex, int MIndex, int NIndex, + CCTK_REAL *AbsTol, CCTK_REAL *RelTol) { DECLARE_CCTK_PARAMETERS @@ -145,7 +145,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, if (sum_handle<0) { CCTK_WARN(1,"SORConfMetric3D: " - "Cannot get handle for sum reduction"); + "Cannot get handle for sum reduction"); retval = ELL_FAILURE; } @@ -178,12 +178,12 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, ierr = Ell_GetRealKey(&finf, "EllLinConfMetric::Bnd::Robin::inf"); if (ierr < 0) { - CCTK_WARN(1,"EllLinConfMetric::Bnd::Robin::inf is not set"); + 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"); + CCTK_WARN(1,"EllLinConfMetric::Bnd::Robin::falloff is not set"); } } else @@ -191,12 +191,12 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, ierr = Ell_GetRealKey(&finf, "EllLinMetric::Bnd::Robin::inf"); if (ierr < 0) { - CCTK_WARN(1,"EllLinMetric::Bnd::Robin::inf is not set"); + 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"); + CCTK_WARN(1,"EllLinMetric::Bnd::Robin::falloff is not set"); } } } @@ -205,7 +205,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, if (Ell_GetIntKey(&maxit, "Ell::SORmaxit") == ELLGET_NOTSET) { CCTK_WARN(1,"SORConfMetric3D: Ell::SORmaxit not set. " - "Maximum allowed iterations being set to 100."); + "Maximum allowed iterations being set to 100."); maxit = 100; } @@ -217,7 +217,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, { const char tmpstr[6] = "const"; CCTK_WARN(3,"SORConfMetric3D: Ell::SORaccel not set. " - "Omega being set to a constant value of 1.8."); + "Omega being set to a constant value of 1.8."); sor_accel = strdup(tmpstr); } @@ -384,7 +384,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, uyy[ijk]=(-SQR(gxz[ijk]) + gxx[ijk]*gzz[ijk])*detrec_pm4; uyz[ijk]=( gxy[ijk]*gxz[ijk] - gxx[ijk]*gyz[ijk])*detrec_pm4; uzz[ijk]=(-SQR(gxy[ijk]) + gxx[ijk]*gyy[ijk])*detrec_pm4; - + det = det*p12; sqrtdet= sqrt(det); @@ -405,7 +405,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, uxz[ijk]=uxz[ijk]*dxdz*sqrtdet; uyz[ijk]=uyz[ijk]*dydz*sqrtdet; - } + } /* Initialize omega. */ /* TODO: Make it so that the value of the constant omega can be set. */ @@ -435,9 +435,9 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, { for (j=1; j<GH->cctk_lsh[1]-1; j++) { - for (i=1; i<GH->cctk_lsh[0]-1; i++) + for (i=1; i<GH->cctk_lsh[0]-1; i++) { - if ((origin_sign+i+j+k)%2 == sorit%2) + if ((origin_sign+i+j+k)%2 == sorit%2) { ijk = CCTK_GFINDEX3D(GH,i ,j ,k ); @@ -452,12 +452,12 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, ipjmk = CCTK_GFINDEX3D(GH,i+1,j-1,k ); imjpk = CCTK_GFINDEX3D(GH,i-1,j+1,k ); imjmk = CCTK_GFINDEX3D(GH,i-1,j-1,k ); - + ijpkp = CCTK_GFINDEX3D(GH,i ,j+1,k+1); ijpkm = CCTK_GFINDEX3D(GH,i ,j+1,k-1); ijmkp = CCTK_GFINDEX3D(GH,i ,j-1,k+1); ijmkm = CCTK_GFINDEX3D(GH,i ,j-1,k-1); - + ipjkp = CCTK_GFINDEX3D(GH,i+1,j ,k+1); ipjkm = CCTK_GFINDEX3D(GH,i+1,j ,k-1); imjkp = CCTK_GFINDEX3D(GH,i-1,j ,k+1); @@ -466,7 +466,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, ac = -1.0*uxx[ipjk] - 2.0*uxx[ijk] - 1.0*uxx[imjk] -1.0*uyy[ijpk] - 2.0*uyy[ijk] - 1.0*uyy[ijmk] -1.0*uzz[ijkp] - 2.0*uzz[ijk] - 1.0*uzz[ijkm]; - + if (Mstorage) { ac += Mlin[ijk]; @@ -478,30 +478,30 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, as = uyy[ijmk]+uyy[ijk]; at = uzz[ijkp]+uzz[ijk]; ab = uzz[ijkm]+uzz[ijk]; - + ane = uxy[ijpk]+uxy[ipjk]; anw =-uxy[imjk]-uxy[ijpk]; ase =-uxy[ipjk]-uxy[ijmk]; asw = uxy[imjk]+uxy[ijmk]; - + ate = uxz[ijkp]+uxz[ipjk]; atw =-uxz[imjk]-uxz[ijkp]; abe =-uxz[ipjk]-uxz[ijkm]; abw = uxz[imjk]+uxz[ijkm]; - + atn = uyz[ijpk]+uyz[ijkp]; ats =-uyz[ijkp]-uyz[ijmk]; abn =-uyz[ijkm]-uyz[ijpk]; absol = uyz[ijkm]+uyz[ijmk]; - + residual = ac * var[ijk] + ae *var[ipjk] + aw*var[imjk] + an *var[ijpk] + as*var[ijmk] + at *var[ijkp] + ab*var[ijkm]; - + residual = residual + ane*var[ipjpk] + anw*var[imjpk]; - + residual = residual + ase*var[ipjmk] + asw*var[imjmk]; @@ -521,13 +521,13 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, var[ijk] = var[ijk] - omega*residual/ac; } - } + } } } /* reduction operation on processor-local residual values */ if (CCTK_ReduceLocScalar(GH, -1, sum_handle, - &resnorm, &glob_residual, CCTK_VARIABLE_REAL)<0) + &resnorm, &glob_residual, CCTK_VARIABLE_REAL)<0) { CCTK_WARN(1,"SORConfMetric3D: Reduction of residual failed"); } @@ -556,8 +556,8 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, if (ierr < 0) { CCTK_VWarn(1,__LINE__,__FILE__,CCTK_THORNSTRING, - "ConfMetric3D: Synchronization of %s failed (Error: %d)", - CCTK_VarName(FieldIndex),ierr); + "ConfMetric3D: Synchronization of %s failed (Error: %d)", + CCTK_VarName(FieldIndex),ierr); } /* Leave iteration loop if tolerance criterium is met */ @@ -593,7 +593,7 @@ int SORConfMetric3D(cGH *GH, int *MetricPsiI, int conformal, if (glob_residual>tol) { 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); + "SOR Solver did not converge (reached tol:%f at %d iterations, requested tol:%f",glob_residual,sorit,tol); retval = ELL_NOCONVERGENCE; } |