Skip to content

Commit 8c865a8

Browse files
committed
add linear constant coefficients equation test
1 parent feb2ae4 commit 8c865a8

11 files changed

+2196
-1029
lines changed

src/lib/foodie.f90

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -219,18 +219,18 @@ subroutine foodie_integrator_factory(scheme, integrator, stages, tolerance, nu,
219219
type is(integrator_runge_kutta_emd)
220220
call integrator%initialize(scheme=scheme, tolerance=tolerance)
221221
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)
227-
endselect
228222
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_lssp%class_name())) > 0) then
229223
allocate(integrator_runge_kutta_lssp :: integrator)
230224
select type(integrator)
231225
type is(integrator_runge_kutta_lssp)
232226
call integrator%initialize(scheme=scheme, stages=stages)
233227
endselect
228+
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_ls%class_name())) > 0) then
229+
allocate(integrator_runge_kutta_ls :: integrator)
230+
select type(integrator)
231+
type is(integrator_runge_kutta_ls)
232+
call integrator%initialize(scheme=scheme)
233+
endselect
234234
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_ssp%class_name())) > 0) then
235235
allocate(integrator_runge_kutta_ssp :: integrator)
236236
select type(integrator)

src/lib/foodie_integrand_object.f90

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ module foodie_integrand_object
1616
#endif
1717
contains
1818
! public deferred procedures that concrete integrand-field must implement
19-
procedure(time_derivative), pass(self), deferred, public :: t !< Time derivative, residuals.
19+
procedure(integrand_dimension_interface), pass(self), deferred, public :: integrand_dimension !< Return integrand dimension.
20+
procedure(time_derivative), pass(self), deferred, public :: t !< Time derivative, residuals.
2021
! operators
2122
procedure(local_error_operator), pass(lhs), deferred, public :: local_error !< `||integrand - integrand||` operator.
2223
generic, public :: operator(.lterror.) => local_error !< Estimate local truncation error.
@@ -62,7 +63,14 @@ module foodie_integrand_object
6263
endtype integrand_object
6364

6465
abstract interface
65-
!< Abstract type bound procedures necessary for implementing a concrete extension of [[integrand_object]].
66+
!< Abstract type bound procedures necessary for implementing a concrete extension of [[integrand_object]].
67+
68+
pure function integrand_dimension_interface(self) result(integrand_dimension)
69+
!< Return integrand dimension.
70+
import :: integrand_object, I_P
71+
class(integrand_object), intent(in) :: self !< Integrand.
72+
integer(I_P) :: integrand_dimension !< Integrand dimension.
73+
endfunction integrand_dimension_interface
6674

6775
function time_derivative(self, t) result(dState_dt)
6876
!< Time derivative function of integrand class, i.e. the residuals function.

src/lib/foodie_integrator_backward_differentiation_formula.f90

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ subroutine integrate(self, U, previous, Dt, t, iterations, autoupdate)
279279
do s=1, self%steps - 1
280280
delta = delta + (previous(s) * (-self%a(s)))
281281
enddo
282-
do s=1, iterations
282+
do s=1, iterations_
283283
U = delta + (U%t(t=t(self%steps) + Dt) * (Dt * self%b))
284284
enddo
285285
if (autoupdate_) call self%update_previous(U=U, previous=previous)

