aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschnetter <schnetter@0cbbb82d-14ec-4423-a1fb-2ab18257ecaa>2004-08-05 14:09:17 +0000
committerschnetter <schnetter@0cbbb82d-14ec-4423-a1fb-2ab18257ecaa>2004-08-05 14:09:17 +0000
commitfa5ba680a694674c70c5f3d8ada429e46fbfa91a (patch)
tree574ed5b0868b8fb4e8ed34ac2579c5e886812bec
parent7e6c532b8a0120092a422341c6e8bac4c3edf1d6 (diff)
Declare the static conformal factor with 3 time levels, and add a
parameter specifying how many should be allocated. The default is, as previously, only 1 time level. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinBase/StaticConformal/trunk@23 0cbbb82d-14ec-4423-a1fb-2ab18257ecaa
-rw-r--r--interface.ccl6
-rw-r--r--param.ccl8
-rw-r--r--schedule.ccl48
-rw-r--r--src/Evolve.c91
-rw-r--r--src/make.code.defn2
5 files changed, 142 insertions, 13 deletions
diff --git a/interface.ccl b/interface.ccl
index f0b1cd9..47f6b9c 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -8,12 +8,12 @@ public:
INT conformal_state type = SCALAR
-REAL confac TYPE = GF tags='tensortypealias="Scalar" Prolongation="None"'
+REAL confac TYPE = GF timelevels = 3 tags='tensortypealias="Scalar" Prolongation="None"'
{
psi
} "Conformal factor"
-REAL confac_1derivs TYPE = GF tags='tensortypealias="U" Prolongation="None"'
+REAL confac_1derivs TYPE = GF timelevels = 3 tags='tensortypealias="U" Prolongation="None"'
{
psix, psiy, psiz
} "First spatial derivatives of conformal factor divided by psi"
@@ -24,7 +24,7 @@ REAL confac_1derivs TYPE = GF tags='tensortypealias="U" Prolongation="None"'
# psi_1, psi_2, psi_3
#} "First spatial derivatives of conformal factor divided by psi"
-REAL confac_2derivs TYPE = GF tags='tensortypealias="dd_sym" Prolongation="None"'
+REAL confac_2derivs TYPE = GF timelevels = 3 tags='tensortypealias="dd_sym" Prolongation="None"'
{
psixx, psixy, psixz, psiyy, psiyz, psizz
} "Second spatial derivatives of conformal factor divided by psi"
diff --git a/param.ccl b/param.ccl
index 3babe4c..5f18f9d 100644
--- a/param.ccl
+++ b/param.ccl
@@ -16,3 +16,11 @@ KEYWORD conformal_storage "How much conformal storage do we have ?"
"factor+derivs" :: "Conformal factor plus first derivatives"
"factor+derivs+2nd derivs" :: "Conformal factor plus first and second derivatives"
} "factor+derivs+2nd derivs"
+
+private:
+
+INT conformal_timelevels "Number of active time levels for the conformal factor"
+{
+ 1 :: ""
+ 3 :: ""
+} 1
diff --git a/schedule.ccl b/schedule.ccl
index 750181a..a8a3599 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -13,20 +13,51 @@ if(CCTK_Equals(metric_type,"static conformal"))
} "Set the conformal_state variable to 0"
- if(CCTK_Equals(conformal_storage, "factor"))
+ if (conformal_timelevels==1)
{
- STORAGE: staticconformal::confac
- }
- if(CCTK_Equals(conformal_storage, "factor+derivs"))
+ if(CCTK_Equals(conformal_storage, "factor"))
+ {
+ STORAGE: confac[1]
+ }
+
+ if(CCTK_Equals(conformal_storage, "factor+derivs"))
+ {
+ STORAGE: confac[1], confac_1derivs[1]
+ }
+
+ if(CCTK_Equals(conformal_storage, "factor+derivs+2nd derivs"))
+ {
+ STORAGE: confac[1], confac_1derivs[1], confac_2derivs[1]
+ }
+
+ }
+ else
{
- STORAGE: staticconformal::confac, staticconformal::confac_1derivs
+
+ if(CCTK_Equals(conformal_storage, "factor"))
+ {
+ STORAGE: confac[3]
+ }
+
+ if(CCTK_Equals(conformal_storage, "factor+derivs"))
+ {
+ STORAGE: confac[3], confac_1derivs[3]
+ }
+
+ if(CCTK_Equals(conformal_storage, "factor+derivs+2nd derivs"))
+ {
+ STORAGE: confac[3], confac_1derivs[3], confac_2derivs[3]
+ }
+
}
- if(CCTK_Equals(conformal_storage, "factor+derivs+2nd derivs"))
+
+ SCHEDULE StaticConformal_Evolve at CCTK_PRESTEP
{
- STORAGE: staticconformal::confac, staticconformal::confac_1derivs, staticconformal::confac_2derivs
- }
+ LANG: C
+ } "Evolve the static conformal factor"
+
}
else
{
@@ -40,4 +71,3 @@ else
LANG: C
} "Set the conformal_state variable to 0"
}
-
diff --git a/src/Evolve.c b/src/Evolve.c
new file mode 100644
index 0000000..a9d4ca0
--- /dev/null
+++ b/src/Evolve.c
@@ -0,0 +1,91 @@
+ /*@@
+ @file Evolve.c
+ @date Thu Jul 29 2004
+ @author Erik Schnetter
+ @desc
+ Evolve the static conformal factor.
+ @enddesc
+ @version $Header$
+ @@*/
+
+#include "cctk.h"
+
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+#include <string.h>
+
+static const char *rcsid = "$Header$";
+
+CCTK_FILEVERSION(CactusEinstein_StaticConformal_Evolve_c)
+
+/********************************************************************
+ ********************* Local Data Types ***********************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* Local Routine Prototypes *********************
+ ********************************************************************/
+
+/********************************************************************
+ ***************** Scheduled Routine Prototypes *********************
+ ********************************************************************/
+
+void StaticConformal_Evolve(CCTK_ARGUMENTS);
+
+/********************************************************************
+ ********************* Other Routine Prototypes *********************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* Local Data *****************************
+ ********************************************************************/
+
+/********************************************************************
+ ********************* External Routines **********************
+ ********************************************************************/
+
+/*@@
+ @routine StaticConformal_Evolve
+ @date Thu Jul 29 2004
+ @author Erik Schnetter
+ @desc
+ Evolve the static conformal factor.
+ @enddesc
+ @calls
+ @calledby
+
+@@*/
+void StaticConformal_Evolve (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ size_t const npoints = cctk_lsh[0] * cctk_lsh[1] * cctk_lsh[2];
+
+ if (*conformal_state >= 1)
+ {
+ memcpy (psi, psi_p, npoints * sizeof *psi);
+ }
+
+ if (*conformal_state >= 2)
+ {
+ memcpy (psix, psix_p, npoints * sizeof *psix);
+ memcpy (psiy, psiy_p, npoints * sizeof *psiy);
+ memcpy (psiz, psiz_p, npoints * sizeof *psiz);
+ }
+
+ if (*conformal_state >= 3)
+ {
+ memcpy (psixx, psixx_p, npoints * sizeof *psixx);
+ memcpy (psixy, psixy_p, npoints * sizeof *psixy);
+ memcpy (psixz, psixz_p, npoints * sizeof *psixz);
+ memcpy (psiyy, psiyy_p, npoints * sizeof *psiyy);
+ memcpy (psiyz, psiyz_p, npoints * sizeof *psiyz);
+ memcpy (psizz, psizz_p, npoints * sizeof *psizz);
+ }
+}
+
+/********************************************************************
+ ********************* Local Routines *************************
+ ********************************************************************/
diff --git a/src/make.code.defn b/src/make.code.defn
index db87b26..ccbdcf1 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = Initialise.c ConfPhys.c
+SRCS = Initialise.c Evolve.c ConfPhys.c
# Subdirectories containing source files
SUBDIRS =