Skip to content
Snippets Groups Projects
Commit 52f22486 authored by Henry's avatar Henry
Browse files

probes: Improved formatting of header to make it easier to parse and read probe locations

New layout:

    # Probe 0 (0.0254 0.0253 0)
    # Probe 1 (0.0508 0.0253 0)
    # Probe 2 (0.0762 0.0253 0)
    #       Probe             0             1             2
    #        Time
            1e-05        142974        128861        115934
            2e-05      -69444.1        -62541      -56395.7
            3e-05      -1546.81      -1445.94      -1154.79
parent c1b53fda
Branches
Tags
No related merge requests found
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -34,7 +34,7 @@ License
namespace Foam
{
defineTypeNameAndDebug(probes, 0);
defineTypeNameAndDebug(probes, 0);
}
......@@ -228,30 +228,35 @@ Foam::label Foam::probes::prepare()
// Create directory if does not exist.
mkDir(probeDir);
OFstream* sPtr = new OFstream(probeDir/fieldName);
OFstream* fPtr = new OFstream(probeDir/fieldName);
OFstream& fout = *fPtr;
if (debug)
{
Info<< "open probe stream: " << sPtr->name() << endl;
Info<< "open probe stream: " << fout.name() << endl;
}
probeFilePtrs_.insert(fieldName, sPtr);
probeFilePtrs_.insert(fieldName, fPtr);
unsigned int w = IOstream::defaultPrecision() + 7;
for (direction cmpt=0; cmpt<vector::nComponents; cmpt++)
forAll(*this, probeI)
{
*sPtr<< '#' << setw(IOstream::defaultPrecision() + 6)
<< vector::componentNames[cmpt];
fout<< "# Probe " << probeI << ' ' << operator[](probeI)
<< endl;
}
forAll(*this, probeI)
{
*sPtr<< ' ' << setw(w) << operator[](probeI)[cmpt];
}
*sPtr << endl;
fout<< '#' << setw(IOstream::defaultPrecision() + 6)
<< "Probe";
forAll(*this, probeI)
{
fout<< ' ' << setw(w) << probeI;
}
fout<< endl;
*sPtr<< '#' << setw(IOstream::defaultPrecision() + 6)
fout<< '#' << setw(IOstream::defaultPrecision() + 6)
<< "Time" << endl;
}
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment