Skip to content

Commit

Permalink
Merge branch 'release/0.2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
szaghi committed Apr 14, 2017
2 parents 50bb1e9 + bf29bc1 commit 0d74347
Show file tree
Hide file tree
Showing 6 changed files with 451 additions and 28 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ cache:
- $HOME/.cache/pip
- $HOME/.local

git:
submodules: false

addons:
apt:
sources:
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ FOODIE is aimed to be a KISS-pure-Fortran library for integrating Ordinary Diffe
+ [ ] 4 steps, 9 stages, 9th order accurate;
+ [ ] 3 steps, 20 stages, 10th order accurate;
+ [ ] Runge-Kutta schemes:
+ [+] [Linear SSP (of any order)](http://fortran-foss-programmers.github.io/FOODIE/module/foodie_integrator_runge_kutta_lssp.html) schemes, see [16]:
+ [x] generic s-stages of order (s-1)-th;
+ [x] generic s-stages of order s-th;
+ [ ] [low-storage](http://fortran-foss-programmers.github.io/FOODIE/module/foodie_integrator_runge_kutta_low_storage.html) schemes, see [1, 2, 3]:
+ [x] 1 stage, namely the forward explicit Euler scheme, 1st order accurate;
+ [ ] 2 stages;
Expand Down
40 changes: 28 additions & 12 deletions src/lib/foodie.f90
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ module foodie
use foodie_integrator_ms_runge_kutta_ssp, only : integrator_ms_runge_kutta_ssp
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
use foodie_integrator_runge_kutta_ssp, only : integrator_runge_kutta_ssp
use penf, only : I_P, R_P

Expand All @@ -97,19 +98,21 @@ module foodie
public :: integrator_ms_runge_kutta_ssp
public :: integrator_runge_kutta_emd
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
function foodie_integrator(scheme, tolerance, nu, alpha) result(integrator)
function foodie_integrator(scheme, stages, tolerance, nu, alpha) result(integrator)
!< 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.
integer(I_P), intent(in), optional :: stages !< Stages of multi-stage methods.
real(R_P), intent(in), optional :: tolerance !< Tolerance on the local truncation error.
real(R_P), intent(in), optional :: nu !< Williams-Robert-Asselin filter coefficient.
real(R_P), intent(in), optional :: alpha !< Robert-Asselin filter coefficient.
Expand All @@ -120,12 +123,13 @@ function foodie_integrator(scheme, tolerance, nu, alpha) result(integrator)
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_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_ssp) :: int_runge_kutta_ssp !< Integrator Runge Kutta ssp.
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)
Expand Down Expand Up @@ -189,6 +193,12 @@ function foodie_integrator(scheme, tolerance, nu, alpha) result(integrator)
type is(integrator_runge_kutta_ls)
call integrator%initialize(scheme=scheme)
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)
endselect
elseif (index(trim(adjustl(scheme)), trim(int_runge_kutta_ssp%class_name())) > 0) then
allocate(integrator_runge_kutta_ssp :: integrator)
select type(integrator)
Expand All @@ -210,12 +220,13 @@ pure function foodie_integrator_class_names() result(names)
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_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_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_ssp) :: int_runge_kutta_ssp !< Integrator Runge Kutta ssp.
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.

names = [ int_adams_bashforth % class_name()]
names = [names, int_adams_bashforth_moulton % class_name()]
Expand All @@ -228,6 +239,7 @@ pure function foodie_integrator_class_names() result(names)
names = [names, int_ms_runge_kutta_ssp % class_name()]
names = [names, int_runge_kutta_emd % class_name()]
names = [names, int_runge_kutta_ls % class_name()]
names = [names, int_runge_kutta_lssp % class_name()]
names = [names, int_runge_kutta_ssp % class_name()]
endfunction foodie_integrator_class_names

Expand All @@ -244,12 +256,13 @@ pure function foodie_integrator_schemes(class_name) result(schemes)
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_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_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_ssp) :: int_runge_kutta_ssp !< Integrator Runge Kutta ssp.
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 (present(class_name)) then
if (trim(int_adams_bashforth%class_name()) == trim(adjustl(class_name))) then
Expand All @@ -274,6 +287,8 @@ pure function foodie_integrator_schemes(class_name) result(schemes)
schemes = int_runge_kutta_emd%supported_schemes()
elseif (trim(int_runge_kutta_ls%class_name()) == trim(adjustl(class_name))) then
schemes = int_runge_kutta_ls%supported_schemes()
elseif (trim(int_runge_kutta_lssp%class_name()) == trim(adjustl(class_name))) then
schemes = int_runge_kutta_lssp%supported_schemes()
elseif (trim(int_runge_kutta_ssp%class_name()) == trim(adjustl(class_name))) then
schemes = int_runge_kutta_ssp%supported_schemes()
endif
Expand All @@ -289,6 +304,7 @@ pure function foodie_integrator_schemes(class_name) result(schemes)
schemes = [schemes, int_ms_runge_kutta_ssp % supported_schemes()]
schemes = [schemes, int_runge_kutta_emd % supported_schemes()]
schemes = [schemes, int_runge_kutta_ls % supported_schemes()]
schemes = [schemes, int_runge_kutta_lssp % supported_schemes()]
schemes = [schemes, int_runge_kutta_ssp % supported_schemes()]
endif
endfunction foodie_integrator_schemes
Expand Down
1 change: 1 addition & 0 deletions src/lib/foodie_integrator_lmm_ssp_vss.f90
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ module foodie_integrator_lmm_ssp_vss
procedure, pass(self) :: update_previous !< Cyclic update previous time steps.
! private methods
procedure, pass(self), private :: integrate_order_2 !< Integrate integrand field by 2nd order formula.
procedure, pass(self), private :: integrate_order_3 !< Integrate integrand field by 3rd order formula.
endtype integrator_lmm_ssp_vss

abstract interface
Expand Down
Loading

0 comments on commit 0d74347

Please sign in to comment.