aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreschnett <eschnett@936e0995-0e4f-0410-aade-aa24bf7baf3d>2010-07-09 22:26:19 +0000
committereschnett <eschnett@936e0995-0e4f-0410-aade-aa24bf7baf3d>2010-07-09 22:26:19 +0000
commite9afc30e19aea509c98e7fe3275a416e9003d659 (patch)
tree81f214d7e8d35c130f9292f4eb455bf78fca2e49
parent77a4300983017e37d69fcf5635a39262375fea9c (diff)
In order to use the CactusNumerical/Noise thorn to perform a stress
test on the hydro equations, "id_noise" has to be properly scheduled with respect to HydroBase_Initial and HydroBase_Prim2ConInitial. As it is now numerical perturbation on the hydro variables could be discarded / overwritten. This (trivial) patch fixes the above mentioned issue and includes some small aesthetic fixes. [From David Radice [david.radice@aei.mpg.de>] git-svn-id: http://svn.cactuscode.org/arrangements/CactusNumerical/Noise/trunk@22 936e0995-0e4f-0410-aade-aa24bf7baf3d
-rw-r--r--schedule.ccl2
-rw-r--r--src/id_noise.c5
2 files changed, 5 insertions, 2 deletions
diff --git a/schedule.ccl b/schedule.ccl
index ccb2e8c..23b7937 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -2,7 +2,7 @@
# $Header$
if (apply_id_noise) {
- SCHEDULE id_noise AT CCTK_INITIAL AFTER (ADMBase_InitialData ADMBase_InitialGauge)
+ SCHEDULE id_noise AT CCTK_INITIAL AFTER (ADMBase_InitialData ADMBase_InitialGauge HydroBase_Initial) BEFORE HydroBase_Prim2ConInitial
{
LANG: C
} "Add noise to initial data"
diff --git a/src/id_noise.c b/src/id_noise.c
index 4d4e8e1..2698272 100644
--- a/src/id_noise.c
+++ b/src/id_noise.c
@@ -26,6 +26,9 @@ add_noise_to_var (int idx, const char* optstring, void* cctkGH)
cGH* GH = cctkGH;
int type;
+ CCTK_VInfo(CCTK_THORNSTRING, "Adding initial data noise to %s",
+ CCTK_VarName(idx));
+
data = (CCTK_REAL*) CCTK_VarDataPtrI(GH, 0, idx);
for (k=1; k< GH->cctk_lsh[2]-1; ++k)
@@ -52,6 +55,6 @@ id_noise(CCTK_ARGUMENTS)
if (CCTK_TraverseString(id_vars, add_noise_to_var, cctkGH,
CCTK_GROUP_OR_VAR) < 0)
{
- CCTK_WARN (1, "Failed to parse 'IDRandom::noisy_id_vars' parameter");
+ CCTK_WARN (1, "Failed to parse 'Noise::id_vars' parameter");
}
}