Go to the documentation of this file.
39 <<
"Invalid (empty) polynomial coefficients for "
44 for (
const auto& coeff : coeffs_)
46 if (
mag(coeff.second() + pTraits<Type>::one) < ROOTVSMALL)
48 canIntegrate_ =
false;
53 if (
debug && !canIntegrate_)
56 <<
"Polynomial " << this->
name() <<
" cannot be integrated"
67 const word& entryName,
76 const entry* eptr =
dict.findEntry(entryName, keyType::LITERAL);
89 dict.checkITstream(is, entryName);
97 dict.readEntry(
"coeffs", this->coeffs_);
100 this->checkCoefficients();
107 const word& entryName,
116 this->checkCoefficients();
124 coeffs_(poly.coeffs_),
125 canIntegrate_(poly.canIntegrate_)
136 Type value = coeffs_[i].first();
137 for (
direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
int debug
Static debugging option.
A keyword and a list of tokens is an 'entry'.
label & setComponent(label &l, const direction)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Polynomial(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name, dictionary and optional registry.
Scalar cmptPow(const Scalar s1, const Scalar s2)
A class for handling words, derived from Foam::string.
virtual void writeData(Ostream &os) const
Write as primitive (inline) format.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
static constexpr const zero Zero
Global zero (0)
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
virtual bool isStream() const noexcept
Return true if this entry is a stream.
virtual scalar userTimeToTime(const scalar theta) const
Convert the user-time (e.g. CA deg) to real-time (s).
Ostream & endl(Ostream &os)
Add newline and flush stream.
Top level data entry class for use in dictionaries. Provides a mechanism to specify a variable as a c...
bool isWord() const noexcept
Token is word-variant (WORD, DIRECTIVE)
#define forAll(list, i)
Loop across all elements in list.
Registry of regIOobjects.
An input stream of tokens.
virtual void writeData(Ostream &os) const
Write in dictionary format.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
OBJstream os(runTime.globalPath()/outputName)
Ostream & indent(Ostream &os)
Indent stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
void skip(label n=1)
Move tokenIndex relative to the current position.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A traits class, which is primarily used for primitives.
virtual Type value(const scalar x) const
Return Polynomial value.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const token & peek() const
Failsafe peek at what the next read would return,.
virtual void userTimeToTime(const Time &t)
Convert time.
#define WarningInFunction
Report a warning using Foam::Warning.