From 4de562c4595ff46790e4a6b7179a0fadb8aa3515 Mon Sep 17 00:00:00 2001 From: baiotti Date: Sun, 4 Mar 2007 10:48:38 +0000 Subject: Fix a bug in setting extra dissipation at the outer boundary. Add a parameter to specify the maximum epsdis for the extra dissipation at the outer boundary, if wanted. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Dissipation/trunk@29 850bcc8b-0e4f-0410-8c26-8d28fbf1eda9 --- param.ccl | 4 ++++ src/setup_epsdis.c | 43 +++++++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/param.ccl b/param.ccl index 9b7dcd0..2ecde5b 100644 --- a/param.ccl +++ b/param.ccl @@ -87,6 +87,10 @@ REAL ob_slope "slope at outer boundary" STEERABLE=always 0:* :: "increase dissipation" } 5 +REAL outer_boundary_max_epsdis "maximal epsdis" STEERABLE=always +{ + *:* :: "<0 for 'off', >=0 for maximal epsdis at the outer boundary" +} -1.0 diff --git a/src/setup_epsdis.c b/src/setup_epsdis.c index 4be7a2c..b3a3b9c 100644 --- a/src/setup_epsdis.c +++ b/src/setup_epsdis.c @@ -49,8 +49,6 @@ setup_epsdis (CCTK_ARGUMENTS) epsdisA[i]=epsdis; } - - if (extra_dissipation_at_outerbound) { symtable = SymmetryTableHandleForGrid (cctkGH); @@ -60,6 +58,7 @@ setup_epsdis (CCTK_ARGUMENTS) for (i = 0; i < 6; i++) { doBC[i] = cctk_bbox[i]!=0 && symbnd[i] < 0; } + if(doBC[0]) { for (k=0;k outer_boundary_max_epsdis) { + epsdisA[index] = outer_boundary_max_epsdis; + } } } } @@ -74,15 +76,17 @@ setup_epsdis (CCTK_ARGUMENTS) if(doBC[1]) { for (k=0;kni-outer_bound_npoints;i--) { + for (i=ni-1;i>=ni-outer_bound_npoints;i--) { index = CCTK_GFINDEX3D(cctkGH,i,j,k); - indexP= CCTK_GFINDEX3D(cctkGH,ni-outer_bound_npoints,j,k); - epsdisA[index]=epsdis+ob_slope*fabs(x[index]-x[indexP]); + indexP= CCTK_GFINDEX3D(cctkGH,ni-outer_bound_npoints-1,j,k); + epsdisA[index]=epsdis+ob_slope*fabs(x[index]-x[indexP]); + if (epsdisA[index] > outer_boundary_max_epsdis) { + epsdisA[index] = outer_boundary_max_epsdis; + } } } } } - if(doBC[2]) { for (k=0;k outer_boundary_max_epsdis) { + epsdisA[index] = outer_boundary_max_epsdis; + } } } } } if(doBC[3]) { for (k=0;knj-outer_bound_npoints;j--) { + for (j=nj-1;j>=nj-outer_bound_npoints;j--) { for (i=0;i outer_boundary_max_epsdis) { + epsdisA[index] = outer_boundary_max_epsdis; + } + } + } } } @@ -113,25 +123,29 @@ setup_epsdis (CCTK_ARGUMENTS) index = CCTK_GFINDEX3D(cctkGH,i,j,k); indexP= CCTK_GFINDEX3D(cctkGH,i,j,outer_bound_npoints); epsdisA[index]=epsdis+ob_slope*fabs(z[index]-z[indexP]); + if (epsdisA[index] > outer_boundary_max_epsdis) { + epsdisA[index] = outer_boundary_max_epsdis; + } } } } } if(doBC[5]) { - for (k=nk;k>nk-outer_bound_npoints;k--) { + for (k=nk-1;k>=nk-outer_bound_npoints;k--) { for (j=0;j outer_boundary_max_epsdis) { + epsdisA[index] = outer_boundary_max_epsdis; + } } } } } } - - if (extra_dissipation_in_horizons && cctk_iteration%update_ah_every == 0) { if (verbose) { @@ -271,4 +285,5 @@ setup_epsdis (CCTK_ARGUMENTS) free(inds); } } + } -- cgit v1.2.3