34Foam::PatchFunction1<Type>::New
37 const word& entryName,
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: "
128 <<
exit(FatalIOError);
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
158 <<
exit(FatalIOError);
167Foam::PatchFunction1<Type>::New
170 const word& entryName,
172 const bool faceValues,
176 return PatchFunction1<Type>::New
193 const word& entryName,
194 std::initializer_list<std::pair<const char*,int>> compat,
196 const bool faceValues,
200 return PatchFunction1<Type>::New
217 const word& entryName,
219 const bool faceValues
229Foam::PatchFunction1<Type>::New
234 const word& entryName,
260 const auto& kw = eptr->
keyword();
263 fref.
cref(cache.get(kw));
270 PatchFunction1<Type>::New
284 fref.
cref(fauto.get());
285 cache.set(kw, fauto);
290 if (mandatory && !fref)
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
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...
const polyPatch const word const word & entryName
const polyPatch const word const word const dictionary & dict
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.
const polyPatch const word const word const dictionary const bool faceValues
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).
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
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.
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a).