Skip to content

Commit 64fe6df

Browse files
committed
Merge branch 'feature/add-linear_advection_test' into develop
2 parents 1f7bb18 + 1812d6e commit 64fe6df

26 files changed

+3257
-2321
lines changed

fobos

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,17 +218,17 @@ rule = tar --xform="s%^%FOODIE/%" -czf FOODIE.tar.gz *
218218

219219
[rule-makecoverage]
220220
help = Rule for performing coverage analysis
221-
rule_1 = FoBiS.py build -f src/tests/accuracy/oscillation/fobos -mode gnu-coverage
222-
rule_2 = ./build/tests/accuracy/oscillation/oscillation -s all
223-
rule_3 = rm -f build/tests/accuracy/oscillation/obj/penf* build/tests/accuracy/oscillation/obj/face* build/tests/accuracy/oscillation/obj/flap* build/tests/accuracy/oscillation/obj/wenoof*
224-
rule_4 = gcov -o build/tests/accuracy/oscillation/obj/ src/lib/foodie*
221+
rule_1 = FoBiS.py build -f src/tests/tester/fobos -mode gnu-coverage
222+
rule_2 = ./build/tests/tester/foodie_tester
223+
rule_3 = rm -f build/tests/tester/obj/penf* build/tests/tester/obj/face* build/tests/tester/obj/flap* build/tests/tester/obj/wenoof*
224+
rule_4 = gcov -o build/tests/tester/obj/ src/lib/foodie*
225225
rule_5 = rm -f *.gcov
226226

227227
[rule-coverage-analysis]
228228
help = Rule for performing coverage analysis and saving reports in markdown
229-
rule_1 = FoBiS.py build -f src/tests/accuracy/oscillation/fobos -mode gnu-coverage
230-
rule_2 = ./build/tests/accuracy/oscillation/oscillation -s all
231-
rule_3 = rm -f build/tests/accuracy/oscillation/obj/penf* build/tests/accuracy/oscillation/obj/face* build/tests/accuracy/oscillation/obj/flap* build/tests/accuracy/oscillation/obj/wenoof*
232-
rule_4 = gcov -o build/tests/accuracy/oscillation/obj/ src/lib/foodie*
229+
rule_1 = FoBiS.py build -f src/tests/tester/fobos -mode gnu-coverage
230+
rule_2 = ./build/tests/tester/foodie_tester
231+
rule_3 = rm -f build/tests/tester/obj/penf* build/tests/tester/obj/face* build/tests/tester/obj/flap* build/tests/tester/obj/wenoof*
232+
rule_4 = gcov -o build/tests/tester/obj/ src/lib/foodie*
233233
rule_5 = FoBiS.py rule -gcov_analyzer wiki/ Coverage-Analysis
234234
rule_6 = rm -f *.gcov

src/lib/foodie.f90

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ module foodie
7474
use foodie_integrator_lmm_ssp, only : integrator_lmm_ssp
7575
use foodie_integrator_lmm_ssp_vss, only : integrator_lmm_ssp_vss
7676
use 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
7780
use foodie_integrator_runge_kutta_emd, only : integrator_runge_kutta_emd
7881
use foodie_integrator_runge_kutta_low_storage, only : integrator_runge_kutta_ls
7982
use foodie_integrator_runge_kutta_lssp, only : integrator_runge_kutta_lssp
@@ -82,11 +85,20 @@ module foodie
8285

8386
implicit none
8487
private
88+
! helper procedures
8589
public :: foodie_integrator_class_names
8690
public :: foodie_integrator_factory
8791
public :: foodie_integrator_schemes
92+
public :: is_available
93+
public :: is_class_available
94+
public :: is_scheme_available
95+
! abstract objects
8896
public :: integrand_object
8997
public :: integrator_object
98+
public :: integrator_multistage_object
99+
public :: integrator_multistage_multistep_object
100+
public :: integrator_multistep_object
101+
! concrete objects
90102
public :: integrator_adams_bashforth
91103
public :: integrator_adams_bashforth_moulton
92104
public :: integrator_adams_moulton
@@ -100,9 +112,6 @@ module foodie
100112
public :: integrator_runge_kutta_ls
101113
public :: integrator_runge_kutta_lssp
102114
public :: integrator_runge_kutta_ssp
103-
public :: is_available
104-
public :: is_class_available
105-
public :: is_scheme_available
106115

107116
contains
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
endfunction 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)
236+
call integrator%initialize(scheme=scheme, tolerance=tolerance, U=U)
221237
endselect
222238
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_lssp%class_name())) > 0) then
223239
allocate(integrator_runge_kutta_lssp :: integrator)
224240
select type(integrator)
225241
type is(integrator_runge_kutta_lssp)
226-
call integrator%initialize(scheme=scheme, stages=stages)
242+
call integrator%initialize(scheme=scheme, stages=stages, U=U)
227243
endselect
228244
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_ls%class_name())) > 0) then
229245
allocate(integrator_runge_kutta_ls :: integrator)
230246
select type(integrator)
231247
type is(integrator_runge_kutta_ls)
232-
call integrator%initialize(scheme=scheme)
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

Comments
 (0)