aboutsummaryrefslogtreecommitdiff
path: root/ML_WaveToy/src/WT_RHS.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ML_WaveToy/src/WT_RHS.cc')
-rw-r--r--ML_WaveToy/src/WT_RHS.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/ML_WaveToy/src/WT_RHS.cc b/ML_WaveToy/src/WT_RHS.cc
index 3f1729b..b6c7b2a 100644
--- a/ML_WaveToy/src/WT_RHS.cc
+++ b/ML_WaveToy/src/WT_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"
@@ -56,15 +57,21 @@ static void WT_RHS_Body(cGH const * restrict const cctkGH, int const dir, int co
const char *groups[] = {"ML_WaveToy::WT_rho","ML_WaveToy::WT_rhorhs","ML_WaveToy::WT_u","ML_WaveToy::WT_urhs"};
GenericFD_AssertGroupStorage(cctkGH, "WT_RHS", 4, groups);
+ GenericFD_EnsureStencilFits(cctkGH, "WT_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);
@@ -97,9 +104,11 @@ static void WT_RHS_Body(cGH const * restrict const cctkGH, int const dir, int co
ptrdiff_t const index = di*i + dj*j + dk*k;
/* Assign local copies of grid functions */
+
CCTK_REAL rhoL = rho[index];
CCTK_REAL uL = u[index];
+
/* Include user supplied include files */
/* Precompute derivatives */
@@ -113,7 +122,6 @@ static void WT_RHS_Body(cGH const * restrict const cctkGH, int const dir, int co
CCTK_REAL rhorhsL = PDstandardNth11u + PDstandardNth22u +
PDstandardNth33u;
-
/* Copy local copies back to grid functions */
rhorhs[index] = rhorhsL;
urhs[index] = urhsL;