Curtis 10(8)
user-callable method to stop the integration
User-callable method to stop the integration (e.g., from f, g, or report).
No further function evaluations are done, and the integrator returns, with the
status set to RKLIB_ERROR_USER_STOPPED. This is not treated as an error
(i.e., it does not stop the program if stop_on_errors is true).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_class), | intent(inout) | :: | me |
get status code and message
Get the status of an integration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_class), | intent(in) | :: | me | |||
| integer, | intent(out), | optional | :: | istatus |
status code ( |
|
| character(len=:), | intent(out), | optional, | allocatable | :: | message |
status message |
Returns true if there was an error. Can use rk_class_status to get more info.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_class), | intent(in) | :: | me |
dense output for the last accepted step
Dense output: compute the state at a time within the last accepted step,
using the continuous extension of the method (if it has one, see
rklib_properties dense).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t |
time at which to compute the state |
||
| real(kind=wp), | intent(out), | dimension(me%n) | :: | x |
state at |
|
| integer, | intent(out), | optional | :: | istatus |
status of this call |
interval of the last accepted step for the dense output
Returns the interval of the last accepted step, which is where interpolate can
be used. For example, this can be called from the report function to get the
previous time and state, so that points in between can be computed.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_class), | intent(inout) | :: | me | |||
| logical, | intent(out) | :: | available |
if dense output is available |
||
| real(kind=wp), | intent(out), | optional | :: | t0 |
initial time of the step |
|
| real(kind=wp), | intent(out), | optional | :: | tf |
final time of the step |
|
| real(kind=wp), | intent(out), | optional, | dimension(me%n) | :: | x0 |
initial state of the step |
| real(kind=wp), | intent(out), | optional, | dimension(me%n) | :: | xf |
final state of the step |
initialize the class (set n,f, and report)
Initialize the rk_variable_step_class.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me | |||
| integer, | intent(in) | :: | n |
number of equations |
||
| procedure(deriv_func) | :: | f |
derivative function |
|||
| real(kind=wp), | intent(in), | optional, | dimension(:) | :: | rtol |
relative tolerance (if size=1,
then same tol used for all
equations). If not present, a default
of |
| real(kind=wp), | intent(in), | optional, | dimension(:) | :: | atol |
absolute tolerance (if size=1,
then same tol used for all
equations). If not present, a default
of |
| type(stepsize_class), | intent(in), | optional | :: | stepsize_method |
method for varying the step size |
|
| integer, | intent(in), | optional | :: | hinit_method |
which method (1 or 2) to use for
automatic initial step size
computation.
1 = use |
|
| procedure(report_func), | optional | :: | report |
for reporting the steps |
||
| procedure(event_func), | optional | :: | g |
for stopping at an event |
||
| logical, | intent(in), | optional | :: | stop_on_errors |
stop the program for any errors (default is False) |
|
| integer, | intent(in), | optional | :: | max_number_of_steps |
max number of steps allowed |
|
| integer, | intent(in), | optional | :: | report_rate |
how often to call report function:
|
|
| class(root_method), | intent(in), | optional | :: | solver |
the root-finding method to use for even finding.
if not present, then |
|
| logical, | intent(in), | optional | :: | dense_output |
to enable the dense output (default is False, unless
|
|
| real(kind=wp), | intent(in), | optional | :: | dense_output_step |
if present and not zero, the points are reported
at this fixed time interval (starting from the initial
time), using the dense output of the method,
rather than at the steps taken by the integrator.
The first and last point are also reported (so the
last interval will generally be shorter).
This is only used if |
Main integration routine for the rk_variable_step_class.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t0 |
initial time |
||
| real(kind=wp), | intent(in), | dimension(:) | :: | x0 |
initial state |
|
| real(kind=wp), | intent(in) | :: | h |
initial abs(time step) |
||
| real(kind=wp), | intent(in) | :: | tf |
final time |
||
| real(kind=wp), | intent(out), | dimension(:) | :: | xf |
final state |
Event-finding integration routine for the rk_variable_step_class. Integrates until g(t,x)=0, or until t=tf (whichever happens first).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t0 |
initial time |
||
| real(kind=wp), | intent(in), | dimension(me%n) | :: | x0 |
initial state |
|
| real(kind=wp), | intent(in) | :: | h |
abs(time step) |
||
| real(kind=wp), | intent(in) | :: | tmax |
max final time if event not located |
||
| real(kind=wp), | intent(in) | :: | tol |
function tolerance for root finding |
||
| real(kind=wp), | intent(out) | :: | tf |
actual final time reached |
||
| real(kind=wp), | intent(out), | dimension(me%n) | :: | xf |
final state (at tf) |
|
| real(kind=wp), | intent(out) | :: | gf |
g value at tf |
Return some info about the integration.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(in) | :: | me | |||
| integer, | intent(out), | optional | :: | num_steps |
number of steps taken |
|
| integer, | intent(out), | optional | :: | num_rejected_steps |
number of rejected steps |
|
| real(kind=wp), | intent(out), | optional | :: | last_accepted_step_size |
the last accepted step size
|
Destructor for the function evaluation cache.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me |
Compute the function at t and x, or get it from the function evaluation
cache if it is there (see set_fsal_cache). This is used by all the variable-step
methods for the first stage of a step. It may already be in the cache because:
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
Compute the function and add it to the function evaluation cache, so that it
can be reused by the next step (see check_fsal_cache). This is used for
f at the end of a step: by the first-same-as-last (FSAL) methods (the last stage
of the step), and by the methods whose dense output needs it as one of its extra stages
(see dense_extra_stages).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rk_variable_step_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t | |||
| real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
| real(kind=wp), | intent(out), | dimension(:) | :: | f |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rkc108_class), | intent(inout) | :: | me | |||
| real(kind=wp), | intent(in) | :: | t |
initial time |
||
| real(kind=wp), | intent(in), | dimension(me%n) | :: | x |
initial state |
|
| real(kind=wp), | intent(in) | :: | h |
time step |
||
| real(kind=wp), | intent(out), | dimension(me%n) | :: | xf |
state at time |
|
| real(kind=wp), | intent(out), | dimension(me%n) | :: | xerr |
truncation error estimate for |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(rkc108_class), | intent(in) | :: | me |
properties of the method