messageStream: Added 'Log' macro which outputs to 'Info' if 'log' is true

regionFunctionObject: moved 'log_' to public 'log' to support the 'Log' macro
This commit is contained in:
Henry Weller
2016-05-25 18:19:46 +01:00
parent 82ca430a02
commit ee462f8241
23 changed files with 80 additions and 89 deletions

View File

@ -313,6 +313,11 @@ extern messageStream Info;
<< #var " " << var << ::Foam::endl << #var " " << var << ::Foam::endl
//- Report write to Foam::Info if the local log switch is true
#define Log \
if (log) Info
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif

View File

@ -49,7 +49,7 @@ bool Foam::functionObjects::regionFunctionObject::writeObject
{ {
const regIOobject& field = obr_.lookupObject<regIOobject>(fieldName); const regIOobject& field = obr_.lookupObject<regIOobject>(fieldName);
if (log_) if (log)
{ {
Info<< "functionObjects::" << type() << " " << name() Info<< "functionObjects::" << type() << " " << name()
<< " writing field: " << field.name() << endl; << " writing field: " << field.name() << endl;
@ -109,7 +109,7 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
dict.lookupOrDefault("region", polyMesh::defaultRegion) dict.lookupOrDefault("region", polyMesh::defaultRegion)
) )
), ),
log_(true) log(true)
{} {}
@ -123,7 +123,7 @@ Foam::functionObjects::regionFunctionObject::regionFunctionObject
functionObject(name), functionObject(name),
time_(obr.time()), time_(obr.time()),
obr_(obr), obr_(obr),
log_(true) log(true)
{} {}
@ -137,7 +137,7 @@ Foam::functionObjects::regionFunctionObject::~regionFunctionObject()
bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict) bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict)
{ {
log_ = dict.lookupOrDefault<Switch>("log", true); log = dict.lookupOrDefault<Switch>("log", true);
return true; return true;
} }

View File

@ -72,9 +72,6 @@ protected:
//- Reference to the region objectRegistry //- Reference to the region objectRegistry
const objectRegistry& obr_; const objectRegistry& obr_;
//- Switch to send output to Info as well as to file
Switch log_;
// Protected member functions // Protected member functions
@ -118,6 +115,9 @@ public:
//- Runtime type information //- Runtime type information
TypeName("regionFunctionObject"); TypeName("regionFunctionObject");
//- Switch write log to Info
Switch log;
// Constructors // Constructors

View File

