mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
- use the dictionary 'get' methods instead of readScalar for
additional checking
Unchecked: readScalar(dict.lookup("key"));
Checked: dict.get<scalar>("key");
- In templated classes that also inherit from a dictionary, an additional
'template' keyword will be required. Eg,
this->coeffsDict().template get<scalar>("key");
For this common use case, the predefined getXXX shortcuts may be
useful. Eg,
this->coeffsDict().getScalar("key");
This commit is contained in:
@ -57,7 +57,7 @@ namespace Foam
|
||||
|
||||
Foam::label Foam::decompositionMethod::nDomains(const dictionary& decompDict)
|
||||
{
|
||||
return readLabel(decompDict.lookup("numberOfSubdomains"));
|
||||
return decompDict.get<label>("numberOfSubdomains");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ bool Foam::distributedTriSurfaceMesh::read()
|
||||
distType_ = distributionTypeNames_.lookup("distributionType", dict_);
|
||||
|
||||
// Merge distance
|
||||
mergeDist_ = readScalar(dict_.lookup("mergeDistance"));
|
||||
dict_.readEntry("mergeDistance", mergeDist_);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user