diff options
-rw-r--r-- | param.ccl | 5 | ||||
-rw-r--r-- | schedule.ccl | 77 | ||||
-rw-r--r-- | src/Initialisation.c | 128 | ||||
-rw-r--r-- | src/Static.c | 72 | ||||
-rw-r--r-- | src/make.code.defn | 2 |
5 files changed, 235 insertions, 49 deletions
@@ -35,8 +35,9 @@ KEYWORD initial_dtshift "Initial dtshift value" KEYWORD evolution_method "The metric an extrinsic curvature evolution method" { - "none" :: "metric and extrinsic curvature are not evolved" -} "none" + "none" :: "The metric and extrinsic curvature are not evolved" + "static" :: "The metric and extrinsic curvature are not evolved" +} "static" KEYWORD lapse_evolution_method "The lapse evolution method" { diff --git a/schedule.ccl b/schedule.ccl index 200f405..61274db 100644 --- a/schedule.ccl +++ b/schedule.ccl @@ -61,70 +61,91 @@ else } "Set the shift_state variable to 0" } -# Initial data for the shift - -if(CCTK_Equals(initial_shift, "zero")) +# Do we have storage for dtlapse? +if (! CCTK_Equals(initial_dtlapse, "none")) { - SCHEDULE ADMBase_ShiftZero in ADMBase_InitialGauge + SCHEDULE ADMBase_SetDtLapseStateOn at CCTK_BASEGRID { LANG: C - } "Set the shift to 0 at all points" + } "Set the dtlapse_state variable to 1" } - -# Do we have storage for dtlapse ? -if (!CCTK_Equals(initial_dtlapse, "none")) +else { STORAGE: dtlapse[1] + SCHEDULE ADMBase_SetDtLapseStateOff at CCTK_BASEGRID + { + LANG: C + } "Set the dtlapse_state variable to 0" +} - SCHEDULE ADMBase_SetDtlapseStateOn at CCTK_BASEGRID +# Do we have storage for dtshift? +if (! CCTK_Equals(initial_dtshift, "none")) +{ + SCHEDULE ADMBase_SetDtShiftStateOn at CCTK_BASEGRID { LANG: C - } "Set the dtlapse_state variable to 1" + } "Set the dtshift_state variable to 1" } else { - SCHEDULE ADMBase_SetDtlapseStateOff at CCTK_BASEGRID + SCHEDULE ADMBase_SetDtShiftStateOff at CCTK_BASEGRID { LANG: C - } "Set the dtlase_state variable to 0" + } "Set the dtshift_state variable to 0" } -# Initial data for dtlapse - -if(CCTK_Equals(initial_dtlapse, "zero")) +# Initial data for the shift +if (CCTK_Equals(initial_shift, "zero")) { - SCHEDULE ADMBase_DtlapseZero in ADMBase_InitialGauge + SCHEDULE ADMBase_ShiftZero in ADMBase_InitialGauge { LANG: C - } "Set dtlapse to 0 at all points" + } "Set the shift to 0 at all points" } -# Do we have storage for dtshift ? -if (!CCTK_Equals(initial_dtshift, "none")) +# Initial data for dtlapse +if (CCTK_Equals(initial_dtlapse, "zero")) { STORAGE: dtshift[1] + SCHEDULE ADMBase_DtLapseZero in ADMBase_InitialGauge + { + LANG: C + } "Set the dtlapse to 0 at all points" +} - SCHEDULE ADMBase_SetDtshiftStateOn at CCTK_BASEGRID +# Initial data for dtshift +if (CCTK_Equals(initial_dtshift, "zero")) +{ + SCHEDULE ADMBase_DtShiftZero in ADMBase_InitialGauge { LANG: C - } "Set the dtshift_state variable to 1" + } "Set the dtshift to 0 at all points" } -else + + + +if (CCTK_Equals(lapse_evolution_method, "static")) { - SCHEDULE ADMBase_SetDtshiftStateOff at CCTK_BASEGRID + SCHEDULE ADMBase_LapseStatic in CCTK_PRESTEP { LANG: C - } "Set the dtlase_state variable to 0" + } "Copy the lapse to the current time level" } -# Initial data for dtshift +if (CCTK_Equals(shift_evolution_method, "static")) +{ + SCHEDULE ADMBase_ShiftStatic in CCTK_PRESTEP + { + LANG: C + } "Copy the shift to the current time level" +} -if(CCTK_Equals(initial_dtshift, "zero")) +if (CCTK_Equals(evolution_method, "static") || CCTK_Equals(evolution_method, "none")) { - SCHEDULE ADMBase_DtshiftZero in ADMBase_InitialGauge + SCHEDULE ADMBase_Static in CCTK_PRESTEP { LANG: C - } "Set dtshift to 0 at all points" + } "Copy the metric and extrinsic curvature to the current time level" } # FIXME: Remove this when symmetries done better diff --git a/src/Initialisation.c b/src/Initialisation.c index f24c672..10fae5e 100644 --- a/src/Initialisation.c +++ b/src/Initialisation.c @@ -33,15 +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_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); +void ADMBase_SetDtLapseStateOn(CCTK_ARGUMENTS); +void ADMBase_SetDtLapseStateOff(CCTK_ARGUMENTS); +void ADMBase_SetDtShiftStateOn(CCTK_ARGUMENTS); +void ADMBase_SetDtShiftStateOff(CCTK_ARGUMENTS); /******************************************************************** ********************* Other Routine Prototypes ********************* @@ -255,6 +255,98 @@ void ADMBase_ShiftZero(CCTK_ARGUMENTS) } /*@@ + @routine ADMBase_DtLapseZero + @date Oct 18 2007 + @author Erik Schnetter + @desc + Scheduled routine to initialise the 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 Oct 18 2007 + @author Erik Schnetter + @desc + Scheduled routine to initialise the 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_DtlapseZero @date Sep 06 2006 @author Erik Schnetter @@ -391,8 +483,8 @@ void ADMBase_SetShiftStateOff(CCTK_ARGUMENTS) } /*@@ - @routine ADMBase_SetDtlapseStateOn - @date Sep 06 2006 + @routine ADMBase_SetDtLapseStateOn + @date Oct 18 2007 @author Erik Schnetter @desc Scheduled routine to set the value of the dtlapse state to on. @@ -404,7 +496,7 @@ void ADMBase_SetShiftStateOff(CCTK_ARGUMENTS) @endhistory @@*/ -void ADMBase_SetDtlapseStateOn(CCTK_ARGUMENTS) +void ADMBase_SetDtLapseStateOn(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; @@ -413,8 +505,8 @@ void ADMBase_SetDtlapseStateOn(CCTK_ARGUMENTS) } /*@@ - @routine ADMBase_SetDtlapseStateOff - @date Sep 06 2006 + @routine ADMBase_SetDtLapseStateOff + @date Oct 18 2007 @author Erik Schnetter @desc Scheduled routine to set the value of the dtlapse state to off. @@ -426,7 +518,7 @@ void ADMBase_SetDtlapseStateOn(CCTK_ARGUMENTS) @endhistory @@*/ -void ADMBase_SetDtlapseStateOff(CCTK_ARGUMENTS) +void ADMBase_SetDtLapseStateOff(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; @@ -435,8 +527,8 @@ void ADMBase_SetDtlapseStateOff(CCTK_ARGUMENTS) } /*@@ - @routine ADMBase_SetDtshiftStateOn - @date Sep 06 2006 + @routine ADMBase_SetDtShiftStateOn + @date Oct 18 2007 @author Erik Schnetter @desc Scheduled routine to set the value of the dtshift state to on. @@ -448,7 +540,7 @@ void ADMBase_SetDtlapseStateOff(CCTK_ARGUMENTS) @endhistory @@*/ -void ADMBase_SetDtshiftStateOn(CCTK_ARGUMENTS) +void ADMBase_SetDtShiftStateOn(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; @@ -457,8 +549,8 @@ void ADMBase_SetDtshiftStateOn(CCTK_ARGUMENTS) } /*@@ - @routine ADMBase_SetDtshiftStateOff - @date Sep 06 2006 + @routine ADMBase_SetDtShiftStateOff + @date Oct 18 2007 @author Erik Schnetter @desc Scheduled routine to set the value of the dtshift state to off. @@ -470,7 +562,7 @@ void ADMBase_SetDtshiftStateOn(CCTK_ARGUMENTS) @endhistory @@*/ -void ADMBase_SetDtshiftStateOff(CCTK_ARGUMENTS) +void ADMBase_SetDtShiftStateOff(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS; DECLARE_CCTK_PARAMETERS; diff --git a/src/Static.c b/src/Static.c new file mode 100644 index 0000000..59ea223 --- /dev/null +++ b/src/Static.c @@ -0,0 +1,72 @@ +#include <string.h> + +#include "cctk.h" +#include "cctk_Arguments.h" + +void ADMBase_LapseStatic (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + int npoints; + + if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::lapse") > 1) + { + npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + memcpy (alp, alp_p, npoints * sizeof *alp); + } + + if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::dtlapse") > 1) + { + npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + memcpy (dtalp, dtalp_p, npoints * sizeof *dtalp); + } +} + +void ADMBase_ShiftStatic (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + int npoints; + + if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::shift") > 1) + { + npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + memcpy (betax, betax_p, npoints * sizeof *betax); + memcpy (betay, betay_p, npoints * sizeof *betay); + memcpy (betaz, betaz_p, npoints * sizeof *betaz); + } + + if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::dtshift") > 1) + { + npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + memcpy (dtbetax, dtbetax_p, npoints * sizeof *dtbetax); + memcpy (dtbetay, dtbetay_p, npoints * sizeof *dtbetay); + memcpy (dtbetaz, dtbetaz_p, npoints * sizeof *dtbetaz); + } +} + +void ADMBase_Static (CCTK_ARGUMENTS) +{ + DECLARE_CCTK_ARGUMENTS; + int npoints; + + if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::metric") > 1) + { + npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + memcpy (gxx, gxx_p, npoints * sizeof *gxx); + memcpy (gxy, gxy_p, npoints * sizeof *gxy); + memcpy (gxz, gxz_p, npoints * sizeof *gxz); + memcpy (gyy, gyy_p, npoints * sizeof *gyy); + memcpy (gyz, gyz_p, npoints * sizeof *gyz); + memcpy (gzz, gzz_p, npoints * sizeof *gzz); + } + + if (CCTK_ActiveTimeLevelsGN (cctkGH, "ADMBase::curv") > 1) + { + npoints = cctk_lsh[0]*cctk_lsh[1]*cctk_lsh[2]; + memcpy (kxx, kxx_p, npoints * sizeof *kxx); + memcpy (kxy, kxy_p, npoints * sizeof *kxy); + memcpy (kxz, kxz_p, npoints * sizeof *kxz); + memcpy (kyy, kyy_p, npoints * sizeof *kyy); + memcpy (kyz, kyz_p, npoints * sizeof *kyz); + memcpy (kzz, kzz_p, npoints * sizeof *kzz); + } +} diff --git a/src/make.code.defn b/src/make.code.defn index fe350cd..9e589ef 100644 --- a/src/make.code.defn +++ b/src/make.code.defn @@ -2,7 +2,7 @@ # $Header$ # Source files in this directory -SRCS = ParamCheck.c Initialisation.c InitSymBound.c +SRCS = ParamCheck.c Initialisation.c Static.c InitSymBound.c # Subdirectories containing source files SUBDIRS = |