Return a concrete instance of integrator_object given a scheme selection.
This is the FOODIE integrators factory.
If an error occurs the error status of integrator_object is updated.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | scheme | Selected integrator given. |
||
class(integrator_object), | intent(out), | allocatable | :: | integrator | The FOODIE integrator. |
|
integer(kind=I_P), | intent(in), | optional | :: | stages | Stages of multi-stage methods. |
|
real(kind=R_P), | intent(in), | optional | :: | tolerance | Tolerance on the local truncation error. |
|
real(kind=R_P), | intent(in), | optional | :: | nu | Williams-Robert-Asselin filter coefficient. |
|
real(kind=R_P), | intent(in), | optional | :: | alpha | Robert-Asselin filter coefficient. |
|
integer(kind=I_P), | intent(in), | optional | :: | iterations | Implicit iterations. |
|
logical, | intent(in), | optional | :: | autoupdate | Enable cyclic autoupdate for multistep. |
|
class(integrand_object), | intent(in), | optional | :: | U | Integrand molding prototype. |
subroutine foodie_integrator_factory(scheme, integrator, stages, tolerance, nu, alpha, iterations, autoupdate, U)
!< Return a concrete instance of [[integrator_object]] given a scheme selection.
!<
!< This is the FOODIE integrators factory.
!<
!< @note If an error occurs the error status of [[integrator_object]] is updated.
character(*), intent(in) :: scheme !< Selected integrator given.
class(integrator_object), allocatable, intent(out) :: integrator !< The FOODIE integrator.
integer(I_P), optional, intent(in) :: stages !< Stages of multi-stage methods.
real(R_P), optional, intent(in) :: tolerance !< Tolerance on the local truncation error.
real(R_P), optional, intent(in) :: nu !< Williams-Robert-Asselin filter coefficient.
real(R_P), optional, intent(in) :: alpha !< Robert-Asselin filter coefficient.
integer(I_P), optional, intent(in) :: iterations !< Implicit iterations.
logical, optional, intent(in) :: autoupdate !< Enable cyclic autoupdate for multistep.
class(integrand_object), optional, intent(in) :: U !< Integrand molding prototype.
type(integrator_adams_bashforth) :: int_adams_bashforth !< Integrator Adams Bashforth.
type(integrator_adams_bashforth_moulton) :: int_adams_bashforth_moulton !< Integrator Adams Bashforth Moulton.
type(integrator_adams_moulton) :: int_adams_moulton !< Integrator Adams Moulton.
type(integrator_back_df) :: int_back_df !< Integrator back differentiation formula.
type(integrator_euler_explicit) :: int_euler_explicit !< Integrator euler explicit.
type(integrator_leapfrog) :: int_leapfrog !< Integrator leapfrog.
type(integrator_lmm_ssp) :: int_lmm_ssp !< Integrator LMM SSP.
type(integrator_lmm_ssp_vss) :: int_lmm_ssp_vss !< Integrator LMM SSP VSS.
type(integrator_ms_runge_kutta_ssp) :: int_ms_runge_kutta_ssp !< Integrator multistep Runge Kutta ssp.
type(integrator_runge_kutta_emd) :: int_runge_kutta_emd !< Integrator Runge Kutta_embdedded.
type(integrator_runge_kutta_ls) :: int_runge_kutta_ls !< Integrator Runge Kutta low storage.
type(integrator_runge_kutta_lssp) :: int_runge_kutta_lssp !< Integrator linear Runge Kutta SSP.
type(integrator_runge_kutta_ssp) :: int_runge_kutta_ssp !< Integrator Runge Kutta SSP.
if (index(trim(adjustl(scheme)), trim(int_adams_bashforth_moulton%class_name())) > 0) then
allocate(integrator_adams_bashforth_moulton :: integrator)
select type(integrator)
type is(integrator_adams_bashforth_moulton)
call integrator%initialize(scheme=scheme, iterations=iterations, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_adams_bashforth%class_name())) > 0) then
allocate(integrator_adams_bashforth :: integrator)
select type(integrator)
type is(integrator_adams_bashforth)
call integrator%initialize(scheme=scheme, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_adams_moulton%class_name())) > 0) then
allocate(integrator_adams_moulton :: integrator)
select type(integrator)
type is(integrator_adams_moulton)
call integrator%initialize(scheme=scheme, iterations=iterations, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_back_df%class_name())) > 0) then
allocate(integrator_back_df :: integrator)
select type(integrator)
type is(integrator_back_df)
call integrator%initialize(scheme=scheme, iterations=iterations, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_euler_explicit%class_name())) > 0) then
allocate(integrator_euler_explicit :: integrator)
select type(integrator)
type is(integrator_euler_explicit)
call integrator%initialize(scheme=scheme, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_leapfrog%class_name())) > 0) then
allocate(integrator_leapfrog :: integrator)
select type(integrator)
type is(integrator_leapfrog)
call integrator%initialize(scheme=scheme, nu=nu, alpha=alpha, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_lmm_ssp_vss%class_name())) > 0) then
allocate(integrator_lmm_ssp_vss :: integrator)
select type(integrator)
type is(integrator_lmm_ssp_vss)
call integrator%initialize(scheme=scheme, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_lmm_ssp%class_name())) > 0) then
allocate(integrator_lmm_ssp :: integrator)
select type(integrator)
type is(integrator_lmm_ssp)
call integrator%initialize(scheme=scheme, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_ms_runge_kutta_ssp%class_name())) > 0) then
allocate(integrator_ms_runge_kutta_ssp :: integrator)
select type(integrator)
type is(integrator_ms_runge_kutta_ssp)
call integrator%initialize(scheme=scheme, iterations=iterations, autoupdate=autoupdate, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_emd%class_name())) > 0) then
allocate(integrator_runge_kutta_emd :: integrator)
select type(integrator)
type is(integrator_runge_kutta_emd)
call integrator%initialize(scheme=scheme, tolerance=tolerance, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_lssp%class_name())) > 0) then
allocate(integrator_runge_kutta_lssp :: integrator)
select type(integrator)
type is(integrator_runge_kutta_lssp)
call integrator%initialize(scheme=scheme, stages=stages, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_ls%class_name())) > 0) then
allocate(integrator_runge_kutta_ls :: integrator)
select type(integrator)
type is(integrator_runge_kutta_ls)
call integrator%initialize(scheme=scheme, U=U)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_ssp%class_name())) > 0) then
allocate(integrator_runge_kutta_ssp :: integrator)
select type(integrator)
type is(integrator_runge_kutta_ssp)
call integrator%initialize(scheme=scheme, U=U)
endselect
else
write(stderr, '(A)')'error: "'//trim(adjustl(scheme))//'" scheme is unknown!'
stop
endif
endsubroutine foodie_integrator_factory