@ -95,7 +95,7 @@ void Foam::functionObjects::fieldAverage::initialize()
void Foam::functionObjects::fieldAverage::restart() void Foam::functionObjects::fieldAverage::restart()
{ {
if (log_) Info Log
<< " Restarting averaging at time " << obr_.time().timeName() << " Restarting averaging at time " << obr_.time().timeName()
<< nl << endl; << nl << endl;
@ -134,7 +134,7 @@ void Foam::functionObjects::fieldAverage::calcAverages()
periodIndex_++; periodIndex_++;
} }
if (log_) Info Log
<< type() << " " << name() << " output:" << nl << type() << " " << name() << " output:" << nl
<< " Calculating averages" << nl; << " Calculating averages" << nl;
@ -156,13 +156,13 @@ void Foam::functionObjects::fieldAverage::calcAverages()
totalTime_[fieldi] += obr_.time().deltaTValue(); totalTime_[fieldi] += obr_.time().deltaTValue();
} }
if (log_) Info<< endl; Log << endl;
} }
void Foam::functionObjects::fieldAverage::writeAverages() const void Foam::functionObjects::fieldAverage::writeAverages() const
{ {
if (log_) Info<< " Writing average fields" << endl; Log << " Writing average fields" << endl;
writeFields<scalar>(); writeFields<scalar>();
writeFields<vector>(); writeFields<vector>();
@ -170,7 +170,7 @@ void Foam::functionObjects::fieldAverage::writeAverages() const
writeFields<symmTensor>(); writeFields<symmTensor>();
writeFields<tensor>(); writeFields<tensor>();
if (log_) Info<< endl; Log << endl;
} }
@ -200,7 +200,7 @@ void Foam::functionObjects::fieldAverage::writeAveragingProperties() const
propsDict.regIOobject::write(); propsDict.regIOobject::write();
if (log_) Info<< endl; Log << endl;
} }
@ -212,7 +212,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
totalTime_.clear(); totalTime_.clear();
totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue()); totalTime_.setSize(faItems_.size(), obr_.time().deltaTValue());
if ((restartOnRestart_ || restartOnOutput_) && log_) if ((restartOnRestart_ || restartOnOutput_) && log)
{ {
Info<< " Starting averaging at time " << obr_.time().timeName() Info<< " Starting averaging at time " << obr_.time().timeName()
<< nl; << nl;
@ -232,7 +232,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
if (!propsDictHeader.headerOk()) if (!propsDictHeader.headerOk())
{ {
if (log_) Info Log
<< " Starting averaging at time " << " Starting averaging at time "
<< obr_.time().timeName() << nl; << obr_.time().timeName() << nl;
@ -241,7 +241,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
IOdictionary propsDict(propsDictHeader); IOdictionary propsDict(propsDictHeader);
if (log_) Info<< " Restarting averaging for fields:" << nl; Log << " Restarting averaging for fields:" << nl;
forAll(faItems_, fieldi) forAll(faItems_, fieldi)
{ {
@ -253,7 +253,7 @@ void Foam::functionObjects::fieldAverage::readAveragingProperties()
totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter")); totalIter_[fieldi] = readLabel(fieldDict.lookup("totalIter"));
totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime")); totalTime_[fieldi] = readScalar(fieldDict.lookup("totalTime"));
if (log_) Info Log
<< " " << fieldName << " " << fieldName
<< " iters = " << totalIter_[fieldi] << " iters = " << totalIter_[fieldi]
<< " time = " << totalTime_[fieldi] << nl; << " time = " << totalTime_[fieldi] << nl;
@ -302,7 +302,7 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
initialised_ = false; initialised_ = false;
if (log_) Info<< type() << " " << name() << ":" << nl; Log << type() << " " << name() << ":" << nl;
dict.readIfPresent("restartOnRestart", restartOnRestart_); dict.readIfPresent("restartOnRestart", restartOnRestart_);
dict.readIfPresent("restartOnOutput", restartOnOutput_); dict.readIfPresent("restartOnOutput", restartOnOutput_);
@ -316,7 +316,7 @@ bool Foam::functionObjects::fieldAverage::read(const dictionary& dict)
readAveragingProperties(); readAveragingProperties();
if (log_) Info<< endl; Log << endl;
return true; return true;
} }

View File

@ -36,7 +36,7 @@ void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldi)
const word& fieldName = faItems_[fieldi].fieldName(); const word& fieldName = faItems_[fieldi].fieldName();
const word& meanFieldName = faItems_[fieldi].meanFieldName(); const word& meanFieldName = faItems_[fieldi].meanFieldName();
if (log_) Info<< " Reading/initialising field " << meanFieldName << endl; Log << " Reading/initialising field " << meanFieldName << endl;
if (obr_.foundObject<Type>(meanFieldName)) if (obr_.foundObject<Type>(meanFieldName))
{ {
@ -44,8 +44,7 @@ void Foam::functionObjects::fieldAverage::addMeanFieldType(const label fieldi)
} }
else if (obr_.found(meanFieldName)) else if (obr_.found(meanFieldName))
{ {
if (log_) Info Log << " Cannot allocate average field " << meanFieldName
<< " Cannot allocate average field " << meanFieldName
<< " since an object with that name already exists." << " since an object with that name already exists."
<< " Disabling averaging for field." << endl; << " Disabling averaging for field." << endl;
@ -112,8 +111,7 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType
const word& meanFieldName = faItems_[fieldi].meanFieldName(); const word& meanFieldName = faItems_[fieldi].meanFieldName();
const word& prime2MeanFieldName = faItems_[fieldi].prime2MeanFieldName(); const word& prime2MeanFieldName = faItems_[fieldi].prime2MeanFieldName();
if (log_) Info Log << " Reading/initialising field " << prime2MeanFieldName << nl;
<< " Reading/initialising field " << prime2MeanFieldName << nl;
if (obr_.foundObject<Type2>(prime2MeanFieldName)) if (obr_.foundObject<Type2>(prime2MeanFieldName))
{ {
@ -121,8 +119,7 @@ void Foam::functionObjects::fieldAverage::addPrime2MeanFieldType
} }
else if (obr_.found(prime2MeanFieldName)) else if (obr_.found(prime2MeanFieldName))
{ {
if (log_) Info Log << " Cannot allocate average field " << prime2MeanFieldName
<< " Cannot allocate average field " << prime2MeanFieldName
<< " since an object with that name already exists." << " since an object with that name already exists."
<< " Disabling averaging for field." << nl; << " Disabling averaging for field." << nl;

View File

@ -60,8 +60,7 @@ fieldCoordinateSystemTransform
{ {
read(dict); read(dict);
if (log_) Info Log << type() << " " << name << ":" << nl
<< type() << " " << name << ":" << nl
<< " Applying transformation from global Cartesian to local " << " Applying transformation from global Cartesian to local "
<< coordSys_ << nl << endl; << coordSys_ << nl << endl;
} }

View File

@ -151,7 +151,7 @@ bool Foam::functionObjects::fieldMinMax::write(const bool postProcess)
writeFiles::write(); writeFiles::write();
if (!location_) writeTime(file()); if (!location_) writeTime(file());
if (log_) Info<< type() << " " << name() << " output:" << nl; Log << type() << " " << name() << " output:" << nl;
forAll(fieldSet_, fieldi) forAll(fieldSet_, fieldi)
{ {
@ -163,7 +163,7 @@ bool Foam::functionObjects::fieldMinMax::write(const bool postProcess)
} }
if (!location_) file()<< endl; if (!location_) file()<< endl;
if (log_) Info<< endl; Log << endl;
return true; return true;
} }

View File

@ -67,34 +67,31 @@ void Foam::functionObjects::fieldMinMax::output
file<< endl; file<< endl;
if (log_) Info Log << " min(" << outputName << ") = " << minValue
<< " min(" << outputName << ") = " << minValue
<< " at location " << minC; << " at location " << minC;
if (Pstream::parRun()) if (Pstream::parRun())
{ {
if (log_) Info<< " on processor " << minProci; Log << " on processor " << minProci;
} }
if (log_) Info Log << nl << " max(" << outputName << ") = " << maxValue
<< nl << " max(" << outputName << ") = " << maxValue
<< " at location " << maxC; << " at location " << maxC;
if (Pstream::parRun()) if (Pstream::parRun())
{ {
if (log_) Info<< " on processor " << maxProci; Log << " on processor " << maxProci;
} }
} }
else else
{ {
file<< token::TAB << minValue << token::TAB << maxValue; file<< token::TAB << minValue << token::TAB << maxValue;
if (log_) Info Log << " min/max(" << outputName << ") = "
<< " min/max(" << outputName << ") = "
<< minValue << ' ' << maxValue; << minValue << ' ' << maxValue;
} }
if (log_) Info<< endl; Log << endl;
} }

View File

@ -294,7 +294,7 @@ bool Foam::functionObjects::fieldValues::cellSource::write
{ {
file() << tab << volume_; file() << tab << volume_;
} }
if (log_) Info<< " total volume = " << volume_ << endl; Log << " total volume = " << volume_ << endl;
} }
forAll(fields_, i) forAll(fields_, i)
@ -322,7 +322,7 @@ bool Foam::functionObjects::fieldValues::cellSource::write
file()<< endl; file()<< endl;
} }
if (log_) Info<< endl; Log << endl;
return true; return true;
} }

