From a79a6ab37879bbb2e37be5a3998a0fe3944536ae Mon Sep 17 00:00:00 2001 From: tbode Date: Wed, 21 Nov 2012 20:50:20 +0000 Subject: Add gridfunctions and boilerplate for vector potential. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/HydroBase/trunk@59 57fe0bb3-ccba-405f-9b23-de0201f165b7 --- interface.ccl | 3 ++ param.ccl | 12 +++++++ schedule.ccl | 40 +++++++++++++++++++++ src/Initialisation.c | 100 +++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 155 insertions(+) diff --git a/interface.ccl b/interface.ccl index c183c2a..fa4fcd3 100755 --- a/interface.ccl +++ b/interface.ccl @@ -42,6 +42,9 @@ CCTK_REAL temperature type = GF Timelevels = 3 tags='ProlongationParameter="Hydr 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" diff --git a/param.ccl b/param.ccl index 5267e80..389d481 100755 --- a/param.ccl +++ b/param.ccl @@ -59,6 +59,18 @@ KEYWORD initial_Bvec "Initial value for Bvec" "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" diff --git a/schedule.ccl b/schedule.ccl index 2e8207e..3389936 100755 --- a/schedule.ccl +++ b/schedule.ccl @@ -15,6 +15,14 @@ if (timelevels == 1) { 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 @@ else if (timelevels == 2) { 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 @@ else if (timelevels == 3) { 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 @@ if (CCTK_Equals(initial_Bvec, "zero")) } "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 diff --git a/src/Initialisation.c b/src/Initialisation.c index 4ed861f..9c6e366 100644 --- a/src/Initialisation.c +++ b/src/Initialisation.c @@ -213,6 +213,106 @@ void HydroBase_Bvec_zero (CCTK_ARGUMENTS) } } +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= 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::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= 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::Aphi"); + } + + } + else + { + CCTK_WARN (CCTK_WARN_ABORT, + "Unsupported parameter value for InitBase::initial_data_setup_method"); + } +} + void HydroBase_InitExcisionMask (CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; -- cgit v1.2.3