diff options
author | schnetter <schnetter@9a8dfbc3-8997-403f-b745-98a780c092cc> | 2009-12-09 19:37:50 +0000 |
---|---|---|
committer | schnetter <schnetter@9a8dfbc3-8997-403f-b745-98a780c092cc> | 2009-12-09 19:37:50 +0000 |
commit | 1868a0bbd2157744830bec00bc3bee79a88804b0 (patch) | |
tree | a157d3fe54ae24c8e80339db30b95e58dca9203f | |
parent | 8ae846323f2616ef21303f472b86cf6fa32e955d (diff) |
Initialise the time derivatives of lapse and shift only if they have
storage
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/Meudon_Mag_NS/trunk@7 9a8dfbc3-8997-403f-b745-98a780c092cc
-rw-r--r-- | src/Mag_NS.cc | 38 | ||||
-rw-r--r-- | src/check_parameters.cc | 8 |
2 files changed, 36 insertions, 10 deletions
diff --git a/src/Mag_NS.cc b/src/Mag_NS.cc index 3787557..8b578a4 100644 --- a/src/Mag_NS.cc +++ b/src/Mag_NS.cc @@ -98,13 +98,6 @@ void ID_Mag_NS_initialise (CCTK_ARGUMENTS) betay[i] = mag_ns.beta_y[i]; betaz[i] = mag_ns.beta_z[i]; - // These initial data assume stationarity - dtalp[i] = 0.0; - - dtbetax[i] = 0.0; - dtbetay[i] = 0.0; - dtbetaz[i] = 0.0; - CCTK_REAL g[3][3]; g[0][0] = mag_ns.g_xx[i]; g[0][1] = mag_ns.g_xy[i]; @@ -169,5 +162,36 @@ void ID_Mag_NS_initialise (CCTK_ARGUMENTS) + CCTK_INFO ("Setting time derivatives of lapse and shift"); + { + // These initial data assume stationarity + + if (CCTK_EQUALS (initial_dtlapse, "ID_Mag_NS")) { +#pragma omp parallel for + for (int i=0; i<npoints; ++i) { + dtalp[i] = 0.0; + } + } else if (CCTK_EQUALS (initial_dtlapse, "none")) { + // do nothing + } else { + CCTK_WARN (CCTK_WARN_ABORT, "internal error"); + } + + if (CCTK_EQUALS (initial_dtshift, "ID_Mag_NS")) { +#pragma omp parallel for + for (int i=0; i<npoints; ++i) { + dtbetax[i] = 0.0; + dtbetay[i] = 0.0; + dtbetaz[i] = 0.0; + } + } else if (CCTK_EQUALS (initial_dtshift, "none")) { + // do nothing + } else { + CCTK_WARN (CCTK_WARN_ABORT, "internal error"); + } + } + + + CCTK_INFO ("Done."); } diff --git a/src/check_parameters.cc b/src/check_parameters.cc index fe0680c..bb085cd 100644 --- a/src/check_parameters.cc +++ b/src/check_parameters.cc @@ -13,11 +13,13 @@ void ID_Mag_NS_check_parameters (CCTK_ARGUMENTS) if (not CCTK_EQUALS (initial_data, "ID_Mag_NS") or not CCTK_EQUALS (initial_lapse, "ID_Mag_NS") or not CCTK_EQUALS (initial_shift, "ID_Mag_NS") or - not CCTK_EQUALS (initial_dtlapse, "ID_Mag_NS") or - not CCTK_EQUALS (initial_dtshift, "ID_Mag_NS") or + not (CCTK_EQUALS (initial_dtlapse, "ID_Mag_NS") or + CCTK_EQUALS (initial_dtlapse, "none")) or + not (CCTK_EQUALS (initial_dtshift, "ID_Mag_NS") or + CCTK_EQUALS (initial_dtshift, "none")) or not CCTK_EQUALS (initial_hydro, "ID_Mag_NS") or not CCTK_EQUALS (initial_Bvec, "ID_Mag_NS")) { - CCTK_PARAMWARN ("The parameters ADMBase::initial_data, ADMBase::initial_lapse, ADMBase::initial_shift, ADMBase::initial_dtlapse, ADMBase::initial_dtshift, HydroBase::initial_hydro, and HydroBase::initial_Bvec must all be set to the value \"ID_Mag_NS\""); + CCTK_PARAMWARN ("The parameters ADMBase::initial_data, ADMBase::initial_lapse, ADMBase::initial_shift, ADMBase::initial_dtlapse, ADMBase::initial_dtshift, HydroBase::initial_hydro, and HydroBase::initial_Bvec must all be set to the value \"ID_Mag_NS\" or \"none\""); } } |