ENH: Updates to function objects

This commit is contained in:
andy
2012-10-16 10:47:21 +01:00
parent 967e389e94
commit 47a746b2c1
6 changed files with 30 additions and 40 deletions

View File

@ -65,25 +65,13 @@ void Foam::regionSizeDistribution::writeGraph
const scalarField& values
) const
{
const fvMesh& mesh = refCast<const fvMesh>(obr_);
const wordList valNames(1, valueName);
fileName outputPath = baseFileDir()/name_;
if (mesh.name() != fvMesh::defaultRegion)
{
outputPath = outputPath/mesh.name();
}
outputPath = outputPath/mesh.time().timeName();
fileName outputPath = baseTimeDir();
mkDir(outputPath);
OFstream str
(
outputPath
/ formatterPtr_().getFileName(coords, valNames)
);
OFstream str(outputPath/formatterPtr_().getFileName(coords, valNames));
Info<< "Writing distribution of " << valueName << " to " << str.name()
<< endl;

View File

@ -166,8 +166,7 @@ void Foam::forceCoeffs::write()
mag(binPoints_)
);
fileName forcesDir =
baseFileDir()/name_/obr_.time().timeName();
fileName forcesDir = baseTimeDir();
mkDir(forcesDir);
if (log_)

View File

@ -228,7 +228,7 @@ void Foam::forces::writeBins() const
autoPtr<writer<vector> > binWriterPtr(writer<vector>::New(binFormat_));
coordSet axis("forces", "distance", binPoints_, mag(binPoints_));
fileName forcesDir = baseFileDir()/name_/obr_.time().timeName();
fileName forcesDir = baseTimeDir();
mkDir(forcesDir);
if (log_)

View File

@ -66,12 +66,15 @@ void Foam::wallShearStress::calcShearStress
ssp = (-Sfp/magSfp) & Reffp;
vector minSsp = min(ssp);
vector maxSsp = max(ssp);
vector minSsp = gMin(ssp);
vector maxSsp = gMax(ssp);
file() << mesh.time().timeName() << token::TAB
<< pp.name() << token::TAB << minSsp
<< token::TAB << maxSsp << endl;
if (Pstream::master())
{
file() << mesh.time().timeName() << token::TAB
<< pp.name() << token::TAB << minSsp
<< token::TAB << maxSsp << endl;
}
if (log_)
{

View File

@ -84,15 +84,15 @@ void Foam::yPlusLES::calcIncompressibleYPlus
const scalarField& Yp = yPlus.boundaryField()[patchI];
scalar minYp = min(Yp);
scalar maxYp = max(Yp);
scalar avgYp = average(Yp);
scalar minYp = gMin(Yp);
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << currPatch.name()
<< " y+ : min = " << min(Yp) << ", max = " << max(Yp)
<< ", average = " << average(Yp) << nl;
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())
@ -150,15 +150,15 @@ void Foam::yPlusLES::calcCompressibleYPlus
const scalarField& Yp = yPlus.boundaryField()[patchI];
scalar minYp = min(Yp);
scalar maxYp = max(Yp);
scalar avgYp = average(Yp);
scalar minYp = gMin(Yp);
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << currPatch.name()
<< " y+ : min = " << min(Yp) << ", max = " << max(Yp)
<< ", average = " << average(Yp) << nl;
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())

View File

@ -79,9 +79,9 @@ void Foam::yPlusRAS::calcIncompressibleYPlus
yPlus.boundaryField()[patchI] = nutPw.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchI];
scalar minYp = min(Yp);
scalar maxYp = max(Yp);
scalar avgYp = average(Yp);
scalar minYp = gMin(Yp);
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
@ -137,9 +137,9 @@ void Foam::yPlusRAS::calcCompressibleYPlus
yPlus.boundaryField()[patchI] = mutPw.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchI];
scalar minYp = min(Yp);
scalar maxYp = max(Yp);
scalar avgYp = average(Yp);
scalar minYp = gMin(Yp);
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{