diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-03-25 16:53:48 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-03-25 16:53:48 -0400 |
commit | afd93dce86328a3489608b729894bb34add6cb90 (patch) | |
tree | 36af56311ce273fcb01cbbb82768a3a6d3708adb /Carpet/CarpetIOASCII | |
parent | b2e07dd1f4a8a7ee0f82fc0453548cb6fa3eb1ac (diff) |
CarpetIO*: Output complex numbers as pair of real numbers
Don't use the (real,imag) notation that C++ would use by default.
Diffstat (limited to 'Carpet/CarpetIOASCII')
-rw-r--r-- | Carpet/CarpetIOASCII/src/ioascii.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc index c7dab0add..a257975a6 100644 --- a/Carpet/CarpetIOASCII/src/ioascii.cc +++ b/Carpet/CarpetIOASCII/src/ioascii.cc @@ -1467,12 +1467,23 @@ namespace CarpetIOASCII { const gdata* gfdata = gfdatas.at(n); os << (n==0 ? "\t" : " "); switch (specific_cactus_type(vartype)) { +#define CARPET_NO_COMPLEX #define TYPECASE(N,T) \ case N: \ os << (*(const data<T>*)gfdata)[index]; \ break; #include "typecase.hh" #undef TYPECASE +#undef CARPET_NO_COMPLEX +#define CARPET_COMPLEX +#define TYPECASE(N,T) \ + case N: \ + os << real((*(const data<T>*)gfdata)[index]) << " " \ + << imag((*(const data<T>*)gfdata)[index]); \ + break; +#include "typecase.hh" +#undef TYPECASE +#undef CARPET_COMPLEX default: UnsupportedVarType(vi); } |