Commit 43e45711 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: subModelBase - added function to get a dictionary

parent 8c8cf921
......@@ -167,6 +167,34 @@ bool Foam::subModelBase::writeTime() const
}
bool Foam::subModelBase::getModelDict
(
const word& entryName,
dictionary& dict
) const
{
if (properties_.found(baseName_))
{
const dictionary& baseDict = properties_.subDict(baseName_);
if (inLine() && baseDict.found(modelName_))
{
const dictionary& modelDict = baseDict.subDict(modelName_);
dict = modelDict.subOrEmptyDict(entryName);
return true;
}
else if (baseDict.found(modelType_))
{
const dictionary& modelDict = baseDict.subDict(modelType_);
dict = modelDict.subOrEmptyDict(entryName);
return true;
}
}
return false;
}
void Foam::subModelBase::write(Ostream& os) const
{
os << coeffDict_;
......
......@@ -179,6 +179,13 @@ public:
// Model properties
//- Retrieve dictionary, return true if set
bool getModelDict
(
const word& entryName,
dictionary& dict
) const;
//- Retrieve generic property from the sub-model
template<class Type>
void getModelProperty(const word& entryName, Type& value) const;
......
Supports Markdown
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