mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: subModelBase - return bool from getModelProperty to identify read success
This commit is contained in:
@ -193,8 +193,9 @@ public:
|
||||
) const;
|
||||
|
||||
//- Retrieve generic property from the sub-model
|
||||
// Return true if found
|
||||
template<class Type>
|
||||
void getModelProperty(const word& entryName, Type& value) const;
|
||||
bool getModelProperty(const word& entryName, Type& value) const;
|
||||
|
||||
//- Retrieve generic property from the sub-model
|
||||
template<class Type>
|
||||
|
||||
@ -82,7 +82,7 @@ void Foam::subModelBase::setBaseProperty
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::subModelBase::getModelProperty
|
||||
bool Foam::subModelBase::getModelProperty
|
||||
(
|
||||
const word& entryName,
|
||||
Type& value
|
||||
@ -94,13 +94,15 @@ void Foam::subModelBase::getModelProperty
|
||||
|
||||
if (inLine() && baseDict.found(modelName_))
|
||||
{
|
||||
baseDict.subDict(modelName_).readIfPresent(entryName, value);
|
||||
return baseDict.subDict(modelName_).readIfPresent(entryName, value);
|
||||
}
|
||||
else if (baseDict.found(modelType_))
|
||||
{
|
||||
baseDict.subDict(modelType_).readIfPresent(entryName, value);
|
||||
return baseDict.subDict(modelType_).readIfPresent(entryName, value);
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user