Return exact solution.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrand_oscillation), | intent(in) | :: | self | Integrand. |
||
real(kind=R_P), | intent(in) | :: | t | Time. |
||
real(kind=R_P), | intent(in), | optional | :: | t0 | Initial time. |
|
class(integrand_object), | intent(in), | optional | :: | U0 | Initial conditions. |
Exact solution.
pure function exact_solution(self, t, t0, U0) result(exact)
!< Return exact solution.
class(integrand_oscillation), intent(in) :: self !< Integrand.
real(R_P), intent(in) :: t !< Time.
real(R_P), intent(in), optional :: t0 !< Initial time.
class(integrand_object), intent(in), optional :: U0 !< Initial conditions.
real(R_P), allocatable :: exact(:) !< Exact solution.
exact = [self%U0(1) * cos(self%f * t) - self%U0(2) * sin(self%f * t), &
self%U0(1) * sin(self%f * t) + self%U0(2) * cos(self%f * t)]
endfunction exact_solution