43 const word Function1Type(coeffDict.
lookup(
"type"));
45 if (printDictionary::prints(coeffDict))
48 << Function1Type <<
endl;
51 typename dictionaryConstructorTable::iterator cstrIter =
52 dictionaryConstructorTablePtr_->find(Function1Type);
54 if (cstrIter == dictionaryConstructorTablePtr_->end())
57 <<
"Unknown Function1 type "
58 << Function1Type <<
" for Function1 "
60 <<
"Valid Function1 types are:" <<
nl
61 << dictionaryConstructorTablePtr_->sortedToc() <<
nl
67 return cstrIter()(
name, units, coeffDict);
78 const word Function1Type =
85 return New(
name, units, Function1Type, is);
89 typename dictionaryConstructorTable::iterator dictCstrIter =
90 dictionaryConstructorTablePtr_->find(Function1Type);
92 if (dictCstrIter == dictionaryConstructorTablePtr_->end())
95 <<
"Unknown Function1 type "
96 << Function1Type <<
" for Function1 "
98 <<
"Valid Function1 types are:" <<
nl
99 << dictionaryConstructorTablePtr_->sortedToc() <<
nl
103 return dictCstrIter()(
name, units,
dict);
132 const word Function1Type(coeffDict.
lookup(
"type"));
134 if (printDictionary::prints(coeffDict))
137 << Function1Type <<
endl;
140 typename dictionaryConstructorTable::iterator cstrIter =
141 dictionaryConstructorTablePtr_->find(Function1Type);
143 if (cstrIter == dictionaryConstructorTablePtr_->end())
146 <<
"Unknown Function1 type "
147 << Function1Type <<
" for Function1 "
148 <<
e.keyword() <<
nl <<
nl
149 <<
"Valid Function1 types are:" <<
nl
150 << dictionaryConstructorTablePtr_->sortedToc() <<
nl
156 return cstrIter()(
e.keyword(), units, coeffDict);
163 token firstToken(is);
164 is.putBack(firstToken);
167 const word Function1Type =
168 firstToken.isWord() ?
word(is) : Function1s::Constant<Type>::
typeName;
172 if (!firstToken.isWord() || !is.eof())
174 return New(
e.keyword(), units, Function1Type, is);
178 <<
"Unable to construct Function1 for " <<
e.keyword()
193 return New({xUnits, valueUnits},
e);
202 const word& Function1Type,
206 typename dictionaryConstructorTable::iterator dictCstrIter =
207 dictionaryConstructorTablePtr_->find(Function1Type);
208 const bool haveDictCstrIter =
209 dictCstrIter != dictionaryConstructorTablePtr_->end();
211 typename IstreamConstructorTable::iterator isCstrIter =
212 IstreamConstructorTablePtr_->find(Function1Type);
213 const bool haveIstreamCstrIter =
214 isCstrIter != IstreamConstructorTablePtr_->end();
216 if (!haveDictCstrIter && !haveIstreamCstrIter)
219 <<
"Unknown Function1 type "
220 << Function1Type <<
" for Function1 "
222 <<
"Valid Function1 types are:" <<
nl
223 << dictionaryConstructorTablePtr_->sortedToc() <<
nl
227 if (!haveIstreamCstrIter)
231 << Function1Type <<
" for Function1 "
232 <<
name <<
" cannot be specified inline" <<
nl <<
nl
233 <<
"Make " <<
name <<
" a sub-dictionary"
237 return isCstrIter()(
name, units, is);
247 const word& Function1Type,
251 return New(
name, {xUnits, valueUnits}, Function1Type, is);
static autoPtr< Function1< Type > > New(const word &name, const Function1s::unitSets &units, const dictionary &dict)
Select from dictionary.
Templated function that returns a constant value.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void putBack(const token &)
Put back token.
bool eof() const
Return true if end of input seen.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
A keyword and a list of tokens is an 'entry'.
Enables the printing of a dictionary and subsequently looked-up defaulted entries.
A token holds items read from Istream.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
Unit conversion structure. Contains the associated dimensions and the multiplier with which to conver...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const dimensionedScalar e
Elementary charge.
errorManipArg< error, int > exit(error &err, const int errNo=1)
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Ostream & indent(Ostream &os)
Indent stream.
tmp< DimensionedField< TypeR, GeoMesh, Field > > New(const tmp< DimensionedField< TypeR, GeoMesh, Field >> &tdf1, const word &name, const dimensionSet &dimensions)
Struct containing two unitSets for use in converting both the argument and the value of a Function1.