summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2019-02-20 12:13:34 +0100
committerAnton Khirnov <anton@khirnov.net>2019-02-20 12:13:34 +0100
commitcb37bf615da4d77d1114b2cbca9c9f4b74f28ff4 (patch)
tree489f68831f37f372f2c94a233dbfa2867c79ac6f /src
parentae180cb8046ae4a0c726165cd6b4fb302a642889 (diff)
Disable dissipation close to the boundary.
Diffstat (limited to 'src')
-rw-r--r--src/maximal_slicing_axi_mg.c30
1 files changed, 30 insertions, 0 deletions
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;
+ }
+}