aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorschnetter <schnetter@d576a68a-b34a-40ae-82fc-004fa1a9d16f>2008-04-15 19:39:13 +0000
committerschnetter <schnetter@d576a68a-b34a-40ae-82fc-004fa1a9d16f>2008-04-15 19:39:13 +0000
commitd25c51164d53a3e18c24daf7e1b202e944a7a0b0 (patch)
tree76cbb09ff93905b11720be4ccb503e45803b6223 /src
parent3090085c8c0c29d6d62f550283d02c51061d2343 (diff)
Add new grid functions for dtlapse and dtbetax, dtbetay, and dtbetaz.
Also add several state variables so that codes can determine whether these variables have storage; storage is off by default for backwards compatibility. This is similar to the way in which the shift vector is handled, which also has no storage by default. This is necessary since the ADMBase variables store currently the 3-metric, lapse, shift, and extrinsic curvature. They do not store the time derivatives of lapse and shift, which makes it impossible to calculate the time derivative of the 4-metric from the ADMBase variables. This is a shortcoming, since almost all current evolution systems require these, including common BSSN gauge conditions and harmonic evolution schemes. (In many cases, initial data assume that these additional time derivatives are zero to get around this issue.) git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/ADMBase/trunk@40 d576a68a-b34a-40ae-82fc-004fa1a9d16f
Diffstat (limited to 'src')
-rw-r--r--src/Initialisation.c186
1 files changed, 186 insertions, 0 deletions
diff --git a/src/Initialisation.c b/src/Initialisation.c
index ba0bba8..f24c672 100644
--- a/src/Initialisation.c
+++ b/src/Initialisation.c
@@ -33,9 +33,15 @@ CCTK_FILEVERSION(CactusEinstein_ADMBase_Initialisation_c)
void ADMBase_CartesianMinkowski(CCTK_ARGUMENTS);
void ADMBase_LapseOne(CCTK_ARGUMENTS);
void ADMBase_ShiftZero(CCTK_ARGUMENTS);
+void ADMBase_DtlapseZero(CCTK_ARGUMENTS);
+void ADMBase_DtshiftZero(CCTK_ARGUMENTS);
void ADMBase_SetShiftStateOn(CCTK_ARGUMENTS);
void ADMBase_SetShiftStateOff(CCTK_ARGUMENTS);
+void ADMBase_SetDtlapseStateOn(CCTK_ARGUMENTS);
+void ADMBase_SetDtlapseStateOff(CCTK_ARGUMENTS);
+void ADMBase_SetDtshiftStateOn(CCTK_ARGUMENTS);
+void ADMBase_SetDtshiftStateOff(CCTK_ARGUMENTS);
/********************************************************************
********************* Other Routine Prototypes *********************
@@ -249,6 +255,98 @@ void ADMBase_ShiftZero(CCTK_ARGUMENTS)
}
/*@@
+ @routine ADMBase_DtlapseZero
+ @date Sep 06 2006
+ @author Erik Schnetter
+ @desc
+ Scheduled routine to initialise dtlapse to zero.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+ @@*/
+void ADMBase_DtlapseZero(CCTK_ARGUMENTS)
+{
+ int i;
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++)
+ {
+ dtalp[i] = 0.0;
+ }
+
+ if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtlapse") > 1)
+ {
+ for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++)
+ {
+ dtalp_p[i] = 0.0;
+ }
+ }
+
+ if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtlapse") > 2)
+ {
+ for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++)
+ {
+ dtalp_p_p[i] = 0.0;
+ }
+ }
+
+}
+
+/*@@
+ @routine ADMBase_DtshiftZero
+ @date Sep 06 2006
+ @author Erik Schnetter
+ @desc
+ Scheduled routine to initialise dtshift to zero.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+ @@*/
+void ADMBase_DtshiftZero(CCTK_ARGUMENTS)
+{
+ int i;
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++)
+ {
+ dtbetax[i] = 0.0;
+ dtbetay[i] = 0.0;
+ dtbetaz[i] = 0.0;
+ }
+
+ if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtshift") > 1)
+ {
+ for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++)
+ {
+ dtbetax_p[i] = 0.0;
+ dtbetay_p[i] = 0.0;
+ dtbetaz_p[i] = 0.0;
+ }
+ }
+
+ if (CCTK_ActiveTimeLevels(cctkGH, "ADMBase::dtshift") > 2)
+ {
+ for(i = 0; i < cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; i++)
+ {
+ dtbetax_p_p[i] = 0.0;
+ dtbetay_p_p[i] = 0.0;
+ dtbetaz_p_p[i] = 0.0;
+ }
+ }
+
+}
+
+/*@@
@routine ADMBase_SetShiftStateOn
@date Thu Apr 25 23:12:18 2002
@author Tom Goodale
@@ -292,6 +390,94 @@ void ADMBase_SetShiftStateOff(CCTK_ARGUMENTS)
*shift_state = 0;
}
+/*@@
+ @routine ADMBase_SetDtlapseStateOn
+ @date Sep 06 2006
+ @author Erik Schnetter
+ @desc
+ Scheduled routine to set the value of the dtlapse state to on.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+ @@*/
+void ADMBase_SetDtlapseStateOn(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ *dtlapse_state = 1;
+}
+
+/*@@
+ @routine ADMBase_SetDtlapseStateOff
+ @date Sep 06 2006
+ @author Erik Schnetter
+ @desc
+ Scheduled routine to set the value of the dtlapse state to off.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+ @@*/
+void ADMBase_SetDtlapseStateOff(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ *dtlapse_state = 0;
+}
+
+/*@@
+ @routine ADMBase_SetDtshiftStateOn
+ @date Sep 06 2006
+ @author Erik Schnetter
+ @desc
+ Scheduled routine to set the value of the dtshift state to on.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+ @@*/
+void ADMBase_SetDtshiftStateOn(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ *dtshift_state = 1;
+}
+
+/*@@
+ @routine ADMBase_SetDtshiftStateOff
+ @date Sep 06 2006
+ @author Erik Schnetter
+ @desc
+ Scheduled routine to set the value of the dtshift state to off.
+ @enddesc
+ @calls
+ @calledby
+ @history
+
+ @endhistory
+
+ @@*/
+void ADMBase_SetDtshiftStateOff(CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ *dtshift_state = 0;
+}
+
/********************************************************************