View File

@ -205,7 +205,7 @@ bool Foam::functionObjects::fieldValues::cellSource::writeValues
file()<< tab << result; file()<< tab << result;
if (log_) Info<< " " << operationTypeNames_[operation_] Log << " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") of " << fieldName << "(" << sourceName_ << ") of " << fieldName
<< " = " << result << endl; << " = " << result << endl;
} }

View File

@ -744,7 +744,7 @@ bool Foam::functionObjects::fieldValues::faceSource::write
{ {
file() << tab << totalArea_; file() << tab << totalArea_;
} }
if (log_) Info<< " total area = " << totalArea_ << endl; Log << " total area = " << totalArea_ << endl;
} }
// construct weight field. Note: zero size means weight = 1 // construct weight field. Note: zero size means weight = 1
@ -791,7 +791,7 @@ bool Foam::functionObjects::fieldValues::faceSource::write
file()<< endl; file()<< endl;
} }
if (log_) Info<< endl; Log << endl;
return true; return true;
} }

View File

@ -344,7 +344,7 @@ bool Foam::functionObjects::fieldValues::faceSource::writeValues
file()<< tab << result; file()<< tab << result;
if (log_) Info<< " " << operationTypeNames_[operation_] Log << " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") of " << fieldName << "(" << sourceName_ << ") of " << fieldName
<< " = " << result << endl; << " = " << result << endl;
} }

