aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpollney <pollney@850bcc8b-0e4f-0410-8c26-8d28fbf1eda9>2007-12-13 12:27:09 +0000
committerpollney <pollney@850bcc8b-0e4f-0410-8c26-8d28fbf1eda9>2007-12-13 12:27:09 +0000
commit102887f6f2daf817ead40641ceb41856c6d43d47 (patch)
treea233910821d7a603ea0c5d1a5a9417b1d7d47e19
parent4dddaca99da04a904ca4573b465eaf756c619fc6 (diff)
Added per-refinement-level dissipation via a new 'epsdis_for_level'
parameter. If this is non-zero for a particular index, then the value will be used as the epsdis parameter for the refinement level corresponding to that index. git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Dissipation/trunk@31 850bcc8b-0e4f-0410-8c26-8d28fbf1eda9
-rw-r--r--param.ccl6
-rw-r--r--src/setup_epsdis.c11
2 files changed, 13 insertions, 4 deletions
diff --git a/param.ccl b/param.ccl
index 69df2fc..758a302 100644
--- a/param.ccl
+++ b/param.ccl
@@ -25,7 +25,11 @@ STRING vars "List of evolved grid functions that should have dissipation added"
.* :: "must be a valid list of grid functions"
} ""
-
+REAL epsdis_for_level[32] "Alternate epsdis for a specific refinement level" \
+ STEERABLE=always
+{
+ : :: "Negative indicates use default"
+} -1.0
# No dissipation near excision boundary
diff --git a/src/setup_epsdis.c b/src/setup_epsdis.c
index a3db48b..498f8c3 100644
--- a/src/setup_epsdis.c
+++ b/src/setup_epsdis.c
@@ -14,6 +14,7 @@
#include "util_Table.h"
#define MAXDIM 3
+#define REFLEVEL ((int)(0.1 + log10((CCTK_REAL)(cctk_levfac[0]))/log10(2.0)))
void
setup_epsdis (CCTK_ARGUMENTS)
@@ -35,6 +36,7 @@ setup_epsdis (CCTK_ARGUMENTS)
const CCTK_INT MAXSURFNUM=100; /* XXX hard limit */
CCTK_INT doBC[2*MAXDIM],symbnd[2*MAXDIM];
CCTK_INT symtable;
+ int reflvl = REFLEVEL;
if (verbose) {
CCTK_VInfo(CCTK_THORNSTRING,"Setting up spatially varying dissipation at T=%g",
@@ -45,9 +47,12 @@ setup_epsdis (CCTK_ARGUMENTS)
nj=cctk_lsh[1];
nk=cctk_lsh[2];
- for (i=0;i<ni*nj*nk;i++) {
- epsdisA[i]=epsdis;
- }
+ if (epsdis_for_level[reflvl] > 0.0)
+ for (i=0; i<ni*nj*nk; ++i)
+ epsdisA[i] = epsdis_for_level[reflvl];
+ else
+ for (i=0;i<ni*nj*nk;i++)
+ epsdisA[i]=epsdis;
if (extra_dissipation_at_outerbound)
{