diff options
author | knarf <knarf@57fe0bb3-ccba-405f-9b23-de0201f165b7> | 2010-02-03 14:18:05 +0000 |
---|---|---|
committer | knarf <knarf@57fe0bb3-ccba-405f-9b23-de0201f165b7> | 2010-02-03 14:18:05 +0000 |
commit | dcc5140aea0da174e28fe465a1a49cf5d7f43094 (patch) | |
tree | fdfcc8d5f5db22b097e7333b41ca9682f2bd8623 | |
parent | c8329088957b2fa6dece72960bc0e1e792764062 (diff) |
add mask for hydro excision to HydroBase
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/HydroBase/trunk@21 57fe0bb3-ccba-405f-9b23-de0201f165b7
-rwxr-xr-x | interface.ccl | 7 | ||||
-rwxr-xr-x | param.ccl | 5 | ||||
-rwxr-xr-x | schedule.ccl | 18 | ||||
-rw-r--r-- | src/HydroBase.h | 2 | ||||
-rw-r--r-- | src/Initialisation.c | 15 |
5 files changed, 46 insertions, 1 deletions
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" @@ -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 <cctk.h> #include <cctk_Arguments.h> #include <cctk_Parameters.h> - +#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<np; ++i) { + hydro_excision_mask[i] = HYDRO_EXCISION_NORMAL; + } +} |