aboutsummaryrefslogtreecommitdiff
path: root/src/portal.cc
diff options
context:
space:
mode:
authorschnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f>2006-06-14 18:29:46 +0000
committerschnetter <schnetter@83718e91-0e4f-0410-abf4-91180603181f>2006-06-14 18:29:46 +0000
commit6ef9a668200bbe058d75b4da9ad9a87b5a10513b (patch)
treee94bcdd3c00b72bc17adf865887527b6d87b2eb6 /src/portal.cc
parent4f7cb5b9a1ba8ece2f1d5a6ad6411e107c806b9f (diff)
Make things work when CCTK_REAL is not double and when CCTK_INT is not
int. Rename field "simulation id" to "jobid" when writing to a file. This makes the field name consistent with thorn Announce. Announce field "jobid" with RDF. git-svn-id: http://svn.cactuscode.org/arrangements/CactusUtils/Formaline/trunk@84 83718e91-0e4f-0410-abf4-91180603181f
Diffstat (limited to 'src/portal.cc')
-rw-r--r--src/portal.cc16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/portal.cc b/src/portal.cc
index be5aab4..83e26fb 100644
--- a/src/portal.cc
+++ b/src/portal.cc
@@ -359,7 +359,7 @@ namespace Formaline
void portal::
store (char const * const key,
- int const value)
+ CCTK_INT const value)
{
assert (key);
@@ -378,14 +378,24 @@ namespace Formaline
void portal::
store (char const * const key,
- double const value)
+ CCTK_REAL const value)
{
assert (key);
+
+#if defined CCTK_REAL_PRECISION_4
+ int const prec = 6;
+#elif defined CCTK_REAL_PRECISION_8
+ int const prec = 15;
+#elif defined CCTK_REAL_PRECISION_16
+ int const prec = 30;
+#else
+ int const prec = 15;
+#endif
ostringstream keybuf;
keybuf << key;
ostringstream valuebuf;
- valuebuf << setprecision(15) << value;
+ valuebuf << setprecision(prec) << value;
msgbuf << "<member>"
<< "<name>" << clean (keybuf.str()) << "</name>"