From cb37bf615da4d77d1114b2cbca9c9f4b74f28ff4 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Wed, 20 Feb 2019 12:13:34 +0100 Subject: Disable dissipation close to the boundary. --- src/maximal_slicing_axi_mg.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src') diff --git a/src/maximal_slicing_axi_mg.c b/src/maximal_slicing_axi_mg.c index c37cbef..14bd2c8 100644 --- a/src/maximal_slicing_axi_mg.c +++ b/src/maximal_slicing_axi_mg.c @@ -871,3 +871,33 @@ void msa_mg_inithist(CCTK_ARGUMENTS) lapse_prev1_time[i] = DBL_MAX; } } + +void maximal_slicing_axi_mg_modify_diss(CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; + + CoordPatch *cp; + + const int reflevel = ctz(cctkGH->cctk_levfac[0]); + + double *epsdis; + + epsdis = CCTK_VarDataPtr(cctkGH, 0, "Dissipation::epsdisA"); + if (!epsdis) + abort(); + + cp = get_coord_patch(ms, reflevel); + + for (int idx_z = 0; idx_z < cp->grid_size[2]; idx_z++) + for (int idx_x = cp->grid_size[0] - cp->offset_right[0] - (ms->fd_stencil + 1); idx_x < cp->grid_size[0]; idx_x++) { + const ptrdiff_t idx_dst = CPINDEX(cp, idx_x, cp->y_idx, idx_z); + epsdis[idx_dst] = 0.0; + } + + for (int idx_x = 0; idx_x < cp->grid_size[0]; idx_x++) + for (int idx_z = cp->grid_size[2] - cp->offset_right[1] - (ms->fd_stencil + 1); idx_z < cp->grid_size[2]; idx_z++) { + const ptrdiff_t idx_dst = CPINDEX(cp, idx_x, cp->y_idx, idx_z); + epsdis[idx_dst] = 0.0; + } +} -- cgit v1.2.3