From 102887f6f2daf817ead40641ceb41856c6d43d47 Mon Sep 17 00:00:00 2001 From: pollney Date: Thu, 13 Dec 2007 12:27:09 +0000 Subject: 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 --- param.ccl | 6 +++++- src/setup_epsdis.c | 11 ++++++++--- 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 0.0) + for (i=0; i