mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rationalize dictionary access methods
- use keyType::option enum to consolidate searching options.
These enumeration names should be more intuitive to use
and improve code readability.
Eg, lookupEntry(key, keyType::REGEX);
vs lookupEntry(key, false, true);
or
Eg, lookupEntry(key, keyType::LITERAL_RECURSIVE);
vs lookupEntry(key, true, false);
- new findEntry(), findDict(), findScoped() methods with consolidated
search options for shorter naming and access names more closely
aligned with other components. Behave simliarly to the
methods lookupEntryPtr(), subDictPtr(), lookupScopedEntryPtr(),
respectively. Default search parameters consistent with lookupEntry().
Eg, const entry* e = dict.findEntry(key);
vs const entry* e = dict.lookupEntryPtr(key, false, true);
- added '*' and '->' dereference operators to dictionary searchers.
This commit is contained in:
@ -68,9 +68,9 @@ void Foam::multiLevelDecomp::createMethodsDict()
|
||||
if
|
||||
(
|
||||
// non-recursive, no patterns
|
||||
coeffsDict_.readIfPresent("method", defaultMethod, false, false)
|
||||
coeffsDict_.readIfPresent("method", defaultMethod, keyType::LITERAL)
|
||||
// non-recursive, no patterns
|
||||
&& coeffsDict_.readIfPresent("domains", domains, false, false)
|
||||
&& coeffsDict_.readIfPresent("domains", domains, keyType::LITERAL)
|
||||
)
|
||||
{
|
||||
// Short-cut version specified by method, domains only
|
||||
@ -169,14 +169,14 @@ void Foam::multiLevelDecomp::createMethodsDict()
|
||||
(
|
||||
iter().isDict()
|
||||
// non-recursive, no patterns
|
||||
&& iter().dict().found("numberOfSubdomains", false, false)
|
||||
&& iter().dict().found("numberOfSubdomains", keyType::LITERAL)
|
||||
)
|
||||
{
|
||||
// No method specified? can use a default method?
|
||||
|
||||
const bool addDefaultMethod
|
||||
(
|
||||
!(iter().dict().found("method", false, false))
|
||||
!(iter().dict().found("method", keyType::LITERAL))
|
||||
&& !defaultMethod.empty()
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user