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,
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();
155 cmptPow(pTraits<Type>::one*
x, coeffs_[i].second())
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)
Ostream & indent(Ostream &os)
Indent stream.
const word const dictionary & dict
Polynomial(const word &entryName, const dictionary &dict, const objectRegistry *obrPtr=nullptr)
Construct from entry name, dictionary and optional registry.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives and vector-space.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
virtual void writeData(Ostream &os) const
Write in dictionary format.
#define forAll(list, i)
Loop across all elements in list.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
virtual scalar userTimeToTime(const scalar theta) const
Convert the user-time (e.g. CA deg) to real-time (s).
A class for handling words, derived from Foam::string.
virtual void userTimeToTime(const Time &t)
Convert time.
virtual Type integrate(const scalar x1, const scalar x2) const
Integrate between two (scalar) values.
Scalar cmptPow(const Scalar s1, const Scalar s2)
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
#define WarningInFunction
Report a warning using Foam::Warning.
virtual bool isStream() const noexcept
True if this entry is a stream.
const token & peek() const noexcept
Failsafe peek at what the next read would return, including handling of any putback.
bool skip(label n=1) noexcept
Move tokenIndex relative to the current position.
Registry of regIOobjects.
virtual ITstream & stream() const =0
Return token stream, if entry is a primitive entry.
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components)
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
An input stream of tokens.
A keyword and a list of tokens is an 'entry'.
virtual void writeData(Ostream &os) const
Write as primitive (inline) format.
static constexpr const zero Zero
Global zero (0)
virtual Type value(const scalar x) const
Return Polynomial value.