From dcc5140aea0da174e28fe465a1a49cf5d7f43094 Mon Sep 17 00:00:00 2001 From: knarf Date: Wed, 3 Feb 2010 14:18:05 +0000 Subject: add mask for hydro excision to HydroBase git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/HydroBase/trunk@21 57fe0bb3-ccba-405f-9b23-de0201f165b7 --- interface.ccl | 7 +++++++ param.ccl | 5 +++++ schedule.ccl | 18 ++++++++++++++++++ src/HydroBase.h | 2 ++ src/Initialisation.c | 15 ++++++++++++++- 5 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 src/HydroBase.h diff --git a/interface.ccl b/interface.ccl index 7b892a0..8c5d143 100755 --- a/interface.ccl +++ b/interface.ccl @@ -4,6 +4,10 @@ implements: HydroBase inherits: InitBase +USES INCLUDE: HydroBase.h + +INCLUDE HEADER: HydroBase.h in HydroBase.h + public: # These variables correspond to the Valencia formulation @@ -34,3 +38,6 @@ CCTK_REAL vel[3] type = GF Timelevels = 3 tags='ProlongationParameter="HydroBas CCTK_REAL Y_e type = GF Timelevels = 3 tags='ProlongationParameter="HydroBase::prolongation_type" tensortypealias="Scalar" interpolator="matter"' "electron fraction" CCTK_REAL Bvec[3] type = GF Timelevels = 3 tags='ProlongationParameter="HydroBase::prolongation_type" tensortypealias="U" interpolator="matter"' "Magnetic field components B^i" + +# This may become CCTK_BYTE when Carpet enables it by default +CCTK_INT hydro_excision_mask type = GF Timelevels = 1 tags='Prolongation="None" checkpoint="no"' "Mask for hydro excision" diff --git a/param.ccl b/param.ccl index 50e4cc7..5add743 100755 --- a/param.ccl +++ b/param.ccl @@ -53,3 +53,8 @@ KEYWORD Bvec_evolution_method "Evolution method for Bvec" { "none" :: "Evolution for Bvec is disabled" } "none" + +BOOLEAN hydro_excision "Turn on of off (default) storage for hydro excision" +{ +} "no" + diff --git a/schedule.ccl b/schedule.ccl index 9d9a956..ffa7278 100755 --- a/schedule.ccl +++ b/schedule.ccl @@ -46,6 +46,11 @@ else if (timelevels == 3) } } +if (hydro_excision) +{ + STORAGE: hydro_excision_mask +} + schedule group HydroBase_Initial at CCTK_INITIAL \ after (ADMBase_InitialData ADMBase_InitialGauge \ IOUtil_RecoverIDFromDatafiles) \ @@ -137,3 +142,16 @@ if (CCTK_Equals(initial_Bvec, "zero")) LANG: C } "Set magnetic field to 0" } + +if (hydro_excision) +{ + schedule GROUP HydroBase_ExcisionHasBeenSet at CCTK_PostStep + { + } "Group to schedule thorns changing the mask before and thorns using the mask after" + + schedule HydroBase_InitExcisionMask in HydroBase_Initial + { + LANG: C + } "Initialize hydro excision mask to 'no excision everywhere'" +} + diff --git a/src/HydroBase.h b/src/HydroBase.h new file mode 100644 index 0000000..0de648a --- /dev/null +++ b/src/HydroBase.h @@ -0,0 +1,2 @@ +#define HYDRO_EXCISION_NORMAL 0 +#define HYDRO_EXCISION_EXCISED 1 diff --git a/src/Initialisation.c b/src/Initialisation.c index fcd71f5..3391fde 100644 --- a/src/Initialisation.c +++ b/src/Initialisation.c @@ -1,7 +1,7 @@ #include #include #include - +#include "HydroBase.h" void HydroBase_Zero (CCTK_ARGUMENTS) @@ -166,3 +166,16 @@ void HydroBase_Bvec_zero (CCTK_ARGUMENTS) "Unsupported parameter value for InitBase::initial_data_setup_method"); } } + +void HydroBase_InitExcisionMask (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + DECLARE_CCTK_PARAMETERS; + + int const np = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2]; + + #pragma omp parallel for + for (int i=0; i