Estimate local truncation error between 2 oscillation approximations.
The estimation is done by norm L2 of U:
$$ error = \sqrt{ \frac{(lhs\%U - rhs\%U)^2}{U^2 } } $$
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_lcce), | intent(in) | :: | lhs | Left hand side. |
||
class(integrand_object), | intent(in) | :: | rhs | Right hand side. |
Error estimation.
pure function local_error(lhs, rhs) result(error)
!< Estimate local truncation error between 2 oscillation approximations.
!<
!< The estimation is done by norm L2 of U:
!<
!< $$ error = \sqrt{ \frac{(lhs\%U - rhs\%U)^2}{U^2 } } $$
class(integrand_lcce), intent(in) :: lhs !< Left hand side.
class(integrand_object), intent(in) :: rhs !< Right hand side.
real(R_P) :: error !< Error estimation.
select type(rhs)
class is(integrand_lcce)
if (lhs%U /= 0._R_P) then
error = sqrt(((lhs%U - rhs%U) ** 2) / lhs%U **2)
elseif (rhs%U /= 0._R_P) then
error = sqrt(((lhs%U - rhs%U) ** 2) / rhs%U **2)
else
error = 0._R_P
endif
endselect
endfunction local_error