summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2014-09-11 12:05:20 +0200
committerAnton Khirnov <anton@khirnov.net>2014-09-11 12:05:20 +0200
commitef4ab28e7fc7486c47075b67d9b6ee326945f370 (patch)
tree61ceabe0c1ae2bfe1a4454f6592facb2e75889bf
parent5817b21222c84a9aaaa486216933aa068ab0f30b (diff)
Add an option for exporting the expansion coefficients.
-rw-r--r--interface.ccl2
-rw-r--r--param.ccl4
-rw-r--r--schedule.ccl4
-rw-r--r--src/brill.c3
4 files changed, 13 insertions, 0 deletions
diff --git a/interface.ccl b/interface.ccl
index 6c1213a..bdd570c 100644
--- a/interface.ccl
+++ b/interface.ccl
@@ -2,3 +2,5 @@
implements: BrillData
INHERITS: ADMBase grid CoordBase
+
+CCTK_REAL brill_coeffs TYPE=array DIM=2 SIZE=basis_order_z,basis_order_r
diff --git a/param.ccl b/param.ccl
index 068f4a6..6984c80 100644
--- a/param.ccl
+++ b/param.ccl
@@ -32,3 +32,7 @@ CCTK_INT overdet "Solve the system overdetermined by this many equations"
{
0: :: ""
} 0
+
+BOOLEAN export_coeffs "Export the coefficients of the spectral expansion in brill_coeffs"
+{
+} "no"
diff --git a/schedule.ccl b/schedule.ccl
index 9ad28f4..9f41c25 100644
--- a/schedule.ccl
+++ b/schedule.ccl
@@ -5,4 +5,8 @@ if (CCTK_Equals(initial_data, "brilldata")) {
SCHEDULE brill_data IN ADMBase_InitialData {
LANG: C
} "Brill wave initial data"
+
+ if (export_coeffs) {
+ STORAGE: brill_coeffs
+ }
}
diff --git a/src/brill.c b/src/brill.c
index 4592081..952287e 100644
--- a/src/brill.c
+++ b/src/brill.c
@@ -378,6 +378,9 @@ void brill_data(CCTK_ARGUMENTS)
brill_solve(bd);
+ if (export_coeffs)
+ memcpy(brill_coeffs, bd->psi_coeffs->data, sizeof(*brill_coeffs) * bd->nb_coeffs);
+
prev_bd = bd;
} else
bd = prev_bd;