aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortbode <tbode@57fe0bb3-ccba-405f-9b23-de0201f165b7>2012-11-21 20:50:20 +0000
committertbode <tbode@57fe0bb3-ccba-405f-9b23-de0201f165b7>2012-11-21 20:50:20 +0000
commita79a6ab37879bbb2e37be5a3998a0fe3944536ae (patch)
tree57ae41120c76ec35a09d0c8c43b03ce35b6f679c
parentb833e38e6c75034d807693e7cfb5f824d6cc597a (diff)
Add gridfunctions and boilerplate for vector potential.
git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/HydroBase/trunk@59 57fe0bb3-ccba-405f-9b23-de0201f165b7
-rwxr-xr-xinterface.ccl3
-rwxr-xr-xparam.ccl12
-rwxr-xr-xschedule.ccl40
-rw-r--r--src/Initialisation.c100
4 files changed, 155 insertions, 0 deletions
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<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;