Skip to content

Commit

Permalink
Merge branch 'feature/add-linear_advection_test' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
szaghi committed May 26, 2017
2 parents 1f7bb18 + 1812d6e commit 64fe6df
Show file tree
Hide file tree
Showing 26 changed files with 3,257 additions and 2,321 deletions.
16 changes: 8 additions & 8 deletions fobos
Original file line number Diff line number Diff line change
Expand Up @@ -218,17 +218,17 @@ rule = tar --xform="s%^%FOODIE/%" -czf FOODIE.tar.gz *

[rule-makecoverage]
help = Rule for performing coverage analysis
rule_1 = FoBiS.py build -f src/tests/accuracy/oscillation/fobos -mode gnu-coverage
rule_2 = ./build/tests/accuracy/oscillation/oscillation -s all
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*
rule_4 = gcov -o build/tests/accuracy/oscillation/obj/ src/lib/foodie*
rule_1 = FoBiS.py build -f src/tests/tester/fobos -mode gnu-coverage
rule_2 = ./build/tests/tester/foodie_tester
rule_3 = rm -f build/tests/tester/obj/penf* build/tests/tester/obj/face* build/tests/tester/obj/flap* build/tests/tester/obj/wenoof*
rule_4 = gcov -o build/tests/tester/obj/ src/lib/foodie*
rule_5 = rm -f *.gcov

[rule-coverage-analysis]
help = Rule for performing coverage analysis and saving reports in markdown
rule_1 = FoBiS.py build -f src/tests/accuracy/oscillation/fobos -mode gnu-coverage
rule_2 = ./build/tests/accuracy/oscillation/oscillation -s all
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*
rule_4 = gcov -o build/tests/accuracy/oscillation/obj/ src/lib/foodie*
rule_1 = FoBiS.py build -f src/tests/tester/fobos -mode gnu-coverage
rule_2 = ./build/tests/tester/foodie_tester
rule_3 = rm -f build/tests/tester/obj/penf* build/tests/tester/obj/face* build/tests/tester/obj/flap* build/tests/tester/obj/wenoof*
rule_4 = gcov -o build/tests/tester/obj/ src/lib/foodie*
rule_5 = FoBiS.py rule -gcov_analyzer wiki/ Coverage-Analysis
rule_6 = rm -f *.gcov
56 changes: 36 additions & 20 deletions src/lib/foodie.f90
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ module foodie
use foodie_integrator_lmm_ssp, only : integrator_lmm_ssp
use foodie_integrator_lmm_ssp_vss, only : integrator_lmm_ssp_vss
use foodie_integrator_ms_runge_kutta_ssp, only : integrator_ms_runge_kutta_ssp
use foodie_integrator_multistage_object, only : integrator_multistage_object
use foodie_integrator_multistage_multistep_object, only : integrator_multistage_multistep_object
use foodie_integrator_multistep_object, only : integrator_multistep_object
use foodie_integrator_runge_kutta_emd, only : integrator_runge_kutta_emd
use foodie_integrator_runge_kutta_low_storage, only : integrator_runge_kutta_ls
use foodie_integrator_runge_kutta_lssp, only : integrator_runge_kutta_lssp
Expand All @@ -82,11 +85,20 @@ module foodie

implicit none
private
! helper procedures
public :: foodie_integrator_class_names
public :: foodie_integrator_factory
public :: foodie_integrator_schemes
public :: is_available
public :: is_class_available
public :: is_scheme_available
! abstract objects
public :: integrand_object
public :: integrator_object
public :: integrator_multistage_object
public :: integrator_multistage_multistep_object
public :: integrator_multistep_object
! concrete objects
public :: integrator_adams_bashforth
public :: integrator_adams_bashforth_moulton
public :: integrator_adams_moulton
Expand All @@ -100,9 +112,6 @@ module foodie
public :: integrator_runge_kutta_ls
public :: integrator_runge_kutta_lssp
public :: integrator_runge_kutta_ssp
public :: is_available
public :: is_class_available
public :: is_scheme_available

contains
pure function foodie_integrator_class_names() result(names)
Expand Down Expand Up @@ -137,18 +146,21 @@ pure function foodie_integrator_class_names() result(names)
names = [names, int_runge_kutta_ssp % class_name()]
endfunction foodie_integrator_class_names

subroutine foodie_integrator_factory(scheme, integrator, stages, tolerance, nu, alpha)
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) :: 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.
Expand All @@ -167,75 +179,79 @@ subroutine foodie_integrator_factory(scheme, integrator, stages, tolerance, nu,
allocate(integrator_adams_bashforth_moulton :: integrator)
select type(integrator)
type is(integrator_adams_bashforth_moulton)
call integrator%initialize(scheme=scheme)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
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)
call integrator%initialize(scheme=scheme, U=U)
endselect
else
write(stderr, '(A)')'error: "'//trim(adjustl(scheme))//'" scheme is unknown!'
Expand Down
Loading

0 comments on commit 64fe6df

Please sign in to comment.