Go to the documentation of this file.
60 dydx[1] =
y[0] - (1.0/
x)*
y[1];
61 dydx[2] =
y[1] - (2.0/
x)*
y[2];
62 dydx[3] =
y[2] - (3.0/
x)*
y[3];
74 dfdx[1] = (1.0/
sqr(
x))*
y[1];
75 dfdx[2] = (2.0/
sqr(
x))*
y[2];
76 dfdx[3] = (3.0/
sqr(
x))*
y[3];
104 int main(
int argc,
char *argv[])
128 ode.derivatives(xStart, yStart, dyStart);
134 for (
label i=0; i<15; i++)
142 scalar dxNext = dxEst;
144 odeSolver->relTol() = relTol;
145 odeSolver->solve(
x,
y, dxNext);
156 scalar xEnd =
x + 1.0;
167 odeSolver->relTol() = 1
e-4;
168 odeSolver->solve(
x, xEnd,
y, dxEst);
170 Info<<
nl <<
"Analytical: y(2.0) = " << yEnd <<
endl;
171 Info <<
"Numerical: y(2.0) = " <<
y <<
", dxEst = " << dxEst <<
endl;
static SLList< string > validArgs
A list of valid (mandatory) arguments.
dimensionedScalar jn(const int n, const dimensionedScalar &ds)
static autoPtr< ODESolver > New(const ODESystem &ode, const dictionary &dict)
Select null constructed.
int main(int argc, char *argv[])
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar exp(const dimensionedScalar &ds)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
Istream and Ostream manipulators taking arguments.
An ODE solver for chemistry.
IOstream & fixed(IOstream &io)
A list of keyword definitions, which are a keyword followed by any number of values (e....
Omanip< int > setw(const int i)
const double e
Elementary charge.
IOstream & scientific(IOstream &io)
Omanip< int > setprecision(const int i)
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Abstract base class for the systems of ordinary differential equations.
dimensionedScalar j0(const dimensionedScalar &ds)
label nEqns() const
Return the number of equations in the system.
Foam::argList args(argc, argv)
dimensionedScalar j1(const dimensionedScalar &ds)
bool add(entry *, bool mergeEntry=false)
Add a new entry.