User: tbode Date: 2012/11/21 02:50 PM
Modified: /trunk/ interface.ccl, param.ccl, schedule.ccl /trunk/src/ Initialisation.c
Log: Add gridfunctions and boilerplate for vector potential.
File Changes:
Directory: /trunk/src/ ======================
File [modified]: Initialisation.c Delta lines: +100 -0 =================================================================== --- trunk/src/Initialisation.c 2012-11-19 18:43:49 UTC (rev 58) +++ trunk/src/Initialisation.c 2012-11-21 20:50:20 UTC (rev 59) @@ -213,6 +213,106 @@ } }
+void HydroBase_Avec_zero (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) { + Avec[i] = 0.0; + Avec[i+ np] = 0.0; + Avec[i+2*np] = 0.0; + } + + if (CCTK_EQUALS (initial_data_setup_method, "init_some_levels") || + CCTK_EQUALS (initial_data_setup_method, "init_single_level")) + { + /* do nothing */ + } + else if (CCTK_EQUALS (initial_data_setup_method, "init_all_levels")) + { + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Avec") >= 2) { +#pragma omp parallel for + for (int i=0; i<np; ++i) { + Avec_p[i] = 0.0; + Avec_p[i+ np] = 0.0; + Avec_p[i+2*np] = 0.0; + } + } + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Avec") >= 3) { +#pragma omp parallel for + for (int i=0; i<np; ++i) { + Avec_p_p[i] = 0.0; + Avec_p_p[i+ np] = 0.0; + Avec_p_p[i+2*np] = 0.0; + } + } + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Avec") >= 4) { + CCTK_WARN (CCTK_WARN_ABORT, + "Too many active time levels for HydroBase::Avec"); + } + + } + else + { + CCTK_WARN (CCTK_WARN_ABORT, + "Unsupported parameter value for InitBase::initial_data_setup_method"); + } +} + +void HydroBase_Aphi_zero (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) { + Aphi[i] = 0.0; + } + + if (CCTK_EQUALS (initial_data_setup_method, "init_some_levels") || + CCTK_EQUALS (initial_data_setup_method, "init_single_level")) + { + /* do nothing */ + } + else if (CCTK_EQUALS (initial_data_setup_method, "init_all_levels")) + { + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Aphi") >= 2) { +#pragma omp parallel for + for (int i=0; i<np; ++i) { + Aphi_p[i] = 0.0; + } + } + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Aphi") >= 3) { +#pragma omp parallel for + for (int i=0; i<np; ++i) { + Aphi_p_p[i] = 0.0; + } + } + + if (CCTK_ActiveTimeLevels(cctkGH, "HydroBase::Aphi") >= 4) { + CCTK_WARN (CCTK_WARN_ABORT, + "Too many active time levels for HydroBase::Aphi"); + } + + } + else + { + CCTK_WARN (CCTK_WARN_ABORT, + "Unsupported parameter value for InitBase::initial_data_setup_method"); + } +} + void HydroBase_InitExcisionMask (CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS;
Directory: /trunk/ ==================
File [modified]: interface.ccl Delta lines: +3 -0 =================================================================== --- trunk/interface.ccl 2012-11-19 18:43:49 UTC (rev 58) +++ trunk/interface.ccl 2012-11-21 20:50:20 UTC (rev 59) @@ -42,6 +42,9 @@ CCTK_REAL entropy type = GF Timelevels = 3 tags='ProlongationParameter="HydroBase::prolongation_type" tensortypealias="Scalar" interpolator="matter"' "Specific Entropy [k_b/baryon]"
CCTK_REAL Bvec[3] type = GF Timelevels = 3 tags='ProlongationParameter="HydroBase::prolongation_type" tensortypealias="U" tensorparity=-1 interpolator="matter"' "Magnetic field components B^i" +CCTK_REAL Avec[3] type = GF Timelevels = 3 tags='ProlongationParameter="HydroBase::prolongation_type" tensortypealias="D" jacobian="jacobian" interpolator="matter"' "Vector potential" +CCTK_REAL Aphi type = GF Timelevels = 3 tags='ProlongationParameter="HydroBase::prolongation_type" tensortypealias="Scalar" jacobian="jacobian" interpolator="matter"' "Electric potential for Lorentz Gauge"
+ # 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"
File [modified]: param.ccl Delta lines: +12 -0 =================================================================== --- trunk/param.ccl 2012-11-19 18:43:49 UTC (rev 58) +++ trunk/param.ccl 2012-11-21 20:50:20 UTC (rev 59) @@ -59,6 +59,18 @@ "zero" :: "initially set to zero" } "none"
+KEYWORD initial_Avec "Initial value for Avec" +{ + "none" :: "inactive" + "zero" :: "initially set to zero" +} "none" + +KEYWORD initial_Aphi "Initial value for Aphi" +{ + "none" :: "inactive" + "zero" :: "initially set to zero" +} "none" + KEYWORD Bvec_evolution_method "Evolution method for Bvec" { "none" :: "Evolution for Bvec is disabled"
File [modified]: schedule.ccl Delta lines: +40 -0 =================================================================== --- trunk/schedule.ccl 2012-11-19 18:43:49 UTC (rev 58) +++ trunk/schedule.ccl 2012-11-21 20:50:20 UTC (rev 59) @@ -15,6 +15,14 @@ { STORAGE: Bvec[1] } + if (!CCTK_EQUALS(initial_Avec, "none")) + { + STORAGE: Avec[1] + } + if (!CCTK_EQUALS(initial_Aphi, "none")) + { + STORAGE: Aphi[1] + } if (!CCTK_EQUALS(initial_temperature, "none")) { STORAGE: temperature[1] @@ -39,6 +47,14 @@ { STORAGE: Bvec[2] } + if (!CCTK_EQUALS(initial_Avec, "none")) + { + STORAGE: Avec[2] + } + if (!CCTK_EQUALS(initial_Aphi, "none")) + { + STORAGE: Aphi[2] + } if (!CCTK_EQUALS(initial_temperature, "none")) { STORAGE: temperature[2] @@ -63,6 +79,14 @@ { STORAGE: Bvec[3] } + if (!CCTK_EQUALS(initial_Avec, "none")) + { + STORAGE: Avec[3] + } + if (!CCTK_EQUALS(initial_Aphi, "none")) + { + STORAGE: Aphi[3] + } if (!CCTK_EQUALS(initial_temperature, "none")) { STORAGE: temperature[3] @@ -166,6 +190,22 @@ } "Set magnetic field to 0" }
+if (CCTK_Equals(initial_Avec, "zero")) +{ + SCHEDULE HydroBase_Avec_zero in HydroBase_Initial + { + LANG: C + } "Set vector potential to 0" +} + +if (CCTK_Equals(initial_Aphi, "zero")) +{ + SCHEDULE HydroBase_Aphi_zero in HydroBase_Initial + { + LANG: C + } "Set vector potential Phi to 0" +} + if (hydro_excision) { schedule GROUP HydroBase_ExcisionMaskSetup in HydroBase_Initial
commits@lists.einsteintoolkit.org