@@ -74,6 +74,9 @@ module foodie
7474use foodie_integrator_lmm_ssp, only : integrator_lmm_ssp
7575use foodie_integrator_lmm_ssp_vss, only : integrator_lmm_ssp_vss
7676use foodie_integrator_ms_runge_kutta_ssp, only : integrator_ms_runge_kutta_ssp
77+ use foodie_integrator_multistage_object, only : integrator_multistage_object
78+ use foodie_integrator_multistage_multistep_object, only : integrator_multistage_multistep_object
79+ use foodie_integrator_multistep_object, only : integrator_multistep_object
7780use foodie_integrator_runge_kutta_emd, only : integrator_runge_kutta_emd
7881use foodie_integrator_runge_kutta_low_storage, only : integrator_runge_kutta_ls
7982use foodie_integrator_runge_kutta_lssp, only : integrator_runge_kutta_lssp
@@ -82,11 +85,20 @@ module foodie
8285
8386implicit none
8487private
88+ ! helper procedures
8589public :: foodie_integrator_class_names
8690public :: foodie_integrator_factory
8791public :: foodie_integrator_schemes
92+ public :: is_available
93+ public :: is_class_available
94+ public :: is_scheme_available
95+ ! abstract objects
8896public :: integrand_object
8997public :: integrator_object
98+ public :: integrator_multistage_object
99+ public :: integrator_multistage_multistep_object
100+ public :: integrator_multistep_object
101+ ! concrete objects
90102public :: integrator_adams_bashforth
91103public :: integrator_adams_bashforth_moulton
92104public :: integrator_adams_moulton
@@ -100,9 +112,6 @@ module foodie
100112public :: integrator_runge_kutta_ls
101113public :: integrator_runge_kutta_lssp
102114public :: integrator_runge_kutta_ssp
103- public :: is_available
104- public :: is_class_available
105- public :: is_scheme_available
106115
107116contains
108117 pure function foodie_integrator_class_names () result(names)
@@ -137,18 +146,21 @@ pure function foodie_integrator_class_names() result(names)
137146 names = [names, int_runge_kutta_ssp % class_name()]
138147 end function foodie_integrator_class_names
139148
140- subroutine foodie_integrator_factory (scheme , integrator , stages , tolerance , nu , alpha )
149+ subroutine foodie_integrator_factory (scheme , integrator , stages , tolerance , nu , alpha , iterations , autoupdate , U )
141150 ! < Return a concrete instance of [[integrator_object]] given a scheme selection.
142151 ! <
143152 ! < This is the FOODIE integrators factory.
144153 ! <
145154 ! < @note If an error occurs the error status of [[integrator_object]] is updated.
146155 character (* ), intent (in ) :: scheme ! < Selected integrator given.
147156 class(integrator_object), allocatable , intent (out ) :: integrator ! < The FOODIE integrator.
148- integer (I_P), optional , intent (in ) :: stages ! < Stages of multi-stage methods.
149- real (R_P), optional , intent (in ) :: tolerance ! < Tolerance on the local truncation error.
150- real (R_P), optional , intent (in ) :: nu ! < Williams-Robert-Asselin filter coefficient.
151- real (R_P), optional , intent (in ) :: alpha ! < Robert-Asselin filter coefficient.
157+ integer (I_P), optional , intent (in ) :: stages ! < Stages of multi-stage methods.
158+ real (R_P), optional , intent (in ) :: tolerance ! < Tolerance on the local truncation error.
159+ real (R_P), optional , intent (in ) :: nu ! < Williams-Robert-Asselin filter coefficient.
160+ real (R_P), optional , intent (in ) :: alpha ! < Robert-Asselin filter coefficient.
161+ integer (I_P), optional , intent (in ) :: iterations ! < Implicit iterations.
162+ logical , optional , intent (in ) :: autoupdate ! < Enable cyclic autoupdate for multistep.
163+ class(integrand_object), optional , intent (in ) :: U ! < Integrand molding prototype.
152164 type (integrator_adams_bashforth) :: int_adams_bashforth ! < Integrator Adams Bashforth.
153165 type (integrator_adams_bashforth_moulton) :: int_adams_bashforth_moulton ! < Integrator Adams Bashforth Moulton.
154166 type (integrator_adams_moulton) :: int_adams_moulton ! < Integrator Adams Moulton.
@@ -167,75 +179,79 @@ subroutine foodie_integrator_factory(scheme, integrator, stages, tolerance, nu,
167179 allocate (integrator_adams_bashforth_moulton :: integrator)
168180 select type (integrator)
169181 type is (integrator_adams_bashforth_moulton)
170- call integrator% initialize(scheme= scheme)
182+ call integrator% initialize(scheme= scheme, iterations = iterations, autoupdate = autoupdate, U = U )
171183 endselect
172184 elseif (index (trim (adjustl (scheme)), trim (int_adams_bashforth% class_name())) > 0 ) then
173185 allocate (integrator_adams_bashforth :: integrator)
174186 select type (integrator)
175187 type is (integrator_adams_bashforth)
176- call integrator% initialize(scheme= scheme)
188+ call integrator% initialize(scheme= scheme, autoupdate = autoupdate, U = U )
177189 endselect
178190 elseif (index (trim (adjustl (scheme)), trim (int_adams_moulton% class_name())) > 0 ) then
179191 allocate (integrator_adams_moulton :: integrator)
180192 select type (integrator)
181193 type is (integrator_adams_moulton)
182- call integrator% initialize(scheme= scheme)
194+ call integrator% initialize(scheme= scheme, iterations = iterations, autoupdate = autoupdate, U = U )
183195 endselect
184196 elseif (index (trim (adjustl (scheme)), trim (int_back_df% class_name())) > 0 ) then
185197 allocate (integrator_back_df :: integrator)
186198 select type (integrator)
187199 type is (integrator_back_df)
188- call integrator% initialize(scheme= scheme)
200+ call integrator% initialize(scheme= scheme, iterations = iterations, autoupdate = autoupdate, U = U )
189201 endselect
190202 elseif (index (trim (adjustl (scheme)), trim (int_euler_explicit% class_name())) > 0 ) then
191203 allocate (integrator_euler_explicit :: integrator)
204+ select type (integrator)
205+ type is (integrator_euler_explicit)
206+ call integrator% initialize(scheme= scheme, U= U)
207+ endselect
192208 elseif (index (trim (adjustl (scheme)), trim (int_leapfrog% class_name())) > 0 ) then
193209 allocate (integrator_leapfrog :: integrator)
194210 select type (integrator)
195211 type is (integrator_leapfrog)
196- call integrator% initialize(scheme= scheme, nu= nu, alpha= alpha)
212+ call integrator% initialize(scheme= scheme, nu= nu, alpha= alpha, autoupdate = autoupdate, U = U )
197213 endselect
198214 elseif (index (trim (adjustl (scheme)), trim (int_lmm_ssp_vss% class_name())) > 0 ) then
199215 allocate (integrator_lmm_ssp_vss :: integrator)
200216 select type (integrator)
201217 type is (integrator_lmm_ssp_vss)
202- call integrator% initialize(scheme= scheme)
218+ call integrator% initialize(scheme= scheme, autoupdate = autoupdate, U = U )
203219 endselect
204220 elseif (index (trim (adjustl (scheme)), trim (int_lmm_ssp% class_name())) > 0 ) then
205221 allocate (integrator_lmm_ssp :: integrator)
206222 select type (integrator)
207223 type is (integrator_lmm_ssp)
208- call integrator% initialize(scheme= scheme)
224+ call integrator% initialize(scheme= scheme, autoupdate = autoupdate, U = U )
209225 endselect
210226 elseif (index (trim (adjustl (scheme)), trim (int_ms_runge_kutta_ssp% class_name())) > 0 ) then
211227 allocate (integrator_ms_runge_kutta_ssp :: integrator)
212228 select type (integrator)
213229 type is (integrator_ms_runge_kutta_ssp)
214- call integrator% initialize(scheme= scheme)
230+ call integrator% initialize(scheme= scheme, iterations = iterations, autoupdate = autoupdate, U = U )
215231 endselect
216232 elseif (index (trim (adjustl (scheme)), trim (int_runge_kutta_emd% class_name())) > 0 ) then
217233 allocate (integrator_runge_kutta_emd :: integrator)
218234 select type (integrator)
219235 type is (integrator_runge_kutta_emd)
220- call integrator% initialize(scheme= scheme, tolerance= tolerance)
221- endselect
222- elseif (index (trim (adjustl (scheme)), trim (int_runge_kutta_ls% class_name())) > 0 ) then
223- allocate (integrator_runge_kutta_ls :: integrator)
224- select type (integrator)
225- type is (integrator_runge_kutta_ls)
226- call integrator% initialize(scheme= scheme)
236+ call integrator% initialize(scheme= scheme, tolerance= tolerance, U= U)
227237 endselect
228238 elseif (index (trim (adjustl (scheme)), trim (int_runge_kutta_lssp% class_name())) > 0 ) then
229239 allocate (integrator_runge_kutta_lssp :: integrator)
230240 select type (integrator)
231241 type is (integrator_runge_kutta_lssp)
232- call integrator% initialize(scheme= scheme, stages= stages)
242+ call integrator% initialize(scheme= scheme, stages= stages, U= U)
243+ endselect
244+ elseif (index (trim (adjustl (scheme)), trim (int_runge_kutta_ls% class_name())) > 0 ) then
245+ allocate (integrator_runge_kutta_ls :: integrator)
246+ select type (integrator)
247+ type is (integrator_runge_kutta_ls)
248+ call integrator% initialize(scheme= scheme, U= U)
233249 endselect
234250 elseif (index (trim (adjustl (scheme)), trim (int_runge_kutta_ssp% class_name())) > 0 ) then
235251 allocate (integrator_runge_kutta_ssp :: integrator)
236252 select type (integrator)
237253 type is (integrator_runge_kutta_ssp)
238- call integrator% initialize(scheme= scheme)
254+ call integrator% initialize(scheme= scheme, U = U )
239255 endselect
240256 else
241257 write (stderr, ' (A)' )' error: "' // trim (adjustl (scheme))// ' " scheme is unknown!'
0 commit comments