33 const unitSets& units,
37 unitSet unitsXPowI(units.x);
40 coeffs[i] = units.value.toStandard(unitsXPowI.toUser(coeffs[i]));
41 unitsXPowI.reset(units.x*unitsXPowI);
50 const unitSets& units,
54 unitSet unitsXPowI(units.x);
57 coeffs[i] = units.value.toUser(unitsXPowI.toStandard(coeffs[i]));
58 unitsXPowI.reset(units.x*unitsXPowI);
90 <<
" must have at least one coefficient"
105 coeffs_(convertRead(units, is))
111 <<
" must have at least one coefficient"
121 coeffs_(poly.coeffs_)
137 Type
y = coeffs_[coeffs_.size() - 1];
139 for (
label i = coeffs_.size() - 2; i >= 0; i --)
141 y =
y*
x + coeffs_[i];
155 Type Sy1 = coeffs_[coeffs_.size() - 1]/coeffs_.size(), Sy2 = Sy1;
157 for (
label i = coeffs_.size() - 2; i >= 0; i --)
159 Sy1 = Sy1*x1 + coeffs_[i]/(i + 1);
160 Sy2 = Sy2*x2 + coeffs_[i]/(i + 1);
163 return x2*Sy2 - x1*Sy1;
174 writeEntry(os,
"coeffs", convertWrite(units, coeffs_));
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return the name of the entry.
Arbitrary order polynomial Function1.
virtual Type integral(const scalar x1, const scalar x2) const
Integrate between two scalar fields.
virtual void write(Ostream &os, const unitSets &units) const
Write in dictionary format.
virtual ~Polynomial()
Destructor.
virtual Type value(const scalar x) const
Return Polynomial value as a function of scalar x.
Polynomial(const word &name, const unitSets &units, const dictionary &dict)
Construct from name and dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Motion of the mesh specified as a list of pointMeshMovers.
Template function which returns the un-mangled name of a given type. Useful for types which do not ha...
A class for handling words, derived from string.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void writeEntry(Ostream &os, const omega &a)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
Struct containing two unitSets for use in converting both the argument and the value of a Function1.