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:
@ -707,8 +707,8 @@ Foam::surfaceFeatures::surfaceFeatures
|
||||
surf_(surf),
|
||||
featurePoints_(featInfoDict.lookup("featurePoints")),
|
||||
featureEdges_(featInfoDict.lookup("featureEdges")),
|
||||
externalStart_(readLabel(featInfoDict.lookup("externalStart"))),
|
||||
internalStart_(readLabel(featInfoDict.lookup("internalStart")))
|
||||
externalStart_(featInfoDict.get<label>("externalStart")),
|
||||
internalStart_(featInfoDict.get<label>("internalStart"))
|
||||
{}
|
||||
|
||||
|
||||
@ -730,8 +730,8 @@ Foam::surfaceFeatures::surfaceFeatures
|
||||
|
||||
featureEdges_ = labelList(featInfoDict.lookup("featureEdges"));
|
||||
featurePoints_ = labelList(featInfoDict.lookup("featurePoints"));
|
||||
externalStart_ = readLabel(featInfoDict.lookup("externalStart"));
|
||||
internalStart_ = readLabel(featInfoDict.lookup("internalStart"));
|
||||
externalStart_ = featInfoDict.get<label>("externalStart");
|
||||
internalStart_ = featInfoDict.get<label>("internalStart");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user