aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@aei.mpg.de>2005-07-30 07:38:00 +0000
committerErik Schnetter <schnetter@aei.mpg.de>2005-07-30 07:38:00 +0000
commit4da88f3b05cef42c764c3b47ca083d6a3f70ce18 (patch)
treecff96246cd017bff50820bd6ef358b062ab795c2
parenta45f00fcf947d825707a8e74cc7fcde57b8161d0 (diff)
CarpetIOASCII: Prepend column numbers to column descriptions
Prepend column numbers to column descriptions in the header of the files. darcs-hash:20050730073824-891bb-54139304b2c3da5a767f6f1a6a357234bb6f6c74.gz
-rw-r--r--Carpet/CarpetIOASCII/src/ioascii.cc18
1 files changed, 12 insertions, 6 deletions
diff --git a/Carpet/CarpetIOASCII/src/ioascii.cc b/Carpet/CarpetIOASCII/src/ioascii.cc
index f48a5c23b..48cf6aa4d 100644
--- a/Carpet/CarpetIOASCII/src/ioascii.cc
+++ b/Carpet/CarpetIOASCII/src/ioascii.cc
@@ -1152,20 +1152,26 @@ namespace CarpetIOASCII {
<< " component " << c
<< " time level " << tl
<< endl
- << "# column format: it\ttl rl c ml\t";
+ << "# column format: 1:it\t2:tl 3:rl 4:c 5:ml";
+ int col=6;
assert (dim>=1 && dim<=3);
const char* const coords = "xyz";
- for (int d=0; d<dim-1; ++d) os << "i" << coords[d] << " "; os << "i" << coords[dim-1];
- os << "\ttime\t";
- for (int d=0; d<dim-1; ++d) os << coords[d] << " "; os << coords[dim-1];
- os << "\tdata" << endl;
+ for (int d=0; d<dim; ++d) {
+ os << (d==0 ? "\t" : " ") << col++ << ":i" << coords[d];
+ }
+ os << "\t" << col++ << ":time";
+ for (int d=0; d<dim; ++d) {
+ os << (d==0 ? "\t" : " ") << col++ << ":" << coords[d];
+ }
+ os << "\t" << col << ":data" << endl;
if (one_file_per_group) {
os << "# data columns:";
int const gindex = CCTK_GroupIndexFromVarI(vi);
int const firstvar = CCTK_FirstVarIndexI(gindex);
int const numvars = CCTK_NumVarsInGroupI(gindex);
for (int n=firstvar; n<firstvar+numvars; ++n) {
- os << " " << CCTK_VarName(n);
+ os << " " << col << ":" << CCTK_VarName(n);
+ col += CarpetSimpleMPIDatatypeLength (vartype);
}
os << endl;
}