Go to the documentation of this file.
43 const scalar intConstant
48 newPoly[0] = intConstant;
51 newPoly[i+1] = poly[i]/(i + 1);
61 const scalar intConstant
72 newPoly[0] = intConstant;
75 newPoly[i] = poly[i]/i;
93 <<
"polynomialFunction coefficients are invalid (empty)"
102 logActive_(poly.logActive_),
103 logCoeff_(poly.logCoeff_)
116 <<
"polynomialFunction coefficients are invalid (empty)"
131 <<
"polynomialFunction coefficients are invalid (empty)"
160 scalar val = coeffs[0];
166 val += coeffs[i]*powX;
172 val += this->logCoeff_*
log(
x);
190 <<
"Cannot integrate polynomial with logarithmic coefficients"
198 scalar val = coeffs[0]*(powX2 - powX1);
201 val += coeffs[i]/(i + 1)*(powX2 - powX1);
213 return cloneIntegral(*
this, intConstant);
220 return cloneIntegralMinus1(*
this, intConstant);
235 coeffs[i] += poly[i];
244 coeffs[i] += poly[i];
261 coeffs[i] -= poly[i];
270 coeffs[i] -= poly[i];
313 for (
int i=0; i<poly.
size()-1; i++)
323 os.
check(
"operator<<(Ostream&, const polynomialFunction&)");
polynomialFunction integralMinus1(const scalar intConstant=0.0) const
Return integral coefficients when lowest order is -1.
polynomialFunction integral(const scalar intConstant=0.0) const
Return integral coefficients.
#define forAll(list, i)
Loop across all elements in list.
virtual ~polynomialFunction()
Destructor.
static polynomialFunction cloneIntegral(const polynomialFunction &, const scalar intConstant=0.0)
Return integral coefficients.
bool logActive_
Include the log term? - only activated using integralMinus1()
void size(const label)
Return the number of coefficients.
scalar integrate(const scalar x1, const scalar x2) const
Integrate between two values.
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.
Ostream & operator<<(Ostream &, const edgeMesh &)
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.
scalar logCoeff_
Log coefficient - only activated using integralMinus1()
errorManip< error > abort(error &err)
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().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))
scalar value(const scalar x) const
Return polynomial value.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static polynomialFunction cloneIntegralMinus1(const polynomialFunction &, const scalar intConstant=0.0)
Return integral coefficients when lowest order is -1.
void setSize(const label)
Reset size of List.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
polynomialFunction & operator+=(const polynomialFunction &)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
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...
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,...
polynomialFunction & operator/=(const scalar)
Polynomial function representation.
bool logActive() const
Return true if the log term is active.
defineTypeNameAndDebug(combustionModel, 0)
polynomialFunction(const label)
Construct a particular size, with all coefficients = 0.0.