View File

@ -110,7 +110,7 @@ bool Foam::functionObjects::fieldValue::write(const bool postProcess)
{ {
writeFiles::write(); writeFiles::write();
if (log_) Info<< type() << " " << name() << " output:" << nl; Log << type() << " " << name() << " output:" << nl;
return true; return true;
} }

View File

@ -179,7 +179,7 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::write
writeTime(file()); writeTime(file());
} }
if (log_) Info<< type() << " " << name() << " output:" << endl; Log << type() << " " << name() << " output:" << endl;
bool found = false; bool found = false;
processFields<scalar>(found); processFields<scalar>(found);
@ -193,16 +193,13 @@ bool Foam::functionObjects::fieldValues::fieldValueDelta::write
file()<< endl; file()<< endl;
} }
if (log_)
{
if (!found) if (!found)
{ {
Info<< " none" << endl; Log << " none" << endl;
} }
else else
{ {
Info<< endl; Log << endl;
}
} }
return true; return true;

View File

@ -110,7 +110,7 @@ void Foam::functionObjects::fieldValues::fieldValueDelta::processFields
Type result = applyOperation(r1, r2); Type result = applyOperation(r1, r2);
if (log_) Info<< " " << operationTypeNames_[operation_] Log << " " << operationTypeNames_[operation_]
<< "(" << fieldName << ") = " << result << "(" << fieldName << ") = " << result
<< endl; << endl;

View File

@ -57,8 +57,7 @@ void Foam::functionObjects::histogram::writeGraph
outputPath/formatterPtr_().getFileName(coords, fieldNames) outputPath/formatterPtr_().getFileName(coords, fieldNames)
); );
if (log_) Info Log << " Writing histogram of " << fieldName
<< " Writing histogram of " << fieldName
<< " to " << graphFile.name() << endl; << " to " << graphFile.name() << endl;
List<const scalarField*> yPtrs(1); List<const scalarField*> yPtrs(1);
@ -118,18 +117,18 @@ bool Foam::functionObjects::histogram::execute(const bool postProcess)
bool Foam::functionObjects::histogram::write(const bool postProcess) bool Foam::functionObjects::histogram::write(const bool postProcess)
{ {
if (log_) Info<< type() << " " << name() << " output:" << nl; Log << type() << " " << name() << " output:" << nl;
const fvMesh& mesh = refCast<const fvMesh>(obr_); const fvMesh& mesh = refCast<const fvMesh>(obr_);
autoPtr<volScalarField> fieldPtr; autoPtr<volScalarField> fieldPtr;
if (obr_.foundObject<volScalarField>(fieldName_)) if (obr_.foundObject<volScalarField>(fieldName_))
{ {
if (log_) Info<< " Looking up field " << fieldName_ << endl; Log << " Looking up field " << fieldName_ << endl;
} }
else else
{ {
if (log_) Info<< " Reading field " << fieldName_ << endl; Log << " Reading field " << fieldName_ << endl;
fieldPtr.reset fieldPtr.reset
( (
new volScalarField new volScalarField

View File

@ -276,7 +276,7 @@ bool Foam::functionObjects::nearWallFields::read(const dictionary& dict)
reverseFieldMap_.insert(sampleFldName, fldName); reverseFieldMap_.insert(sampleFldName, fldName);
} }
if (log_) Info << type() << " " << name() Log << type() << " " << name()
<< ": Sampling " << fieldMap_.size() << " fields" << endl; << ": Sampling " << fieldMap_.size() << " fields" << endl;
// Do analysis // Do analysis
@ -300,7 +300,7 @@ bool Foam::functionObjects::nearWallFields::execute(const bool postProcess)
&& vtf_.empty() && vtf_.empty()
) )
{ {
if (log_) Info<< type() << " " << name() Log << type() << " " << name()
<< ": Creating " << fieldMap_.size() << " fields" << endl; << ": Creating " << fieldMap_.size() << " fields" << endl;
createFields(vsf_); createFields(vsf_);
@ -309,10 +309,10 @@ bool Foam::functionObjects::nearWallFields::execute(const bool postProcess)
createFields(vSymmtf_); createFields(vSymmtf_);
createFields(vtf_); createFields(vtf_);
if (log_) Info<< endl; Log << endl;
} }
if (log_) Info<< type() << " " << name() Log << type() << " " << name()
<< " output:" << nl << " output:" << nl
<< " Sampling fields to " << time_.timeName() << " Sampling fields to " << time_.timeName()
<< endl; << endl;
@ -331,7 +331,7 @@ bool Foam::functionObjects::nearWallFields::write(const bool postProcess)
{ {
DebugInFunction << endl; DebugInFunction << endl;
if (log_) Info<< " Writing sampled fields to " << time_.timeName() Log << " Writing sampled fields to " << time_.timeName()
<< endl; << endl;
forAll(vsf_, i) forAll(vsf_, i)
@ -355,7 +355,7 @@ bool Foam::functionObjects::nearWallFields::write(const bool postProcess)
vtf_[i].write(); vtf_[i].write();
} }
if (log_) Info<< endl; Log << endl;
return true; return true;
} }

