37 const word& entryName,
39 const dictionary&
dict,
40 const bool faceValues,
46 const dictionary* coeffs = (eptr ? eptr->dictPtr() :
nullptr);
53 <<
"For " << entryName <<
" with dictionary entries: "
71 <<
"For " << entryName <<
" with primitive entry" <<
nl;
73 ITstream& is = eptr->stream();
75 if (is.peek().isWord())
77 modelType = is.peek().wordToken();
83 const Type constValue = pTraits<Type>(is);
85 return autoPtr<PatchFunction1<Type>>
87 new PatchFunction1Types::ConstantField<Type>
99 if (modelType ==
"uniform" || modelType ==
"nonuniform")
101 return autoPtr<PatchFunction1<Type>>
103 new PatchFunction1Types::ConstantField<Type>
118 if (modelType.empty())
125 <<
"Missing or invalid PatchFunction1 entry: "
127 <<
exit(FatalIOError);
144 coeffs = &
dict.optionalSubDict(kw +
"Coeffs", keyType::LITERAL);
148 auto* ctorPtr = dictionaryConstructorTable(modelType);
153 <<
"Unknown PatchFunction1 type "
154 << modelType <<
" for " << entryName
155 <<
"\n\nValid PatchFunction1 types :\n"
156 << dictionaryConstructorTablePtr_->sortedToc() <<
nl
157 <<
exit(FatalIOError);
160 return ctorPtr(pp, modelType, entryName, *coeffs, faceValues);
169 const word& entryName,
171 const bool faceValues,
179 dict.findEntry(entryName, keyType::LITERAL),
192 const word& entryName,
193 std::initializer_list<std::pair<const char*,int>> compat,
195 const bool faceValues,
203 dict.findCompat(entryName, compat, keyType::LITERAL),
216 const word& entryName,
218 const bool faceValues
233 const word& entryName,
236 const bool faceValues,
245 fref.
cref(cache.get(entryName));
254 const entry* eptr =
dict.findEntry(entryName, matchOpt);
259 const auto& kw = eptr->
keyword();
262 fref.
cref(cache.get(kw));
283 fref.
cref(fauto.get());
284 cache.set(kw, fauto);
289 if (mandatory && !fref)
292 <<
"No match for " << entryName <<
nl
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
static autoPtr< PatchFunction1< Type > > NewCompat(const polyPatch &pp, const word &entryName, std::initializer_list< std::pair< const char *, int > > compat, const dictionary &dict, const bool faceValues=true, const bool mandatory=true)
Compatibility selector.
static autoPtr< PatchFunction1< Type > > NewIfPresent(const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
An optional selector.
static autoPtr< Time > New()
Construct (dummy) Time - no functionObjects or libraries.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A keyword and a list of tokens is an 'entry'.
const keyType & keyword() const noexcept
Return keyword.
option
Enumeration for the data type and search/match modes (bitmask)
A patch is a list of labels that address the faces in the global face list.
A class for managing references or pointers (no reference counting)
A class for handling words, derived from Foam::string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define DebugInFunction
Report an information message using Foam::Info.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)