33 const word& entryName,
34 const Type& defaultValue
37 Type result = defaultValue;
52 const word& entryName,
56 if (properties_.found(baseName_))
67 const word& entryName,
71 if (properties_.found(baseName_))
73 dictionary& baseDict = properties_.subDict(baseName_);
74 baseDict.add(entryName, value,
true);
78 properties_.add(baseName_, dictionary());
79 properties_.subDict(baseName_).add(entryName, value);
87 const word& entryName,
91 if (properties_.found(baseName_))
93 const dictionary& baseDict = properties_.subDict(baseName_);
95 if (inLine() && baseDict.found(modelName_))
97 return baseDict.subDict(modelName_).readIfPresent(entryName, value);
99 else if (baseDict.found(modelType_))
101 return baseDict.subDict(modelType_).readIfPresent(entryName, value);
112 const word& entryName,
113 const Type& defaultValue
116 Type result = defaultValue;
117 getModelProperty(entryName, result);
125 const word& entryName,
129 if (properties_.found(baseName_))
135 if (baseDict.
found(modelName_))
137 baseDict.
subDict(modelName_).
add(entryName, value,
true);
141 baseDict.
add(modelName_, dictionary());
142 baseDict.
subDict(modelName_).
add(entryName, value,
true);
147 if (baseDict.
found(modelType_))
149 baseDict.
subDict(modelType_).
add(entryName, value,
true);
153 baseDict.
add(modelType_, dictionary());
154 baseDict.
subDict(modelType_).
add(entryName, value,
true);
160 properties_.add(baseName_, dictionary());
164 properties_.subDict(baseName_).add(modelName_, dictionary());
165 properties_.subDict(baseName_).subDict(modelName_).add
173 properties_.subDict(baseName_).add(modelType_, dictionary());
174 properties_.subDict(baseName_).subDict(modelType_).add
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Type getBaseProperty(const word &entryName, const Type &defaultValue=Type(Zero)) const
Retrieve generic property from the base model.
dictionary & properties_
Reference to properties dictionary e.g. for restart.
entry * add(entry *entryPtr, bool mergeEntry=false)
Add a new entry.
const word baseName_
Name of the sub-model base class.
const dictionary & subDict(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find and return a sub-dictionary.
bool found(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry (const access) with the given keyword.
void setModelProperty(const word &entryName, const Type &value)
Add generic property to the sub-model.
A class for handling words, derived from Foam::string.
bool getModelProperty(const word &entryName, Type &value) const
Retrieve generic property from the sub-model.
bool readIfPresent(const word &keyword, T &val, enum keyType::option matchOpt=keyType::REGEX) const
Find an entry if present, and assign to T val. FatalIOError if it is found and the number of tokens i...
void setBaseProperty(const word &entryName, const Type &value)
Add generic property to the base model.