From ef4ab28e7fc7486c47075b67d9b6ee326945f370 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Thu, 11 Sep 2014 12:05:20 +0200 Subject: Add an option for exporting the expansion coefficients. --- interface.ccl | 2 ++ param.ccl | 4 ++++ schedule.ccl | 4 ++++ src/brill.c | 3 +++ 4 files changed, 13 insertions(+) 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; -- cgit v1.2.3