Skip to content

Commit af6d75a

Browse files
committed
add method to check if a solver implement fast mode integrate
1 parent 932e692 commit af6d75a

14 files changed

Lines changed: 153 additions & 0 deletions

src/lib/foodie_integrator_adams_bashforth.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ module foodie_integrator_adams_bashforth
5353
trim(class_name_)//'_15', &
5454
trim(class_name_)//'_16'] !< List of supported schemes.
5555

56+
logical, parameter :: has_fast_mode_=.true. !< Flag to check if integrator provides *fast mode* integrate.
57+
5658
type, extends(integrator_object) :: integrator_adams_bashforth
5759
!< FOODIE integrator: provide an explicit class of Adams-Bashforth multi-step schemes, from 1st to 16th order accurate.
5860
!<
@@ -64,6 +66,7 @@ module foodie_integrator_adams_bashforth
6466
! deferred methods
6567
procedure, pass(self) :: class_name !< Return the class name of schemes.
6668
procedure, pass(self) :: description !< Return pretty-printed object description.
69+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
6770
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
6871
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
6972
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -104,6 +107,14 @@ pure function description(self, prefix) result(desc)
104107
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
105108
endfunction description
106109

110+
elemental function has_fast_mode(self)
111+
!< Return .true. if the integrator class has *fast mode* integrate.
112+
class(integrator_adams_bashforth), intent(in) :: self !< Integrator.
113+
logical :: has_fast_mode !< Inquire result.
114+
115+
has_fast_mode = has_fast_mode_
116+
endfunction has_fast_mode
117+
107118
pure subroutine integr_assign_integr(lhs, rhs)
108119
!< Operator `=`.
109120
class(integrator_adams_bashforth), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_adams_bashforth_moulton.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ module foodie_integrator_adams_bashforth_moulton
105105
trim(class_name_)//'_15', &
106106
trim(class_name_)//'_16'] !< List of supported schemes.
107107

108+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
109+
108110
type, extends(integrator_object) :: integrator_adams_bashforth_moulton
109111
!< FOODIE integrator: provide an explicit class of Adams-Bashforth-Moulton multi-step schemes, from 1st to 4rd order accurate.
110112
!<
@@ -117,6 +119,7 @@ module foodie_integrator_adams_bashforth_moulton
117119
! deferred methods
118120
procedure, pass(self) :: class_name !< Return the class name of schemes.
119121
procedure, pass(self) :: description !< Return pretty-printed object description.
122+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
120123
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
121124
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
122125
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -156,6 +159,14 @@ pure function description(self, prefix) result(desc)
156159
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
157160
endfunction description
158161

162+
elemental function has_fast_mode(self)
163+
!< Return .true. if the integrator class has *fast mode* integrate.
164+
class(integrator_adams_bashforth_moulton), intent(in) :: self !< Integrator.
165+
logical :: has_fast_mode !< Inquire result.
166+
167+
has_fast_mode = has_fast_mode_
168+
endfunction has_fast_mode
169+
159170
pure subroutine integr_assign_integr(lhs, rhs)
160171
!< Operator `=`.
161172
class(integrator_adams_bashforth_moulton), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_adams_moulton.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ module foodie_integrator_adams_moulton
5454
trim(class_name_)//'_14', &
5555
trim(class_name_)//'_15'] !< List of supported schemes.
5656

57+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
58+
5759
type, extends(integrator_object) :: integrator_adams_moulton
5860
!< FOODIE integrator: provide an explicit class of Adams-Moulton multi-step schemes, from 1st to 16th order accurate.
5961
!<
@@ -66,6 +68,7 @@ module foodie_integrator_adams_moulton
6668
procedure, pass(self) :: class_name !< Return the class name of schemes.
6769
procedure, pass(self) :: description !< Return pretty-printed object description.
6870
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
71+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
6972
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
7073
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
7174
! public methods
@@ -104,6 +107,14 @@ pure function description(self, prefix) result(desc)
104107
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
105108
endfunction description
106109

110+
elemental function has_fast_mode(self)
111+
!< Return .true. if the integrator class has *fast mode* integrate.
112+
class(integrator_adams_moulton), intent(in) :: self !< Integrator.
113+
logical :: has_fast_mode !< Inquire result.
114+
115+
has_fast_mode = has_fast_mode_
116+
endfunction has_fast_mode
117+
107118
pure subroutine integr_assign_integr(lhs, rhs)
108119
!< Operator `=`.
109120
class(integrator_adams_moulton), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_backward_differentiation_formula.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ module foodie_integrator_backward_differentiation_formula
5050
trim(class_name_)//'_5', &
5151
trim(class_name_)//'_6'] !< List of supported schemes.
5252

53+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
54+
5355
type, extends(integrator_object) :: integrator_back_df
5456
!< FOODIE integrator: provide an implicit class of Backward-Differentiation-Formula multi-step schemes, from 1st to 6th order
5557
!< accurate.
@@ -63,6 +65,7 @@ module foodie_integrator_backward_differentiation_formula
6365
! deferred methods
6466
procedure, pass(self) :: class_name !< Return the class name of schemes.
6567
procedure, pass(self) :: description !< Return pretty-printed object description.
68+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
6669
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
6770
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
6871
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -102,6 +105,14 @@ pure function description(self, prefix) result(desc)
102105
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
103106
endfunction description
104107

