Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0. More...
Public Types | |
enum | components { A, B, C, D } |
Component labeling enumeration. More... | |
Public Types inherited from VectorSpace< cubicEqn, scalar, 4 > | |
typedef VectorSpace< cubicEqn, scalar, Ncmpts > | vsType |
VectorSpace type. More... | |
typedef scalar | cmptType |
Component type. More... | |
typedef scalar | magType |
Magnitude type. More... | |
typedef scalar * | iterator |
Random access iterator for traversing VectorSpace. More... | |
Public Member Functions | |
cubicEqn () | |
Construct null. More... | |
cubicEqn (const Foam::zero) | |
Construct initialized to zero. More... | |
cubicEqn (const scalar a, const scalar b, const scalar c, const scalar d) | |
Construct from components. More... | |
scalar | a () const |
scalar | b () const |
scalar | c () const |
scalar | d () const |
scalar & | a () |
scalar & | b () |
scalar & | c () |
scalar & | d () |
scalar | value (const scalar x) const |
Evaluate at x. More... | |
scalar | derivative (const scalar x) const |
Evaluate the derivative at x. More... | |
scalar | error (const scalar x) const |
Estimate the error of evaluation at x. More... | |
Roots< 3 > | roots () const |
Get the roots. More... | |
Public Member Functions inherited from VectorSpace< cubicEqn, scalar, 4 > | |
VectorSpace () | |
Construct null. More... | |
VectorSpace (const Foam::zero) | |
Construct initialized to zero. More... | |
VectorSpace (Istream &is) | |
Construct from Istream. More... | |
VectorSpace (const VectorSpace< cubicEqn, scalar, Ncmpts > &vs) | |
Copy construct. More... | |
VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &) | |
Copy construct of a VectorSpace with the same size. More... | |
const scalar & | component (const direction) const |
scalar & | component (const direction) |
void | component (scalar &, const direction) const |
void | replace (const direction, const scalar &) |
const scalar * | cdata () const noexcept |
Return const pointer to the first data element. More... | |
scalar * | data () noexcept |
Return pointer to the first data element. More... | |
const ConstBlock< SubVector, BStart > | block () const |
const Foam::VectorSpace< cubicEqn, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
const scalar & | operator[] (const direction) const |
scalar & | operator[] (const direction) |
void | operator= (const VectorSpace< cubicEqn, scalar, Ncmpts > &) |
void | operator= (const Foam::zero) |
void | operator+= (const VectorSpace< cubicEqn, scalar, Ncmpts > &) |
void | operator-= (const VectorSpace< cubicEqn, scalar, Ncmpts > &) |
void | operator*= (const scalar) |
void | operator/= (const scalar) |
iterator | begin () |
Return an iterator to begin of VectorSpace. More... | |
const_iterator | begin () const |
Return const_iterator to begin of VectorSpace. More... | |
iterator | end () |
Return an iterator to end of VectorSpace. More... | |
const_iterator | end () const |
Return const_iterator to end of VectorSpace. More... | |
const_iterator | cbegin () const |
Return const_iterator to begin of VectorSpace. More... | |
const_iterator | cend () const |
Return const_iterator to end of VectorSpace. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from VectorSpace< cubicEqn, scalar, 4 > | |
static constexpr direction | size () |
Return the number of elements in the VectorSpace = Ncmpts. More... | |
static cubicEqn | uniform (const scalar &s) |
Return a VectorSpace with all elements = s. More... | |
Public Attributes inherited from VectorSpace< cubicEqn, scalar, 4 > | |
const typedef scalar * | const_iterator |
Random access iterator for traversing VectorSpace. More... | |
scalar | v_ [Ncmpts] |
The components of this vector space. More... | |
Static Public Attributes inherited from VectorSpace< cubicEqn, scalar, 4 > | |
static constexpr direction | dim |
Dimensionality of space. More... | |
static constexpr direction | nComponents |
Number of components in this vector space. More... | |
static constexpr direction | mRows |
static constexpr direction | nCols |
static const char *const | typeName |
static const char *const | componentNames [] |
static const cubicEqn | zero |
static const cubicEqn | one |
static const cubicEqn | max |
static const cubicEqn | min |
static const cubicEqn | rootMax |
static const cubicEqn | rootMin |
Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0.
Definition at line 51 of file cubicEqn.H.
enum components |
|
inline |
Construct null.
Definition at line 30 of file cubicEqnI.H.
|
inline |
Construct initialized to zero.
Definition at line 34 of file cubicEqnI.H.
|
inline |
Construct from components.
Definition at line 41 of file cubicEqnI.H.
References A, B, Foam::constant::physicoChemical::b, Foam::constant::universal::c, C, and D.
|
inline |
Definition at line 57 of file cubicEqnI.H.
References A.
Referenced by cubicEqn::roots().
|
inline |
Definition at line 63 of file cubicEqnI.H.
References B.
Referenced by cubicEqn::roots().
|
inline |
Definition at line 69 of file cubicEqnI.H.
References C.
Referenced by cubicEqn::roots().
|
inline |
Definition at line 75 of file cubicEqnI.H.
References D.
Referenced by cubicEqn::roots().
|
inline |
Definition at line 81 of file cubicEqnI.H.
References A.
|
inline |
Definition at line 87 of file cubicEqnI.H.
References B.
|
inline |
Definition at line 93 of file cubicEqnI.H.
References C.
|
inline |
Definition at line 99 of file cubicEqnI.H.
References D.
|
inline |
Evaluate at x.
Definition at line 105 of file cubicEqnI.H.
References Foam::constant::physicoChemical::b, Foam::constant::universal::c, and x.
Referenced by particle< Type >::trackToMovingTri().
|
inline |
Evaluate the derivative at x.
Definition at line 111 of file cubicEqnI.H.
References Foam::constant::physicoChemical::b, Foam::constant::universal::c, and x.
|
inline |
Estimate the error of evaluation at x.
Definition at line 117 of file cubicEqnI.H.
References Foam::constant::physicoChemical::b, Foam::constant::universal::c, Foam::mag(), Foam::magSqr(), and x.
Foam::Roots< 3 > roots | ( | ) | const |
Get the roots.
Definition at line 34 of file cubicEqn.C.
References cubicEqn::a(), Foam::atan2(), cubicEqn::b(), cubicEqn::c(), Foam::cbrt(), Foam::cos(), cubicEqn::d(), Foam::hypot(), Foam::mag(), Foam::roots::nan, p, linearEqn::roots(), Foam::sign(), Foam::sin(), Foam::sqrt(), Roots< N >::type(), and x.
Referenced by Foam::eigenValues().