DOPRI5 (Dormand-Prince 5(4)) integrator for streamline computation Provides adaptive step size control and high-order accuracy
Following SOLID principles: - Single responsibility: Only handles numerical integration - Open/closed: Extensible to other integration methods - Interface segregation: Clean, focused interface - Dependency inversion: Depends on abstract velocity field interface Integration parameters for DOPRI5 method DOPRI5 Butcher tableau coefficients
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
real(kind=wp), | public | :: | rtol | = | 1.0e-6_wp |
Relative tolerance |
|
real(kind=wp), | public | :: | atol | = | 1.0e-9_wp |
Absolute tolerance |
|
real(kind=wp), | public | :: | h_initial | = | 0.01_wp |
Initial step size |
|
real(kind=wp), | public | :: | h_min | = | 1.0e-12_wp |
Minimum step size |
|
real(kind=wp), | public | :: | h_max | = | 1.0_wp |
Maximum step size |
|
integer, | public | :: | max_steps | = | 10000 |
Maximum integration steps |
|
real(kind=wp), | public | :: | safety_factor | = | 0.9_wp |
Step size safety factor |
|
real(kind=wp), | public | :: | max_factor | = | 5.0_wp |
Maximum step increase factor |
|
real(kind=wp), | public | :: | min_factor | = | 0.2_wp |
Minimum step decrease factor |
Integrate streamline using DOPRI5 method with adaptive step size
Type | Intent | Optional | Attributes | Name | |||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
real(kind=wp), | intent(in) | :: | x0 | ||||||||||||||||||||||||
real(kind=wp), | intent(in) | :: | y0 | ||||||||||||||||||||||||
real(kind=wp), | intent(in) | :: | t0 | ||||||||||||||||||||||||
real(kind=wp), | intent(in) | :: | t_final | ||||||||||||||||||||||||
private function u_func(x, y)Arguments
Return Value real(kind=wp) |
|||||||||||||||||||||||||||
private function v_func(x, y)Arguments
Return Value real(kind=wp) |
|||||||||||||||||||||||||||
type(integration_params_t), | intent(in) | :: | params | ||||||||||||||||||||||||
real(kind=wp), | intent(out), | allocatable | :: | path_x(:) | |||||||||||||||||||||||
real(kind=wp), | intent(out), | allocatable | :: | path_y(:) | |||||||||||||||||||||||
real(kind=wp), | intent(out), | allocatable | :: | times(:) | |||||||||||||||||||||||
integer, | intent(out) | :: | n_points | ||||||||||||||||||||||||
integer, | intent(out) | :: | n_accepted | ||||||||||||||||||||||||
integer, | intent(out) | :: | n_rejected | ||||||||||||||||||||||||
logical, | intent(out) | :: | success |