View File

@ -47,7 +47,7 @@ void Foam::functionObjects::nearWallFields::createFields
if (obr_.found(sampleFldName)) if (obr_.found(sampleFldName))
{ {
if (log_) Info<< " a field " << sampleFldName Log << " a field " << sampleFldName
<< " already exists on the mesh." << " already exists on the mesh."
<< endl; << endl;
} }
@ -63,7 +63,7 @@ void Foam::functionObjects::nearWallFields::createFields
sflds.set(sz, new VolFieldType(io, fld)); sflds.set(sz, new VolFieldType(io, fld));
if (log_) Info<< " created " << sflds[sz].name() Log << " created " << sflds[sz].name()
<< " to sample " << fld.name() << endl; << " to sample " << fld.name() << endl;
} }
} }

View File

@ -71,7 +71,7 @@ void Foam::functionObjects::readFields::loadField
) )
{ {
// Store field locally // Store field locally
if (log_) Info<< " Reading " << fieldName << endl; Log << " Reading " << fieldName << endl;
label sz = vflds.size(); label sz = vflds.size();
vflds.setSize(sz+1); vflds.setSize(sz+1);
@ -84,7 +84,7 @@ void Foam::functionObjects::readFields::loadField
) )
{ {
// Store field locally // Store field locally
if (log_) Info<< " Reading " << fieldName << endl; Log << " Reading " << fieldName << endl;
label sz = sflds.size(); label sz = sflds.size();
sflds.setSize(sz+1); sflds.setSize(sz+1);

View File

@ -208,7 +208,7 @@ bool Foam::functionObjects::forceCoeffs::write(const bool postProcess)
<< tab << Cm << tab << Cd << tab << Cm << tab << Cd
<< tab << Cl << tab << Clf << tab << Clr << endl; << tab << Cl << tab << Clf << tab << Clr << endl;
if (log_) Info<< type() << " " << name() << " output:" << nl Log << type() << " " << name() << " output:" << nl
<< " Cm = " << Cm << nl << " Cm = " << Cm << nl
<< " Cd = " << Cd << nl << " Cd = " << Cd << nl
<< " Cl = " << Cl << nl << " Cl = " << Cl << nl
@ -240,7 +240,7 @@ bool Foam::functionObjects::forceCoeffs::write(const bool postProcess)
file(1) << endl; file(1) << endl;
} }
if (log_) Info<< endl; Log << endl;
} }
return true; return true;

View File

