aboutsummaryrefslogtreecommitdiff
path: root/src/Metadata.cc
diff options
context:
space:
mode:
authorhinder <hinder@b2a53a04-0f4f-0410-87ed-f9f25ced00cf>2011-09-25 21:43:44 +0000
committerhinder <hinder@b2a53a04-0f4f-0410-87ed-f9f25ced00cf>2011-09-25 21:43:44 +0000
commit32ae652a29c362e93582fbbb718a37152a09cf33 (patch)
tree4ca6d34122e8bd200bb49538032d324381bc4061 /src/Metadata.cc
parent94234d2c4c76ac16e6e888f1bc62b2564586022b (diff)
Add output of metadata file TwoPunctures.bbh
The format and keys are defined in http://arxiv.org/abs/0709.0093 with additional draft keys defined for the NR-AR project (to be committed to the arXiv version when finalized). Also introduced grid scalars for the ADM energy and angular momentum and the puncture ADM masses. git-svn-id: http://svn.einsteintoolkit.org/cactus/EinsteinInitialData/TwoPunctures/trunk@124 b2a53a04-0f4f-0410-87ed-f9f25ced00cf
Diffstat (limited to 'src/Metadata.cc')
-rw-r--r--src/Metadata.cc64
1 files changed, 64 insertions, 0 deletions
diff --git a/src/Metadata.cc b/src/Metadata.cc
new file mode 100644
index 0000000..b67903b
--- /dev/null
+++ b/src/Metadata.cc
@@ -0,0 +1,64 @@
+
+#include <iostream>
+#include <fstream>
+#include <iomanip>
+
+#include "cctk.h"
+#include "cctk_Arguments.h"
+#include "cctk_Parameters.h"
+
+using namespace std;
+
+extern "C"
+void TwoPunctures_Metadata (CCTK_ARGUMENTS)
+{
+ DECLARE_CCTK_ARGUMENTS;
+ DECLARE_CCTK_PARAMETERS;
+
+ if (CCTK_MyProc(cctkGH) == 0)
+ {
+ ofstream o;
+ o.open(string(string(out_dir) + "/TwoPunctures.bbh").c_str());
+
+ o << setprecision(19);
+
+ o << "\
+# ==================================\n\
+# Numerical Relativity Metadata file\n\
+# ==================================\n\
+#\n\
+# This file contains information about the simulation provided by the\n\
+# TwoPunctures thorn. The format is described in the NR Data Format Document\n\
+# http://arxiv.org/abs/0709.0093 [draft SVN r707].\n\
+" << endl;
+
+ o << "[metadata]" << endl;
+ o << "initial-ADM-energy = " << *E << endl;
+ o << "initial-ADM-angular-momentumx = " << *J1 << endl;
+ o << "initial-ADM-angular-momentumy = " << *J2 << endl;
+ o << "initial-ADM-angular-momentumz = " << *J3 << endl;
+ o << "initial-separation = " << par_b * 2 << endl;
+ o << "initial-data-type = Bowen-York" << endl;
+ o << "initial-data-bibtex-keys = Bowen:1980yu Brandt:1997tf Ansorg:2004ds" << endl;
+ o << "initial-bh-position1x = " << par_b + center_offset[0] << endl;
+ o << "initial-bh-position1y = " << center_offset[1] << endl;
+ o << "initial-bh-position1z = " << center_offset[2] << endl;
+ o << "initial-bh-position2x = " << -par_b + center_offset[0] << endl;
+ o << "initial-bh-position2y = " << center_offset[1] << endl;
+ o << "initial-bh-position2z = " << center_offset[2] << endl;
+ o << "initial-bh-momentum1x = " << par_P_plus[0] << endl;
+ o << "initial-bh-momentum1y = " << par_P_plus[1] << endl;
+ o << "initial-bh-momentum1z = " << par_P_plus[2] << endl;
+ o << "initial-bh-momentum2x = " << par_P_minus[0] << endl;
+ o << "initial-bh-momentum2y = " << par_P_minus[1] << endl;
+ o << "initial-bh-momentum2z = " << par_P_minus[2] << endl;
+ o << "initial-bh-spin1x = " << par_S_plus[0] << endl;
+ o << "initial-bh-spin1y = " << par_S_plus[1] << endl;
+ o << "initial-bh-spin1z = " << par_S_plus[2] << endl;
+ o << "initial-bh-spin2x = " << par_S_minus[0] << endl;
+ o << "initial-bh-spin2y = " << par_S_minus[1] << endl;
+ o << "initial-bh-spin2z = " << par_S_minus[2] << endl;
+ o << "initial-bh-puncture-adm-mass1 = " << *mp_adm << endl;
+ o << "initial-bh-puncture-adm-mass2 = " << *mm_adm << endl;
+ }
+}