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: " 62 IOobjectOption::MUST_READ
72 <<
"For " << entryName <<
" with primitive entry" <<
nl;
74 ITstream& is = eptr->stream();
76 if (is.peek().isWord())
78 modelType = is.peek().wordToken();
84 const Type constValue = pTraits<Type>(is);
86 return autoPtr<PatchFunction1<Type>>
88 new PatchFunction1Types::ConstantField<Type>
100 if (modelType ==
"uniform" || modelType ==
"nonuniform")
102 return autoPtr<PatchFunction1<Type>>
104 new PatchFunction1Types::ConstantField<Type>
119 if (modelType.empty())
126 <<
"Missing or invalid PatchFunction1 entry: " 145 coeffs = &
dict.optionalSubDict(kw +
"Coeffs", keyType::LITERAL);
149 auto* ctorPtr = dictionaryConstructorTable(modelType);
154 <<
"Unknown PatchFunction1 type " 155 << modelType <<
" for " << entryName
156 <<
"\n\nValid PatchFunction1 types :\n" 157 << dictionaryConstructorTablePtr_->sortedToc() <<
nl 161 return ctorPtr(
pp, modelType, entryName, *coeffs, faceValues);
170 const word& entryName,
172 const bool faceValues,
180 dict.findEntry(entryName, keyType::LITERAL),
193 const word& entryName,
194 std::initializer_list<std::pair<const char*,int>> compat,
196 const bool faceValues,
204 dict.findCompat(entryName, compat, keyType::LITERAL),
217 const word& entryName,
219 const bool faceValues
234 const word& entryName,
237 const bool faceValues,
246 fref.
cref(cache.get(entryName));
255 const entry* eptr =
dict.findEntry(entryName, matchOpt);
260 const auto& kw = eptr->keyword();
263 fref.
cref(cache.get(kw));
284 fref.
cref(fauto.get());
285 cache.set(kw, fauto);
290 if (mandatory && !fref)
293 <<
"No match for " << entryName <<
nl
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...
constexpr char nl
The newline '\n' character (0x0a)
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
A HashTable of pointers to objects of type <T>, with deallocation management of the pointers...
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
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.
A class for managing references or pointers (no reference counting)
A class for handling words, derived from Foam::string.
#define DebugInFunction
Report an information message using Foam::Info.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
option
Enumeration for the data type and search/match modes (bitmask)
static autoPtr< PatchFunction1< Type > > NewIfPresent(const polyPatch &pp, const word &entryName, const dictionary &dict, const bool faceValues=true)
An optional selector.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A patch is a list of labels that address the faces in the global face list.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...