From 2036580101df874a2f1dea044f43b48f7516cfcb Mon Sep 17 00:00:00 2001 From: schnetter Date: Mon, 7 Dec 2009 16:56:16 +0000 Subject: Add a parameter "initial_hydro" to HydroBase with a default setting of "zero". This parameter, which can be extended by hydro initial data thorns, determines which hydro thorn is setting up initial data. The default setting "zero" is implemented by HydroBase itself, setting all hydro variables to zero. This corresponds to a vacuum, but without atmosphere. Reformat and/or clarify some comments in the ccl files. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/HydroBase/trunk@17 57fe0bb3-ccba-405f-9b23-de0201f165b7 --- src/Initialisation.c | 120 +++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 101 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/Initialisation.c b/src/Initialisation.c index de2411c..a739091 100644 --- a/src/Initialisation.c +++ b/src/Initialisation.c @@ -1,31 +1,113 @@ -#include "cctk.h" +#include +#include +#include -#include "cctk_Arguments.h" -#include "cctk_Parameters.h" -void HydroBase_Y_e_one(CCTK_ARGUMENTS) + +void HydroBase_Zero (CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - int i; - - for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) - Y_e[i] = 1.0; - if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Y_e") > 1) - for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) - Y_e_p[i] = 1.0; + int const np = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2]; + +#pragma omp parallel for + for (int i=0; i 2) - for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++) - Y_e_p_p[i] = 1.0; + if (CCTK_EQUALS (initial_data_setup_method, "init_some_levels") || + CCTK_EQUALS (initial_data_setup_method, "init_single_levels")) + { + /* do nothing */ + } + else if (CCTK_EQUALS (initial_data_setup_method, "init_all_levels")) + { + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::rho") >= 2) { +#pragma omp parallel for + for (int i=0; i= 3) { +#pragma omp parallel for + for (int i=0; i= 4) { + CCTK_WARN (CCTK_WARN_ABORT, + "Too many active time levels for HydroBase variables"); + } + + } + else + { + CCTK_WARN (CCTK_WARN_ABORT, + "Unsupported parameter value for InitBase::initial_data_setup_method"); + } } -/*void HydroBase_SetY_eStateOn(CCTK_ARGUMENTS) + + +void HydroBase_Y_e_one (CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; - - *Y_e_state = 1; -}*/ - + + int const np = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2]; + +#pragma omp parallel for + for (int i=0; i= 2) { +#pragma omp parallel for + for (int i=0; i= 3) { +#pragma omp parallel for + for (int i=0; i= 4) { + CCTK_WARN (CCTK_WARN_ABORT, + "Too many active time levels for HydroBase::Y_e"); + } + + } + else + { + CCTK_WARN (CCTK_WARN_ABORT, + "Unsupported parameter value for InitBase::initial_data_setup_method"); + } +} -- cgit v1.2.3