Create the actual MS-RK-SSP integrator: initialize the A,Ahat,B,Bhat,D,T coefficients.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(integrator_ms_runge_kutta_ssp), | intent(inout) | :: | self | Integrator. |
||
character(len=*), | intent(in) | :: | scheme | Selected scheme. |
||
integer(kind=I_P), | intent(in), | optional | :: | iterations | Implicit iterations. |
|
logical, | intent(in), | optional | :: | autoupdate | Enable cyclic autoupdate of previous time steps. |
|
class(integrand_object), | intent(in), | optional | :: | U | Integrand molding prototype. |
|
logical, | intent(in), | optional | :: | stop_on_fail | Stop execution if initialization fail. |
subroutine initialize(self, scheme, iterations, autoupdate, U, stop_on_fail)
!< Create the actual MS-RK-SSP integrator: initialize the *A,Ahat,B,Bhat,D,T* coefficients.
class(integrator_ms_runge_kutta_ssp), intent(inout) :: self !< Integrator.
character(*), intent(in) :: scheme !< Selected scheme.
integer(I_P), intent(in), optional :: iterations !< Implicit iterations.
logical, intent(in), optional :: autoupdate !< Enable cyclic autoupdate of previous time steps.
class(integrand_object), intent(in), optional :: U !< Integrand molding prototype.
logical, intent(in), optional :: stop_on_fail !< Stop execution if initialization fail.
if (self%is_supported(scheme=scheme)) then
call self%destroy
self%description_ = trim(adjustl(scheme))
select case(trim(adjustl(scheme)))
case('ms_runge_kutta_ssp_steps_2_stages_2_order_3')
self%steps = 2
self%stages = 2
allocate(self%A(1:self%stages, 1:self%stages)) ; self%A = 0._R_P
self%A(2, 1) = 0.910683602522959_R_P
allocate(self%Ahat(1:self%stages, 1:self%steps)) ; self%Ahat = 0._R_P
self%Ahat(2, 1) = -1.11985107194706e-19_R_P
allocate(self%B(1:self%stages)) ; self%B = 0._R_P
self%B(1) = 0.535898384862245_R_P
self%B(2) = 0.803847577293368_R_P
allocate(self%Bhat(1:self%steps)) ; self%Bhat = 0._R_P
self%Bhat(1) = 0.267949192431123_R_P
allocate(self%D(1:self%stages, 1:self%steps)) ; self%D = 0._R_P
self%D(2, 1) = 1._R_P / 3._R_P
self%D(2, 2) = 2._R_P / 3._R_P
allocate(self%Q(1:self%steps)) ; self%Q = 0._R_P
self%Q(1) = 0.607695154586736_R_P
self%Q(2) = 0.392304845413264_R_P
case('ms_runge_kutta_ssp_steps_3_stages_2_order_3')
self%steps = 3
self%stages = 2
allocate(self%A(1:self%stages, 1:self%stages)) ; self%A = 0._R_P
self%A(2, 1) = 0.731058363135786_R_P
allocate(self%Ahat(1:self%stages, 1:self%steps)) ; self%Ahat = 0._R_P
self%Ahat(2, 1) = 0.127467809251820_R_P
allocate(self%B(1:self%stages)) ; self%B = 0._R_P
self%B(1) = 0.618048297723782_R_P
self%B(2) = 0.759677988437936_R_P
allocate(self%Bhat(1:self%steps)) ; self%Bhat = 0._R_P
self%Bhat(1) = 0.246670340394148_R_P
allocate(self%D(1:self%stages, 1:self%steps)) ; self%D = 0._R_P
self%D(2, 1) = 0.186433848116852_R_P
self%D(2, 2) = 1.80945758995975e-24_R_P
self%D(2, 3) = 0.813566151883148_R_P
allocate(self%Q(1:self%steps)) ; self%Q = 0._R_P
self%Q(1) = 0.312198313277933_R_P
self%Q(2) = 2.58493941422821e-24_R_P
self%Q(3) = 0.687801686722067_R_P
case('ms_runge_kutta_ssp_steps_4_stages_5_order_8')
self%steps = 4
self%stages = 5
allocate(self%A(1:self%stages, 1:self%stages)) ; self%A = 0._R_P
self%A(2, 1) = 0.0112355687952080_R_P
self%A(3, 1) = 0.782384118905967_R_P
self%A(4, 1) = 0.0997788285846345_R_P
self%A(5, 1) = 0.0173871875042219_R_P
self%A(4, 2) = 0.775239818309315_R_P
self%A(5, 2) = 0.781995253645396_R_P
self%A(4, 3) = 0.522304633131092_R_P
self%A(5, 3) = 0.0817254029032851_R_P
self%A(5, 4) = 0.654483113500859_R_P
allocate(self%Ahat(1:self%stages, 1:self%steps)) ; self%Ahat = 0._R_P
self%Ahat(2, 1) = 0.000422703250336666_R_P
self%Ahat(3, 1) = 0.0959783036454617_R_P
self%Ahat(4, 1) = 0.0140562464699573_R_P
self%Ahat(5, 1) = 0.0519851819388547_R_P
self%Ahat(2, 2) = 0.259546324808661_R_P
self%Ahat(3, 2) = 0.382496291927802_R_P
self%Ahat(4, 2) = 0.195323228972419_R_P
self%Ahat(5, 2) = 0.435648262830826_R_P
self%Ahat(2, 3) = 0.752684925098657_R_P
self%Ahat(3, 3) = 0.563081036068107_R_P
self%Ahat(4, 3) = 0.209815168854422_R_P
self%Ahat(5, 3) = 0.151720560507208_R_P
allocate(self%B(1:self%stages)) ; self%B = 0._R_P
self%B(1) = 0.711472565648602_R_P
self%B(2) = 0.0953138922500395_R_P
self%B(3) = 0.0808915576045876_R_P
self%B(4) = 0.214580109044146_R_P
self%B(5) = 0.351640244526174_R_P
allocate(self%Bhat(1:self%steps)) ; self%Bhat = 0._R_P
self%Bhat(1) = 0.00614782373612238_R_P
self%Bhat(2) = 0.138226341918060_R_P
self%Bhat(3) = 0.541410372692778_R_P
allocate(self%D(1:self%stages, 1:self%steps)) ; self%D = 0._R_P
self%D(2, 1) = 0.0273928990974108_R_P
self%D(3, 1) = 0.283607987548794_R_P
self%D(4, 1) = 0.0642241421937960_R_P
self%D(5, 1) = 0.194681462814288_R_P
self%D(2, 2) = 0.554039201229659_R_P
self%D(3, 2) = 0.0914454235177934_R_P
self%D(4, 2) = 0.198601843371796_R_P
self%D(5, 2) = 0.293086617882372_R_P
self%D(2, 3) = 0.348927848402249_R_P
self%D(3, 3) = 0.437897855084625_R_P
self%D(4, 3) = 0.662266498804591_R_P
self%D(5, 3) = 0.158740367819382_R_P
self%D(2, 4) = 0.0696400512706807_R_P
self%D(3, 4) = 0.187048733848788_R_P
self%D(4, 4) = 0.0749075156298171_R_P
self%D(5, 4) = 0.353491551483958_R_P
allocate(self%Q(1:self%steps)) ; self%Q = 0._R_P
self%Q(1) = 0.0273988434707855_R_P
self%Q(2) = 0.286296288278021_R_P
self%Q(3) = 0.484893800452111_R_P
self%Q(4) = 0.201411067799082_R_P
endselect
self%autoupdate = .true. ; if (present(autoupdate)) self%autoupdate = autoupdate
self%iterations = 1 ; if (present(iterations)) self%iterations = iterations
self%registers_stages = self%stages
self%registers_steps = self%steps
if (present(U)) call self%allocate_integrand_members(U=U)
else
call self%trigger_error(error=ERROR_UNSUPPORTED_SCHEME, &
error_message='"'//trim(adjustl(scheme))//'" unsupported scheme', &
is_severe=stop_on_fail)
endif
endsubroutine initialize