User: eschnett Date: 2013/06/13 01:55 PM
Modified: /trunk/src/ Initialisation.c, Static.c
Log: Initialise all grid points when grid functions are padded
Use cctk_ash instead of cctk_lsh to determine total array size.
File Changes:
Directory: /trunk/src/ ======================
File [modified]: Initialisation.c Delta lines: +17 -17 =================================================================== --- trunk/src/Initialisation.c 2013-05-27 22:32:00 UTC (rev 73) +++ trunk/src/Initialisation.c 2013-06-13 18:55:16 UTC (rev 74) @@ -75,7 +75,7 @@ DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS;
- for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { gxx[i] = 1.0; gyy[i] = 1.0; @@ -96,7 +96,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::metric") > 1) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { gxx_p[i] = 1.0; gyy_p[i] = 1.0; @@ -110,7 +110,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::metric") > 2) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { gxx_p_p[i] = 1.0; gyy_p_p[i] = 1.0; @@ -125,7 +125,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::curv") > 1) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { kxx_p[i] = 0.0; kyy_p[i] = 0.0; @@ -139,7 +139,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::curv") > 2) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) {
kxx_p_p[i] = 0.0; @@ -176,14 +176,14 @@ DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS;
- for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { alp[i] = 1.0; }
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::lapse") > 1) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { alp_p[i] = 1.0; } @@ -191,7 +191,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::lapse") > 2) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { alp_p_p[i] = 1.0; } @@ -218,7 +218,7 @@ DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS;
- for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { betax[i] = 0.0; betay[i] = 0.0; @@ -227,7 +227,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::shift") > 1) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { betax_p[i] = 0.0; betay_p[i] = 0.0; @@ -237,7 +237,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::shift") > 2) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { betax_p_p[i] = 0.0; betay_p_p[i] = 0.0; @@ -266,14 +266,14 @@ DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS;
- for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { dtalp[i] = 0.0; }
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtlapse") > 1) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { dtalp_p[i] = 0.0; } @@ -281,7 +281,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtlapse") > 2) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { dtalp_p_p[i] = 0.0; } @@ -308,7 +308,7 @@ DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS;
- for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { dtbetax[i] = 0.0; dtbetay[i] = 0.0; @@ -317,7 +317,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtshift") > 1) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { dtbetax_p[i] = 0.0; dtbetay_p[i] = 0.0; @@ -327,7 +327,7 @@
if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtshift") > 2) { - for(int i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) + for(int i = 0; i < cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; i++) { dtbetax_p_p[i] = 0.0; dtbetay_p_p[i] = 0.0;
File [modified]: Static.c Delta lines: +6 -6 =================================================================== --- trunk/src/Static.c 2013-05-27 22:32:00 UTC (rev 73) +++ trunk/src/Static.c 2013-06-13 18:55:16 UTC (rev 74) @@ -10,13 +10,13 @@
if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::lapse") > 1) { - npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + npoints = cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; memcpy (alp, alp_p, npoints * sizeof *alp); }
if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::dtlapse") > 1) { - npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + npoints = cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; memcpy (dtalp, dtalp_p, npoints * sizeof *dtalp); } } @@ -28,7 +28,7 @@
if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::shift") > 1) { - npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + npoints = cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; memcpy (betax, betax_p, npoints * sizeof *betax); memcpy (betay, betay_p, npoints * sizeof *betay); memcpy (betaz, betaz_p, npoints * sizeof *betaz); @@ -36,7 +36,7 @@
if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::dtshift") > 1) { - npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + npoints = cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; memcpy (dtbetax, dtbetax_p, npoints * sizeof *dtbetax); memcpy (dtbetay, dtbetay_p, npoints * sizeof *dtbetay); memcpy (dtbetaz, dtbetaz_p, npoints * sizeof *dtbetaz); @@ -50,7 +50,7 @@
if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::metric") > 1) { - npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + npoints = cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; memcpy (gxx, gxx_p, npoints * sizeof *gxx); memcpy (gxy, gxy_p, npoints * sizeof *gxy); memcpy (gxz, gxz_p, npoints * sizeof *gxz); @@ -61,7 +61,7 @@
if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::curv") > 1) { - npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + npoints = cctk_ash[0]*cctk_ash[1]*cctk_ash[2]; memcpy (kxx, kxx_p, npoints * sizeof *kxx); memcpy (kxy, kxy_p, npoints * sizeof *kxy); memcpy (kxz, kxz_p, npoints * sizeof *kxz);
commits@lists.einsteintoolkit.org