37 namespace substitutionModels
64 const entry* ePtr =
dict.findScoped(lookup);
69 <<
"Unable to find entry " << lookup
79 oss << de.dictName() << de;
83 for (
const auto& t : ePtr->stream())
85 if (oss.
count()) oss << separator_;
99 Foam::substitutionModels::dictionaryValue::dictionaryValue
109 separator_(
dict.getOrDefault<
word>(
"separator",
" ")),
112 const auto* oPtr =
dict.findEntry(
"object");
113 const auto* pPtr =
dict.findEntry(
"path");
118 <<
"Specify either 'object' or 'path' but not both" 125 dict.readIfPresent<
word>(
"region", region_);
138 for (
const auto&
e : entriesDict)
149 return entries_.found(keyName);
159 if (!valid(
key))
return false;
164 if (replaceBuiltin(
path))
174 <<
"Unable to find dictionary at " <<
path 175 <<
". Deactivating." <<
endl;
184 const auto* obrPtr = time_.cfindObject<objectRegistry>(region_);
189 <<
"Unable to find region " << region_
190 <<
". Deactivating." <<
endl;
196 const auto* dictPtr = obrPtr->cfindObject<IOdictionary>(object_,
true);
201 <<
"Unable find dictionary " << object_
202 <<
" on region " << region_
203 <<
". Deactivating." <<
endl;
208 return processDict(*dictPtr,
key, buffer);
215 return entries_.sortedToc();
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool processDict(const dictionary &dict, const word &key, string &buffer) const
Main function to process the dictionary.
Base class for substitution models.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Lookup type of boundary radiation properties.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
Foam::string str() const
Get the string. As Foam::string instead of std::string (may change in future)
const dimensionedScalar e
Elementary charge.
A class for handling words, derived from Foam::string.
std::streamsize count()
The number of bytes outputted.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Input from file stream as an ISstream, normally using std::ifstream for the actual input...
virtual bool valid(const word &keyName) const
Return true of model applies to this keyName.
addToRunTimeSelectionTable(substitutionModel, dictionaryValue, dictionary)
virtual wordList keys() const
Return a word list of the keys.
string & replaceAll(const std::string &s1, const std::string &s2, size_type pos=0)
Replace all occurrences of sub-string s1 with s2, beginning at pos in the string. ...
#define WarningInFunction
Report a warning using Foam::Warning.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
defineTypeNameAndDebug(dictionaryValue, 0)
The dictionaryValue substitution model. Dictionaries can be retrieved from an object registry...
Mesh consisting of general polyhedral cells.
virtual bool apply(const word &key, string &buffer) const
Apply substitutions to this string buffer.
static word cleanKey(const string &str)
Clean the key text.
static string keyify(const word &w)
Return a key representation from a word.
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping and return the expanded string.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...