diff options
Diffstat (limited to 'ML_hydro/src/hydro_soundWave.cc')
-rw-r--r-- | ML_hydro/src/hydro_soundWave.cc | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/ML_hydro/src/hydro_soundWave.cc b/ML_hydro/src/hydro_soundWave.cc index 6f25303..ca8be3d 100644 --- a/ML_hydro/src/hydro_soundWave.cc +++ b/ML_hydro/src/hydro_soundWave.cc @@ -21,7 +21,7 @@ #define SQR(x) ((x) * (x)) #define CUB(x) ((x) * (x) * (x)) -static void hydro_soundWave_Body(cGH const * restrict const cctkGH, int const dir, int const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], int const min[3], int const max[3], int const n_subblock_gfs, CCTK_REAL * restrict const subblock_gfs[]) +static void hydro_soundWave_Body(cGH const * restrict const cctkGH, int const dir, int const face, CCTK_REAL const normal[3], CCTK_REAL const tangentA[3], CCTK_REAL const tangentB[3], int const imin[3], int const imax[3], int const n_subblock_gfs, CCTK_REAL * restrict const subblock_gfs[]) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; @@ -29,20 +29,6 @@ static void hydro_soundWave_Body(cGH const * restrict const cctkGH, int const di /* Declare finite differencing variables */ - if (verbose > 1) - { - CCTK_VInfo(CCTK_THORNSTRING,"Entering hydro_soundWave_Body"); - } - - if (cctk_iteration % hydro_soundWave_calc_every != hydro_soundWave_calc_offset) - { - return; - } - - const char *groups[] = {"ML_hydro::eps_group","grid::coordinates","ML_hydro::rho_group","ML_hydro::vel_group"}; - GenericFD_AssertGroupStorage(cctkGH, "hydro_soundWave", 4, groups); - - /* Include user-supplied include files */ /* Initialise finite differencing variables */ @@ -56,6 +42,7 @@ static void hydro_soundWave_Body(cGH const * restrict const cctkGH, int const di 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 t = ToReal(cctk_time); CCTK_REAL const dxi = INV(dx); CCTK_REAL const dyi = INV(dy); CCTK_REAL const dzi = INV(dz); @@ -79,10 +66,18 @@ static void hydro_soundWave_Body(cGH const * restrict const cctkGH, int const di CCTK_REAL const p1ody2 = INV(SQR(dy)); CCTK_REAL const p1odz2 = INV(SQR(dz)); + /* Assign local copies of arrays functions */ + + + + /* Calculate temporaries and arrays functions */ + + /* Copy local copies back to grid functions */ + /* Loop over the grid points */ #pragma omp parallel LC_LOOP3 (hydro_soundWave, - i,j,k, min[0],min[1],min[2], max[0],max[1],max[2], + i,j,k, imin[0],imin[1],imin[2], imax[0],imax[1],imax[2], cctk_lsh[0],cctk_lsh[1],cctk_lsh[2]) { ptrdiff_t const index = di*i + dj*j + dk*k; @@ -122,5 +117,25 @@ extern "C" void hydro_soundWave(CCTK_ARGUMENTS) DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Entering hydro_soundWave_Body"); + } + + if (cctk_iteration % hydro_soundWave_calc_every != hydro_soundWave_calc_offset) + { + return; + } + + const char *groups[] = {"ML_hydro::eps_group","grid::coordinates","ML_hydro::rho_group","ML_hydro::vel_group"}; + GenericFD_AssertGroupStorage(cctkGH, "hydro_soundWave", 4, groups); + + GenericFD_LoopOverEverything(cctkGH, &hydro_soundWave_Body); + + if (verbose > 1) + { + CCTK_VInfo(CCTK_THORNSTRING,"Leaving hydro_soundWave_Body"); + } } |