108+
elemental function has_fast_mode(self)
109+
!< Return .true. if the integrator class has *fast mode* integrate.
110+
class(integrator_back_df), intent(in) :: self !< Integrator.
111+
logical :: has_fast_mode !< Inquire result.
112+
113+
has_fast_mode = has_fast_mode_
114+
endfunction has_fast_mode
115+
105116
pure subroutine integr_assign_integr(lhs, rhs)
106117
!< Operator `=`.
107118
class(integrator_back_df), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_euler_explicit.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module foodie_integrator_euler_explicit
2525
character(len=99), parameter :: class_name_='euler_explicit' !< Name of the class of schemes.
2626
character(len=99), parameter :: supported_schemes_(1:1)=[trim(class_name_)] !< List of supported schemes.
2727

28+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
29+
2830
type, extends(integrator_object) :: integrator_euler_explicit
2931
!< FOODIE integrator: provide explicit Euler scheme, it being 1st order accurate.
3032
!<
@@ -33,6 +35,7 @@ module foodie_integrator_euler_explicit
3335
! deferred methods
3436
procedure, pass(self) :: class_name !< Return the class name of schemes.
3537
procedure, pass(self) :: description !< Return pretty-printed object description.
38+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
3639
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
3740
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
3841
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -61,6 +64,14 @@ pure function description(self, prefix) result(desc)
6164
desc = prefix_//'Euler, Explicit (1 step/stage) 1st order scheme'
6265
endfunction description
6366

