aboutsummaryrefslogtreecommitdiff
path: root/src/Static.c
diff options
context:
space:
mode:
authorschnetter <schnetter@d576a68a-b34a-40ae-82fc-004fa1a9d16f>2010-01-23 20:12:37 +0000
committerschnetter <schnetter@d576a68a-b34a-40ae-82fc-004fa1a9d16f>2010-01-23 20:12:37 +0000
commitf4406d8869f626808e5aeb26a258727eba9b4442 (patch)
tree1b328e4a8dfefee638ddbee99bd0c3838dffc76c /src/Static.c
parent37ba0b8ba7feddbc3137b00c94c05f0f5037b641 (diff)
Add "static" as synonym to "none" to metric evolution keywords. The
gauges already use the "static" keyword for this. Rename some methods to have proper capitalisation, e.g. from "SetDtlapse" to "SetDtLapse". Initialise DtLapse and DtShift to zero if these initial conditions are chosen. ADMBase already initialises metric, lapse, and shift when Minkowski initial conditions are chosen. Evolve all ADMBase variables if they have the evolution method "static", which is offered by ADMBase. This evolution copies the past to the current time level in cctk_prestep, which works with and without CactusBase/MoL. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/ADMBase/trunk@48 d576a68a-b34a-40ae-82fc-004fa1a9d16f
Diffstat (limited to 'src/Static.c')
-rw-r--r--src/Static.c72
1 files changed, 72 insertions, 0 deletions
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);
+ }
+}