diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2011-06-12 22:22:13 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2011-06-12 22:22:13 -0400 |
commit | a8b69dc06e565427bc96d16c443bb4b3392c4365 (patch) | |
tree | 0bbd7ff18f442eacee9454384bd5548315900d35 /ML_WaveToyFO/src/WTFO_RHS.cc | |
parent | 05347a08d0c9bd2a87846ab4ad8990fe26274a4a (diff) |
Rename tensor indices
Tensor indices with numbers are not supported any more in Kranc;
rename them to use letters instead.
Diffstat (limited to 'ML_WaveToyFO/src/WTFO_RHS.cc')
-rw-r--r-- | ML_WaveToyFO/src/WTFO_RHS.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ML_WaveToyFO/src/WTFO_RHS.cc b/ML_WaveToyFO/src/WTFO_RHS.cc index 208608d..7141c11 100644 --- a/ML_WaveToyFO/src/WTFO_RHS.cc +++ b/ML_WaveToyFO/src/WTFO_RHS.cc @@ -6,6 +6,7 @@ #include <math.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include "cctk.h" #include "cctk_Arguments.h" #include "cctk_Parameters.h" @@ -59,15 +60,21 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int const char *groups[] = {"ML_WaveToyFO::WT_rho","ML_WaveToyFO::WT_rhorhs","ML_WaveToyFO::WT_urhs","ML_WaveToyFO::WT_v","ML_WaveToyFO::WT_vrhs"}; GenericFD_AssertGroupStorage(cctkGH, "WTFO_RHS", 5, groups); + GenericFD_EnsureStencilFits(cctkGH, "WTFO_RHS", 2, 2, 2); + /* Include user-supplied include files */ /* Initialise finite differencing variables */ ptrdiff_t const di = 1; ptrdiff_t const dj = CCTK_GFINDEX3D(cctkGH,0,1,0) - CCTK_GFINDEX3D(cctkGH,0,0,0); ptrdiff_t const dk = CCTK_GFINDEX3D(cctkGH,0,0,1) - CCTK_GFINDEX3D(cctkGH,0,0,0); + ptrdiff_t const cdi = sizeof(CCTK_REAL) * di; + ptrdiff_t const cdj = sizeof(CCTK_REAL) * dj; + ptrdiff_t const cdk = sizeof(CCTK_REAL) * dk; CCTK_REAL const dx = ToReal(CCTK_DELTA_SPACE(0)); CCTK_REAL const dy = ToReal(CCTK_DELTA_SPACE(1)); CCTK_REAL const dz = ToReal(CCTK_DELTA_SPACE(2)); + CCTK_REAL const dt = ToReal(CCTK_DELTA_TIME); CCTK_REAL const dxi = INV(dx); CCTK_REAL const dyi = INV(dy); CCTK_REAL const dzi = INV(dz); @@ -100,11 +107,13 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int ptrdiff_t const index = di*i + dj*j + dk*k; /* Assign local copies of grid functions */ + CCTK_REAL rhoL = rho[index]; CCTK_REAL v1L = v1[index]; CCTK_REAL v2L = v2[index]; CCTK_REAL v3L = v3[index]; + /* Include user supplied include files */ /* Precompute derivatives */ @@ -127,7 +136,6 @@ static void WTFO_RHS_Body(cGH const * restrict const cctkGH, int const dir, int CCTK_REAL v3rhsL = PDstandardNth3rho; - /* Copy local copies back to grid functions */ rhorhs[index] = rhorhsL; urhs[index] = urhsL; |