67+
elemental function has_fast_mode(self)
68+
!< Return .true. if the integrator class has *fast mode* integrate.
69+
class(integrator_euler_explicit), intent(in) :: self !< Integrator.
70+
logical :: has_fast_mode !< Inquire result.
71+
72+
has_fast_mode = has_fast_mode_
73+
endfunction has_fast_mode
74+
6475
pure subroutine integr_assign_integr(lhs, rhs)
6576
!< Operator `=`.
6677
class(integrator_euler_explicit), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_leapfrog.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ module foodie_integrator_leapfrog
4949
character(len=99), parameter :: supported_schemes_(1:2)=[trim(class_name_)//' ', &
5050
trim(class_name_)//'_raw'] !< List of supported schemes.
5151

52+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
53+
5254
type, extends(integrator_object) :: integrator_leapfrog
5355
!< FOODIE integrator: provide an explicit class of leapfrog multi-step schemes, 2nd order accurate.
5456
!<
@@ -62,6 +64,7 @@ module foodie_integrator_leapfrog
6264
! deferred methods
6365
procedure, pass(self) :: class_name !< Return the class name of schemes.
6466
procedure, pass(self) :: description !< Return pretty-printed object description.
67+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
6568
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
6669
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
6770
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -92,6 +95,14 @@ pure function description(self, prefix) result(desc)
9295
desc = desc//prefix_//'Explicit leapfrog multi-step 2nd order scheme'
9396
endfunction description
9497

98+
elemental function has_fast_mode(self)
99+
!< Return .true. if the integrator class has *fast mode* integrate.
100+
class(integrator_leapfrog), intent(in) :: self !< Integrator.
101+
logical :: has_fast_mode !< Inquire result.
102+
103+
has_fast_mode = has_fast_mode_
104+
endfunction has_fast_mode
105+
95106
pure subroutine integr_assign_integr(lhs, rhs)
96107
!< Operator `=`.
97108
class(integrator_leapfrog), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_lmm_ssp.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ module foodie_integrator_lmm_ssp
4040
trim(class_name_)//'_steps_4_order_3', &
4141
trim(class_name_)//'_steps_5_order_3'] !< List of supported schemes.
4242

43+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
44+
4345
type, extends(integrator_object) :: integrator_lmm_ssp
4446
!< FOODIE integrator: provide an explicit class of Linear Multi-step Methods (LLM) with Strong Stability Preserving property,
4547
!< from 2nd to 3rd order accurate.
@@ -53,6 +55,7 @@ module foodie_integrator_lmm_ssp
5355
! deferred methods
5456
procedure, pass(self) :: class_name !< Return the class name of schemes.
5557
procedure, pass(self) :: description !< Return pretty-printed object description.
58+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
5659
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
5760
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
5861
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -92,6 +95,14 @@ pure function description(self, prefix) result(desc)
9295
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
9396
endfunction description
9497

98+
elemental function has_fast_mode(self)
99+
!< Return .true. if the integrator class has *fast mode* integrate.
100+
class(integrator_lmm_ssp), intent(in) :: self !< Integrator.
101+
logical :: has_fast_mode !< Inquire result.
102+
103+
has_fast_mode = has_fast_mode_
104+
endfunction has_fast_mode
105+
95106
pure subroutine integr_assign_integr(lhs, rhs)
96107
!< Operator `=`.
97108
class(integrator_lmm_ssp), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_lmm_ssp_vss.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ module foodie_integrator_lmm_ssp_vss
5353
trim(class_name_)//'_steps_4_order_3', &
5454
trim(class_name_)//'_steps_5_order_3'] !< List of supported schemes.
5555

56+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
57+
5658
type, extends(integrator_object) :: integrator_lmm_ssp_vss
5759
!< FOODIE integrator: provide an explicit class of Linear Multi-step Methods (LLM) with Strong Stability Preserving property and
5860
!< variable stepsize (VSS), from 2nd to 3rd order accurate.
@@ -65,6 +67,7 @@ module foodie_integrator_lmm_ssp_vss
6567
! deferred methods
6668
procedure, pass(self) :: class_name !< Return the class name of schemes.
6769
procedure, pass(self) :: description !< Return pretty-printed object description.
70+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
6871
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
6972
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
7073
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -121,6 +124,14 @@ pure function description(self, prefix) result(desc)
121124
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
122125
endfunction description
123126

127+
elemental function has_fast_mode(self)
128+
!< Return .true. if the integrator class has *fast mode* integrate.
129+
class(integrator_lmm_ssp_vss), intent(in) :: self !< Integrator.
130+
logical :: has_fast_mode !< Inquire result.
131+
132+
has_fast_mode = has_fast_mode_
133+
endfunction has_fast_mode
134+
124135
pure subroutine integr_assign_integr(lhs, rhs)
125136
!< Operator `=`.
126137
class(integrator_lmm_ssp_vss), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_ms_runge_kutta_ssp.f90

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ module foodie_integrator_ms_runge_kutta_ssp
4949
trim(class_name_)//'_steps_4_stages_5_order_8'] !< List of supported
5050
!< schemes.
5151

52+
logical, parameter :: has_fast_mode_=.false. !< Flag to check if integrator provides *fast mode* integrate.
53+
5254
type, extends(integrator_object) :: integrator_ms_runge_kutta_ssp
5355
!< FOODIE integrator: provide an explicit class of Multi-step Runge-Kutta Methods with Strong Stability Preserving property,
5456
!< from 3rd to 8th order accurate.
@@ -67,6 +69,7 @@ module foodie_integrator_ms_runge_kutta_ssp
6769
! deferred methods
6870
procedure, pass(self) :: class_name !< Return the class name of schemes.
6971
procedure, pass(self) :: description !< Return pretty-printed object description.
72+
procedure, pass(self) :: has_fast_mode !< Return .true. if the integrator class has *fast mode* integrate.
7073
procedure, pass(lhs) :: integr_assign_integr !< Operator `=`.
7174
procedure, pass(self) :: is_supported !< Return .true. if the integrator class support the given scheme.
7275
procedure, pass(self) :: supported_schemes !< Return the list of supported schemes.
@@ -106,6 +109,14 @@ pure function description(self, prefix) result(desc)
106109
desc = desc//prefix_//' + '//supported_schemes_(ubound(supported_schemes_, dim=1))
107110
endfunction description
108111

112+
elemental function has_fast_mode(self)
113+
!< Return .true. if the integrator class has *fast mode* integrate.
114+
class(integrator_ms_runge_kutta_ssp), intent(in) :: self !< Integrator.
115+
logical :: has_fast_mode !< Inquire result.
116+
117+
has_fast_mode = has_fast_mode_
118+
endfunction has_fast_mode
119+
109120
pure subroutine integr_assign_integr(lhs, rhs)
110121
!< Operator `=`.
111122
class(integrator_ms_runge_kutta_ssp), intent(inout) :: lhs !< Left hand side.

src/lib/foodie_integrator_object.f90

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ module foodie_integrator_object
2323
! deferred methods
2424
procedure(class_name_interface), pass(self), deferred :: class_name !< Return the class name of schemes.
2525
procedure(description_interface), pass(self), deferred :: description !< Return pretty-printed obj. description.
26+
procedure(has_fast_mode_interface), pass(self), deferred :: has_fast_mode !< Return .true. if the integrator class
27+
!< has *fast mode* integrate.
2628
procedure(assignment_interface), pass(lhs), deferred :: integr_assign_integr !< Operator `=`.
2729
procedure(is_supported_interface), pass(self), deferred :: is_supported !< Return .true. if the integrator class
2830
!< support the given scheme.
@@ -55,6 +57,13 @@ pure subroutine assignment_interface(lhs, rhs)
5557
class(integrator_object), intent(in) :: rhs !< Right hand side.
5658
endsubroutine assignment_interface
5759

60+
elemental function has_fast_mode_interface(self) result(has_fast_mode)
61+
!< Return .true. if the integrator class has *fast mode* integrate.
62+
import :: integrator_object
63+
class(integrator_object), intent(in) :: self !< Integrator.
64+
logical :: has_fast_mode !< Inquire result.
65+
endfunction has_fast_mode_interface
66+
5867
elemental function is_supported_interface(self, scheme) result(is_supported)
5968
!< Return .true. if the integrator class support the given scheme.
6069
import :: integrator_object

0 commit comments

Comments
 (0)