src/tests/lcce/fobos

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
[modes]
2+
modes = gnu gnu-debug gnu-coverage
3+
intel intel-debug
4+
errors-analysis
5+
gnu-pure gnu-debug-pure gnu-coverage-pure
6+
intel-pure intel-debug-pure
7+
8+
[common-variables]
9+
$CSTATIC_GNU = -cpp -c -frealloc-lhs
10+
$CSTATIC_INT = -cpp -c -assume realloc_lhs
11+
$DEBUG_GNU = -Og -g3 -Warray-bounds -Wcharacter-truncation -Wline-truncation -Wimplicit-interface -Wimplicit-procedure -Wunderflow -Wuninitialized -fcheck=all -fmodule-private -ffree-line-length-132 -fimplicit-none -fbacktrace -fdump-core -finit-real=nan -std=f2008 -fall-intrinsics
12+
$DEBUG_INT = -O0 -debug all -check all -warn all -extend-source 132 -traceback -gen-interfaces -fp-stack-check -fstack-protector-all -ftrapuv -no-ftz -std08
13+
$OPTIMIZE = -O2
14+
$EXDIRS = src/tests/parallel/ src/tests/regression/
15+
PENF/src/tests/
16+
FACE/src/tests/ FACE/src/third_party/
17+
FLAP/src/tests/ FLAP/src/third_party/
18+
WenOOF/src/tests/ WenOOF/src/third_party/
19+
20+
# main modes
21+
[gnu]
22+
help = Build test in release mode with GNU gfortran
23+
compiler = gnu
24+
cflags = $CSTATIC_GNU $OPTIMIZE
25+
lflags = $OPTIMIZE
26+
template = template-common
27+
28+
[gnu-debug]
29+
help = Build test in debug mode with GNU gfortran
30+
compiler = gnu
31+
cflags = $CSTATIC_GNU $DEBUG_GNU
32+
lflags = $DEBUG_GNU
33+
template = template-common
34+
35+
[gnu-coverage]
36+
help = Build test in release coverage mode with GNU gfortran
37+
compiler = gnu
38+
cflags = $CSTATIC_GNU $DEBUG_GNU
39+
lflags = $DEBUG_GNU
40+
coverage = True
41+
template = template-common
42+
43+
[intel]
44+
help = Build test in release mode with Intel Fortran
45+
compiler = intel
46+
cflags = $CSTATIC_INT $OPTIMIZE
47+
lflags = $OPTIMIZE
48+
template = template-common
49+
50+
[intel-debug]
51+
help = Build test in debug mode with Intel Fortran
52+
compiler = intel
53+
cflags = $CSTATIC_INT $DEBUG_INT
54+
lflags = $DEBUG_INT
55+
template = template-common
56+
57+
[errors-analysis]
58+
help = Build test in release mode (for errors analysis) with GNU gfortran
59+
compiler = gnu
60+
cflags = $CSTATIC_GNU $OPTIMIZE
61+
lflags = $OPTIMIZE
62+
cflags_heritage = True
63+
target = src/tests/lcc/foodie_test_lcce.f90
64+
exclude_dirs = $EXDIRS
65+
mod_dir = mod
66+
obj_dir = obj
67+
src = src/
68+
colors = True
69+
quiet = False
70+
log = True
71+
jobs = 10
72+
73+
# pure modes for testing FOODIE ADT with "pure" procedures
74+
[gnu-pure]
75+
help = Build test in release mode with GNU gfortran
76+
compiler = gnu
77+
cflags = $CSTATIC_GNU $OPTIMIZE
78+
lflags = $OPTIMIZE
79+
preproc = -DPURE
80+
template = template-common
81+
82+
[gnu-debug-pure]
83+
help = Build test in debug mode with GNU gfortran
84+
compiler = gnu
85+
cflags = $CSTATIC_GNU $DEBUG_GNU
86+
lflags = $DEBUG_GNU
87+
preproc = -DPURE
88+
template = template-common
89+
90+
[gnu-coverage-pure]
91+
help = Build test in release coverage mode with GNU gfortran
92+
compiler = gnu
93+
cflags = $CSTATIC_GNU $OPTIMIZE
94+
lflags = $OPTIMIZE
95+
preproc = -DPURE
96+
coverage = True
97+
template = template-common
98+
99+
[intel-pure]
100+
help = Build test in release mode with Intel Fortran
101+
compiler = intel
102+
cflags = $CSTATIC_INT $OPTIMIZE
103+
lflags = $OPTIMIZE
104+
preproc = -DPURE
105+
template = template-common
106+
107+
[intel-debug-pure]
108+
help = Build test in debug mode with Intel Fortran
109+
compiler = intel
110+
cflags = $CSTATIC_INT $DEBUG_INT
111+
lflags = $DEBUG_INT
112+
preproc = -DPURE
113+
template = template-common
114+
115+
# templates
116+
[template-common]
117+
cflags_heritage = True
118+
build_dir = build/tests/lcc/
119+
mod_dir = mod
120+
obj_dir = obj
121+
src = src/
122+
target = src/tests/lcc/foodie_test_lcce.f90
123+
exclude_dirs = $EXDIRS
124+
colors = True
125+
quiet = False
126+
log = True
127+
jobs = 10

0 commit comments

Comments
 (0)