aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--interface.ccl5
-rw-r--r--param.ccl14
-rw-r--r--schedule.ccl5
-rw-r--r--src/IDFileADM_Init.c33
-rw-r--r--src/IDFileADM_ParamCheck.c74
-rw-r--r--src/make.code.defn2
6 files changed, 127 insertions, 6 deletions
diff --git a/interface.ccl b/interface.ccl
index b9bc1c2..909ba84 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -1,5 +1,6 @@
# Interface definition for thorn IDFileADM
# $Header$
-implements: IDFileADM
-inherits: ADMBase IO
+IMPLEMENTS: IDFileADM
+
+INHERITS: ADMBase StaticConformal IO
diff --git a/param.ccl b/param.ccl
index 841ad94..94e1643 100644
--- a/param.ccl
+++ b/param.ccl
@@ -1,7 +1,7 @@
# Parameter definitions for thorn IDFileADM
# $Header$
-shares: ADMBase
+SHARES: ADMBase
EXTENDS KEYWORD initial_lapse
{
@@ -18,6 +18,16 @@ EXTENDS KEYWORD initial_data
"read from file" :: "Read the initial data using the file reader. Note that this only allows you to read the metric from a file, it does not actually do it. You still have to programme the file reader accordingly."
}
-shares: IO
+USES KEYWORD metric_type
+
+
+
+SHARES: StaticConformal
+
+USES KEYWORD conformal_storage
+
+
+
+SHARES: IO
USES STRING filereader_ID_vars
diff --git a/schedule.ccl b/schedule.ccl
index e03eacb..df19f6b 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -5,3 +5,8 @@ schedule IDFileADM_ParamCheck at PARAMCHECK
{
LANG: C
} "Ensure that all ADMBase initial data are either initialised or read from a file"
+
+schedule IDFileADM_Init at INITIAL
+{
+ LANG: C
+} "Initialise the conformal_state"
diff --git a/src/IDFileADM_Init.c b/src/IDFileADM_Init.c
new file mode 100644
index 0000000..0dbd38d
--- /dev/null
+++ b/src/IDFileADM_Init.c
@@ -0,0 +1,33 @@
+/* $Header$ */
+
+#include <assert.h>
+#include <stdlib.h>
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+/** Initialise the conformal_state. */
+void IDFileADM_Init (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ if (CCTK_EQUALS(initial_data, "read from file")) {
+ if (CCTK_EQUALS (metric_type, "physical")) {
+ *conformal_state = 0;
+ } else if (CCTK_EQUALS (metric_type, "static conformal")) {
+ if (CCTK_EQUALS (conformal_storage, "factor")) {
+ *conformal_state = 1;
+ } else if (CCTK_EQUALS (conformal_storage, "factor+derivs")) {
+ *conformal_state = 2;
+ } else if (CCTK_EQUALS (conformal_storage, "factor+derivs+2nd derivs")) {
+ *conformal_state = 3;
+ } else {
+ CCTK_WARN (0, "Unknown conformal_storage type");
+ }
+ } else {
+ CCTK_WARN (0, "Unknown metric type");
+ }
+ }
+}
diff --git a/src/IDFileADM_ParamCheck.c b/src/IDFileADM_ParamCheck.c
index 40f9bab..04171f2 100644
--- a/src/IDFileADM_ParamCheck.c
+++ b/src/IDFileADM_ParamCheck.c
@@ -52,13 +52,29 @@ void IDFileADM_ParamCheck (CCTK_ARGUMENTS)
}
}
- if (CCTK_EQUALS(initial_shift, "read from file")) {
+ if (CCTK_EQUALS(initial_data, "read from file")) {
int const igxx = CCTK_VarIndex ("ADMBase::gxx");
int const igxy = CCTK_VarIndex ("ADMBase::gxy");
int const igxz = CCTK_VarIndex ("ADMBase::gxz");
int const igyy = CCTK_VarIndex ("ADMBase::gyy");
int const igyz = CCTK_VarIndex ("ADMBase::gyz");
int const igzz = CCTK_VarIndex ("ADMBase::gzz");
+ int const ikxx = CCTK_VarIndex ("ADMBase::kxx");
+ int const ikxy = CCTK_VarIndex ("ADMBase::kxy");
+ int const ikxz = CCTK_VarIndex ("ADMBase::kxz");
+ int const ikyy = CCTK_VarIndex ("ADMBase::kyy");
+ int const ikyz = CCTK_VarIndex ("ADMBase::kyz");
+ int const ikzz = CCTK_VarIndex ("ADMBase::kzz");
+ int const ipsi = CCTK_VarIndex ("StaticConformal::psi");
+ int const ipsix = CCTK_VarIndex ("StaticConformal::psix");
+ int const ipsiy = CCTK_VarIndex ("StaticConformal::psiy");
+ int const ipsiz = CCTK_VarIndex ("StaticConformal::psiz");
+ int const ipsixx = CCTK_VarIndex ("StaticConformal::psixx");
+ int const ipsixy = CCTK_VarIndex ("StaticConformal::psixy");
+ int const ipsixz = CCTK_VarIndex ("StaticConformal::psixz");
+ int const ipsiyy = CCTK_VarIndex ("StaticConformal::psiyy");
+ int const ipsiyz = CCTK_VarIndex ("StaticConformal::psiyz");
+ int const ipsizz = CCTK_VarIndex ("StaticConformal::psizz");
assert (igxx >= 0);
assert (igxy >= 0);
assert (igxz >= 0);
@@ -73,6 +89,62 @@ void IDFileADM_ParamCheck (CCTK_ARGUMENTS)
|| ! variable_is_read[igzz]) {
CCTK_PARAMWARN ("The metric is initialised using the file reader, but the group ADMBase::metric has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
}
+ assert (ikxx >= 0);
+ assert (ikxy >= 0);
+ assert (ikxz >= 0);
+ assert (ikyy >= 0);
+ assert (ikyz >= 0);
+ assert (ikzz >= 0);
+ if (! variable_is_read[ikxx]
+ || ! variable_is_read[ikxy]
+ || ! variable_is_read[ikxz]
+ || ! variable_is_read[ikyy]
+ || ! variable_is_read[ikyz]
+ || ! variable_is_read[ikzz]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, but the group ADMBase::curv has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ if (CCTK_EQUALS (metric_type, "physical")) {
+ /* do nothing */
+ } else if (CCTK_EQUALS (metric_type, "static conformal")) {
+ if (CCTK_EQUALS (conformal_storage, "factor")) {
+ assert (ipsi >= 0);
+ if (! variable_is_read[ipsi]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, and the metric_type is \"static conformal\", and the conformal_storage is \"factor\", but the group StaticConformal::confac has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ } else if (CCTK_EQUALS (conformal_storage, "factor+derivs")) {
+ assert (ipsi >= 0);
+ if (! variable_is_read[ipsi]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, and the metric_type is \"static conformal\", and the conformal_storage is \"factor+derivs\", but the group StaticConformal::confac has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ if (! variable_is_read[ipsix]
+ || ! variable_is_read[ipsiy]
+ || ! variable_is_read[ipsiz]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, and the metric_type is \"static conformal\", and the conformal_storage is \"factor+derivs\", but the group StaticConformal::confac_1derivs has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ } else if (CCTK_EQUALS (conformal_storage, "factor+derivs+2nd derivs")) {
+ assert (ipsi >= 0);
+ if (! variable_is_read[ipsi]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, and the metric_type is \"static conformal\", and the conformal_storage is \"factor+derivs+2nd derivs\", but the group StaticConformal::confac has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ if (! variable_is_read[ipsix]
+ || ! variable_is_read[ipsiy]
+ || ! variable_is_read[ipsiz]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, and the metric_type is \"static conformal\", and the conformal_storage is \"factor+derivs+2nd derivs\", but the group StaticConformal::confac_1derivs has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ if (! variable_is_read[ipsixx]
+ || ! variable_is_read[ipsixy]
+ || ! variable_is_read[ipsixz]
+ || ! variable_is_read[ipsiyy]
+ || ! variable_is_read[ipsiyz]
+ || ! variable_is_read[ipsizz]) {
+ CCTK_PARAMWARN ("The metric is initialised using the file reader, and the metric_type is \"static conformal\", and the conformal_storage is \"factor+derivs+2nd derivs\", but the group StaticConformal::confac_2derivs has not been scheduled to be read. Please set the parameter \"IO::filereader_ID_vars\" accordingly.");
+ }
+ } else {
+ CCTK_PARAMWARN ("Unknown conformal_storage type");
+ }
+ } else {
+ CCTK_PARAMWARN ("Unknown metric type");
+ }
}
free (variable_is_read);
diff --git a/src/make.code.defn b/src/make.code.defn
index a8a6e7c..71dd988 100644
--- a/src/make.code.defn
+++ b/src/make.code.defn
@@ -2,7 +2,7 @@
# $Header$
# Source files in this directory
-SRCS = IDFileADM_ParamCheck.c
+SRCS = IDFileADM_ParamCheck.c IDFileADM_Init.c
# Subdirectories containing source files
SUBDIRS =