main integration class
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private | :: | istatus | = | 0 |
status code |
|
logical, | private | :: | stopped | = | .false. |
if user has stopped the integration in |
|
integer, | private | :: | num_steps | = | 0 |
number of accepted steps taken |
|
integer, | private | :: | max_number_of_steps | = | huge(1) |
maximum number of steps to take |
|
integer, | private | :: | report_rate | = | 1 |
how often to call report function:
|
|
logical, | private | :: | stop_on_errors | = | .false. |
if true, then errors will stop the program |
|
integer, | private | :: | n | = | 0 |
user specified number of variables |
|
procedure(deriv_func), | private, | pointer | :: | f | => | null() |
user-specified derivative function |
procedure(report_func), | private, | pointer | :: | report | => | null() |
user-specified report function |
procedure(event_func), | private, | pointer | :: | g | => | null() |
event function (stop when this is zero) |
type(root_method), | private | :: | solver | = | root_method_brent |
the root solver method to use for even finding |
|
real(kind=wp), | private, | dimension(:,:), allocatable | :: | funcs |
matrix to store the function
evalutaions in the step function.
this will be size ( |
user-callable method to stop the integration
User-callable method to stop the integration.
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 |
Initialize the rk_class.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | n |
number of variables |
||
procedure(deriv_func) | :: | f |
derivative function |
|||
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 |
Begin an integration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me |
Raise an exception.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me | |||
integer, | intent(in) | :: | error_code |
the error to raise |
Clear any exception.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me |
Wrapper for exporting points during integration.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me | |||
real(kind=wp), | intent(in) | :: | t | |||
real(kind=wp), | intent(in), | dimension(:) | :: | x | ||
logical, | intent(in), | optional | :: | first_or_last |
if this is the first or last point (always reported) |
routine called before integration begins to set up internal variables.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(inout) | :: | me |
Returns the properties of the method.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(rk_class), | intent(in) | :: | me |
properties of the method
type,abstract,public :: rk_class !! main integration class private integer :: istatus = 0 !! status code logical :: stopped = .false. !! if user has stopped the integration in `f` or `report`. integer :: num_steps = 0 !! number of accepted steps taken integer :: max_number_of_steps = huge(1) !! maximum number of steps to take integer :: report_rate = 1 !! how often to call report function: !! `0` : no reporting (same as not associating `report`), !! `1` : report every point, !! `2` : report every other point, etc. !! The first and last point are always reported. logical :: stop_on_errors = .false. !! if true, then errors will stop the program integer :: n = 0 !! user specified number of variables procedure(deriv_func),pointer :: f => null() !! user-specified derivative function procedure(report_func),pointer :: report => null() !! user-specified report function procedure(event_func),pointer :: g => null() !! event function (stop when this is zero) type(root_method) :: solver = root_method_brent !! the root solver method to use for even finding real(wp),dimension(:,:),allocatable :: funcs !! matrix to store the function !! evalutaions in the step function. !! this will be size (`n` x `number_of_registers`) contains private procedure,public :: destroy !! destructor procedure,public :: stop => rk_class_stop !! user-callable method to stop the integration procedure,public :: status => rk_class_status !! get status code and message procedure,public :: failed procedure :: init => initialize_rk_class procedure :: begin => begin_integration_rk_class procedure :: raise_exception procedure :: clear_exception procedure :: export_point procedure(begin_func),deferred :: begin_integration procedure(properties_func),deferred,public :: properties end type rk_class