Compute new estimation of the time step Dt.
The formula employed is:
$$ Dt_{new} = 0.9 Dt_{old} \left( \frac{tolerance}{error} \right)^{\frac{1}{p+1}} $$
0.9 is a safety factor.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_runge_kutta_emd), | intent(in) | :: | self | Integrator. |
||
real(kind=R_P), | intent(in) | :: | error | Local truncation error estimation. |
||
real(kind=R_P), | intent(inout) | :: | Dt | Time step. |
elemental subroutine new_Dt(self, error, Dt)
!< Compute new estimation of the time step Dt.
!<
!< The formula employed is:
!<
!< $$ Dt_{new} = 0.9 Dt_{old} \left( \frac{tolerance}{error} \right)^{\frac{1}{p+1}} $$
!<
!< @note 0.9 is a safety factor.
class(integrator_runge_kutta_emd), intent(in) :: self !< Integrator.
real(R_P), intent(in) :: error !< Local truncation error estimation.
real(R_P), intent(inout) :: Dt !< Time step.
if (error>self%tolerance) Dt = 0.9_R_P * Dt * (self%tolerance/error) ** self%pp1_inv
endsubroutine new_Dt