@ -393,8 +393,7 @@ void Foam::functionObjects::forces::applyBins
void Foam::functionObjects::forces::writeForces() void Foam::functionObjects::forces::writeForces()
{ {
if (log_) Info Log << type() << " " << name() << " output:" << nl
<< type() << " " << name() << " output:" << nl
<< " sum of forces:" << nl << " sum of forces:" << nl
<< " pressure : " << sum(force_[0]) << nl << " pressure : " << sum(force_[0]) << nl
<< " viscous : " << sum(force_[1]) << nl << " viscous : " << sum(force_[1]) << nl
@ -612,7 +611,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
initialised_ = false; initialised_ = false;
if (log_) Info<< type() << " " << name() << ":" << nl; Log << type() << " " << name() << ":" << nl;
directForceDensity_ = dict.lookupOrDefault("directForceDensity", false); directForceDensity_ = dict.lookupOrDefault("directForceDensity", false);
@ -653,11 +652,11 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
dict.readIfPresent("porosity", porosity_); dict.readIfPresent("porosity", porosity_);
if (porosity_) if (porosity_)
{ {
if (log_) Info<< " Including porosity effects" << endl; Log << " Including porosity effects" << endl;
} }
else else
{ {
if (log_) Info<< " Not including porosity effects" << endl; Log << " Not including porosity effects" << endl;
} }
if (dict.found("binData")) if (dict.found("binData"))
@ -908,7 +907,7 @@ bool Foam::functionObjects::forces::write(const bool postProcess)
writeBins(); writeBins();
if (log_) Info<< endl; Log << endl;
} }
return true; return true;

View File

@ -88,7 +88,7 @@ void Foam::functionObjects::wallShearStress::calcShearStress
<< endl; << endl;
} }
if (log_) Info<< " min/max(" << pp.name() << ") = " Log << " min/max(" << pp.name() << ") = "
<< minSsp << ", " << maxSsp << endl; << minSsp << ", " << maxSsp << endl;
} }
} }
@ -222,7 +222,7 @@ bool Foam::functionObjects::wallShearStress::execute(const bool postProcess)
mesh.lookupObject<volVectorField>(type()) mesh.lookupObject<volVectorField>(type())
); );
if (log_) Info<< type() << " " << name() << " output:" << nl; Log << type() << " " << name() << " output:" << nl;
tmp<volSymmTensorField> Reff; tmp<volSymmTensorField> Reff;
@ -260,7 +260,7 @@ bool Foam::functionObjects::wallShearStress::write(const bool postProcess)
const volVectorField& wallShearStress = const volVectorField& wallShearStress =
obr_.lookupObject<volVectorField>(type()); obr_.lookupObject<volVectorField>(type());
if (log_) Info<< type() << " " << name() << " output:" << nl Log << type() << " " << name() << " output:" << nl
<< " writing field " << wallShearStress.name() << nl << " writing field " << wallShearStress.name() << nl
<< endl; << endl;

View File

@ -106,8 +106,7 @@ void Foam::functionObjects::yPlus::calcYPlus
if (Pstream::master()) if (Pstream::master())
{ {
if (log_) Info Log << " patch " << patch.name()
<< " patch " << patch.name()
<< " y+ : min = " << minYplus << ", max = " << maxYplus << " y+ : min = " << minYplus << ", max = " << maxYplus
<< ", average = " << avgYplus << nl; << ", average = " << avgYplus << nl;
@ -137,8 +136,7 @@ void Foam::functionObjects::yPlus::calcYPlus
if (Pstream::master()) if (Pstream::master())
{ {
if (log_) Info Log << " patch " << patch.name()
<< " patch " << patch.name()
<< " y+ : min = " << minYplus << ", max = " << maxYplus << " y+ : min = " << minYplus << ", max = " << maxYplus
<< ", average = " << avgYplus << nl; << ", average = " << avgYplus << nl;
@ -227,7 +225,7 @@ bool Foam::functionObjects::yPlus::execute(const bool postProcess)
mesh.lookupObject<volScalarField>(type()) mesh.lookupObject<volScalarField>(type())
); );
if (log_) Info<< type() << " " << name() << " output:" << nl; Log << type() << " " << name() << " output:" << nl;
if (mesh.foundObject<turbulenceModel>(turbulenceModel::propertiesName)) if (mesh.foundObject<turbulenceModel>(turbulenceModel::propertiesName))
{ {
@ -254,7 +252,7 @@ bool Foam::functionObjects::yPlus::write(const bool postProcess)
const volScalarField& yPlus = const volScalarField& yPlus =
obr_.lookupObject<volScalarField>(type()); obr_.lookupObject<volScalarField>(type());
if (log_) Info<< " writing field " << yPlus.name() << endl; Log << " writing field " << yPlus.name() << endl;
yPlus.write(); yPlus.write();