Go to the documentation of this file.
44 const polynomialFunction& poly,
45 const scalar intConstant
50 newPoly[0] = intConstant;
53 newPoly[i+1] = poly[i]/(i + 1);
62 const polynomialFunction& poly,
63 const scalar intConstant
66 polynomialFunction newPoly(poly.size()+1);
70 newPoly.logActive_ =
true;
71 newPoly.logCoeff_ = poly[0];
74 newPoly[0] = intConstant;
75 for (
label i=1; i < poly.size(); ++i)
77 newPoly[i] = poly[i]/i;
95 <<
"polynomialFunction coefficients are invalid (empty)"
104 logActive_(poly.logActive_),
105 logCoeff_(poly.logCoeff_)
118 <<
"polynomialFunction coefficients are invalid (empty)"
133 <<
"polynomialFunction coefficients are invalid (empty)"
162 scalar
val = coeffs[0];
166 for (
label i=1; i<coeffs.size(); ++i)
168 val += coeffs[i]*powX;
192 <<
"Cannot integrate polynomial with logarithmic coefficients"
200 scalar
val = coeffs[0]*(powX2 - powX1);
201 for (
label i=1; i<coeffs.size(); ++i)
203 val += coeffs[i]/(i + 1)*(powX2 - powX1);
215 return cloneIntegral(*
this, intConstant);
222 return cloneIntegralMinus1(*
this, intConstant);
233 if (coeffs.size() > poly.size())
237 coeffs[i] += poly[i];
242 coeffs.
setSize(poly.size(), 0.0);
246 coeffs[i] += poly[i];
259 if (coeffs.size() > poly.size())
263 coeffs[i] -= poly[i];
268 coeffs.
setSize(poly.size(), 0.0);
272 coeffs[i] -= poly[i];
315 for (
int i=0; i<poly.size()-1; i++)
polynomialFunction integralMinus1(const scalar intConstant=0.0) const
Return integral coefficients when lowest order is -1.
label ListType::const_reference val
polynomialFunction integral(const scalar intConstant=0.0) const
Return integral coefficients.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static constexpr const zero Zero
Global zero.
virtual ~polynomialFunction()
Destructor.
scalar integrate(const scalar x1, const scalar x2) const
Integrate between two values.
#define forAll(list, i)
Loop across all elements in list.
polynomialFunction & operator*=(const scalar)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
scalar logCoeff() const
Return the log coefficient.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
dimensionedScalar log(const dimensionedScalar &ds)
Macros for easy insertion into run-time selection tables.
errorManip< error > abort(error &err)
scalar value(const scalar x) const
Return polynomial value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
polynomialFunction & operator+=(const polynomialFunction &)
polynomialFunction & operator-=(const polynomialFunction &)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
polynomialFunction & operator/=(const scalar)
Polynomial function representation.
void setSize(const label newSize)
Alias for resize(const label)
Begin list [isseparator].
bool logActive() const
Return true if the log term is active.
defineTypeNameAndDebug(combustionModel, 0)
Ostream & operator<<(Ostream &, const boundaryPatch &)
polynomialFunction(const label)
Construct a particular size, with all coefficients = 0.0.