From 935d7a81315a8ce36f051a833cecc61cbe402bc6 Mon Sep 17 00:00:00 2001
From: henry <Henry Weller h.weller@opencfd.co.uk>
Date: Thu, 5 Jun 2008 20:19:41 +0100
Subject: [PATCH] Changed format to be spreadsheet-friendly:

#           x         0.05         0.03
#           y         0.05         0.04
#           z        0.001        0.001
#        Time
        0.005     0.130842   7.7749e-05
         0.01    0.0554095   -0.0100031
        0.015    0.0388121   -0.0115969
---
 src/sampling/probes/probes.C | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/sampling/probes/probes.C b/src/sampling/probes/probes.C
index 2fcd9688e6a..b47f52e1f0e 100644
--- a/src/sampling/probes/probes.C
+++ b/src/sampling/probes/probes.C
@@ -231,14 +231,22 @@ bool Foam::probes::checkFieldTypes()
 
                 probeFilePtrs_.insert(fldName, sPtr);
 
-                *sPtr<< '#' << setw(IOstream::defaultPrecision() + 6)
-                     << "Time";
+                unsigned int w = IOstream::defaultPrecision() + 7;
 
-                forAll(probeLocations_, probeI)
+                for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
                 {
-                    *sPtr << token::SPACE << probeLocations_[probeI];
+                    *sPtr<< '#' << setw(IOstream::defaultPrecision() + 6)
+                        << vector::componentNames[cmpt];
+
+                    forAll(probeLocations_, probeI)
+                    {
+                        *sPtr<< setw(w) << probeLocations_[probeI][cmpt];
+                    }
+                    *sPtr << endl;
                 }
-                *sPtr << endl;
+
+                *sPtr<< '#' << setw(IOstream::defaultPrecision() + 6)
+                    << "Time" << endl;
             }
         }
 
-- 
GitLab