mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: more consistent use of good() or direct testing instead valid()
This commit is contained in:
@ -453,7 +453,7 @@ Foam::functionObjects::extractEulerianParticles::extractEulerianParticles
|
||||
fvMeshFunctionObject(name, runTime, dict),
|
||||
writeFile(runTime, name),
|
||||
cloud_(mesh_, "eulerianParticleCloud"),
|
||||
faceZoneName_(word::null),
|
||||
faceZoneName_(),
|
||||
zoneID_(-1),
|
||||
patchIDs_(),
|
||||
patchFaceIDs_(),
|
||||
|
||||
@ -126,7 +126,7 @@ Foam::histogramModel::histogramModel
|
||||
:
|
||||
writeFile(mesh, name, "histogram", dict),
|
||||
mesh_(mesh),
|
||||
fieldName_(word::null)
|
||||
fieldName_()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -88,7 +88,7 @@ Foam::functionObjects::norm::norm
|
||||
fieldExpression(name, runTime, dict),
|
||||
norm_(normType::L1),
|
||||
divisorPtr_(nullptr),
|
||||
divisorFieldName_(word::null),
|
||||
divisorFieldName_(),
|
||||
p_(-1)
|
||||
{
|
||||
read(dict);
|
||||
@ -127,7 +127,7 @@ bool Foam::functionObjects::norm::read(const dictionary& dict)
|
||||
{
|
||||
divisorFieldName_ = dict.get<word>("divisorField");
|
||||
|
||||
if (divisorFieldName_ == word::null)
|
||||
if (divisorFieldName_.empty())
|
||||
{
|
||||
FatalIOErrorInFunction(dict)
|
||||
<< "The norm 'field' needs the input entry 'divisorField'."
|
||||
|
||||
@ -78,7 +78,7 @@ Foam::resolutionIndexModel::resolutionIndexModel
|
||||
)
|
||||
:
|
||||
mesh_(mesh),
|
||||
resultName_(word::null)
|
||||
resultName_()
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -206,7 +206,7 @@ void Foam::functionObjects::forceCoeffs::calcMomentCoeffs()
|
||||
|
||||
void Foam::functionObjects::forceCoeffs::createIntegratedDataFile()
|
||||
{
|
||||
if (!coeffFilePtr_.valid())
|
||||
if (!coeffFilePtr_)
|
||||
{
|
||||
coeffFilePtr_ = newFileAtStartTime("coefficient");
|
||||
writeIntegratedDataFileHeader("Coefficients", coeffFilePtr_());
|
||||
|
||||
@ -412,13 +412,13 @@ void Foam::functionObjects::forces::addToInternalField
|
||||
|
||||
void Foam::functionObjects::forces::createIntegratedDataFiles()
|
||||
{
|
||||
if (!forceFilePtr_.valid())
|
||||
if (!forceFilePtr_)
|
||||
{
|
||||
forceFilePtr_ = newFileAtStartTime("force");
|
||||
writeIntegratedDataFileHeader("Force", forceFilePtr_());
|
||||
}
|
||||
|
||||
if (!momentFilePtr_.valid())
|
||||
if (!momentFilePtr_)
|
||||
{
|
||||
momentFilePtr_ = newFileAtStartTime("moment");
|
||||
writeIntegratedDataFileHeader("Moment", momentFilePtr_());
|
||||
|
||||
@ -356,7 +356,7 @@ Foam::functionObjects::sizeDistribution::sizeDistribution
|
||||
(
|
||||
selectionModeTypeNames_.get("selectionMode", dict)
|
||||
),
|
||||
selectionModeTypeName_(word::null),
|
||||
selectionModeTypeName_(),
|
||||
functionType_(functionTypeNames_.get("functionType", dict)),
|
||||
abszissaType_(abszissaTypeNames_.get("abszissaType", dict)),
|
||||
nCells_(0),
|
||||
|
||||
@ -109,7 +109,7 @@ bool Foam::functionObjects::runTimeControls::minMaxCondition::apply()
|
||||
const word valueType =
|
||||
state_.objectResultType(functionObjectName_, fieldName);
|
||||
|
||||
if (valueType == word::null)
|
||||
if (valueType.empty())
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Unable to find entry " << fieldName
|
||||
|
||||
Reference in New Issue
Block a user