diff --git a/doc/html/annotated.html b/doc/html/annotated.html index 7da6065..8e611cb 100644 --- a/doc/html/annotated.html +++ b/doc/html/annotated.html @@ -3,8 +3,7 @@ - - + integral: Data Types List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
@@ -109,7 +135,7 @@
diff --git a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html index 91d359b..64b820a 100644 --- a/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html +++ b/doc/html/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src Directory Reference + +integral: D:/users/christopherson/Code/integral/src Directory Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
+ + +

+Files

@@ -93,7 +120,7 @@ + doxygen 1.8.11 diff --git a/doc/html/double_pendulum_example_no_legend.png b/doc/html/double_pendulum_example_no_legend.png new file mode 100644 index 0000000..d3f5dfe Binary files /dev/null and b/doc/html/double_pendulum_example_no_legend.png differ diff --git a/doc/html/double_pendulum_example_short_time.png b/doc/html/double_pendulum_example_short_time.png new file mode 100644 index 0000000..9f9e332 Binary files /dev/null and b/doc/html/double_pendulum_example_short_time.png differ diff --git a/doc/html/double_pendulum_example_short_time_no_legend.png b/doc/html/double_pendulum_example_short_time_no_legend.png new file mode 100644 index 0000000..55f8b8a Binary files /dev/null and b/doc/html/double_pendulum_example_short_time_no_legend.png differ diff --git a/doc/html/doxygen.css b/doc/html/doxygen.css index 4f1ab91..1425ec5 100644 --- a/doc/html/doxygen.css +++ b/doc/html/doxygen.css @@ -1,13 +1,9 @@ -/* The standard CSS for doxygen 1.8.13 */ +/* The standard CSS for doxygen 1.8.11 */ body, table, div, p, dl { font: 400 14px/22px Roboto,sans-serif; } -p.reference, p.definition { - font: 400 14px/22px Roboto,sans-serif; -} - /* @group Heading Levels */ h1.groupheader { @@ -177,7 +173,7 @@ pre.fragment { } div.fragment { - padding: 0px; + padding: 4px 6px; margin: 4px 8px 4px 2px; background-color: #FBFCFD; border: 1px solid #C4CFE5; @@ -236,15 +232,6 @@ span.lineno a:hover { background-color: #C8C8C8; } -.lineno { - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} - div.ah, span.ah { background-color: black; font-weight: bold; @@ -514,29 +501,6 @@ table.memberdecls { /* Styles for detailed member documentation */ -.memtitle { - padding: 8px; - border-top: 1px solid #A8B8D9; - border-left: 1px solid #A8B8D9; - border-right: 1px solid #A8B8D9; - border-top-right-radius: 4px; - border-top-left-radius: 4px; - margin-bottom: -1px; - background-image: url('nav_f.png'); - background-repeat: repeat-x; - background-color: #E2E8F2; - line-height: 1.25; - font-weight: 300; - float:left; -} - -.permalink -{ - font-size: 65%; - display: inline-block; - vertical-align: middle; -} - .memtemplate { font-size: 80%; color: #4665A2; @@ -575,7 +539,7 @@ table.memberdecls { } .memname { - font-weight: 400; + font-weight: bold; margin-left: 6px; } @@ -591,24 +555,24 @@ table.memberdecls { color: #253555; font-weight: bold; text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); - background-color: #DFE5F1; + background-image:url('nav_f.png'); + background-repeat:repeat-x; + background-color: #E2E8F2; /* opera specific markup */ box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); border-top-right-radius: 4px; + border-top-left-radius: 4px; /* firefox specific markup */ -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; -moz-border-radius-topright: 4px; + -moz-border-radius-topleft: 4px; /* webkit specific markup */ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); -webkit-border-top-right-radius: 4px; + -webkit-border-top-left-radius: 4px; } -.overload { - font-family: "courier new",courier,monospace; - font-size: 65%; -} - .memdoc, dl.reflist dd { border-bottom: 1px solid #A8B8D9; border-left: 1px solid #A8B8D9; @@ -950,7 +914,6 @@ table.fieldtable { padding-bottom: 4px; padding-top: 5px; text-align:left; - font-weight: 400; -moz-border-radius-topleft: 4px; -moz-border-radius-topright: 4px; -webkit-border-top-left-radius: 4px; @@ -1215,11 +1178,6 @@ dl.section dd { text-align: center; } -.plantumlgraph -{ - text-align: center; -} - .diagraph { text-align: center; @@ -1515,82 +1473,3 @@ tr.heading h2 { } } -/* @group Markdown */ - -/* -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.markdownTableHead tr { -} - -table.markdownTableBodyLeft td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -th.markdownTableHeadLeft th.markdownTableHeadRight th.markdownTableHeadCenter th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft { - text-align: left -} - -th.markdownTableHeadRight { - text-align: right -} - -th.markdownTableHeadCenter { - text-align: center -} -*/ - -table.markdownTable { - border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; -} - -table.markdownTable td, table.markdownTable th { - border: 1px solid #2D4068; - padding: 3px 7px 2px; -} - -table.markdownTable tr { -} - -th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { - background-color: #374F7F; - color: #FFFFFF; - font-size: 110%; - padding-bottom: 4px; - padding-top: 5px; -} - -th.markdownTableHeadLeft, td.markdownTableBodyLeft { - text-align: left -} - -th.markdownTableHeadRight, td.markdownTableBodyRight { - text-align: right -} - -th.markdownTableHeadCenter, td.markdownTableBodyCenter { - text-align: center -} - - -/* @end */ diff --git a/doc/html/files.html b/doc/html/files.html index 197a5ef..f05ce23 100644 --- a/doc/html/files.html +++ b/doc/html/files.html @@ -3,8 +3,7 @@ - - + integral: File List @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
diff --git a/doc/html/functions.html b/doc/html/functions.html index 51d69cb..2c23868 100644 --- a/doc/html/functions.html +++ b/doc/html/functions.html @@ -3,8 +3,7 @@ - - + integral: Data Fields @@ -15,10 +14,14 @@ + @@ -38,19 +41,60 @@
- + - - - - + + + +
- + - - - - + + + +
- + - - - - + + +
diff --git a/doc/html/hierarchy.html b/doc/html/hierarchy.html index 9831ad2..33fa1b0 100644 --- a/doc/html/hierarchy.html +++ b/doc/html/hierarchy.html @@ -3,8 +3,7 @@ - - + integral: Class Hierarchy @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +
diff --git a/doc/html/index.html b/doc/html/index.html index 6c33e48..dd32474 100644 --- a/doc/html/index.html +++ b/doc/html/index.html @@ -3,8 +3,7 @@ - - + integral: Main Page @@ -15,10 +14,14 @@ + @@ -38,19 +41,34 @@
- + - - - - +
-
+

+Introduction

+

INTEGRAL is a Fortran library providing an easy-to-use, object-oriented interface to several integration routines. Integration of functions of one variable are provided by the QUADPACK library. Integration of systems of ordinary differential equations are provided by the ODEPACK library.

+
+double_pendulum_example_short_time_no_legend.png +
+
diff --git a/doc/html/integral__adaptive__integrator_8f90_source.html b/doc/html/integral__adaptive__integrator_8f90_source.html index 8742d80..8843aa3 100644 --- a/doc/html/integral__adaptive__integrator_8f90_source.html +++ b/doc/html/integral__adaptive__integrator_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_adaptive_integrator.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_adaptive_integrator.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_adaptive_integrator.f90
2 
3 submodule(integral_core) integral_adaptive_integrator
4 contains
5 ! ------------------------------------------------------------------------------
6  module subroutine ai_init(this, err)
7  ! Arguments
8  class(adaptive_integrator), intent(inout) :: this
9  class(errors), intent(inout), optional, target :: err
10 
11  ! Local Variables
12  class(errors), pointer :: errmgr
13  type(errors), target :: deferr
14  integer(int32) :: flag, liwork, lwork, n
15  logical :: use_breakpoints
16 
17  ! Initialization
18  if (present(err)) then
19  errmgr => err
20  else
21  errmgr => deferr
22  end if
23  use_breakpoints = .false.
24  if (this%get_use_breakpoints()) then
25  if (allocated(this%m_breakpoints)) use_breakpoints = .true.
26  end if
27 
28  ! Allocate memory
29  if (use_breakpoints) then
30  n = size(this%m_breakpoints) + 2
31  liwork = max(2 * this%get_max_subintervals() + n, 3 * n - 2)
32  lwork = liwork * 2 - n
33  else
34  liwork = this%get_max_subintervals()
35  lwork = 4 * liwork
36  end if
37 
38  if (.not.allocated(this%m_iwork)) then
39  allocate(this%m_iwork(liwork), stat = flag)
40  else
41  if (size(this%m_iwork) < liwork) then
42  deallocate(this%m_iwork)
43  allocate(this%m_iwork(liwork), stat = flag)
44  end if
45  end if
46  if (flag == 0) then
47  if (.not.allocated(this%m_work)) then
48  allocate(this%m_work(lwork), stat = flag)
49  else
50  if (size(this%m_work) < lwork) then
51  deallocate(this%m_work)
52  allocate(this%m_work(lwork), stat = flag)
53  end if
54  end if
55  end if
56 
57  ! Report any errors
58  if (flag /= 0) then
59  call errmgr%report_error("ai_init", &
60  "Insufficient memory available.", int_out_of_memory_error)
61  return
62  end if
63  end subroutine
64 
65 ! ------------------------------------------------------------------------------
66  module function ai_integrate(this, fcn, a, b, info, err) result(rst)
67  ! Arguments
68  class(adaptive_integrator), intent(inout) :: this
69  procedure(integrand), intent(in), pointer :: fcn
70  real(real64), intent(in) :: a, b
71  type(integration_behavior), intent(out), optional :: info
72  class(errors), intent(inout), optional, target :: err
73  real(real64) :: rst
74 
75  ! Local Variables
76  integer(int32) :: ier, neval, limit, lenw, last, leniw, npts, flag
77  real(real64) :: abserr, epsabs, epsrel
78  class(errors), pointer :: errmgr
79  type(errors), target :: deferr
80  character(len = 256) :: errmsg
81  logical :: usedqagp
82  real(real64), allocatable, dimension(:) :: pts
83 
84  ! Initialization
85  if (present(err)) then
86  errmgr => err
87  else
88  errmgr => deferr
89  end if
90 
91  usedqagp = .false.
92  if (this%get_use_breakpoints()) then
93  if (allocated(this%m_breakpoints)) then
94  npts = size(this%m_breakpoints) + 2
95  allocate(pts(npts), stat = flag)
96  if (flag /= 0) then
97  call errmgr%report_error("ai_integrate", &
98  "Insufficient memory available.", &
99  int_out_of_memory_error)
100  return
101  end if
102  pts(2:npts-1) = this%m_breakpoints
103  pts(1) = a
104  pts(npts) = b
105  usedqagp = .true.
106  end if
107  end if
108 
109  call this%initialize(errmgr)
110  if (errmgr%has_error_occurred()) return
111 
112  limit = this%get_max_subintervals()
113  leniw = size(this%m_iwork)
114  lenw = size(this%m_work)
115  epsabs = this%get_abs_tol()
116  epsrel = this%get_rel_tol()
117 
118  ! Compute the integral
119  if (usedqagp) then
120  call dqagp(local_fcn, a, b, npts, pts, epsabs, epsrel, &
121  rst, abserr, neval, ier, leniw, lenw, last, iwork, work)
122  else
123  call dqags(local_fcn, a, b, epsabs, epsrel, rst, abserr, neval, &
124  ier, limit, lenw, last, this%m_iwork, this%m_work)
125  end if
126 
127  ! Collect info regarding the integration process
128  if (present(info)) then
129  info%error_estimate = abserr
130  info%evaluation_count = neval
131  info%subinterval_count = last
132  end if
133 
134  ! Check for errors
135  select case (ier)
136  case (1)
137  write(errmsg, '(AI0A)') "The maximum number (", limit, &
138  ") of subdivisions allowed has been achieved."
139  call errmgr%report_error("ai_integrate", trim(errmsg), &
140  int_count_exceeded_error)
141  return
142  case (2)
143  call errmgr%report_error("ai_integrate", &
144  "The occurence of roundoff error has been detected " // &
145  "thereby preventing the requested tolerance from being " // &
146  "achieved.", int_round_off_error)
147  return
148  case (3)
149  call errmgr%report_error("ai_integrate", &
150  "The integrand appears to be behaving too poorly to proceed.", &
151  int_integrand_behavior_error)
152  return
153  case (4)
154  call errmgr%report_error("ai_integrate", &
155  "The algorithm cannot converge with the assigned tolerances.", &
156  int_convergence_error)
157  return
158  case (5)
159  call errmgr%report_error("ai_integrate", &
160  "The integral is likely divergent", int_divergent_error)
161  return
162  case (6)
163  call errmgr%report_error("ai_integrate", &
164  "An invalid input has been provided.", int_invalid_input_error)
165  return
166  end select
167 
168  contains
169  ! This is required as the F77 code doesn't deal with procedure pointers
170  function local_fcn(xarg) result(frst)
171  real(real64), intent(in) :: xarg
172  real(real64) :: frst
173  frst = fcn(xarg)
174  end function
175  end function
176 
177 ! ------------------------------------------------------------------------------
178  pure module function ai_get_use_brkpnts(this) result(x)
179  class(adaptive_integrator), intent(in) :: this
180  logical :: x
181  x = this%m_userDefinedBreaks
182  end function
183 
184 ! --------------------
185  module subroutine ai_set_use_brkpnts(this, x)
186  class(adaptive_integrator), intent(inout) :: this
187  logical, intent(in) :: x
188  this%m_userDefinedBreaks = x
189  end subroutine
190 
191 ! ------------------------------------------------------------------------------
192  module function ai_get_breakpoints(this) result(x)
193  class(adaptive_integrator), intent(in) :: this
194  real(real64), allocatable, dimension(:) :: x
195  if (allocated(this%m_breakpoints)) then
196  x = this%m_breakpoints
197  end if
198  end function
199 
200 ! --------------------
201  module subroutine ai_set_breakpoints(this, x)
202  class(adaptive_integrator), intent(inout) :: this
203  real(real64), intent(in), dimension(:) :: x
204  if (allocated(this%m_breakpoints)) deallocate(this%m_breakpoints)
205  this%m_breakpoints = x
206  call this%set_use_breakpoints(.true.)
207  end subroutine
208 
209 ! ------------------------------------------------------------------------------
210 end submodule
+
1 ! integral_adaptive_integrator.f90
2 
3 submodule(integral_core) integral_adaptive_integrator
4 contains
5 ! ------------------------------------------------------------------------------
6  module subroutine ai_init(this, err)
7  ! Arguments
8  class(adaptive_integrator), intent(inout) :: this
9  class(errors), intent(inout), optional, target :: err
10 
11  ! Local Variables
12  class(errors), pointer :: errmgr
13  type(errors), target :: deferr
14  integer(int32) :: flag, liwork, lwork, n
15  logical :: use_breakpoints
16 
17  ! Initialization
18  if (present(err)) then
19  errmgr => err
20  else
21  errmgr => deferr
22  end if
23  use_breakpoints = .false.
24  if (this%get_use_breakpoints()) then
25  if (allocated(this%m_breakpoints)) use_breakpoints = .true.
26  end if
27 
28  ! Allocate memory
29  if (use_breakpoints) then
30  n = size(this%m_breakpoints) + 2
31  liwork = max(2 * this%get_max_subintervals() + n, 3 * n - 2)
32  lwork = liwork * 2 - n
33  else
34  liwork = this%get_max_subintervals()
35  lwork = 4 * liwork
36  end if
37 
38  if (.not.allocated(this%m_iwork)) then
39  allocate(this%m_iwork(liwork), stat = flag)
40  else
41  if (size(this%m_iwork) < liwork) then
42  deallocate(this%m_iwork)
43  allocate(this%m_iwork(liwork), stat = flag)
44  end if
45  end if
46  if (flag == 0) then
47  if (.not.allocated(this%m_work)) then
48  allocate(this%m_work(lwork), stat = flag)
49  else
50  if (size(this%m_work) < lwork) then
51  deallocate(this%m_work)
52  allocate(this%m_work(lwork), stat = flag)
53  end if
54  end if
55  end if
56 
57  ! Report any errors
58  if (flag /= 0) then
59  call errmgr%report_error("ai_init", &
60  "Insufficient memory available.", int_out_of_memory_error)
61  return
62  end if
63  end subroutine
64 
65 ! ------------------------------------------------------------------------------
66  module function ai_integrate(this, fcn, a, b, info, err) result(rst)
67  ! Arguments
68  class(adaptive_integrator), intent(inout) :: this
69  procedure(integrand), intent(in), pointer :: fcn
70  real(real64), intent(in) :: a, b
71  type(integration_behavior), intent(out), optional :: info
72  class(errors), intent(inout), optional, target :: err
73  real(real64) :: rst
74 
75  ! Local Variables
76  integer(int32) :: ier, neval, limit, lenw, last, leniw, npts, flag
77  real(real64) :: abserr, epsabs, epsrel
78  class(errors), pointer :: errmgr
79  type(errors), target :: deferr
80  character(len = 256) :: errmsg
81  logical :: usedqagp
82  real(real64), allocatable, dimension(:) :: pts
83 
84  ! Initialization
85  if (present(err)) then
86  errmgr => err
87  else
88  errmgr => deferr
89  end if
90 
91  usedqagp = .false.
92  if (this%get_use_breakpoints()) then
93  if (allocated(this%m_breakpoints)) then
94  npts = size(this%m_breakpoints) + 2
95  allocate(pts(npts), stat = flag)
96  if (flag /= 0) then
97  call errmgr%report_error("ai_integrate", &
98  "Insufficient memory available.", &
99  int_out_of_memory_error)
100  return
101  end if
102  pts(2:npts-1) = this%m_breakpoints
103  pts(1) = a
104  pts(npts) = b
105  usedqagp = .true.
106  end if
107  end if
108 
109  call this%initialize(errmgr)
110  if (errmgr%has_error_occurred()) return
111 
112  limit = this%get_max_subintervals()
113  leniw = size(this%m_iwork)
114  lenw = size(this%m_work)
115  epsabs = this%get_abs_tol()
116  epsrel = this%get_rel_tol()
117 
118  ! Compute the integral
119  if (usedqagp) then
120  call dqagp(local_fcn, a, b, npts, pts, epsabs, epsrel, &
121  rst, abserr, neval, ier, leniw, lenw, last, iwork, work)
122  else
123  call dqags(local_fcn, a, b, epsabs, epsrel, rst, abserr, neval, &
124  ier, limit, lenw, last, this%m_iwork, this%m_work)
125  end if
126 
127  ! Collect info regarding the integration process
128  if (present(info)) then
129  info%error_estimate = abserr
130  info%evaluation_count = neval
131  info%subinterval_count = last
132  end if
133 
134  ! Check for errors
135  select case (ier)
136  case (1)
137  write(errmsg, '(AI0A)') "The maximum number (", limit, &
138  ") of subdivisions allowed has been achieved."
139  call errmgr%report_error("ai_integrate", trim(errmsg), &
140  int_count_exceeded_error)
141  return
142  case (2)
143  call errmgr%report_error("ai_integrate", &
144  "The occurence of roundoff error has been detected " // &
145  "thereby preventing the requested tolerance from being " // &
146  "achieved.", int_round_off_error)
147  return
148  case (3)
149  call errmgr%report_error("ai_integrate", &
150  "The integrand appears to be behaving too poorly to proceed.", &
151  int_integrand_behavior_error)
152  return
153  case (4)
154  call errmgr%report_error("ai_integrate", &
155  "The algorithm cannot converge with the assigned tolerances.", &
156  int_convergence_error)
157  return
158  case (5)
159  call errmgr%report_error("ai_integrate", &
160  "The integral is likely divergent", int_divergent_error)
161  return
162  case (6)
163  call errmgr%report_error("ai_integrate", &
164  "An invalid input has been provided.", int_invalid_input_error)
165  return
166  end select
167 
168  contains
169  ! This is required as the F77 code doesn't deal with procedure pointers
170  function local_fcn(xarg) result(frst)
171  real(real64), intent(in) :: xarg
172  real(real64) :: frst
173  frst = fcn(xarg)
174  end function
175  end function
176 
177 ! ------------------------------------------------------------------------------
178  pure module function ai_get_use_brkpnts(this) result(x)
179  class(adaptive_integrator), intent(in) :: this
180  logical :: x
181  x = this%m_userDefinedBreaks
182  end function
183 
184 ! --------------------
185  module subroutine ai_set_use_brkpnts(this, x)
186  class(adaptive_integrator), intent(inout) :: this
187  logical, intent(in) :: x
188  this%m_userDefinedBreaks = x
189  end subroutine
190 
191 ! ------------------------------------------------------------------------------
192  module function ai_get_breakpoints(this) result(x)
193  class(adaptive_integrator), intent(in) :: this
194  real(real64), allocatable, dimension(:) :: x
195  if (allocated(this%m_breakpoints)) then
196  x = this%m_breakpoints
197  end if
198  end function
199 
200 ! --------------------
201  module subroutine ai_set_breakpoints(this, x)
202  class(adaptive_integrator), intent(inout) :: this
203  real(real64), intent(in), dimension(:) :: x
204  if (allocated(this%m_breakpoints)) deallocate(this%m_breakpoints)
205  this%m_breakpoints = x
206  call this%set_use_breakpoints(.true.)
207  end subroutine
208 
209 ! ------------------------------------------------------------------------------
210 end submodule
integral_core
+
diff --git a/doc/html/integral__core_8f90_source.html b/doc/html/integral__core_8f90_source.html index 75971f3..2014445 100644 --- a/doc/html/integral__core_8f90_source.html +++ b/doc/html/integral__core_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_core.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_core.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_core.f90
2 
3 module integral_core
4  use, intrinsic :: iso_fortran_env, only : int32, real64
5  use ferror
6  implicit none
7  private
8  public :: int_out_of_memory_error
9  public :: int_count_exceeded_error
10  public :: int_round_off_error
11  public :: int_integrand_behavior_error
12  public :: int_convergence_error
13  public :: int_divergent_error
14  public :: int_invalid_input_error
15  public :: int_lack_of_definition_error
16  public :: int_array_size_mismatch_error
17  public :: int_excessive_work_error
18  public :: int_impractical_tolerance_error
19  public :: int_repeated_error_test_failure
20  public :: int_15_point_rule
21  public :: int_21_point_rule
22  public :: int_31_point_rule
23  public :: int_41_point_rule
24  public :: int_51_point_rule
25  public :: int_61_point_rule
26  public :: integrand
27  public :: ode_fcn
28  public :: ode_jacobian
29  public :: ode_constraint
30  public :: integration_behavior
31  public :: integrator_base
33  public :: finite_interval_fcn
34  public :: adaptive_integrator
35  public :: nonadaptive_integrator
36  public :: ode_helper
37  public :: ode_integrator
38  public :: ode_integrator_interface
39  public :: ode_integrator_reset
40  public :: ode_auto
41 
42 ! ------------------------------------------------------------------------------
44  integer(int32), parameter :: int_out_of_memory_error = 1
47  integer(int32), parameter :: int_count_exceeded_error = 2
49  integer(int32), parameter :: int_round_off_error = 3
51  integer(int32), parameter :: int_integrand_behavior_error = 4
53  integer(int32), parameter :: int_convergence_error = 5
55  integer(int32), parameter :: int_divergent_error = 6
57  integer(int32), parameter :: int_invalid_input_error = 7
59  integer(int32), parameter :: int_lack_of_definition_error = 8
61  integer(int32), parameter :: int_array_size_mismatch_error = 9
62  integer(int32), parameter :: int_excessive_work_error = 10
63  integer(int32), parameter :: int_impractical_tolerance_error = 11
64  integer(int32), parameter :: int_repeated_error_test_failure = 12
65 
66 ! ------------------------------------------------------------------------------
68  integer(int32), parameter :: int_15_point_rule = 15
70  integer(int32), parameter :: int_21_point_rule = 21
72  integer(int32), parameter :: int_31_point_rule = 31
74  integer(int32), parameter :: int_41_point_rule = 41
76  integer(int32), parameter :: int_51_point_rule = 51
78  integer(int32), parameter :: int_61_point_rule = 61
79 
80 ! ------------------------------------------------------------------------------
81  interface
82 
87  function integrand(x) result(f)
88  use, intrinsic :: iso_fortran_env, only : real64
89  real(real64), intent(in) :: x
90  real(real64) :: f
91  end function
92 
102  subroutine ode_fcn(x, y, dydx)
103  use, intrinsic :: iso_fortran_env, only : real64
104  real(real64), intent(in) :: x
105  real(real64), intent(in), dimension(:) :: y
106  real(real64), intent(out), dimension(:) :: dydx
107  end subroutine
108 
117  subroutine ode_jacobian(x, y, jac)
118  use, intrinsic :: iso_fortran_env, only : real64
119  real(real64), intent(in) :: x
120  real(real64), intent(in), dimension(:) :: y
121  real(real64), intent(out), dimension(:,:) :: jac
122  end subroutine
123 
133  subroutine ode_constraint(x, y, f)
134  use, intrinsic :: iso_fortran_env, only : real64
135  real(real64), intent(in) :: x
136  real(real64), intent(in), dimension(:) :: y
137  real(real64), intent(out), dimension(:) :: f
138  end subroutine
139  end interface
140 
141 ! ------------------------------------------------------------------------------
145  real(real64) :: error_estimate
147  integer(int32) :: evaluation_count
150  integer(int32) :: subinterval_count
151  end type
152 
153 ! ******************************************************************************
154 ! INTEGRAL_INTEGRATOR_BASE.F90
155 ! ------------------------------------------------------------------------------
158  private
160  real(real64) :: m_abstol = 1.0d-8
162  real(real64) :: m_reltol = 1.0d-8
164  integer(int32) :: m_maxint = 10
165  contains
175  procedure, public :: get_abs_tol => ib_get_abs_tol
185  procedure, public :: set_abs_tol => ib_set_abs_tol
195  procedure, public :: get_rel_tol => ib_get_rel_tol
205  procedure, public :: set_rel_tol => ib_set_rel_tol
216  procedure, public :: get_max_subintervals => ib_get_max_subintervals
227  procedure, public :: ib_set_max_subintervals => ib_set_max_subintervals
228  end type
229 
230 ! ------------------------------------------------------------------------------
231  interface
232  pure module function ib_get_abs_tol(this) result(x)
233  class(integrator_base), intent(in) :: this
234  real(real64) :: x
235  end function
236 
237  module subroutine ib_set_abs_tol(this, x)
238  class(integrator_base), intent(inout) :: this
239  real(real64), intent(in) :: x
240  end subroutine
241 
242  pure module function ib_get_rel_tol(this) result(x)
243  class(integrator_base), intent(in) :: this
244  real(real64) :: x
245  end function
246 
247  module subroutine ib_set_rel_tol(this, x)
248  class(integrator_base), intent(inout) :: this
249  real(real64), intent(in) :: x
250  end subroutine
251 
252  pure module function ib_get_max_subintervals(this) result(x)
253  class(integrator_base), intent(in) :: this
254  integer(int32) :: x
255  end function
256 
257  module subroutine ib_set_max_subintervals(this, x)
258  class(integrator_base), intent(inout) :: this
259  integer(int32), intent(in) :: x
260  end subroutine
261  end interface
262 
263 ! ******************************************************************************
266  type, abstract, extends(integrator_base) :: finite_interval_integrator
267  contains
269  procedure(finite_interval_fcn), public, deferred, pass :: integrate
270  end type
271 
272  interface
273 
285  function finite_interval_fcn(this, fcn, a, b, info, err) result(rst)
286  use, intrinsic :: iso_fortran_env, only : real64
287  use ferror
288  import finite_interval_integrator
289  import integrand
290  import integration_behavior
291  class(finite_interval_integrator), intent(inout) :: this
292  procedure(integrand), intent(in), pointer :: fcn
293  real(real64), intent(in) :: a, b
294  type(integration_behavior), intent(out), optional :: info
295  class(errors), intent(inout), optional, target :: err
296  real(real64) :: rst
297  end function
298  end interface
299 
300 ! ******************************************************************************
301 ! INTEGRAL_ADAPTIVE_INTEGRATOR.F90
302 ! ------------------------------------------------------------------------------
351  type, extends(finite_interval_integrator) :: adaptive_integrator
352  private
354  real(real64), allocatable, dimension(:) :: m_work
356  integer(int32), allocatable, dimension(:) :: m_iwork
358  logical :: m_userdefinedbreaks = .false.
360  real(real64), allocatable, dimension(:) :: m_breakpoints
361  contains
376  procedure, public :: initialize => ai_init
412  procedure, public :: integrate => ai_integrate
425  procedure, public :: get_use_breakpoints => ai_get_use_brkpnts
438  procedure, public :: set_use_breakpoints => ai_set_use_brkpnts
449  procedure, public :: get_breakpoints => ai_get_breakpoints
462  procedure, public :: set_breakpoints => ai_set_breakpoints
463  end type
464 
465 ! ------------------------------------------------------------------------------
466  interface
467  module subroutine ai_init(this, err)
468  class(adaptive_integrator), intent(inout) :: this
469  class(errors), intent(inout), optional, target :: err
470  end subroutine
471 
472  module function ai_integrate(this, fcn, a, b, info, err) result(rst)
473  class(adaptive_integrator), intent(inout) :: this
474  procedure(integrand), intent(in), pointer :: fcn
475  real(real64), intent(in) :: a, b
476  type(integration_behavior), intent(out), optional :: info
477  class(errors), intent(inout), optional, target :: err
478  real(real64) :: rst
479  end function
480 
481  pure module function ai_get_use_brkpnts(this) result(x)
482  class(adaptive_integrator), intent(in) :: this
483  logical :: x
484  end function
485 
486  module subroutine ai_set_use_brkpnts(this, x)
487  class(adaptive_integrator), intent(inout) :: this
488  logical, intent(in) :: x
489  end subroutine
490 
491  module function ai_get_breakpoints(this) result(x)
492  class(adaptive_integrator), intent(in) :: this
493  real(real64), allocatable, dimension(:) :: x
494  end function
495 
496  module subroutine ai_set_breakpoints(this, x)
497  class(adaptive_integrator), intent(inout) :: this
498  real(real64), intent(in), dimension(:) :: x
499  end subroutine
500  end interface
501 
502 ! ******************************************************************************
503 ! INTEGRAL_NONADAPTIVE_INTEGRATOR.F90
504 ! ------------------------------------------------------------------------------
508  type, extends(finite_interval_integrator) :: nonadaptive_integrator
509  private
511  integer(int32) :: m_rule = int_15_point_rule
512  contains
537  procedure, public :: integrate => ni_integrate
555  procedure, public :: get_rule => ni_get_rule
578  procedure, public :: set_rule => ni_set_rule
579  end type
580 
581 ! ------------------------------------------------------------------------------
582  interface
583  module function ni_integrate(this, fcn, a, b, info, err) result(rst)
584  class(nonadaptive_integrator), intent(inout) :: this
585  procedure(integrand), intent(in), pointer :: fcn
586  real(real64), intent(in) :: a, b
587  type(integration_behavior), intent(out), optional :: info
588  class(errors), intent(inout), optional, target :: err
589  real(real64) :: rst
590  end function
591 
592  pure module function ni_get_rule(this) result(x)
593  class(nonadaptive_integrator), intent(in) :: this
594  integer(int32) :: x
595  end function
596 
597  module subroutine ni_set_rule(this, x, err)
598  class(nonadaptive_integrator), intent(inout) :: this
599  integer(int32), intent(in) :: x
600  class(errors), intent(inout), optional, target :: err
601  end subroutine
602  end interface
603 
604 ! ******************************************************************************
605 ! INTEGRAL_ODE_HELPER.F90
606 ! ------------------------------------------------------------------------------
609  type :: ode_helper
610  private
612  procedure(ode_fcn), pointer, nopass :: m_fcn => null()
614  procedure(ode_jacobian), pointer, nopass :: m_jac => null()
616  procedure(ode_constraint), pointer, nopass :: m_rts => null()
618  integer(int32) :: m_count = 0
620  integer(int32) :: m_constraints = 0
621  contains
712  procedure, public :: define_equations => oh_init
722  procedure, public :: get_equation_count => oh_get_count
735  procedure, public :: get_equations_defined => oh_is_fcn_defined
748  procedure, public :: get_jacobian_defined => oh_is_jac_defined
883  procedure, public :: define_constraints => oh_define_constraints
893  procedure, public :: get_constraint_count => oh_get_constraint_count
904  procedure, public :: get_constraints_defined => oh_get_constraints_defined
905  !! @brief Evaluates the routine containing the system of ODEs.
906  !!
907  !! @par Syntax
908  !! @code{.f90}
909  !! subroutine evaluate_ode(class(ode_helper) this, real(real64) x, real(real64) y(:), real(real64) dydx(:))
910  !! @endcode
911  !!
912  !! @param[in,out] this The ode_helper object.
913  !! @param[in] x The value of the independent variable at which to
914  !! evalaute the ODEs.
915  !! @param[in] y An N-element array cotnaining the current estimates
916  !! of the dependent variables as evaluated at @p x.
917  !! @param[out] dydx An N-element array where the values of the ODEs
918  !! as evaluated at @p x are to be written.
919  procedure, public :: evaluate_ode => oh_eval
933  procedure, public :: evaluate_jacobian => oh_eval_jac
948  procedure, public :: evaluate_constraints => oh_eval_constraints
949  end type
950 
951  interface
952  module subroutine oh_init(this, neqn, fcn, jac)
953  class(ode_helper), intent(inout) :: this
954  integer(int32), intent(in) :: neqn
955  procedure(ode_fcn), pointer, intent(in) :: fcn
956  procedure(ode_jacobian), pointer, intent(in), optional :: jac
957  end subroutine
958 
959  pure module function oh_get_count(this) result(x)
960  class(ode_helper), intent(in) :: this
961  integer(int32) :: x
962  end function
963 
964  pure module function oh_is_fcn_defined(this) result(x)
965  class(ode_helper), intent(in) :: this
966  logical :: x
967  end function
968 
969  pure module function oh_is_jac_defined(this) result(x)
970  class(ode_helper), intent(in) :: this
971  logical :: x
972  end function
973 
974  module subroutine oh_define_constraints(this, n, fcn)
975  class(ode_helper), intent(inout) :: this
976  integer(int32), intent(in) :: n
977  procedure(ode_constraint), intent(in), pointer :: fcn
978  end subroutine
979 
980  pure module function oh_get_constraint_count(this) result(x)
981  class(ode_helper), intent(in) :: this
982  integer(int32) :: x
983  end function
984 
985  pure module function oh_get_constraints_defined(this) result(x)
986  class(ode_helper), intent(in) :: this
987  logical :: x
988  end function
989 
990  module subroutine oh_eval(this, x, y, dydx)
991  class(ode_helper), intent(inout) :: this
992  real(real64), intent(in) :: x
993  real(real64), intent(in), dimension(:) :: y
994  real(real64), intent(out), dimension(:) :: dydx
995  end subroutine
996 
997  module subroutine oh_eval_jac(this, x, y, jac)
998  class(ode_helper), intent(inout) :: this
999  real(real64), intent(in) :: x
1000  real(real64), intent(in), dimension(:) :: y
1001  real(real64), intent(out), dimension(:,:) :: jac
1002  end subroutine
1003 
1004  module subroutine oh_eval_constraints(this, x, y, f)
1005  class(ode_helper), intent(inout) :: this
1006  real(real64), intent(in) :: x
1007  real(real64), intent(in), dimension(:) :: y
1008  real(real64), intent(out), dimension(:) :: f
1009  end subroutine
1010  end interface
1011 
1012 ! ******************************************************************************
1013 ! INTEGRAL_ODE_INTEGRATOR.F90
1014 ! ------------------------------------------------------------------------------
1015  type, abstract :: ode_integrator
1017  real(real64), allocatable, dimension(:) :: m_rtol
1019  real(real64), allocatable, dimension(:) :: m_atol
1022  logical :: m_alloutput = .true.
1026  logical :: m_canovershoot = .true.
1029  real(real64) :: m_criticalpoint = 0.0d0
1031  integer(int32) :: m_minbuffersize = 500
1034  real(real64) :: m_maxstepsize = 1.0d0
1037  logical :: m_limitstepsize = .false.
1039  integer(int32) :: m_maxstepcount = 500
1040  contains
1075  procedure, public :: integrate => oi_integrate
1087  procedure, public :: get_provide_all_output => oi_get_use_all_output
1100  procedure, public :: set_provide_all_output => oi_set_use_all_output
1112  procedure, public :: get_allow_overshoot => oi_get_allow_overshoot
1125  procedure, public :: set_allow_overshoot => oi_set_allow_overshoot
1136  procedure, public :: get_integration_limit => oi_get_critical_point
1147  procedure, public :: set_integration_limit => oi_set_critical_point
1157  procedure, public :: get_min_buffer_size => oi_get_min_buffer_size
1169  procedure, public :: set_min_buffer_size => oi_set_min_buffer_size
1179  procedure, public :: get_max_step_size => oi_get_max_step_size
1190  procedure, public :: set_max_step_size => oi_set_max_step_size
1201  procedure, public :: get_limit_step_size => oi_get_limit_step_size
1214  procedure, public :: set_limit_step_size => oi_set_limit_step_size
1225  procedure, public :: get_iteration_limit => oi_get_iteration_limit
1236  procedure, public :: set_iteration_limit => oi_set_iteration_limit
1246  procedure, public :: get_relative_tolerances => oi_get_rtol
1256  procedure, public :: set_relative_tolerances => oi_set_rtol
1266  procedure, public :: get_absolute_tolerances => oi_get_atol
1276  procedure, public :: set_absolute_tolerances => oi_set_atol
1304  procedure(ode_integrator_interface), public, deferred, pass :: step
1313  procedure(ode_integrator_reset), public, deferred, pass :: reset
1314  end type
1315 
1316 ! ------------------------------------------------------------------------------
1317  interface
1318 
1340  function ode_integrator_interface(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1341  use, intrinsic :: iso_fortran_env, only : int32, real64
1342  use ferror
1343  import ode_integrator
1344  import ode_helper
1345  class(ode_integrator), intent(inout) :: this
1346  class(ode_helper), intent(inout) :: fcn
1347  real(real64), intent(inout) :: x
1348  real(real64), intent(inout), dimension(:) :: y
1349  real(real64), intent(in) :: xout
1350  real(real64), intent(in), dimension(:) :: rtol, atol
1351  class(errors), intent(inout), optional, target :: err
1352  logical :: brk
1353  end function
1354 
1358  subroutine ode_integrator_reset(this)
1359  import ode_integrator
1360  class(ode_integrator), intent(inout) :: this
1361  end subroutine
1362 
1363  module function oi_integrate(this, fcnobj, x, y, err) result(rst)
1364  class(ode_integrator), intent(inout) :: this
1365  class(ode_helper), intent(inout) :: fcnobj
1366  real(real64), intent(in), dimension(:) :: x, y
1367  class(errors), intent(inout), optional, target :: err
1368  real(real64), allocatable, dimension(:,:) :: rst
1369  end function
1370 
1371  pure module function oi_get_use_all_output(this) result(x)
1372  class(ode_integrator), intent(in) :: this
1373  logical :: x
1374  end function
1375 
1376  module subroutine oi_set_use_all_output(this, x)
1377  class(ode_integrator), intent(inout) :: this
1378  logical, intent(in) :: x
1379  end subroutine
1380 
1381  pure module function oi_get_allow_overshoot(this) result(x)
1382  class(ode_integrator), intent(in) :: this
1383  logical :: x
1384  end function
1385 
1386  module subroutine oi_set_allow_overshoot(this, x)
1387  class(ode_integrator), intent(inout) :: this
1388  logical, intent(in) :: x
1389  end subroutine
1390 
1391  pure module function oi_get_critical_point(this) result(x)
1392  class(ode_integrator), intent(in) :: this
1393  real(real64) :: x
1394  end function
1395 
1396  module subroutine oi_set_critical_point(this, x)
1397  class(ode_integrator), intent(inout) :: this
1398  real(real64), intent(in) :: x
1399  end subroutine
1400 
1401  pure module function oi_get_min_buffer_size(this) result(x)
1402  class(ode_integrator), intent(in) :: this
1403  integer(int32) :: x
1404  end function
1405 
1406  module subroutine oi_set_min_buffer_size(this, x)
1407  class(ode_integrator), intent(inout) :: this
1408  integer(int32), intent(in) :: x
1409  end subroutine
1410 
1411  pure module function oi_get_max_step_size(this) result(x)
1412  class(ode_integrator), intent(in) :: this
1413  real(real64) :: x
1414  end function
1415 
1416  module subroutine oi_set_max_step_size(this, x)
1417  class(ode_integrator), intent(inout) :: this
1418  real(real64), intent(in) :: x
1419  end subroutine
1420 
1421  pure module function oi_get_limit_step_size(this) result(x)
1422  class(ode_integrator), intent(in) :: this
1423  logical :: x
1424  end function
1425 
1426  module subroutine oi_set_limit_step_size(this, x)
1427  class(ode_integrator), intent(inout) :: this
1428  logical, intent(in) :: x
1429  end subroutine
1430 
1431  pure module function oi_get_iteration_limit(this) result(x)
1432  class(ode_integrator), intent(in) :: this
1433  integer(int32) :: x
1434  end function
1435 
1436  module subroutine oi_set_iteration_limit(this, x)
1437  class(ode_integrator), intent(inout) :: this
1438  integer(int32), intent(in) :: x
1439  end subroutine
1440 
1441  module function oi_get_rtol(this) result(x)
1442  class(ode_integrator), intent(in) :: this
1443  real(real64), allocatable, dimension(:) :: x
1444  end function
1445 
1446  module subroutine oi_set_rtol(this, x)
1447  class(ode_integrator), intent(inout) :: this
1448  real(real64), intent(in), dimension(:) :: x
1449  end subroutine
1450 
1451  module function oi_get_atol(this) result(x)
1452  class(ode_integrator), intent(in) :: this
1453  real(real64), allocatable, dimension(:) :: x
1454  end function
1455 
1456  module subroutine oi_set_atol(this, x)
1457  class(ode_integrator), intent(inout) :: this
1458  real(real64), intent(in), dimension(:) :: x
1459  end subroutine
1460  end interface
1461 
1462 ! ******************************************************************************
1463 ! INTEGRAL_ODE_AUTO.F90
1464 ! ------------------------------------------------------------------------------
1541  type, extends(ode_integrator) :: ode_auto
1543  real(real64), allocatable, dimension(:) :: m_rwork
1545  integer(int32), allocatable, dimension(:) :: m_iwork
1550  integer(int32), allocatable, dimension(:) :: m_rststats
1552  integer(int32) :: m_istate = 1
1553  contains
1594  procedure, public :: step => oa_step
1603  procedure, public :: reset => oa_reset_integrator
1615  procedure, public :: get_constraint_status => oa_get_constraint_info
1616 
1617  procedure, private :: init_workspace => oa_init_workspace
1618  end type
1619 
1620  interface
1621  module function oa_step(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1622  class(ode_auto), intent(inout) :: this
1623  class(ode_helper), intent(inout) :: fcn
1624  real(real64), intent(inout) :: x
1625  real(real64), intent(inout), dimension(:) :: y
1626  real(real64), intent(in) :: xout
1627  real(real64), intent(in), dimension(:) :: rtol, atol
1628  class(errors), intent(inout), optional, target :: err
1629  logical :: brk
1630  end function
1631 
1632  module subroutine oa_init_workspace(this, liw, lrw, ncnsts, err)
1633  class(ode_auto), intent(inout) :: this
1634  integer(int32), intent(in) :: liw, lrw, ncnsts
1635  class(errors), intent(inout) :: err
1636  end subroutine
1637 
1638  module subroutine oa_reset_integrator(this)
1639  class(ode_auto), intent(inout) :: this
1640  end subroutine
1641 
1642  module function oa_get_constraint_info(this) result(x)
1643  class(ode_auto), intent(in) :: this
1644  logical, allocatable, dimension(:) :: x
1645  end function
1646  end interface
1647 end module
Defines a routine capable of describing constraints on a system of ODEs of N variables exposed to M c...
-
Defines an integrator for systems of first order ODEs that is capable of switching between an Adams m...
-
Defines a routine capable of computing the Jacobian matrix of a system of N first order ODEs of N var...
-
Defines a routine containing a system of first order ODEs.
-
Resets the state of the integrator.
-
Defines a routine for computing a single integration step in the direction of xout.
-
Defines a base type for integrator types.
-
Defines the signature of a routine used to integrate a function of one variable over a finite interva...
-
Defines an integrator that uses a non-adaptive Gauss-Kronrod method to compute the integral of a func...
-
Defines a type used to pass information regarding the ODEs to the solver.
-
Defines a function of one variable to be integrated.
-
A type that defines an integrator meant to operate on integrands over a finite region.
- -
Defines an integrator that uses an adaptive Gauss-Kronrod method to compute the integral of a functio...
-
Provides information regarding the behavior of an integrator.
+
1 ! integral_core.f90
2 
12 
19  use, intrinsic :: iso_fortran_env, only : int32, real64
20  use ferror
21  implicit none
22  private
23  public :: int_out_of_memory_error
24  public :: int_count_exceeded_error
25  public :: int_round_off_error
26  public :: int_integrand_behavior_error
27  public :: int_convergence_error
28  public :: int_divergent_error
29  public :: int_invalid_input_error
30  public :: int_lack_of_definition_error
31  public :: int_array_size_mismatch_error
32  public :: int_excessive_work_error
33  public :: int_impractical_tolerance_error
34  public :: int_repeated_error_test_failure
35  public :: int_15_point_rule
36  public :: int_21_point_rule
37  public :: int_31_point_rule
38  public :: int_41_point_rule
39  public :: int_51_point_rule
40  public :: int_61_point_rule
41  public :: integrand
42  public :: ode_fcn
43  public :: ode_jacobian
44  public :: ode_constraint
45  public :: integration_behavior
46  public :: integrator_base
48  public :: finite_interval_fcn
49  public :: adaptive_integrator
50  public :: nonadaptive_integrator
51  public :: ode_helper
52  public :: ode_integrator
53  public :: ode_integrator_interface
54  public :: ode_integrator_reset
55  public :: ode_auto
56 
57 ! ------------------------------------------------------------------------------
59  integer(int32), parameter :: int_out_of_memory_error = 1
62  integer(int32), parameter :: int_count_exceeded_error = 2
64  integer(int32), parameter :: int_round_off_error = 3
66  integer(int32), parameter :: int_integrand_behavior_error = 4
68  integer(int32), parameter :: int_convergence_error = 5
70  integer(int32), parameter :: int_divergent_error = 6
72  integer(int32), parameter :: int_invalid_input_error = 7
74  integer(int32), parameter :: int_lack_of_definition_error = 8
76  integer(int32), parameter :: int_array_size_mismatch_error = 9
80  integer(int32), parameter :: int_excessive_work_error = 10
83  integer(int32), parameter :: int_impractical_tolerance_error = 11
85  integer(int32), parameter :: int_repeated_error_test_failure = 12
86 
87 ! ------------------------------------------------------------------------------
89  integer(int32), parameter :: int_15_point_rule = 15
91  integer(int32), parameter :: int_21_point_rule = 21
93  integer(int32), parameter :: int_31_point_rule = 31
95  integer(int32), parameter :: int_41_point_rule = 41
97  integer(int32), parameter :: int_51_point_rule = 51
99  integer(int32), parameter :: int_61_point_rule = 61
100 
101 ! ------------------------------------------------------------------------------
102  interface
103 
108  function integrand(x) result(f)
109  use, intrinsic :: iso_fortran_env, only : real64
110  real(real64), intent(in) :: x
111  real(real64) :: f
112  end function
113 
123  subroutine ode_fcn(x, y, dydx)
124  use, intrinsic :: iso_fortran_env, only : real64
125  real(real64), intent(in) :: x
126  real(real64), intent(in), dimension(:) :: y
127  real(real64), intent(out), dimension(:) :: dydx
128  end subroutine
129 
138  subroutine ode_jacobian(x, y, jac)
139  use, intrinsic :: iso_fortran_env, only : real64
140  real(real64), intent(in) :: x
141  real(real64), intent(in), dimension(:) :: y
142  real(real64), intent(out), dimension(:,:) :: jac
143  end subroutine
144 
154  subroutine ode_constraint(x, y, f)
155  use, intrinsic :: iso_fortran_env, only : real64
156  real(real64), intent(in) :: x
157  real(real64), intent(in), dimension(:) :: y
158  real(real64), intent(out), dimension(:) :: f
159  end subroutine
160  end interface
161 
162 ! ------------------------------------------------------------------------------
166  real(real64) :: error_estimate
168  integer(int32) :: evaluation_count
171  integer(int32) :: subinterval_count
172  end type
173 
174 ! ******************************************************************************
175 ! INTEGRAL_INTEGRATOR_BASE.F90
176 ! ------------------------------------------------------------------------------
179  private
181  real(real64) :: m_abstol = 1.0d-8
183  real(real64) :: m_reltol = 1.0d-8
185  integer(int32) :: m_maxint = 10
186  contains
196  procedure, public :: get_abs_tol => ib_get_abs_tol
206  procedure, public :: set_abs_tol => ib_set_abs_tol
216  procedure, public :: get_rel_tol => ib_get_rel_tol
226  procedure, public :: set_rel_tol => ib_set_rel_tol
237  procedure, public :: get_max_subintervals => ib_get_max_subintervals
248  procedure, public :: ib_set_max_subintervals => ib_set_max_subintervals
249  end type
250 
251 ! ------------------------------------------------------------------------------
252  interface
253  pure module function ib_get_abs_tol(this) result(x)
254  class(integrator_base), intent(in) :: this
255  real(real64) :: x
256  end function
257 
258  module subroutine ib_set_abs_tol(this, x)
259  class(integrator_base), intent(inout) :: this
260  real(real64), intent(in) :: x
261  end subroutine
262 
263  pure module function ib_get_rel_tol(this) result(x)
264  class(integrator_base), intent(in) :: this
265  real(real64) :: x
266  end function
267 
268  module subroutine ib_set_rel_tol(this, x)
269  class(integrator_base), intent(inout) :: this
270  real(real64), intent(in) :: x
271  end subroutine
272 
273  pure module function ib_get_max_subintervals(this) result(x)
274  class(integrator_base), intent(in) :: this
275  integer(int32) :: x
276  end function
277 
278  module subroutine ib_set_max_subintervals(this, x)
279  class(integrator_base), intent(inout) :: this
280  integer(int32), intent(in) :: x
281  end subroutine
282  end interface
283 
284 ! ******************************************************************************
287  type, abstract, extends(integrator_base) :: finite_interval_integrator
288  contains
290  procedure(finite_interval_fcn), public, deferred, pass :: integrate
291  end type
292 
293  interface
294 
306  function finite_interval_fcn(this, fcn, a, b, info, err) result(rst)
307  use, intrinsic :: iso_fortran_env, only : real64
308  use ferror
309  import finite_interval_integrator
310  import integrand
311  import integration_behavior
312  class(finite_interval_integrator), intent(inout) :: this
313  procedure(integrand), intent(in), pointer :: fcn
314  real(real64), intent(in) :: a, b
315  type(integration_behavior), intent(out), optional :: info
316  class(errors), intent(inout), optional, target :: err
317  real(real64) :: rst
318  end function
319  end interface
320 
321 ! ******************************************************************************
322 ! INTEGRAL_ADAPTIVE_INTEGRATOR.F90
323 ! ------------------------------------------------------------------------------
372  type, extends(finite_interval_integrator) :: adaptive_integrator
373  private
375  real(real64), allocatable, dimension(:) :: m_work
377  integer(int32), allocatable, dimension(:) :: m_iwork
379  logical :: m_userdefinedbreaks = .false.
381  real(real64), allocatable, dimension(:) :: m_breakpoints
382  contains
397  procedure, public :: initialize => ai_init
433  procedure, public :: integrate => ai_integrate
446  procedure, public :: get_use_breakpoints => ai_get_use_brkpnts
459  procedure, public :: set_use_breakpoints => ai_set_use_brkpnts
470  procedure, public :: get_breakpoints => ai_get_breakpoints
483  procedure, public :: set_breakpoints => ai_set_breakpoints
484  end type
485 
486 ! ------------------------------------------------------------------------------
487  interface
488  module subroutine ai_init(this, err)
489  class(adaptive_integrator), intent(inout) :: this
490  class(errors), intent(inout), optional, target :: err
491  end subroutine
492 
493  module function ai_integrate(this, fcn, a, b, info, err) result(rst)
494  class(adaptive_integrator), intent(inout) :: this
495  procedure(integrand), intent(in), pointer :: fcn
496  real(real64), intent(in) :: a, b
497  type(integration_behavior), intent(out), optional :: info
498  class(errors), intent(inout), optional, target :: err
499  real(real64) :: rst
500  end function
501 
502  pure module function ai_get_use_brkpnts(this) result(x)
503  class(adaptive_integrator), intent(in) :: this
504  logical :: x
505  end function
506 
507  module subroutine ai_set_use_brkpnts(this, x)
508  class(adaptive_integrator), intent(inout) :: this
509  logical, intent(in) :: x
510  end subroutine
511 
512  module function ai_get_breakpoints(this) result(x)
513  class(adaptive_integrator), intent(in) :: this
514  real(real64), allocatable, dimension(:) :: x
515  end function
516 
517  module subroutine ai_set_breakpoints(this, x)
518  class(adaptive_integrator), intent(inout) :: this
519  real(real64), intent(in), dimension(:) :: x
520  end subroutine
521  end interface
522 
523 ! ******************************************************************************
524 ! INTEGRAL_NONADAPTIVE_INTEGRATOR.F90
525 ! ------------------------------------------------------------------------------
529  type, extends(finite_interval_integrator) :: nonadaptive_integrator
530  private
532  integer(int32) :: m_rule = int_15_point_rule
533  contains
558  procedure, public :: integrate => ni_integrate
576  procedure, public :: get_rule => ni_get_rule
599  procedure, public :: set_rule => ni_set_rule
600  end type
601 
602 ! ------------------------------------------------------------------------------
603  interface
604  module function ni_integrate(this, fcn, a, b, info, err) result(rst)
605  class(nonadaptive_integrator), intent(inout) :: this
606  procedure(integrand), intent(in), pointer :: fcn
607  real(real64), intent(in) :: a, b
608  type(integration_behavior), intent(out), optional :: info
609  class(errors), intent(inout), optional, target :: err
610  real(real64) :: rst
611  end function
612 
613  pure module function ni_get_rule(this) result(x)
614  class(nonadaptive_integrator), intent(in) :: this
615  integer(int32) :: x
616  end function
617 
618  module subroutine ni_set_rule(this, x, err)
619  class(nonadaptive_integrator), intent(inout) :: this
620  integer(int32), intent(in) :: x
621  class(errors), intent(inout), optional, target :: err
622  end subroutine
623  end interface
624 
625 ! ******************************************************************************
626 ! INTEGRAL_ODE_HELPER.F90
627 ! ------------------------------------------------------------------------------
630  type :: ode_helper
631  private
633  procedure(ode_fcn), pointer, nopass :: m_fcn => null()
635  procedure(ode_jacobian), pointer, nopass :: m_jac => null()
637  procedure(ode_constraint), pointer, nopass :: m_rts => null()
639  integer(int32) :: m_count = 0
641  integer(int32) :: m_constraints = 0
642  contains
733  procedure, public :: define_equations => oh_init
743  procedure, public :: get_equation_count => oh_get_count
756  procedure, public :: get_equations_defined => oh_is_fcn_defined
769  procedure, public :: get_jacobian_defined => oh_is_jac_defined
904  procedure, public :: define_constraints => oh_define_constraints
914  procedure, public :: get_constraint_count => oh_get_constraint_count
925  procedure, public :: get_constraints_defined => oh_get_constraints_defined
926  !! @brief Evaluates the routine containing the system of ODEs.
927  !!
928  !! @par Syntax
929  !! @code{.f90}
930  !! subroutine evaluate_ode(class(ode_helper) this, real(real64) x, real(real64) y(:), real(real64) dydx(:))
931  !! @endcode
932  !!
933  !! @param[in,out] this The ode_helper object.
934  !! @param[in] x The value of the independent variable at which to
935  !! evalaute the ODEs.
936  !! @param[in] y An N-element array cotnaining the current estimates
937  !! of the dependent variables as evaluated at @p x.
938  !! @param[out] dydx An N-element array where the values of the ODEs
939  !! as evaluated at @p x are to be written.
940  procedure, public :: evaluate_ode => oh_eval
954  procedure, public :: evaluate_jacobian => oh_eval_jac
969  procedure, public :: evaluate_constraints => oh_eval_constraints
970  end type
971 
972  interface
973  module subroutine oh_init(this, neqn, fcn, jac)
974  class(ode_helper), intent(inout) :: this
975  integer(int32), intent(in) :: neqn
976  procedure(ode_fcn), pointer, intent(in) :: fcn
977  procedure(ode_jacobian), pointer, intent(in), optional :: jac
978  end subroutine
979 
980  pure module function oh_get_count(this) result(x)
981  class(ode_helper), intent(in) :: this
982  integer(int32) :: x
983  end function
984 
985  pure module function oh_is_fcn_defined(this) result(x)
986  class(ode_helper), intent(in) :: this
987  logical :: x
988  end function
989 
990  pure module function oh_is_jac_defined(this) result(x)
991  class(ode_helper), intent(in) :: this
992  logical :: x
993  end function
994 
995  module subroutine oh_define_constraints(this, n, fcn)
996  class(ode_helper), intent(inout) :: this
997  integer(int32), intent(in) :: n
998  procedure(ode_constraint), intent(in), pointer :: fcn
999  end subroutine
1000 
1001  pure module function oh_get_constraint_count(this) result(x)
1002  class(ode_helper), intent(in) :: this
1003  integer(int32) :: x
1004  end function
1005 
1006  pure module function oh_get_constraints_defined(this) result(x)
1007  class(ode_helper), intent(in) :: this
1008  logical :: x
1009  end function
1010 
1011  module subroutine oh_eval(this, x, y, dydx)
1012  class(ode_helper), intent(inout) :: this
1013  real(real64), intent(in) :: x
1014  real(real64), intent(in), dimension(:) :: y
1015  real(real64), intent(out), dimension(:) :: dydx
1016  end subroutine
1017 
1018  module subroutine oh_eval_jac(this, x, y, jac)
1019  class(ode_helper), intent(inout) :: this
1020  real(real64), intent(in) :: x
1021  real(real64), intent(in), dimension(:) :: y
1022  real(real64), intent(out), dimension(:,:) :: jac
1023  end subroutine
1024 
1025  module subroutine oh_eval_constraints(this, x, y, f)
1026  class(ode_helper), intent(inout) :: this
1027  real(real64), intent(in) :: x
1028  real(real64), intent(in), dimension(:) :: y
1029  real(real64), intent(out), dimension(:) :: f
1030  end subroutine
1031  end interface
1032 
1033 ! ******************************************************************************
1034 ! INTEGRAL_ODE_INTEGRATOR.F90
1035 ! ------------------------------------------------------------------------------
1036  type, abstract :: ode_integrator
1038  real(real64), allocatable, dimension(:) :: m_rtol
1040  real(real64), allocatable, dimension(:) :: m_atol
1043  logical :: m_alloutput = .true.
1047  logical :: m_canovershoot = .true.
1050  real(real64) :: m_criticalpoint = 0.0d0
1052  integer(int32) :: m_minbuffersize = 500
1055  real(real64) :: m_maxstepsize = 1.0d0
1058  logical :: m_limitstepsize = .false.
1060  integer(int32) :: m_maxstepcount = 500
1061  contains
1096  procedure, public :: integrate => oi_integrate
1108  procedure, public :: get_provide_all_output => oi_get_use_all_output
1121  procedure, public :: set_provide_all_output => oi_set_use_all_output
1133  procedure, public :: get_allow_overshoot => oi_get_allow_overshoot
1146  procedure, public :: set_allow_overshoot => oi_set_allow_overshoot
1157  procedure, public :: get_integration_limit => oi_get_critical_point
1168  procedure, public :: set_integration_limit => oi_set_critical_point
1178  procedure, public :: get_min_buffer_size => oi_get_min_buffer_size
1190  procedure, public :: set_min_buffer_size => oi_set_min_buffer_size
1200  procedure, public :: get_max_step_size => oi_get_max_step_size
1211  procedure, public :: set_max_step_size => oi_set_max_step_size
1222  procedure, public :: get_limit_step_size => oi_get_limit_step_size
1235  procedure, public :: set_limit_step_size => oi_set_limit_step_size
1246  procedure, public :: get_iteration_limit => oi_get_iteration_limit
1257  procedure, public :: set_iteration_limit => oi_set_iteration_limit
1267  procedure, public :: get_relative_tolerances => oi_get_rtol
1277  procedure, public :: set_relative_tolerances => oi_set_rtol
1287  procedure, public :: get_absolute_tolerances => oi_get_atol
1297  procedure, public :: set_absolute_tolerances => oi_set_atol
1325  procedure(ode_integrator_interface), public, deferred, pass :: step
1334  procedure(ode_integrator_reset), public, deferred, pass :: reset
1335  end type
1336 
1337 ! ------------------------------------------------------------------------------
1338  interface
1339 
1361  function ode_integrator_interface(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1362  use, intrinsic :: iso_fortran_env, only : int32, real64
1363  use ferror
1364  import ode_integrator
1365  import ode_helper
1366  class(ode_integrator), intent(inout) :: this
1367  class(ode_helper), intent(inout) :: fcn
1368  real(real64), intent(inout) :: x
1369  real(real64), intent(inout), dimension(:) :: y
1370  real(real64), intent(in) :: xout
1371  real(real64), intent(in), dimension(:) :: rtol, atol
1372  class(errors), intent(inout), optional, target :: err
1373  logical :: brk
1374  end function
1375 
1379  subroutine ode_integrator_reset(this)
1380  import ode_integrator
1381  class(ode_integrator), intent(inout) :: this
1382  end subroutine
1383 
1384  module function oi_integrate(this, fcnobj, x, y, err) result(rst)
1385  class(ode_integrator), intent(inout) :: this
1386  class(ode_helper), intent(inout) :: fcnobj
1387  real(real64), intent(in), dimension(:) :: x, y
1388  class(errors), intent(inout), optional, target :: err
1389  real(real64), allocatable, dimension(:,:) :: rst
1390  end function
1391 
1392  pure module function oi_get_use_all_output(this) result(x)
1393  class(ode_integrator), intent(in) :: this
1394  logical :: x
1395  end function
1396 
1397  module subroutine oi_set_use_all_output(this, x)
1398  class(ode_integrator), intent(inout) :: this
1399  logical, intent(in) :: x
1400  end subroutine
1401 
1402  pure module function oi_get_allow_overshoot(this) result(x)
1403  class(ode_integrator), intent(in) :: this
1404  logical :: x
1405  end function
1406 
1407  module subroutine oi_set_allow_overshoot(this, x)
1408  class(ode_integrator), intent(inout) :: this
1409  logical, intent(in) :: x
1410  end subroutine
1411 
1412  pure module function oi_get_critical_point(this) result(x)
1413  class(ode_integrator), intent(in) :: this
1414  real(real64) :: x
1415  end function
1416 
1417  module subroutine oi_set_critical_point(this, x)
1418  class(ode_integrator), intent(inout) :: this
1419  real(real64), intent(in) :: x
1420  end subroutine
1421 
1422  pure module function oi_get_min_buffer_size(this) result(x)
1423  class(ode_integrator), intent(in) :: this
1424  integer(int32) :: x
1425  end function
1426 
1427  module subroutine oi_set_min_buffer_size(this, x)
1428  class(ode_integrator), intent(inout) :: this
1429  integer(int32), intent(in) :: x
1430  end subroutine
1431 
1432  pure module function oi_get_max_step_size(this) result(x)
1433  class(ode_integrator), intent(in) :: this
1434  real(real64) :: x
1435  end function
1436 
1437  module subroutine oi_set_max_step_size(this, x)
1438  class(ode_integrator), intent(inout) :: this
1439  real(real64), intent(in) :: x
1440  end subroutine
1441 
1442  pure module function oi_get_limit_step_size(this) result(x)
1443  class(ode_integrator), intent(in) :: this
1444  logical :: x
1445  end function
1446 
1447  module subroutine oi_set_limit_step_size(this, x)
1448  class(ode_integrator), intent(inout) :: this
1449  logical, intent(in) :: x
1450  end subroutine
1451 
1452  pure module function oi_get_iteration_limit(this) result(x)
1453  class(ode_integrator), intent(in) :: this
1454  integer(int32) :: x
1455  end function
1456 
1457  module subroutine oi_set_iteration_limit(this, x)
1458  class(ode_integrator), intent(inout) :: this
1459  integer(int32), intent(in) :: x
1460  end subroutine
1461 
1462  module function oi_get_rtol(this) result(x)
1463  class(ode_integrator), intent(in) :: this
1464  real(real64), allocatable, dimension(:) :: x
1465  end function
1466 
1467  module subroutine oi_set_rtol(this, x)
1468  class(ode_integrator), intent(inout) :: this
1469  real(real64), intent(in), dimension(:) :: x
1470  end subroutine
1471 
1472  module function oi_get_atol(this) result(x)
1473  class(ode_integrator), intent(in) :: this
1474  real(real64), allocatable, dimension(:) :: x
1475  end function
1476 
1477  module subroutine oi_set_atol(this, x)
1478  class(ode_integrator), intent(inout) :: this
1479  real(real64), intent(in), dimension(:) :: x
1480  end subroutine
1481  end interface
1482 
1483 ! ******************************************************************************
1484 ! INTEGRAL_ODE_AUTO.F90
1485 ! ------------------------------------------------------------------------------
1562  type, extends(ode_integrator) :: ode_auto
1564  real(real64), allocatable, dimension(:) :: m_rwork
1566  integer(int32), allocatable, dimension(:) :: m_iwork
1571  integer(int32), allocatable, dimension(:) :: m_rststats
1573  integer(int32) :: m_istate = 1
1574  contains
1615  procedure, public :: step => oa_step
1624  procedure, public :: reset => oa_reset_integrator
1636  procedure, public :: get_constraint_status => oa_get_constraint_info
1637 
1638  procedure, private :: init_workspace => oa_init_workspace
1639  end type
1640 
1641  interface
1642  module function oa_step(this, fcn, x, y, xout, rtol, atol, err) result(brk)
1643  class(ode_auto), intent(inout) :: this
1644  class(ode_helper), intent(inout) :: fcn
1645  real(real64), intent(inout) :: x
1646  real(real64), intent(inout), dimension(:) :: y
1647  real(real64), intent(in) :: xout
1648  real(real64), intent(in), dimension(:) :: rtol, atol
1649  class(errors), intent(inout), optional, target :: err
1650  logical :: brk
1651  end function
1652 
1653  module subroutine oa_init_workspace(this, liw, lrw, ncnsts, err)
1654  class(ode_auto), intent(inout) :: this
1655  integer(int32), intent(in) :: liw, lrw, ncnsts
1656  class(errors), intent(inout) :: err
1657  end subroutine
1658 
1659  module subroutine oa_reset_integrator(this)
1660  class(ode_auto), intent(inout) :: this
1661  end subroutine
1662 
1663  module function oa_get_constraint_info(this) result(x)
1664  class(ode_auto), intent(in) :: this
1665  logical, allocatable, dimension(:) :: x
1666  end function
1667  end interface
1668 end module
Defines a routine capable of describing constraints on a system of ODEs of N variables exposed to M c...
+
Defines an integrator for systems of first order ODEs that is capable of switching between an Adams m...
+
Defines a routine capable of computing the Jacobian matrix of a system of N first order ODEs of N var...
+
Defines a routine containing a system of first order ODEs.
+
Resets the state of the integrator.
+
Defines a routine for computing a single integration step in the direction of xout.
+
Defines a base type for integrator types.
+
Defines the signature of a routine used to integrate a function of one variable over a finite interva...
+
Defines an integrator that uses a non-adaptive Gauss-Kronrod method to compute the integral of a func...
+
Defines a type used to pass information regarding the ODEs to the solver.
+
Defines a function of one variable to be integrated.
+
A type that defines an integrator meant to operate on integrands over a finite region.
+ +
integral_core
+
Defines an integrator that uses an adaptive Gauss-Kronrod method to compute the integral of a functio...
+
Provides information regarding the behavior of an integrator.
@@ -108,7 +132,7 @@ + doxygen 1.8.11 diff --git a/doc/html/integral__integrator__base_8f90_source.html b/doc/html/integral__integrator__base_8f90_source.html index 4ab8a31..074cf31 100644 --- a/doc/html/integral__integrator__base_8f90_source.html +++ b/doc/html/integral__integrator__base_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_integrator_base.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_integrator_base.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_integrator_base.f90
2 
3 submodule(integral_core) integral_integrator_base
4 contains
5 ! ------------------------------------------------------------------------------
6  pure module function ib_get_abs_tol(this) result(x)
7  class(integrator_base), intent(in) :: this
8  real(real64) :: x
9  x = this%m_absTol
10  end function
11 
12  module subroutine ib_set_abs_tol(this, x)
13  class(integrator_base), intent(inout) :: this
14  real(real64), intent(in) :: x
15  this%m_absTol = x
16  end subroutine
17 
18 ! ------------------------------------------------------------------------------
19  pure module function ib_get_rel_tol(this) result(x)
20  class(integrator_base), intent(in) :: this
21  real(real64) :: x
22  x = this%m_relTol
23  end function
24 
25  module subroutine ib_set_rel_tol(this, x)
26  class(integrator_base), intent(inout) :: this
27  real(real64), intent(in) :: x
28  this%m_relTol = x
29  end subroutine
30 
31 ! ------------------------------------------------------------------------------
32  pure module function ib_get_max_subintervals(this) result(x)
33  class(integrator_base), intent(in) :: this
34  integer(int32) :: x
35  x = this%m_maxInt
36  end function
37 
38  module subroutine ib_set_max_subintervals(this, x)
39  class(integrator_base), intent(inout) :: this
40  integer(int32), intent(in) :: x
41  this%m_maxInt = x
42  end subroutine
43 
44 ! ------------------------------------------------------------------------------
45 end submodule
+
1 ! integral_integrator_base.f90
2 
3 submodule(integral_core) integral_integrator_base
4 contains
5 ! ------------------------------------------------------------------------------
6  pure module function ib_get_abs_tol(this) result(x)
7  class(integrator_base), intent(in) :: this
8  real(real64) :: x
9  x = this%m_absTol
10  end function
11 
12  module subroutine ib_set_abs_tol(this, x)
13  class(integrator_base), intent(inout) :: this
14  real(real64), intent(in) :: x
15  this%m_absTol = x
16  end subroutine
17 
18 ! ------------------------------------------------------------------------------
19  pure module function ib_get_rel_tol(this) result(x)
20  class(integrator_base), intent(in) :: this
21  real(real64) :: x
22  x = this%m_relTol
23  end function
24 
25  module subroutine ib_set_rel_tol(this, x)
26  class(integrator_base), intent(inout) :: this
27  real(real64), intent(in) :: x
28  this%m_relTol = x
29  end subroutine
30 
31 ! ------------------------------------------------------------------------------
32  pure module function ib_get_max_subintervals(this) result(x)
33  class(integrator_base), intent(in) :: this
34  integer(int32) :: x
35  x = this%m_maxInt
36  end function
37 
38  module subroutine ib_set_max_subintervals(this, x)
39  class(integrator_base), intent(inout) :: this
40  integer(int32), intent(in) :: x
41  this%m_maxInt = x
42  end subroutine
43 
44 ! ------------------------------------------------------------------------------
45 end submodule
integral_core
+
diff --git a/doc/html/integral__nonadaptive__integrator_8f90_source.html b/doc/html/integral__nonadaptive__integrator_8f90_source.html index bdffaef..4914fcc 100644 --- a/doc/html/integral__nonadaptive__integrator_8f90_source.html +++ b/doc/html/integral__nonadaptive__integrator_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_nonadaptive_integrator.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_nonadaptive_integrator.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_nonadaptive_integrator.f90
2 
3 submodule(integral_core) integral_nonadaptive_integrator
4 contains
5 ! ------------------------------------------------------------------------------
6  module function ni_integrate(this, fcn, a, b, info, err) result(rst)
7  ! Arguments
8  class(nonadaptive_integrator), intent(inout) :: this
9  procedure(integrand), intent(in), pointer :: fcn
10  real(real64), intent(in) :: a, b
11  type(integration_behavior), intent(out), optional :: info
12  class(errors), intent(inout), optional, target :: err
13  real(real64) :: rst
14 
15  ! Local Variables
16  real(real64) :: abserr, resabs, resasc
17  integer(int32) :: n
18 
19  ! Determine the correct rule, and perform the integration
20  select case (this%get_rule())
21  case (int_15_point_rule)
22  n = 15
23  call dqk15(local_fcn, a, b, rst, abserr, resabs, resasc)
24  case (int_21_point_rule)
25  n = 21
26  call dqk21(local_fcn, a, b, rst, abserr, resabs, resasc)
27  case (int_31_point_rule)
28  n = 31
29  call dqk31(local_fcn, a, b, rst, abserr, resabs, resasc)
30  case (int_41_point_rule)
31  n = 41
32  call dqk41(local_fcn, a, b, rst, abserr, resabs, resasc)
33  case (int_51_point_rule)
34  n = 51
35  call dqk51(local_fcn, a, b, rst, abserr, resabs, resasc)
36  case (int_61_point_rule)
37  n = 61
38  call dqk61(local_fcn, a, b, rst, abserr, resabs, resasc)
39  end select
40 
41  ! Report out the integration statistics
42  if (present(info)) then
43  info%error_estimate = abserr
44  info%evaluation_count = n
45  info%subinterval_count = 0
46  end if
47  contains
48  ! This is required as the F77 code doesn't deal with procedure pointers
49  function local_fcn(xarg) result(frst)
50  real(real64), intent(in) :: xarg
51  real(real64) :: frst
52  frst = fcn(xarg)
53  end function
54  end function
55 
56 ! ------------------------------------------------------------------------------
57  pure module function ni_get_rule(this) result(x)
58  class(nonadaptive_integrator), intent(in) :: this
59  integer(int32) :: x
60  x = this%m_rule
61  end function
62 
63 ! ------------------------------------------------------------------------------
64  module subroutine ni_set_rule(this, x, err)
65  class(nonadaptive_integrator), intent(inout) :: this
66  integer(int32), intent(in) :: x
67  class(errors), intent(inout), optional, target :: err
68  class(errors), pointer :: errmgr
69  type(errors), target :: deferr
70  if (present(err)) then
71  errmgr => err
72  else
73  errmgr => deferr
74  end if
75  if (x /= int_15_point_rule .and. x /= int_21_point_rule .and. &
76  x /= int_31_point_rule .and. x /= int_41_point_rule .and. &
77  x /= int_51_point_rule .and. x /= int_61_point_rule) then
78  call errmgr%report_error("ni_set_rule", &
79  "Unknown integration rule requested.", &
80  int_invalid_input_error)
81  return
82  end if
83  this%m_rule = x
84  end subroutine
85 
86 ! ------------------------------------------------------------------------------
87 end submodule
+
1 ! integral_nonadaptive_integrator.f90
2 
3 submodule(integral_core) integral_nonadaptive_integrator
4 contains
5 ! ------------------------------------------------------------------------------
6  module function ni_integrate(this, fcn, a, b, info, err) result(rst)
7  ! Arguments
8  class(nonadaptive_integrator), intent(inout) :: this
9  procedure(integrand), intent(in), pointer :: fcn
10  real(real64), intent(in) :: a, b
11  type(integration_behavior), intent(out), optional :: info
12  class(errors), intent(inout), optional, target :: err
13  real(real64) :: rst
14 
15  ! Local Variables
16  real(real64) :: abserr, resabs, resasc
17  integer(int32) :: n
18 
19  ! Determine the correct rule, and perform the integration
20  select case (this%get_rule())
21  case (int_15_point_rule)
22  n = 15
23  call dqk15(local_fcn, a, b, rst, abserr, resabs, resasc)
24  case (int_21_point_rule)
25  n = 21
26  call dqk21(local_fcn, a, b, rst, abserr, resabs, resasc)
27  case (int_31_point_rule)
28  n = 31
29  call dqk31(local_fcn, a, b, rst, abserr, resabs, resasc)
30  case (int_41_point_rule)
31  n = 41
32  call dqk41(local_fcn, a, b, rst, abserr, resabs, resasc)
33  case (int_51_point_rule)
34  n = 51
35  call dqk51(local_fcn, a, b, rst, abserr, resabs, resasc)
36  case (int_61_point_rule)
37  n = 61
38  call dqk61(local_fcn, a, b, rst, abserr, resabs, resasc)
39  end select
40 
41  ! Report out the integration statistics
42  if (present(info)) then
43  info%error_estimate = abserr
44  info%evaluation_count = n
45  info%subinterval_count = 0
46  end if
47  contains
48  ! This is required as the F77 code doesn't deal with procedure pointers
49  function local_fcn(xarg) result(frst)
50  real(real64), intent(in) :: xarg
51  real(real64) :: frst
52  frst = fcn(xarg)
53  end function
54  end function
55 
56 ! ------------------------------------------------------------------------------
57  pure module function ni_get_rule(this) result(x)
58  class(nonadaptive_integrator), intent(in) :: this
59  integer(int32) :: x
60  x = this%m_rule
61  end function
62 
63 ! ------------------------------------------------------------------------------
64  module subroutine ni_set_rule(this, x, err)
65  class(nonadaptive_integrator), intent(inout) :: this
66  integer(int32), intent(in) :: x
67  class(errors), intent(inout), optional, target :: err
68  class(errors), pointer :: errmgr
69  type(errors), target :: deferr
70  if (present(err)) then
71  errmgr => err
72  else
73  errmgr => deferr
74  end if
75  if (x /= int_15_point_rule .and. x /= int_21_point_rule .and. &
76  x /= int_31_point_rule .and. x /= int_41_point_rule .and. &
77  x /= int_51_point_rule .and. x /= int_61_point_rule) then
78  call errmgr%report_error("ni_set_rule", &
79  "Unknown integration rule requested.", &
80  int_invalid_input_error)
81  return
82  end if
83  this%m_rule = x
84  end subroutine
85 
86 ! ------------------------------------------------------------------------------
87 end submodule
integral_core
+
diff --git a/doc/html/integral__ode__auto_8f90_source.html b/doc/html/integral__ode__auto_8f90_source.html index 1588ff7..101cddd 100644 --- a/doc/html/integral__ode__auto_8f90_source.html +++ b/doc/html/integral__ode__auto_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_ode_auto.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_ode_auto.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_ode_auto.f90
2 
3 submodule(integral_core) integral_ode_auto
4 contains
5 ! ------------------------------------------------------------------------------
6  module function oa_step(this, fcn, x, y, xout, rtol, atol, err) result(brk)
7  ! Arguments
8  class(ode_auto), intent(inout) :: this
9  class(ode_helper), intent(inout) :: fcn
10  real(real64), intent(inout) :: x
11  real(real64), intent(inout), dimension(:) :: y
12  real(real64), intent(in) :: xout
13  real(real64), intent(in), dimension(:) :: rtol, atol
14  class(errors), intent(inout), optional, target :: err
15  logical :: brk
16 
17  ! Local Variables
18  integer(int32) :: neq, itask, iopt, lrw, liw, jt, ncnst, lrn, lrs, itol
19  logical :: useconstraints
20  class(errors), pointer :: errmgr
21  type(errors), target :: deferr
22 
23  ! Initialization
24  brk = .false.
25  neq = fcn%get_equation_count()
26  ncnst = fcn%get_constraint_count()
27  useconstraints = fcn%get_constraints_defined()
28  if (present(err)) then
29  errmgr => err
30  else
31  errmgr => deferr
32  end if
33 
34  ! Ensure workspace arrays are sized appropriately
35  lrn = 20 + 16 * neq + 3 * ncnst
36  lrs = 22 + 9 * neq + neq**2 + 3 * ncnst
37  lrw = max(lrn, lrs)
38  liw = 20 + neq
39 
40  ! Define workspace arrays
41  call this%init_workspace(liw, lrw, ncnst, errmgr)
42  if (errmgr%has_error_occurred()) return
43 
44  ! Additional Initialization
45  iopt = 0
46  if (this%get_allow_overshoot()) then
47  itask = 1
48  if (this%get_provide_all_output()) itask = 2
49  else
50  itask = 4
51  iopt = 1
52  this%m_rwork(1) = this%get_integration_limit()
53  if (this%get_provide_all_output()) itask = 5
54  end if
55  if (fcn%get_jacobian_defined()) then
56  jt = 1
57  else
58  jt = 2
59  end if
60  itol = 4
61 
62  if (this%get_limit_step_size()) then
63  iopt = 1
64  this%m_rwork(6) = this%get_max_step_size()
65  end if
66 
67  if (this%get_iteration_limit() /= 500) then
68  iopt = 1
69  this%m_iwork(6) = this%get_iteration_limit()
70  end if
71 
72  ! Determine if we are to call DLSODA or DLSODAR
73  if (useconstraints .and. ncnst > 0) then
74  call dlsodar(odepackfcn, neq, y, x, xout, itol, rtol, atol, itask, &
75  this%m_istate, iopt, this%m_rwork, lrw, this%m_iwork, liw, &
76  odepackjac, jt, odepackconstraints, ncnst, this%m_rststats)
77 
78  ! Check output condition
79  select case (this%m_istate)
80  case (3)
81  ! Root Found
82  brk = .true.
83  case (-1)
84  call errmgr%report_error("oa_step", &
85  "Excessive work has been done during this " // &
86  "integration step.", int_excessive_work_error)
87  case (-2)
88  call errmgr%report_error("oa_step", &
89  "Unachievable tolerances have been requested.", &
90  int_impractical_tolerance_error)
91  case (-3)
92  call errmgr%report_error("oa_step", &
93  "An invalid input was encountered.", &
94  int_invalid_input_error)
95  case (-4)
96  call errmgr%report_error("oa_step", &
97  "Error testing has failed repeatadly. " // &
98  "Ensure inputs are valid.", int_repeated_error_test_failure)
99  case (-5)
100  call errmgr%report_error("oa_step", "Repeated convergence " // &
101  "failures have been encountered.", int_convergence_error)
102  case (-6)
103  call errmgr%report_error("oa_step", "A solution component " // &
104  "has effectively vanished.", int_integrand_behavior_error)
105  case (-7)
106  call errmgr%report_error("oa_step", "An insufficiently " // &
107  "sized workspace array was provided.", &
108  int_invalid_input_error)
109  end select
110  else
111  call dlsoda(odepackfcn, neq, y, x, xout, itol, rtol, atol, itask, &
112  this%m_istate, iopt, this%m_rwork, lrw, this%m_iwork, liw, &
113  odepackjac, jt)
114 
115  ! Check output condition
116  select case (this%m_istate)
117  case (-1)
118  call errmgr%report_error("oa_step", &
119  "Excessive work has been done during this " // &
120  "integration step.", int_excessive_work_error)
121  case (-2)
122  call errmgr%report_error("oa_step", &
123  "Unachievable tolerances have been requested.", &
124  int_impractical_tolerance_error)
125  case (-3)
126  call errmgr%report_error("oa_step", &
127  "An invalid input was encountered.", &
128  int_invalid_input_error)
129  case (-4)
130  call errmgr%report_error("oa_step", &
131  "Error testing has failed repeatadly. " // &
132  "Ensure inputs are valid.", int_repeated_error_test_failure)
133  case (-5)
134  call errmgr%report_error("oa_step", "Repeated convergence " // &
135  "failures have been encountered.", int_convergence_error)
136  case (-6)
137  call errmgr%report_error("oa_step", "A solution component " // &
138  "has effectively vanished.", int_integrand_behavior_error)
139  case (-7)
140  call errmgr%report_error("oa_step", "An insufficiently " // &
141  "sized workspace array was provided.", &
142  int_invalid_input_error)
143  end select
144  end if
145 
146  contains
147  subroutine odepackfcn(n, x, y, dydx)
148  integer(int32), intent(in) :: n
149  real(real64), intent(in) :: x, y(n)
150  real(real64), intent(out) :: dydx(n)
151  call fcn%evaluate_ode(x, y, dydx)
152  end subroutine
153 
154  subroutine odepackjac(n, x, y, ml, mu, pd, nrowpd)
155  integer(int32), intent(in) :: n, ml, mu, nrowpd
156  real(real64), intent(in) :: x, y(n)
157  real(real64), intent(out) :: pd(nrowpd, n)
158  call fcn%evaluate_jacobian(x, y, pd)
159  end subroutine
160 
161  subroutine odepackconstraints(neq, x, y, ng, gout)
162  integer(int32), intent(in) :: neq, ng
163  real(real64), intent(in) :: x, y(neq)
164  real(real64), intent(out) :: gout(ng)
165  call fcn%evaluate_constraints(x, y, gout)
166  end subroutine
167  end function
168 
169 ! ------------------------------------------------------------------------------
170  module subroutine oa_reset_integrator(this)
171  class(ode_auto), intent(inout) :: this
172  this%m_istate = 1
173  end subroutine
174 
175 ! ------------------------------------------------------------------------------
176  module subroutine oa_init_workspace(this, liw, lrw, ncnsts, err)
177  ! Arguments
178  class(ode_auto), intent(inout) :: this
179  integer(int32), intent(in) :: liw, lrw, ncnsts
180  class(errors), intent(inout) :: err
181 
182  ! Local Variables
183  integer(int32) :: flag
184 
185  ! Process
186  flag = 0
187  if (allocated(this%m_iwork)) then
188  if (size(this%m_iwork) < liw) then
189  deallocate(this%m_iwork)
190  allocate(this%m_iwork(liw), stat = flag)
191  end if
192  else
193  allocate(this%m_iwork(liw), stat = flag)
194  end if
195 
196  if (flag == 0) then
197  if (allocated(this%m_rwork)) then
198  if (size(this%m_rwork) < lrw) then
199  deallocate(this%m_rwork)
200  allocate(this%m_rwork(lrw), stat = flag)
201  end if
202  else
203  allocate(this%m_rwork(lrw), stat = flag)
204  end if
205  end if
206 
207  if (flag == 0 .and. ncnsts > 0) then
208  if (allocated(this%m_rststats)) then
209  if (size(this%m_rststats) /= ncnsts) then
210  deallocate(this%m_rststats)
211  allocate(this%m_rststats(ncnsts), stat = flag)
212  end if
213  else
214  allocate(this%m_rststats(ncnsts), stat = flag)
215  end if
216  end if
217 
218  ! Error Checking
219  if (flag /= 0) then
220  call err%report_error("oa_init_workspace", &
221  "Insufficient memory available.", int_out_of_memory_error)
222  return
223  end if
224  end subroutine
225 
226 ! ------------------------------------------------------------------------------
227  module function oa_get_constraint_info(this) result(x)
228  ! Arguments
229  class(ode_auto), intent(in) :: this
230  logical, allocatable, dimension(:) :: x
231 
232  ! Local Variables
233  integer(int32) :: i, n
234 
235  ! Process
236  if (.not.allocated(this%m_rststats)) return
237  n = size(this%m_rststats)
238  allocate(x(n))
239  do i = 1, n
240  x(i) = this%m_rststats(i) == 1
241  end do
242  end function
243 
244 ! ------------------------------------------------------------------------------
245 end submodule
+
1 ! integral_ode_auto.f90
2 
3 submodule(integral_core) integral_ode_auto
4 contains
5 ! ------------------------------------------------------------------------------
6  module function oa_step(this, fcn, x, y, xout, rtol, atol, err) result(brk)
7  ! Arguments
8  class(ode_auto), intent(inout) :: this
9  class(ode_helper), intent(inout) :: fcn
10  real(real64), intent(inout) :: x
11  real(real64), intent(inout), dimension(:) :: y
12  real(real64), intent(in) :: xout
13  real(real64), intent(in), dimension(:) :: rtol, atol
14  class(errors), intent(inout), optional, target :: err
15  logical :: brk
16 
17  ! Local Variables
18  integer(int32) :: neq, itask, iopt, lrw, liw, jt, ncnst, lrn, lrs, itol
19  logical :: useconstraints
20  class(errors), pointer :: errmgr
21  type(errors), target :: deferr
22 
23  ! Initialization
24  brk = .false.
25  neq = fcn%get_equation_count()
26  ncnst = fcn%get_constraint_count()
27  useconstraints = fcn%get_constraints_defined()
28  if (present(err)) then
29  errmgr => err
30  else
31  errmgr => deferr
32  end if
33 
34  ! Ensure workspace arrays are sized appropriately
35  lrn = 20 + 16 * neq + 3 * ncnst
36  lrs = 22 + 9 * neq + neq**2 + 3 * ncnst
37  lrw = max(lrn, lrs)
38  liw = 20 + neq
39 
40  ! Define workspace arrays
41  call this%init_workspace(liw, lrw, ncnst, errmgr)
42  if (errmgr%has_error_occurred()) return
43 
44  ! Additional Initialization
45  iopt = 0
46  if (this%get_allow_overshoot()) then
47  itask = 1
48  if (this%get_provide_all_output()) itask = 2
49  else
50  itask = 4
51  iopt = 1
52  this%m_rwork(1) = this%get_integration_limit()
53  if (this%get_provide_all_output()) itask = 5
54  end if
55  if (fcn%get_jacobian_defined()) then
56  jt = 1
57  else
58  jt = 2
59  end if
60  itol = 4
61 
62  if (this%get_limit_step_size()) then
63  iopt = 1
64  this%m_rwork(6) = this%get_max_step_size()
65  end if
66 
67  if (this%get_iteration_limit() /= 500) then
68  iopt = 1
69  this%m_iwork(6) = this%get_iteration_limit()
70  end if
71 
72  ! Determine if we are to call DLSODA or DLSODAR
73  if (useconstraints .and. ncnst > 0) then
74  call dlsodar(odepackfcn, neq, y, x, xout, itol, rtol, atol, itask, &
75  this%m_istate, iopt, this%m_rwork, lrw, this%m_iwork, liw, &
76  odepackjac, jt, odepackconstraints, ncnst, this%m_rststats)
77 
78  ! Check output condition
79  select case (this%m_istate)
80  case (3)
81  ! Root Found
82  brk = .true.
83  case (-1)
84  call errmgr%report_error("oa_step", &
85  "Excessive work has been done during this " // &
86  "integration step.", int_excessive_work_error)
87  case (-2)
88  call errmgr%report_error("oa_step", &
89  "Unachievable tolerances have been requested.", &
90  int_impractical_tolerance_error)
91  case (-3)
92  call errmgr%report_error("oa_step", &
93  "An invalid input was encountered.", &
94  int_invalid_input_error)
95  case (-4)
96  call errmgr%report_error("oa_step", &
97  "Error testing has failed repeatadly. " // &
98  "Ensure inputs are valid.", int_repeated_error_test_failure)
99  case (-5)
100  call errmgr%report_error("oa_step", "Repeated convergence " // &
101  "failures have been encountered.", int_convergence_error)
102  case (-6)
103  call errmgr%report_error("oa_step", "A solution component " // &
104  "has effectively vanished.", int_integrand_behavior_error)
105  case (-7)
106  call errmgr%report_error("oa_step", "An insufficiently " // &
107  "sized workspace array was provided.", &
108  int_invalid_input_error)
109  end select
110  else
111  call dlsoda(odepackfcn, neq, y, x, xout, itol, rtol, atol, itask, &
112  this%m_istate, iopt, this%m_rwork, lrw, this%m_iwork, liw, &
113  odepackjac, jt)
114 
115  ! Check output condition
116  select case (this%m_istate)
117  case (-1)
118  call errmgr%report_error("oa_step", &
119  "Excessive work has been done during this " // &
120  "integration step.", int_excessive_work_error)
121  case (-2)
122  call errmgr%report_error("oa_step", &
123  "Unachievable tolerances have been requested.", &
124  int_impractical_tolerance_error)
125  case (-3)
126  call errmgr%report_error("oa_step", &
127  "An invalid input was encountered.", &
128  int_invalid_input_error)
129  case (-4)
130  call errmgr%report_error("oa_step", &
131  "Error testing has failed repeatadly. " // &
132  "Ensure inputs are valid.", int_repeated_error_test_failure)
133  case (-5)
134  call errmgr%report_error("oa_step", "Repeated convergence " // &
135  "failures have been encountered.", int_convergence_error)
136  case (-6)
137  call errmgr%report_error("oa_step", "A solution component " // &
138  "has effectively vanished.", int_integrand_behavior_error)
139  case (-7)
140  call errmgr%report_error("oa_step", "An insufficiently " // &
141  "sized workspace array was provided.", &
142  int_invalid_input_error)
143  end select
144  end if
145 
146  contains
147  subroutine odepackfcn(n, x, y, dydx)
148  integer(int32), intent(in) :: n
149  real(real64), intent(in) :: x, y(n)
150  real(real64), intent(out) :: dydx(n)
151  call fcn%evaluate_ode(x, y, dydx)
152  end subroutine
153 
154  subroutine odepackjac(n, x, y, ml, mu, pd, nrowpd)
155  integer(int32), intent(in) :: n, ml, mu, nrowpd
156  real(real64), intent(in) :: x, y(n)
157  real(real64), intent(out) :: pd(nrowpd, n)
158  call fcn%evaluate_jacobian(x, y, pd)
159  end subroutine
160 
161  subroutine odepackconstraints(neq, x, y, ng, gout)
162  integer(int32), intent(in) :: neq, ng
163  real(real64), intent(in) :: x, y(neq)
164  real(real64), intent(out) :: gout(ng)
165  call fcn%evaluate_constraints(x, y, gout)
166  end subroutine
167  end function
168 
169 ! ------------------------------------------------------------------------------
170  module subroutine oa_reset_integrator(this)
171  class(ode_auto), intent(inout) :: this
172  this%m_istate = 1
173  end subroutine
174 
175 ! ------------------------------------------------------------------------------
176  module subroutine oa_init_workspace(this, liw, lrw, ncnsts, err)
177  ! Arguments
178  class(ode_auto), intent(inout) :: this
179  integer(int32), intent(in) :: liw, lrw, ncnsts
180  class(errors), intent(inout) :: err
181 
182  ! Local Variables
183  integer(int32) :: flag
184 
185  ! Process
186  flag = 0
187  if (allocated(this%m_iwork)) then
188  if (size(this%m_iwork) < liw) then
189  deallocate(this%m_iwork)
190  allocate(this%m_iwork(liw), stat = flag)
191  end if
192  else
193  allocate(this%m_iwork(liw), stat = flag)
194  end if
195 
196  if (flag == 0) then
197  if (allocated(this%m_rwork)) then
198  if (size(this%m_rwork) < lrw) then
199  deallocate(this%m_rwork)
200  allocate(this%m_rwork(lrw), stat = flag)
201  end if
202  else
203  allocate(this%m_rwork(lrw), stat = flag)
204  end if
205  end if
206 
207  if (flag == 0 .and. ncnsts > 0) then
208  if (allocated(this%m_rststats)) then
209  if (size(this%m_rststats) /= ncnsts) then
210  deallocate(this%m_rststats)
211  allocate(this%m_rststats(ncnsts), stat = flag)
212  end if
213  else
214  allocate(this%m_rststats(ncnsts), stat = flag)
215  end if
216  end if
217 
218  ! Error Checking
219  if (flag /= 0) then
220  call err%report_error("oa_init_workspace", &
221  "Insufficient memory available.", int_out_of_memory_error)
222  return
223  end if
224  end subroutine
225 
226 ! ------------------------------------------------------------------------------
227  module function oa_get_constraint_info(this) result(x)
228  ! Arguments
229  class(ode_auto), intent(in) :: this
230  logical, allocatable, dimension(:) :: x
231 
232  ! Local Variables
233  integer(int32) :: i, n
234 
235  ! Process
236  if (.not.allocated(this%m_rststats)) return
237  n = size(this%m_rststats)
238  allocate(x(n))
239  do i = 1, n
240  x(i) = this%m_rststats(i) == 1
241  end do
242  end function
243 
244 ! ------------------------------------------------------------------------------
245 end submodule
integral_core
+
diff --git a/doc/html/integral__ode__helper_8f90_source.html b/doc/html/integral__ode__helper_8f90_source.html index a1ee055..e923319 100644 --- a/doc/html/integral__ode__helper_8f90_source.html +++ b/doc/html/integral__ode__helper_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_ode_helper.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_ode_helper.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_ode_helper.f90
2 
3 submodule(integral_core) integral_ode_helper
4 contains
5 ! ------------------------------------------------------------------------------
6  module subroutine oh_init(this, neqn, fcn, jac)
7  class(ode_helper), intent(inout) :: this
8  integer(int32), intent(in) :: neqn
9  procedure(ode_fcn), pointer, intent(in) :: fcn
10  procedure(ode_jacobian), pointer, intent(in), optional :: jac
11  nullify(this%m_fcn)
12  nullify(this%m_jac)
13  this%m_count = neqn
14  this%m_fcn => fcn
15  if (present(jac)) this%m_jac => jac
16  end subroutine
17 
18 ! ------------------------------------------------------------------------------
19  pure module function oh_get_count(this) result(x)
20  class(ode_helper), intent(in) :: this
21  integer(int32) :: x
22  x = this%m_count
23  end function
24 
25 ! ------------------------------------------------------------------------------
26  pure module function oh_is_fcn_defined(this) result(x)
27  class(ode_helper), intent(in) :: this
28  logical :: x
29  x = associated(this%m_fcn)
30  end function
31 
32 ! ------------------------------------------------------------------------------
33  pure module function oh_is_jac_defined(this) result(x)
34  class(ode_helper), intent(in) :: this
35  logical :: x
36  x = associated(this%m_jac)
37  end function
38 
39 ! ------------------------------------------------------------------------------
40  module subroutine oh_define_constraints(this, n, fcn)
41  class(ode_helper), intent(inout) :: this
42  integer(int32), intent(in) :: n
43  procedure(ode_constraint), intent(in), pointer :: fcn
44  this%m_constraints = n
45  this%m_rts => fcn
46  end subroutine
47 
48 ! ------------------------------------------------------------------------------
49  pure module function oh_get_constraint_count(this) result(x)
50  class(ode_helper), intent(in) :: this
51  integer(int32) :: x
52  x = this%m_constraints
53  end function
54 
55 ! ------------------------------------------------------------------------------
56  pure module function oh_get_constraints_defined(this) result(x)
57  class(ode_helper), intent(in) :: this
58  logical :: x
59  x = associated(this%m_rts)
60  end function
61 
62 ! ------------------------------------------------------------------------------
63  module subroutine oh_eval(this, x, y, dydx)
64  class(ode_helper), intent(inout) :: this
65  real(real64), intent(in) :: x
66  real(real64), intent(in), dimension(:) :: y
67  real(real64), intent(out), dimension(:) :: dydx
68  call this%m_fcn(x, y, dydx)
69  end subroutine
70 
71 ! ------------------------------------------------------------------------------
72  module subroutine oh_eval_jac(this, x, y, jac)
73  class(ode_helper), intent(inout) :: this
74  real(real64), intent(in) :: x
75  real(real64), intent(in), dimension(:) :: y
76  real(real64), intent(out), dimension(:,:) :: jac
77  call this%m_jac(x, y, jac)
78  end subroutine
79 
80 ! ------------------------------------------------------------------------------
81  module subroutine oh_eval_constraints(this, x, y, f)
82  class(ode_helper), intent(inout) :: this
83  real(real64), intent(in) :: x
84  real(real64), intent(in), dimension(:) :: y
85  real(real64), intent(out), dimension(:) :: f
86  call this%m_rts(x, y, f)
87  end subroutine
88 
89 ! ------------------------------------------------------------------------------
90 end submodule
+
1 ! integral_ode_helper.f90
2 
3 submodule(integral_core) integral_ode_helper
4 contains
5 ! ------------------------------------------------------------------------------
6  module subroutine oh_init(this, neqn, fcn, jac)
7  class(ode_helper), intent(inout) :: this
8  integer(int32), intent(in) :: neqn
9  procedure(ode_fcn), pointer, intent(in) :: fcn
10  procedure(ode_jacobian), pointer, intent(in), optional :: jac
11  nullify(this%m_fcn)
12  nullify(this%m_jac)
13  this%m_count = neqn
14  this%m_fcn => fcn
15  if (present(jac)) this%m_jac => jac
16  end subroutine
17 
18 ! ------------------------------------------------------------------------------
19  pure module function oh_get_count(this) result(x)
20  class(ode_helper), intent(in) :: this
21  integer(int32) :: x
22  x = this%m_count
23  end function
24 
25 ! ------------------------------------------------------------------------------
26  pure module function oh_is_fcn_defined(this) result(x)
27  class(ode_helper), intent(in) :: this
28  logical :: x
29  x = associated(this%m_fcn)
30  end function
31 
32 ! ------------------------------------------------------------------------------
33  pure module function oh_is_jac_defined(this) result(x)
34  class(ode_helper), intent(in) :: this
35  logical :: x
36  x = associated(this%m_jac)
37  end function
38 
39 ! ------------------------------------------------------------------------------
40  module subroutine oh_define_constraints(this, n, fcn)
41  class(ode_helper), intent(inout) :: this
42  integer(int32), intent(in) :: n
43  procedure(ode_constraint), intent(in), pointer :: fcn
44  this%m_constraints = n
45  this%m_rts => fcn
46  end subroutine
47 
48 ! ------------------------------------------------------------------------------
49  pure module function oh_get_constraint_count(this) result(x)
50  class(ode_helper), intent(in) :: this
51  integer(int32) :: x
52  x = this%m_constraints
53  end function
54 
55 ! ------------------------------------------------------------------------------
56  pure module function oh_get_constraints_defined(this) result(x)
57  class(ode_helper), intent(in) :: this
58  logical :: x
59  x = associated(this%m_rts)
60  end function
61 
62 ! ------------------------------------------------------------------------------
63  module subroutine oh_eval(this, x, y, dydx)
64  class(ode_helper), intent(inout) :: this
65  real(real64), intent(in) :: x
66  real(real64), intent(in), dimension(:) :: y
67  real(real64), intent(out), dimension(:) :: dydx
68  call this%m_fcn(x, y, dydx)
69  end subroutine
70 
71 ! ------------------------------------------------------------------------------
72  module subroutine oh_eval_jac(this, x, y, jac)
73  class(ode_helper), intent(inout) :: this
74  real(real64), intent(in) :: x
75  real(real64), intent(in), dimension(:) :: y
76  real(real64), intent(out), dimension(:,:) :: jac
77  call this%m_jac(x, y, jac)
78  end subroutine
79 
80 ! ------------------------------------------------------------------------------
81  module subroutine oh_eval_constraints(this, x, y, f)
82  class(ode_helper), intent(inout) :: this
83  real(real64), intent(in) :: x
84  real(real64), intent(in), dimension(:) :: y
85  real(real64), intent(out), dimension(:) :: f
86  call this%m_rts(x, y, f)
87  end subroutine
88 
89 ! ------------------------------------------------------------------------------
90 end submodule
integral_core
+
diff --git a/doc/html/integral__ode__integrator_8f90_source.html b/doc/html/integral__ode__integrator_8f90_source.html index 20737ce..9fed4aa 100644 --- a/doc/html/integral__ode__integrator_8f90_source.html +++ b/doc/html/integral__ode__integrator_8f90_source.html @@ -3,9 +3,8 @@ - - -integral: /home/jason/github/integral/src/integral_ode_integrator.f90 Source File + +integral: D:/users/christopherson/Code/integral/src/integral_ode_integrator.f90 Source File @@ -15,10 +14,14 @@ + @@ -38,19 +41,39 @@ - + - - - - + +
-
1 ! integral_ode_integrator.f90
2 
3 submodule(integral_core) integral_ode_integrator
4 contains
5 ! ------------------------------------------------------------------------------
6  module function oi_integrate(this, fcnobj, x, y, err) result(rst)
7  ! Arguments
8  class(ode_integrator), intent(inout) :: this
9  class(ode_helper), intent(inout) :: fcnobj
10  real(real64), intent(in), dimension(:) :: x, y
11  class(errors), intent(inout), optional, target :: err
12  real(real64), allocatable, dimension(:,:) :: rst
13 
14  ! Local Variables
15  integer(int32) :: neqn, ncols, flag, i, n, nbuffer
16  real(real64), allocatable, dimension(:,:) :: buffer
17  real(real64), allocatable, dimension(:) :: ytemp
18  real(real64) :: xout, xi
19  class(errors), pointer :: errmgr
20  type(errors), target :: deferr
21  character(len = 256) :: errmsg
22  logical :: brk, ascending
23 
24  ! Initialization
25  if (present(err)) then
26  errmgr => err
27  else
28  errmgr => deferr
29  end if
30  neqn = fcnobj%get_equation_count()
31  ncols = neqn + 1
32  n = size(x)
33  if (this%get_provide_all_output()) then
34  nbuffer = this%get_min_buffer_size()
35  else
36  nbuffer = n
37  end if
38  allocate(ytemp(neqn), stat = flag)
39  if (flag /= 0) then
40  call errmgr%report_error("oi_integrate", &
41  "Insufficient memory available.", int_out_of_memory_error)
42  return
43  end if
44 
45  ! Quick Return
46  if (neqn <= 0) return
47 
48  ! Input Checking
49  if (.not.fcnobj%get_equations_defined()) then
50  ! ERROR: Equations undefined
51  call errmgr%report_error("oi_integrate", &
52  "The routine expected to hold the ODEs is undefined.", &
53  int_lack_of_definition_error)
54  return
55  end if
56  if (neqn /= size(y)) then
57  ! ERROR: # of equations does not match initial condition vector size
58  write(errmsg, '(AI0AI0A)') "Expected an array of size ", neqn, &
59  ", but found an array of size ", size(y), "."
60  call errmgr%report_error("oi_integrate", trim(errmsg), &
61  int_array_size_mismatch_error)
62  return
63  end if
64  if (n < 2) then
65  ! ERROR: There must be at least a starting and ending point for the
66  ! integration routine
67  end if
68  if (x(n) == x(1)) then
69  ! ERROR: No integration range
70  call errmgr%report_error("oi_integrate", &
71  "The starting and ending integration points are the same.", &
72  int_invalid_input_error)
73  return
74  end if
75 
76  ! Ensure tolerances are defined. If not, utilize defaults
77  if (allocated(this%m_rtol)) then
78  if (size(this%m_rtol) /= neqn) then
79  ! WARNING: Size mismatch in tolerance array - using defaults
80  call errmgr%report_warning("oi_integrate", &
81  "The relative tolerance array is not correctly " // &
82  "sized for the problem. Using a default tolerance " // &
83  "instead.", int_array_size_mismatch_error)
84  deallocate(this%m_rtol)
85  this%m_rtol = alloc_default_rtol(neqn)
86  end if
87  else
88  this%m_rtol = alloc_default_rtol(neqn)
89  end if
90 
91  if (allocated(this%m_atol)) then
92  if (size(this%m_rtol) /= neqn) then
93  ! WARNING: Size mismatch in tolerance array - using defaults
94  call errmgr%report_warning("oi_integrate", &
95  "The absolute tolerance array is not correctly " // &
96  "sized for the problem. Using a default tolerance " // &
97  "instead.", int_array_size_mismatch_error)
98  deallocate(this%m_atol)
99  this%m_atol = alloc_default_atol(neqn)
100  end if
101  else
102  this%m_atol = alloc_default_atol(neqn)
103  end if
104 
105  ! Additional Initialization
106  allocate(buffer(nbuffer, ncols), stat = flag)
107  if (flag /= 0) then
108  call errmgr%report_error("oi_integrate", &
109  "Insufficient memory available.", int_out_of_memory_error)
110  return
111  end if
112  ascending = x(n) > x(1)
113 
114  ! Store the initial conditions
115  buffer(1,1) = x(1)
116  buffer(1,2:ncols) = y
117 
118  ! Integrate
119  i = 1
120  if (this%get_provide_all_output()) then
121  xout = x(n)
122  call this%set_integration_limit(x(n))
123  call this%set_allow_overshoot(.false.)
124  end if
125  do
126  ! Copy the previous step's output
127  xi = buffer(i,1)
128  ytemp = buffer(i,2:ncols)
129 
130  ! Increment i
131  i = i + 1
132 
133  ! Ensure the buffer is sufficiently sized
134  if (i > size(buffer, 1)) then
135  call realloc_buffer(buffer, &
136  size(buffer, 1) + nbuffer, errmgr)
137  if (errmgr%has_error_occurred()) return
138  end if
139 
140  ! Take the next integration step
141  if (.not.this%get_provide_all_output()) xout = x(i)
142  brk = this%step(fcnobj, xi, ytemp, xout, this%m_rtol, this%m_atol, &
143  errmgr)
144  if (brk) then
145  ! Store the output, and then exit
146  buffer(i,1) = xi
147  buffer(i,2:ncols) = ytemp
148  exit
149  end if
150  if (errmgr%has_error_occurred()) return
151 
152  ! Store the output
153  buffer(i,1) = xi
154  buffer(i,2:ncols) = ytemp
155 
156  ! Break if X exceeds XOUT
157  if (ascending .and. xi >= x(n)) then
158  exit
159  else if (.not.ascending .and. xi <= x(n)) then
160  exit
161  end if
162  end do
163 
164  ! Resize the buffer to tightly fit the data, if necessary
165  rst = buffer(1:i,:)
166  end function
167 
168 ! ------------------------------------------------------------------------------
169  pure module function oi_get_use_all_output(this) result(x)
170  class(ode_integrator), intent(in) :: this
171  logical :: x
172  x = this%m_allOutput
173  end function
174 
175 ! --------------------
176  module subroutine oi_set_use_all_output(this, x)
177  class(ode_integrator), intent(inout) :: this
178  logical, intent(in) :: x
179  this%m_allOutput = x
180  end subroutine
181 
182 ! ------------------------------------------------------------------------------
183  pure module function oi_get_allow_overshoot(this) result(x)
184  class(ode_integrator), intent(in) :: this
185  logical :: x
186  x = this%m_canOvershoot
187  end function
188 
189 ! --------------------
190  module subroutine oi_set_allow_overshoot(this, x)
191  class(ode_integrator), intent(inout) :: this
192  logical, intent(in) :: x
193  this%m_canOvershoot = x
194  end subroutine
195 
196 ! ------------------------------------------------------------------------------
197  pure module function oi_get_critical_point(this) result(x)
198  class(ode_integrator), intent(in) :: this
199  real(real64) :: x
200  x = this%m_criticalPoint
201  end function
202 
203 ! --------------------
204  module subroutine oi_set_critical_point(this, x)
205  class(ode_integrator), intent(inout) :: this
206  real(real64), intent(in) :: x
207  this%m_criticalPoint = x
208  end subroutine
209 
210 ! ------------------------------------------------------------------------------
211  pure module function oi_get_min_buffer_size(this) result(x)
212  class(ode_integrator), intent(in) :: this
213  integer(int32) :: x
214  x = this%m_minBufferSize
215  end function
216 
217 ! --------------------
218  module subroutine oi_set_min_buffer_size(this, x)
219  class(ode_integrator), intent(inout) :: this
220  integer(int32), intent(in) :: x
221  this%m_minBufferSize = x
222  end subroutine
223 
224 ! ------------------------------------------------------------------------------
225  pure module function oi_get_max_step_size(this) result(x)
226  class(ode_integrator), intent(in) :: this
227  real(real64) :: x
228  x = this%m_maxStepSize
229  end function
230 
231 ! --------------------
232  module subroutine oi_set_max_step_size(this, x)
233  class(ode_integrator), intent(inout) :: this
234  real(real64), intent(in) :: x
235  this%m_maxStepSize = x
236  end subroutine
237 
238 ! ------------------------------------------------------------------------------
239  pure module function oi_get_limit_step_size(this) result(x)
240  class(ode_integrator), intent(in) :: this
241  logical :: x
242  x = this%m_limitStepSize
243  end function
244 
245 ! --------------------
246  module subroutine oi_set_limit_step_size(this, x)
247  class(ode_integrator), intent(inout) :: this
248  logical, intent(in) :: x
249  this%m_limitStepSize = x
250  end subroutine
251 
252 ! ------------------------------------------------------------------------------
253  pure module function oi_get_iteration_limit(this) result(x)
254  class(ode_integrator), intent(in) :: this
255  integer(int32) :: x
256  x = this%m_maxStepCount
257  end function
258 
259 ! --------------------
260  module subroutine oi_set_iteration_limit(this, x)
261  class(ode_integrator), intent(inout) :: this
262  integer(int32), intent(in) :: x
263  this%m_maxStepCount = x
264  end subroutine
265 
266 ! ------------------------------------------------------------------------------
267  module function oi_get_rtol(this) result(x)
268  class(ode_integrator), intent(in) :: this
269  real(real64), allocatable, dimension(:) :: x
270  x = this%m_rtol
271  end function
272 
273 ! --------------------
274  module subroutine oi_set_rtol(this, x)
275  class(ode_integrator), intent(inout) :: this
276  real(real64), intent(in), dimension(:) :: x
277  this%m_rtol = x
278  end subroutine
279 
280 ! ------------------------------------------------------------------------------
281  module function oi_get_atol(this) result(x)
282  class(ode_integrator), intent(in) :: this
283  real(real64), allocatable, dimension(:) :: x
284  x = this%m_atol
285  end function
286 
287 ! --------------------
288  module subroutine oi_set_atol(this, x)
289  class(ode_integrator), intent(inout) :: this
290  real(real64), intent(in), dimension(:) :: x
291  this%m_atol = x
292  end subroutine
293 
294 ! ******************************************************************************
295 ! PRIVATE SUBMODULE ROUTINES
296 ! ------------------------------------------------------------------------------
297  ! Establishes a default relative tolerance array.
298  function alloc_default_rtol(n) result(x)
299  integer(int32), intent(in) :: n
300  real(real64), dimension(n) :: x
301  x = 1.0d-6
302  end function
303 
304 ! ------------------------------------------------------------------------------
305  ! Establishes a default absolute tolerance array.
306  function alloc_default_atol(n) result(x)
307  integer(int32), intent(in) :: n
308  real(real64), dimension(n) :: x
309  x = 1.0d-8
310  end function
311 
312 ! ------------------------------------------------------------------------------
313  subroutine realloc_buffer(x, new_row_count, err)
314  ! Arguments
315  real(real64), intent(inout), allocatable, dimension(:,:) :: x
316  integer(int32), intent(in) :: new_row_count
317  class(errors), intent(inout) :: err
318 
319  ! Local Variables
320  integer(int32) :: oldm, n, flag
321  real(real64), allocatable, dimension(:,:) :: temp
322 
323  ! Initialization
324  oldm = size(x, 1)
325  n = size(x, 2)
326 
327  ! If oldm == new_row_count, do nothing
328  if (oldm == new_row_count) return
329 
330  ! Allocate space for a temporary array that allows for resizing of X
331  allocate(temp(oldm, n), stat = flag)
332  if (flag /= 0) then
333  call err%report_error("realloc_buffer", &
334  "Insufficient memory available.", int_out_of_memory_error)
335  return
336  end if
337  temp = x
338 
339  ! Deallocate X, and resize
340  deallocate(x)
341  allocate(x(new_row_count, n), stat = flag)
342  if (flag /= 0) then
343  call err%report_error("realloc_buffer", &
344  "Insufficient memory available.", int_out_of_memory_error)
345  return
346  end if
347 
348  ! Copy temp back into X
349  if (new_row_count > oldm) then
350  x(1:oldm,:) = temp
351  else
352  x = temp(1:new_row_count,:)
353  end if
354  end subroutine
355 
356 ! ------------------------------------------------------------------------------
357 end submodule
+
1 ! integral_ode_integrator.f90
2 
3 submodule(integral_core) integral_ode_integrator
4 contains
5 ! ------------------------------------------------------------------------------
6  module function oi_integrate(this, fcnobj, x, y, err) result(rst)
7  ! Arguments
8  class(ode_integrator), intent(inout) :: this
9  class(ode_helper), intent(inout) :: fcnobj
10  real(real64), intent(in), dimension(:) :: x, y
11  class(errors), intent(inout), optional, target :: err
12  real(real64), allocatable, dimension(:,:) :: rst
13 
14  ! Local Variables
15  integer(int32) :: neqn, ncols, flag, i, n, nbuffer
16  real(real64), allocatable, dimension(:,:) :: buffer
17  real(real64), allocatable, dimension(:) :: ytemp
18  real(real64) :: xout, xi
19  class(errors), pointer :: errmgr
20  type(errors), target :: deferr
21  character(len = 256) :: errmsg
22  logical :: brk, ascending
23 
24  ! Initialization
25  if (present(err)) then
26  errmgr => err
27  else
28  errmgr => deferr
29  end if
30  neqn = fcnobj%get_equation_count()
31  ncols = neqn + 1
32  n = size(x)
33  if (this%get_provide_all_output()) then
34  nbuffer = this%get_min_buffer_size()
35  else
36  nbuffer = n
37  end if
38  allocate(ytemp(neqn), stat = flag)
39  if (flag /= 0) then
40  call errmgr%report_error("oi_integrate", &
41  "Insufficient memory available.", int_out_of_memory_error)
42  return
43  end if
44 
45  ! Quick Return
46  if (neqn <= 0) return
47 
48  ! Input Checking
49  if (.not.fcnobj%get_equations_defined()) then
50  ! ERROR: Equations undefined
51  call errmgr%report_error("oi_integrate", &
52  "The routine expected to hold the ODEs is undefined.", &
53  int_lack_of_definition_error)
54  return
55  end if
56  if (neqn /= size(y)) then
57  ! ERROR: # of equations does not match initial condition vector size
58  write(errmsg, '(AI0AI0A)') "Expected an array of size ", neqn, &
59  ", but found an array of size ", size(y), "."
60  call errmgr%report_error("oi_integrate", trim(errmsg), &
61  int_array_size_mismatch_error)
62  return
63  end if
64  if (n < 2) then
65  ! ERROR: There must be at least a starting and ending point for the
66  ! integration routine
67  end if
68  if (x(n) == x(1)) then
69  ! ERROR: No integration range
70  call errmgr%report_error("oi_integrate", &
71  "The starting and ending integration points are the same.", &
72  int_invalid_input_error)
73  return
74  end if
75 
76  ! Ensure tolerances are defined. If not, utilize defaults
77  if (allocated(this%m_rtol)) then
78  if (size(this%m_rtol) /= neqn) then
79  ! WARNING: Size mismatch in tolerance array - using defaults
80  call errmgr%report_warning("oi_integrate", &
81  "The relative tolerance array is not correctly " // &
82  "sized for the problem. Using a default tolerance " // &
83  "instead.", int_array_size_mismatch_error)
84  deallocate(this%m_rtol)
85  this%m_rtol = alloc_default_rtol(neqn)
86  end if
87  else
88  this%m_rtol = alloc_default_rtol(neqn)
89  end if
90 
91  if (allocated(this%m_atol)) then
92  if (size(this%m_rtol) /= neqn) then
93  ! WARNING: Size mismatch in tolerance array - using defaults
94  call errmgr%report_warning("oi_integrate", &
95  "The absolute tolerance array is not correctly " // &
96  "sized for the problem. Using a default tolerance " // &
97  "instead.", int_array_size_mismatch_error)
98  deallocate(this%m_atol)
99  this%m_atol = alloc_default_atol(neqn)
100  end if
101  else
102  this%m_atol = alloc_default_atol(neqn)
103  end if
104 
105  ! Additional Initialization
106  allocate(buffer(nbuffer, ncols), stat = flag)
107  if (flag /= 0) then
108  call errmgr%report_error("oi_integrate", &
109  "Insufficient memory available.", int_out_of_memory_error)
110  return
111  end if
112  ascending = x(n) > x(1)
113 
114  ! Store the initial conditions
115  buffer(1,1) = x(1)
116  buffer(1,2:ncols) = y
117 
118  ! Integrate
119  i = 1
120  if (this%get_provide_all_output()) then
121  xout = x(n)
122  call this%set_integration_limit(x(n))
123  call this%set_allow_overshoot(.false.)
124  end if
125  do
126  ! Copy the previous step's output
127  xi = buffer(i,1)
128  ytemp = buffer(i,2:ncols)
129 
130  ! Increment i
131  i = i + 1
132 
133  ! Ensure the buffer is sufficiently sized
134  if (i > size(buffer, 1)) then
135  call realloc_buffer(buffer, &
136  size(buffer, 1) + nbuffer, errmgr)
137  if (errmgr%has_error_occurred()) return
138  end if
139 
140  ! Take the next integration step
141  if (.not.this%get_provide_all_output()) xout = x(i)
142  brk = this%step(fcnobj, xi, ytemp, xout, this%m_rtol, this%m_atol, &
143  errmgr)
144  if (brk) then
145  ! Store the output, and then exit
146  buffer(i,1) = xi
147  buffer(i,2:ncols) = ytemp
148  exit
149  end if
150  if (errmgr%has_error_occurred()) return
151 
152  ! Store the output
153  buffer(i,1) = xi
154  buffer(i,2:ncols) = ytemp
155 
156  ! Break if X exceeds XOUT
157  if (ascending .and. xi >= x(n)) then
158  exit
159  else if (.not.ascending .and. xi <= x(n)) then
160  exit
161  end if
162  end do
163 
164  ! Resize the buffer to tightly fit the data, if necessary
165  rst = buffer(1:i,:)
166  end function
167 
168 ! ------------------------------------------------------------------------------
169  pure module function oi_get_use_all_output(this) result(x)
170  class(ode_integrator), intent(in) :: this
171  logical :: x
172  x = this%m_allOutput
173  end function
174 
175 ! --------------------
176  module subroutine oi_set_use_all_output(this, x)
177  class(ode_integrator), intent(inout) :: this
178  logical, intent(in) :: x
179  this%m_allOutput = x
180  end subroutine
181 
182 ! ------------------------------------------------------------------------------
183  pure module function oi_get_allow_overshoot(this) result(x)
184  class(ode_integrator), intent(in) :: this
185  logical :: x
186  x = this%m_canOvershoot
187  end function
188 
189 ! --------------------
190  module subroutine oi_set_allow_overshoot(this, x)
191  class(ode_integrator), intent(inout) :: this
192  logical, intent(in) :: x
193  this%m_canOvershoot = x
194  end subroutine
195 
196 ! ------------------------------------------------------------------------------
197  pure module function oi_get_critical_point(this) result(x)
198  class(ode_integrator), intent(in) :: this
199  real(real64) :: x
200  x = this%m_criticalPoint
201  end function
202 
203 ! --------------------
204  module subroutine oi_set_critical_point(this, x)
205  class(ode_integrator), intent(inout) :: this
206  real(real64), intent(in) :: x
207  this%m_criticalPoint = x
208  end subroutine
209 
210 ! ------------------------------------------------------------------------------
211  pure module function oi_get_min_buffer_size(this) result(x)
212  class(ode_integrator), intent(in) :: this
213  integer(int32) :: x
214  x = this%m_minBufferSize
215  end function
216 
217 ! --------------------
218  module subroutine oi_set_min_buffer_size(this, x)
219  class(ode_integrator), intent(inout) :: this
220  integer(int32), intent(in) :: x
221  this%m_minBufferSize = x
222  end subroutine
223 
224 ! ------------------------------------------------------------------------------
225  pure module function oi_get_max_step_size(this) result(x)
226  class(ode_integrator), intent(in) :: this
227  real(real64) :: x
228  x = this%m_maxStepSize
229  end function
230 
231 ! --------------------
232  module subroutine oi_set_max_step_size(this, x)
233  class(ode_integrator), intent(inout) :: this
234  real(real64), intent(in) :: x
235  this%m_maxStepSize = x
236  end subroutine
237 
238 ! ------------------------------------------------------------------------------
239  pure module function oi_get_limit_step_size(this) result(x)
240  class(ode_integrator), intent(in) :: this
241  logical :: x
242  x = this%m_limitStepSize
243  end function
244 
245 ! --------------------
246  module subroutine oi_set_limit_step_size(this, x)
247  class(ode_integrator), intent(inout) :: this
248  logical, intent(in) :: x
249  this%m_limitStepSize = x
250  end subroutine
251 
252 ! ------------------------------------------------------------------------------
253  pure module function oi_get_iteration_limit(this) result(x)
254  class(ode_integrator), intent(in) :: this
255  integer(int32) :: x
256  x = this%m_maxStepCount
257  end function
258 
259 ! --------------------
260  module subroutine oi_set_iteration_limit(this, x)
261  class(ode_integrator), intent(inout) :: this
262  integer(int32), intent(in) :: x
263  this%m_maxStepCount = x
264  end subroutine
265 
266 ! ------------------------------------------------------------------------------
267  module function oi_get_rtol(this) result(x)
268  class(ode_integrator), intent(in) :: this
269  real(real64), allocatable, dimension(:) :: x
270  x = this%m_rtol
271  end function
272 
273 ! --------------------
274  module subroutine oi_set_rtol(this, x)
275  class(ode_integrator), intent(inout) :: this
276  real(real64), intent(in), dimension(:) :: x
277  this%m_rtol = x
278  end subroutine
279 
280 ! ------------------------------------------------------------------------------
281  module function oi_get_atol(this) result(x)
282  class(ode_integrator), intent(in) :: this
283  real(real64), allocatable, dimension(:) :: x
284  x = this%m_atol
285  end function
286 
287 ! --------------------
288  module subroutine oi_set_atol(this, x)
289  class(ode_integrator), intent(inout) :: this
290  real(real64), intent(in), dimension(:) :: x
291  this%m_atol = x
292  end subroutine
293 
294 ! ******************************************************************************
295 ! PRIVATE SUBMODULE ROUTINES
296 ! ------------------------------------------------------------------------------
297  ! Establishes a default relative tolerance array.
298  function alloc_default_rtol(n) result(x)
299  integer(int32), intent(in) :: n
300  real(real64), dimension(n) :: x
301  x = 1.0d-6
302  end function
303 
304 ! ------------------------------------------------------------------------------
305  ! Establishes a default absolute tolerance array.
306  function alloc_default_atol(n) result(x)
307  integer(int32), intent(in) :: n
308  real(real64), dimension(n) :: x
309  x = 1.0d-8
310  end function
311 
312 ! ------------------------------------------------------------------------------
313  subroutine realloc_buffer(x, new_row_count, err)
314  ! Arguments
315  real(real64), intent(inout), allocatable, dimension(:,:) :: x
316  integer(int32), intent(in) :: new_row_count
317  class(errors), intent(inout) :: err
318 
319  ! Local Variables
320  integer(int32) :: oldm, n, flag
321  real(real64), allocatable, dimension(:,:) :: temp
322 
323  ! Initialization
324  oldm = size(x, 1)
325  n = size(x, 2)
326 
327  ! If oldm == new_row_count, do nothing
328  if (oldm == new_row_count) return
329 
330  ! Allocate space for a temporary array that allows for resizing of X
331  allocate(temp(oldm, n), stat = flag)
332  if (flag /= 0) then
333  call err%report_error("realloc_buffer", &
334  "Insufficient memory available.", int_out_of_memory_error)
335  return
336  end if
337  temp = x
338 
339  ! Deallocate X, and resize
340  deallocate(x)
341  allocate(x(new_row_count, n), stat = flag)
342  if (flag /= 0) then
343  call err%report_error("realloc_buffer", &
344  "Insufficient memory available.", int_out_of_memory_error)
345  return
346  end if
347 
348  ! Copy temp back into X
349  if (new_row_count > oldm) then
350  x(1:oldm,:) = temp
351  else
352  x = temp(1:new_row_count,:)
353  end if
354  end subroutine
355 
356 ! ------------------------------------------------------------------------------
357 end submodule
integral_core
+
diff --git a/doc/html/interfaceintegral__core_1_1finite__interval__fcn-members.html b/doc/html/interfaceintegral__core_1_1finite__interval__fcn-members.html index 5ad0468..3227220 100644 --- a/doc/html/interfaceintegral__core_1_1finite__interval__fcn-members.html +++ b/doc/html/interfaceintegral__core_1_1finite__interval__fcn-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1finite__interval__fcn.html b/doc/html/interfaceintegral__core_1_1finite__interval__fcn.html index 9d12943..407fc39 100644 --- a/doc/html/interfaceintegral__core_1_1finite__interval__fcn.html +++ b/doc/html/interfaceintegral__core_1_1finite__interval__fcn.html @@ -3,8 +3,7 @@ - - + integral: integral_core::finite_interval_fcn Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/interfaceintegral__core_1_1integrand-members.html b/doc/html/interfaceintegral__core_1_1integrand-members.html index 4f1bee3..169b778 100644 --- a/doc/html/interfaceintegral__core_1_1integrand-members.html +++ b/doc/html/interfaceintegral__core_1_1integrand-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1integrand.html b/doc/html/interfaceintegral__core_1_1integrand.html index 5bb7e74..2052964 100644 --- a/doc/html/interfaceintegral__core_1_1integrand.html +++ b/doc/html/interfaceintegral__core_1_1integrand.html @@ -3,8 +3,7 @@ - - + integral: integral_core::integrand Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/interfaceintegral__core_1_1ode__constraint-members.html b/doc/html/interfaceintegral__core_1_1ode__constraint-members.html index 067014b..5abde51 100644 --- a/doc/html/interfaceintegral__core_1_1ode__constraint-members.html +++ b/doc/html/interfaceintegral__core_1_1ode__constraint-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1ode__constraint.html b/doc/html/interfaceintegral__core_1_1ode__constraint.html index f1beb39..a76b6b1 100644 --- a/doc/html/interfaceintegral__core_1_1ode__constraint.html +++ b/doc/html/interfaceintegral__core_1_1ode__constraint.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_constraint Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/interfaceintegral__core_1_1ode__fcn-members.html b/doc/html/interfaceintegral__core_1_1ode__fcn-members.html index f957777..6e0652b 100644 --- a/doc/html/interfaceintegral__core_1_1ode__fcn-members.html +++ b/doc/html/interfaceintegral__core_1_1ode__fcn-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1ode__fcn.html b/doc/html/interfaceintegral__core_1_1ode__fcn.html index fea564f..92fc373 100644 --- a/doc/html/interfaceintegral__core_1_1ode__fcn.html +++ b/doc/html/interfaceintegral__core_1_1ode__fcn.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_fcn Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/interfaceintegral__core_1_1ode__integrator__interface-members.html b/doc/html/interfaceintegral__core_1_1ode__integrator__interface-members.html index 5cdc832..09ac0f2 100644 --- a/doc/html/interfaceintegral__core_1_1ode__integrator__interface-members.html +++ b/doc/html/interfaceintegral__core_1_1ode__integrator__interface-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1ode__integrator__interface.html b/doc/html/interfaceintegral__core_1_1ode__integrator__interface.html index 31aa3e7..ac8a42d 100644 --- a/doc/html/interfaceintegral__core_1_1ode__integrator__interface.html +++ b/doc/html/interfaceintegral__core_1_1ode__integrator__interface.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_integrator_interface Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/interfaceintegral__core_1_1ode__integrator__reset-members.html b/doc/html/interfaceintegral__core_1_1ode__integrator__reset-members.html index 49f60d5..b53ba3d 100644 --- a/doc/html/interfaceintegral__core_1_1ode__integrator__reset-members.html +++ b/doc/html/interfaceintegral__core_1_1ode__integrator__reset-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1ode__integrator__reset.html b/doc/html/interfaceintegral__core_1_1ode__integrator__reset.html index e93f162..e5b2be8 100644 --- a/doc/html/interfaceintegral__core_1_1ode__integrator__reset.html +++ b/doc/html/interfaceintegral__core_1_1ode__integrator__reset.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_integrator_reset Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/interfaceintegral__core_1_1ode__jacobian-members.html b/doc/html/interfaceintegral__core_1_1ode__jacobian-members.html index daf4637..ef3c124 100644 --- a/doc/html/interfaceintegral__core_1_1ode__jacobian-members.html +++ b/doc/html/interfaceintegral__core_1_1ode__jacobian-members.html @@ -3,8 +3,7 @@ - - + integral: Member List @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
diff --git a/doc/html/interfaceintegral__core_1_1ode__jacobian.html b/doc/html/interfaceintegral__core_1_1ode__jacobian.html index 5ef282d..bcfbabe 100644 --- a/doc/html/interfaceintegral__core_1_1ode__jacobian.html +++ b/doc/html/interfaceintegral__core_1_1ode__jacobian.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_jacobian Interface Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +

The documentation for this interface was generated from the following file:
diff --git a/doc/html/jquery.js b/doc/html/jquery.js index f5343ed..1f4d0b4 100644 --- a/doc/html/jquery.js +++ b/doc/html/jquery.js @@ -65,23 +65,4 @@ Released under MIT license. https://raw.github.com/stevenbenner/jquery-powertip/master/LICENSE.txt */ -(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{a(jQuery)}}(function(k){var A=k(document),s=k(window),w=k("body");var n="displayController",e="hasActiveHover",d="forcedOpen",u="hasMouseMove",f="mouseOnToPopup",g="originalTitle",y="powertip",o="powertipjq",l="powertiptarget",E=180/Math.PI;var c={isTipOpen:false,isFixedTipOpen:false,isClosing:false,tipOpenImminent:false,activeHover:null,currentX:0,currentY:0,previousX:0,previousY:0,desyncTimeout:null,mouseTrackingActive:false,delayInProgress:false,windowWidth:0,windowHeight:0,scrollTop:0,scrollLeft:0};var p={none:0,top:1,bottom:2,left:4,right:8};k.fn.powerTip=function(F,N){if(!this.length){return this}if(k.type(F)==="string"&&k.powerTip[F]){return k.powerTip[F].call(this,this,N)}var O=k.extend({},k.fn.powerTip.defaults,F),G=new x(O);h();this.each(function M(){var R=k(this),Q=R.data(y),P=R.data(o),T=R.data(l),S;if(R.data(n)){k.powerTip.destroy(R)}S=R.attr("title");if(!Q&&!T&&!P&&S){R.data(y,S);R.data(g,S);R.removeAttr("title")}R.data(n,new t(R,O,G))});if(!O.manual){this.on({"mouseenter.powertip":function J(P){k.powerTip.show(this,P)},"mouseleave.powertip":function L(){k.powerTip.hide(this)},"focus.powertip":function K(){k.powerTip.show(this)},"blur.powertip":function H(){k.powerTip.hide(this,true)},"keydown.powertip":function I(P){if(P.keyCode===27){k.powerTip.hide(this,true)}}})}return this};k.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false};k.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se","n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};k.powerTip={show:function z(F,G){if(G){i(G);c.previousX=G.pageX;c.previousY=G.pageY;k(F).data(n).show()}else{k(F).first().data(n).show(true,true)}return F},reposition:function r(F){k(F).first().data(n).resetPosition();return F},hide:function D(G,F){if(G){k(G).first().data(n).hide(F)}else{if(c.activeHover){c.activeHover.data(n).hide(true)}}return G},destroy:function C(G){k(G).off(".powertip").each(function F(){var I=k(this),H=[g,n,e,d];if(I.data(g)){I.attr("title",I.data(g));H.push(y)}I.removeData(H)});return G}};k.powerTip.showTip=k.powerTip.show;k.powerTip.closeTip=k.powerTip.hide;function b(){var F=this;F.top="auto";F.left="auto";F.right="auto";F.bottom="auto";F.set=function(H,G){if(k.isNumeric(G)){F[H]=Math.round(G)}}}function t(K,N,F){var J=null;function L(P,Q){M();if(!K.data(e)){if(!P){c.tipOpenImminent=true;J=setTimeout(function O(){J=null;I()},N.intentPollInterval)}else{if(Q){K.data(d,true)}F.showTip(K)}}}function G(P){M();c.tipOpenImminent=false;if(K.data(e)){K.data(d,false);if(!P){c.delayInProgress=true;J=setTimeout(function O(){J=null;F.hideTip(K);c.delayInProgress=false},N.closeDelay)}else{F.hideTip(K)}}}function I(){var Q=Math.abs(c.previousX-c.currentX),O=Math.abs(c.previousY-c.currentY),P=Q+O;if(P",{id:Q.popupId});if(w.length===0){w=k("body")}w.append(O)}if(Q.followMouse){if(!O.data(u)){A.on("mousemove",M);s.on("scroll",M);O.data(u,true)}}if(Q.mouseOnToPopup){O.on({mouseenter:function L(){if(O.data(f)){if(c.activeHover){c.activeHover.data(n).cancel()}}},mouseleave:function N(){if(c.activeHover){c.activeHover.data(n).hide()}}})}function I(S){S.data(e,true);O.queue(function R(T){H(S);T()})}function H(S){var U;if(!S.data(e)){return}if(c.isTipOpen){if(!c.isClosing){K(c.activeHover)}O.delay(100).queue(function R(V){H(S);V()});return}S.trigger("powerTipPreRender");U=B(S);if(U){O.empty().append(U)}else{return}S.trigger("powerTipRender");c.activeHover=S;c.isTipOpen=true;O.data(f,Q.mouseOnToPopup);if(!Q.followMouse){G(S);c.isFixedTipOpen=true}else{M()}O.fadeIn(Q.fadeInTime,function T(){if(!c.desyncTimeout){c.desyncTimeout=setInterval(J,500)}S.trigger("powerTipOpen")})}function K(R){c.isClosing=true;c.activeHover=null;c.isTipOpen=false;c.desyncTimeout=clearInterval(c.desyncTimeout);R.data(e,false);R.data(d,false);O.fadeOut(Q.fadeOutTime,function S(){var T=new b();c.isClosing=false;c.isFixedTipOpen=false;O.removeClass();T.set("top",c.currentY+Q.offset);T.set("left",c.currentX+Q.offset);O.css(T);R.trigger("powerTipClose")})}function M(){if(!c.isFixedTipOpen&&(c.isTipOpen||(c.tipOpenImminent&&O.data(u)))){var R=O.outerWidth(),V=O.outerHeight(),U=new b(),S,T;U.set("top",c.currentY+Q.offset);U.set("left",c.currentX+Q.offset);S=m(U,R,V);if(S!==p.none){T=a(S);if(T===1){if(S===p.right){U.set("left",c.windowWidth-R)}else{if(S===p.bottom){U.set("top",c.scrollTop+c.windowHeight-V)}}}else{U.set("left",c.currentX-R-Q.offset);U.set("top",c.currentY-V-Q.offset)}}O.css(U)}}function G(S){var R,T;if(Q.smartPlacement){R=k.fn.powerTip.smartPlacementLists[Q.placement];k.each(R,function(U,W){var V=m(F(S,W),O.outerWidth(),O.outerHeight());T=W;if(V===p.none){return false}})}else{F(S,Q.placement);T=Q.placement}O.addClass(T)}function F(U,T){var R=0,S,W,V=new b();V.set("top",0);V.set("left",0);O.css(V);do{S=O.outerWidth();W=O.outerHeight();V=P.compute(U,T,S,W,Q.offset);O.css(V)}while(++R<=5&&(S!==O.outerWidth()||W!==O.outerHeight()));return V}function J(){var R=false;if(c.isTipOpen&&!c.isClosing&&!c.delayInProgress){if(c.activeHover.data(e)===false||c.activeHover.is(":disabled")){R=true}else{if(!v(c.activeHover)&&!c.activeHover.is(":focus")&&!c.activeHover.data(d)){if(O.data(f)){if(!v(O)){R=true}}else{R=true}}}if(R){K(c.activeHover)}}}this.showTip=I;this.hideTip=K;this.resetPosition=G}function q(F){return window.SVGElement&&F[0] instanceof SVGElement}function h(){if(!c.mouseTrackingActive){c.mouseTrackingActive=true;k(function H(){c.scrollLeft=s.scrollLeft();c.scrollTop=s.scrollTop();c.windowWidth=s.width();c.windowHeight=s.height()});A.on("mousemove",i);s.on({resize:function G(){c.windowWidth=s.width();c.windowHeight=s.height()},scroll:function F(){var I=s.scrollLeft(),J=s.scrollTop();if(I!==c.scrollLeft){c.currentX+=I-c.scrollLeft;c.scrollLeft=I}if(J!==c.scrollTop){c.currentY+=J-c.scrollTop;c.scrollTop=J}}})}}function i(F){c.currentX=F.pageX;c.currentY=F.pageY}function v(F){var H=F.offset(),J=F[0].getBoundingClientRect(),I=J.right-J.left,G=J.bottom-J.top;return c.currentX>=H.left&&c.currentX<=H.left+I&&c.currentY>=H.top&&c.currentY<=H.top+G}function B(I){var G=I.data(y),F=I.data(o),K=I.data(l),H,J;if(G){if(k.isFunction(G)){G=G.call(I[0])}J=G}else{if(F){if(k.isFunction(F)){F=F.call(I[0])}if(F.length>0){J=F.clone(true,true)}}else{if(K){H=k("#"+K);if(H.length>0){J=H.html()}}}}return J}function m(M,L,K){var G=c.scrollTop,J=c.scrollLeft,I=G+c.windowHeight,F=J+c.windowWidth,H=p.none;if(M.topI||Math.abs(M.bottom-c.windowHeight)>I){H|=p.bottom}if(M.leftF){H|=p.left}if(M.left+L>F||M.right1){return}h.preventDefault();var j=h.originalEvent.changedTouches[0],g=document.createEvent("MouseEvents");g.initMouseEvent(i,true,true,window,1,j.screenX,j.screenY,j.clientX,j.clientY,false,false,false,false,0,null);h.target.dispatchEvent(g)}d._touchStart=function(h){var g=this;if(a||!g._mouseCapture(h.originalEvent.changedTouches[0])){return}a=true;g._touchMoved=false;e(h,"mouseover");e(h,"mousemove");e(h,"mousedown")};d._touchMove=function(g){if(!a){return}this._touchMoved=true;e(g,"mousemove")};d._touchEnd=function(g){if(!a){return}e(g,"mouseup");e(g,"mouseout");if(!this._touchMoved){e(g,"click")}a=false};d._mouseInit=function(){var g=this;g.element.bind({touchstart:b.proxy(g,"_touchStart"),touchmove:b.proxy(g,"_touchMove"),touchend:b.proxy(g,"_touchEnd")});f.call(g)};d._mouseDestroy=function(){var g=this;g.element.unbind({touchstart:b.proxy(g,"_touchStart"),touchmove:b.proxy(g,"_touchMove"),touchend:b.proxy(g,"_touchEnd")});c.call(g)}})(jQuery);/*! - * SmartMenus jQuery Plugin - v1.0.0 - January 27, 2016 - * http://www.smartmenus.org/ - * - * Copyright Vasil Dinkov, Vadikom Web Ltd. - * http://vadikom.com - * - * Licensed MIT - */ -(function(a){if(typeof define==="function"&&define.amd){define(["jquery"],a)}else{if(typeof module==="object"&&typeof module.exports==="object"){module.exports=a(require("jquery"))}else{a(jQuery)}}}(function(a){var b=[],e=!!window.createPopup,f=false,d="ontouchstart" in window,h=false,g=window.requestAnimationFrame||function(l){return setTimeout(l,1000/60)},c=window.cancelAnimationFrame||function(l){clearTimeout(l)};function k(m){var n=".smartmenus_mouse";if(!h&&!m){var o=true,l=null;a(document).bind(i([["mousemove",function(s){var t={x:s.pageX,y:s.pageY,timeStamp:new Date().getTime()};if(l){var q=Math.abs(l.x-t.x),p=Math.abs(l.y-t.y);if((q>0||p>0)&&q<=2&&p<=2&&t.timeStamp-l.timeStamp<=300){f=true;if(o){var r=a(s.target).closest("a");if(r.is("a")){a.each(b,function(){if(a.contains(this.$root[0],r[0])){this.itemEnter({currentTarget:r[0]});return false}})}o=false}}}l=t}],[d?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut",function(p){if(j(p.originalEvent)){f=false}}]],n));h=true}else{if(h&&m){a(document).unbind(n);h=false}}}function j(l){return !/^(4|mouse)$/.test(l.pointerType)}function i(l,n){if(!n){n=""}var m={};a.each(l,function(o,p){m[p[0].split(" ").join(n+" ")+n]=p[1]});return m}a.SmartMenus=function(m,l){this.$root=a(m);this.opts=l;this.rootId="";this.accessIdPrefix="";this.$subArrow=null;this.activatedItems=[];this.visibleSubMenus=[];this.showTimeout=0;this.hideTimeout=0;this.scrollTimeout=0;this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.idInc=0;this.$firstLink=null;this.$firstSub=null;this.disabled=false;this.$disableOverlay=null;this.$touchScrollingSub=null;this.cssTransforms3d="perspective" in m.style||"webkitPerspective" in m.style;this.wasCollapsible=false;this.init()};a.extend(a.SmartMenus,{hideAll:function(){a.each(b,function(){this.menuHideAll()})},destroy:function(){while(b.length){b[0].destroy()}k(true)},prototype:{init:function(n){var l=this;if(!n){b.push(this);this.rootId=(new Date().getTime()+Math.random()+"").replace(/\D/g,"");this.accessIdPrefix="sm-"+this.rootId+"-";if(this.$root.hasClass("sm-rtl")){this.opts.rightToLeftSubMenus=true}var r=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).bind(i([["mouseover focusin",a.proxy(this.rootOver,this)],["mouseout focusout",a.proxy(this.rootOut,this)],["keydown",a.proxy(this.rootKeyDown,this)]],r)).delegate("a",i([["mouseenter",a.proxy(this.itemEnter,this)],["mouseleave",a.proxy(this.itemLeave,this)],["mousedown",a.proxy(this.itemDown,this)],["focus",a.proxy(this.itemFocus,this)],["blur",a.proxy(this.itemBlur,this)],["click",a.proxy(this.itemClick,this)]],r));r+=this.rootId;if(this.opts.hideOnClick){a(document).bind(i([["touchstart",a.proxy(this.docTouchStart,this)],["touchmove",a.proxy(this.docTouchMove,this)],["touchend",a.proxy(this.docTouchEnd,this)],["click",a.proxy(this.docClick,this)]],r))}a(window).bind(i([["resize orientationchange",a.proxy(this.winResize,this)]],r));if(this.opts.subIndicators){this.$subArrow=a("").addClass("sub-arrow");if(this.opts.subIndicatorsText){this.$subArrow.html(this.opts.subIndicatorsText)}}k()}this.$firstSub=this.$root.find("ul").each(function(){l.menuInit(a(this))}).eq(0);this.$firstLink=this.$root.find("a").eq(0);if(this.opts.markCurrentItem){var p=/(index|default)\.[^#\?\/]*/i,m=/#.*/,q=window.location.href.replace(p,""),o=q.replace(m,"");this.$root.find("a").each(function(){var s=this.href.replace(p,""),t=a(this);if(s==q||s==o){t.addClass("current");if(l.opts.markCurrentTree){t.parentsUntil("[data-smartmenus-id]","ul").each(function(){a(this).dataSM("parent-a").addClass("current")})}}})}this.wasCollapsible=this.isCollapsible()},destroy:function(m){if(!m){var n=".smartmenus";this.$root.removeData("smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").unbind(n).undelegate(n);n+=this.rootId;a(document).unbind(n);a(window).unbind(n);if(this.opts.subIndicators){this.$subArrow=null}}this.menuHideAll();var l=this;this.$root.find("ul").each(function(){var o=a(this);if(o.dataSM("scroll-arrows")){o.dataSM("scroll-arrows").remove()}if(o.dataSM("shown-before")){if(l.opts.subMenusMinWidth||l.opts.subMenusMaxWidth){o.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap")}if(o.dataSM("scroll-arrows")){o.dataSM("scroll-arrows").remove()}o.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})}if((o.attr("id")||"").indexOf(l.accessIdPrefix)==0){o.removeAttr("id")}}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("ie-shim").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded");this.$root.find("a.has-submenu").each(function(){var o=a(this);if(o.attr("id").indexOf(l.accessIdPrefix)==0){o.removeAttr("id")}}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub");if(this.opts.subIndicators){this.$root.find("span.sub-arrow").remove()}if(this.opts.markCurrentItem){this.$root.find("a.current").removeClass("current")}if(!m){this.$root=null;this.$firstLink=null;this.$firstSub=null;if(this.$disableOverlay){this.$disableOverlay.remove();this.$disableOverlay=null}b.splice(a.inArray(this,b),1)}},disable:function(l){if(!this.disabled){this.menuHideAll();if(!l&&!this.opts.isPopup&&this.$root.is(":visible")){var m=this.$root.offset();this.$disableOverlay=a('
').css({position:"absolute",top:m.top,left:m.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(true),opacity:0}).appendTo(document.body)}this.disabled=true}},docClick:function(l){if(this.$touchScrollingSub){this.$touchScrollingSub=null;return}if(this.visibleSubMenus.length&&!a.contains(this.$root[0],l.target)||a(l.target).is("a")){this.menuHideAll()}},docTouchEnd:function(m){if(!this.lastTouch){return}if(this.visibleSubMenus.length&&(this.lastTouch.x2===undefined||this.lastTouch.x1==this.lastTouch.x2)&&(this.lastTouch.y2===undefined||this.lastTouch.y1==this.lastTouch.y2)&&(!this.lastTouch.target||!a.contains(this.$root[0],this.lastTouch.target))){if(this.hideTimeout){clearTimeout(this.hideTimeout);this.hideTimeout=0}var l=this;this.hideTimeout=setTimeout(function(){l.menuHideAll()},350)}this.lastTouch=null},docTouchMove:function(m){if(!this.lastTouch){return}var l=m.originalEvent.touches[0];this.lastTouch.x2=l.pageX;this.lastTouch.y2=l.pageY},docTouchStart:function(m){var l=m.originalEvent.touches[0];this.lastTouch={x1:l.pageX,y1:l.pageY,target:l.target}},enable:function(){if(this.disabled){if(this.$disableOverlay){this.$disableOverlay.remove();this.$disableOverlay=null}this.disabled=false}},getClosestMenu:function(m){var l=a(m).closest("ul");while(l.dataSM("in-mega")){l=l.parent().closest("ul")}return l[0]||null},getHeight:function(l){return this.getOffset(l,true)},getOffset:function(n,l){var m;if(n.css("display")=="none"){m={position:n[0].style.position,visibility:n[0].style.visibility};n.css({position:"absolute",visibility:"hidden"}).show()}var o=n[0].getBoundingClientRect&&n[0].getBoundingClientRect(),p=o&&(l?o.height||o.bottom-o.top:o.width||o.right-o.left);if(!p&&p!==0){p=l?n[0].offsetHeight:n[0].offsetWidth}if(m){n.hide().css(m)}return p},getStartZIndex:function(l){var m=parseInt(this[l?"$root":"$firstSub"].css("z-index"));if(!l&&isNaN(m)){m=parseInt(this.$root.css("z-index"))}return !isNaN(m)?m:1},getTouchPoint:function(l){return l.touches&&l.touches[0]||l.changedTouches&&l.changedTouches[0]||l},getViewport:function(l){var m=l?"Height":"Width",o=document.documentElement["client"+m],n=window["inner"+m];if(n){o=Math.min(o,n)}return o},getViewportHeight:function(){return this.getViewport(true)},getViewportWidth:function(){return this.getViewport()},getWidth:function(l){return this.getOffset(l)},handleEvents:function(){return !this.disabled&&this.isCSSOn()},handleItemEvents:function(l){return this.handleEvents()&&!this.isLinkInMegaMenu(l)},isCollapsible:function(){return this.$firstSub.css("position")=="static"},isCSSOn:function(){return this.$firstLink.css("display")=="block"},isFixed:function(){var l=this.$root.css("position")=="fixed";if(!l){this.$root.parentsUntil("body").each(function(){if(a(this).css("position")=="fixed"){l=true;return false}})}return l},isLinkInMegaMenu:function(l){return a(this.getClosestMenu(l[0])).hasClass("mega-menu")},isTouchMode:function(){return !f||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(p,l){var n=p.closest("ul"),q=n.dataSM("level");if(q>1&&(!this.activatedItems[q-2]||this.activatedItems[q-2][0]!=n.dataSM("parent-a")[0])){var m=this;a(n.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(n).each(function(){m.itemActivate(a(this).dataSM("parent-a"))})}if(!this.isCollapsible()||l){this.menuHideSubMenus(!this.activatedItems[q-1]||this.activatedItems[q-1][0]!=p[0]?q-1:q)}this.activatedItems[q-1]=p;if(this.$root.triggerHandler("activate.smapi",p[0])===false){return}var o=p.dataSM("sub");if(o&&(this.isTouchMode()||(!this.opts.showOnClick||this.clickActivated))){this.menuShow(o)}},itemBlur:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}this.$root.triggerHandler("blur.smapi",l[0])},itemClick:function(o){var n=a(o.currentTarget);if(!this.handleItemEvents(n)){return}if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==n.closest("ul")[0]){this.$touchScrollingSub=null;o.stopPropagation();return false}if(this.$root.triggerHandler("click.smapi",n[0])===false){return false}var p=a(o.target).is("span.sub-arrow"),m=n.dataSM("sub"),l=m?m.dataSM("level")==2:false;if(m&&!m.is(":visible")){if(this.opts.showOnClick&&l){this.clickActivated=true}this.itemActivate(n);if(m.is(":visible")){this.focusActivated=true;return false}}else{if(this.isCollapsible()&&p){this.itemActivate(n);this.menuHide(m);return false}}if(this.opts.showOnClick&&l||n.hasClass("disabled")||this.$root.triggerHandler("select.smapi",n[0])===false){return false}},itemDown:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}l.dataSM("mousedown",true)},itemEnter:function(n){var m=a(n.currentTarget);if(!this.handleItemEvents(m)){return}if(!this.isTouchMode()){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}var l=this;this.showTimeout=setTimeout(function(){l.itemActivate(m)},this.opts.showOnClick&&m.closest("ul").dataSM("level")==1?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",m[0])},itemFocus:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}if(this.focusActivated&&(!this.isTouchMode()||!l.dataSM("mousedown"))&&(!this.activatedItems.length||this.activatedItems[this.activatedItems.length-1][0]!=l[0])){this.itemActivate(l,true)}this.$root.triggerHandler("focus.smapi",l[0])},itemLeave:function(m){var l=a(m.currentTarget);if(!this.handleItemEvents(l)){return}if(!this.isTouchMode()){l[0].blur();if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}}l.removeDataSM("mousedown");this.$root.triggerHandler("mouseleave.smapi",l[0])},menuHide:function(m){if(this.$root.triggerHandler("beforehide.smapi",m[0])===false){return}m.stop(true,true);if(m.css("display")!="none"){var l=function(){m.css("z-index","")};if(this.isCollapsible()){if(this.opts.collapsibleHideFunction){this.opts.collapsibleHideFunction.call(this,m,l)}else{m.hide(this.opts.collapsibleHideDuration,l)}}else{if(this.opts.hideFunction){this.opts.hideFunction.call(this,m,l)}else{m.hide(this.opts.hideDuration,l)}}if(m.dataSM("ie-shim")){m.dataSM("ie-shim").remove().css({"-webkit-transform":"",transform:""})}if(m.dataSM("scroll")){this.menuScrollStop(m);m.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).unbind(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()}m.dataSM("parent-a").removeClass("highlighted").attr("aria-expanded","false");m.attr({"aria-expanded":"false","aria-hidden":"true"});var n=m.dataSM("level");this.activatedItems.splice(n-1,1);this.visibleSubMenus.splice(a.inArray(m,this.visibleSubMenus),1);this.$root.triggerHandler("hide.smapi",m[0])}},menuHideAll:function(){if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=0}var m=this.opts.isPopup?1:0;for(var l=this.visibleSubMenus.length-1;l>=m;l--){this.menuHide(this.visibleSubMenus[l])}if(this.opts.isPopup){this.$root.stop(true,true);if(this.$root.is(":visible")){if(this.opts.hideFunction){this.opts.hideFunction.call(this,this.$root)}else{this.$root.hide(this.opts.hideDuration)}if(this.$root.dataSM("ie-shim")){this.$root.dataSM("ie-shim").remove()}}}this.activatedItems=[];this.visibleSubMenus=[];this.clickActivated=false;this.focusActivated=false;this.zIndexInc=0;this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(n){for(var l=this.activatedItems.length-1;l>=n;l--){var m=this.activatedItems[l].dataSM("sub");if(m){this.menuHide(m)}}},menuIframeShim:function(l){if(e&&this.opts.overlapControlsInIE&&!l.dataSM("ie-shim")){l.dataSM("ie-shim",a(" +
+ +
+ +
+
integral_core Module Reference
+
+
+ +

integral_core +More...

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Data Types

type  adaptive_integrator
 Defines an integrator that uses an adaptive Gauss-Kronrod method to compute the integral of a function of one variable over a finite interval. More...
 
interface  finite_interval_fcn
 Defines the signature of a routine used to integrate a function of one variable over a finite interval. More...
 
type  finite_interval_integrator
 A type that defines an integrator meant to operate on integrands over a finite region. More...
 
interface  integrand
 Defines a function of one variable to be integrated. More...
 
type  integration_behavior
 Provides information regarding the behavior of an integrator. More...
 
type  integrator_base
 Defines a base type for integrator types. More...
 
type  nonadaptive_integrator
 Defines an integrator that uses a non-adaptive Gauss-Kronrod method to compute the integral of a function of one variable over a finite interval. More...
 
type  ode_auto
 Defines an integrator for systems of first order ODEs that is capable of switching between an Adams method and a BDF method automatically. This integrator is able to handle both stiff and non-stiff systems of equations. More...
 
interface  ode_constraint
 Defines a routine capable of describing constraints on a system of ODEs of N variables exposed to M constraints. More...
 
interface  ode_fcn
 Defines a routine containing a system of first order ODEs. More...
 
type  ode_helper
 Defines a type used to pass information regarding the ODEs to the solver. More...
 
type  ode_integrator
 
interface  ode_integrator_interface
 Defines a routine for computing a single integration step in the direction of xout. More...
 
interface  ode_integrator_reset
 Resets the state of the integrator. More...
 
interface  ode_jacobian
 Defines a routine capable of computing the Jacobian matrix of a system of N first order ODEs of N variables. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Variables

+integer(int32), parameter, public int_out_of_memory_error = 1
 An error flag indicating insufficient memory.
 
+integer(int32), parameter, public int_count_exceeded_error = 2
 An error flag indicates a specific parameter count has been exceeded.
 
+integer(int32), parameter, public int_round_off_error = 3
 An error flag indicating round off error has become an issue.
 
+integer(int32), parameter, public int_integrand_behavior_error = 4
 An error flag indicating difficult integrand behavior.
 
+integer(int32), parameter, public int_convergence_error = 5
 An error flag indicating convergence issues.
 
+integer(int32), parameter, public int_divergent_error = 6
 An error flag indicating divergent behavior.
 
+integer(int32), parameter, public int_invalid_input_error = 7
 An error flag indicating an invalid input.
 
+integer(int32), parameter, public int_lack_of_definition_error = 8
 An error flag denoting a lack of definition.
 
+integer(int32), parameter, public int_array_size_mismatch_error = 9
 An error indicating an inappropriately sized array.
 
+integer(int32), parameter, public int_excessive_work_error = 10
 An error indicating the too many iterations have been performed suggesting that excessive amounts of work are required to continue the solution process.
 
+integer(int32), parameter, public int_impractical_tolerance_error = 11
 An error indicating that the user-defined tolerances are too stringent to be practical for the problem at hand.
 
+integer(int32), parameter, public int_repeated_error_test_failure = 12
 An error that occurs if integrator error tests fail repeatadly.
 
+integer(int32), parameter, public int_15_point_rule = 15
 Defines a 15-point Gauss-Kronrod integration rule.
 
+integer(int32), parameter, public int_21_point_rule = 21
 Defines a 21-point Gauss-Kronrod integration rule.
 
+integer(int32), parameter, public int_31_point_rule = 31
 Defines a 31-point Gauss-Kronrod integration rule.
 
+integer(int32), parameter, public int_41_point_rule = 41
 Defines a 41-point Gauss-Kronrod integration rule.
 
+integer(int32), parameter, public int_51_point_rule = 51
 Defines a 51-point Gauss-Kronrod integration rule.
 
+integer(int32), parameter, public int_61_point_rule = 61
 Defines a 61-point Gauss-Kronrod integration rule.
 
+

Detailed Description

+

integral_core

+
Purpose
Provides types and routines allowing for the integration of functions and systems of ordinary differential equations.
+
+ + + + + diff --git a/doc/html/namespaceintegral__core.js b/doc/html/namespaceintegral__core.js new file mode 100644 index 0000000..3bd0d97 --- /dev/null +++ b/doc/html/namespaceintegral__core.js @@ -0,0 +1,18 @@ +var namespaceintegral__core = +[ + [ "adaptive_integrator", "structintegral__core_1_1adaptive__integrator.html", "structintegral__core_1_1adaptive__integrator" ], + [ "finite_interval_fcn", "interfaceintegral__core_1_1finite__interval__fcn.html", "interfaceintegral__core_1_1finite__interval__fcn" ], + [ "finite_interval_integrator", "structintegral__core_1_1finite__interval__integrator.html", "structintegral__core_1_1finite__interval__integrator" ], + [ "integrand", "interfaceintegral__core_1_1integrand.html", "interfaceintegral__core_1_1integrand" ], + [ "integration_behavior", "structintegral__core_1_1integration__behavior.html", "structintegral__core_1_1integration__behavior" ], + [ "integrator_base", "structintegral__core_1_1integrator__base.html", "structintegral__core_1_1integrator__base" ], + [ "nonadaptive_integrator", "structintegral__core_1_1nonadaptive__integrator.html", "structintegral__core_1_1nonadaptive__integrator" ], + [ "ode_auto", "structintegral__core_1_1ode__auto.html", "structintegral__core_1_1ode__auto" ], + [ "ode_constraint", "interfaceintegral__core_1_1ode__constraint.html", "interfaceintegral__core_1_1ode__constraint" ], + [ "ode_fcn", "interfaceintegral__core_1_1ode__fcn.html", "interfaceintegral__core_1_1ode__fcn" ], + [ "ode_helper", "structintegral__core_1_1ode__helper.html", "structintegral__core_1_1ode__helper" ], + [ "ode_integrator", "structintegral__core_1_1ode__integrator.html", "structintegral__core_1_1ode__integrator" ], + [ "ode_integrator_interface", "interfaceintegral__core_1_1ode__integrator__interface.html", "interfaceintegral__core_1_1ode__integrator__interface" ], + [ "ode_integrator_reset", "interfaceintegral__core_1_1ode__integrator__reset.html", "interfaceintegral__core_1_1ode__integrator__reset" ], + [ "ode_jacobian", "interfaceintegral__core_1_1ode__jacobian.html", "interfaceintegral__core_1_1ode__jacobian" ] +]; \ No newline at end of file diff --git a/doc/html/namespacemembers.html b/doc/html/namespacemembers.html new file mode 100644 index 0000000..c8dfef4 --- /dev/null +++ b/doc/html/namespacemembers.html @@ -0,0 +1,181 @@ + + + + + + +integral: Module Members + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
Here is a list of all documented module members with links to the modules they belong to:
+
+
+ + + + diff --git a/doc/html/namespacemembers_vars.html b/doc/html/namespacemembers_vars.html new file mode 100644 index 0000000..61742c2 --- /dev/null +++ b/doc/html/namespacemembers_vars.html @@ -0,0 +1,181 @@ + + + + + + +integral: Module Members + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
+ + + + diff --git a/doc/html/namespaces.html b/doc/html/namespaces.html new file mode 100644 index 0000000..68b9906 --- /dev/null +++ b/doc/html/namespaces.html @@ -0,0 +1,128 @@ + + + + + + +integral: Modules List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
Modules List
+
+
+
Here is a list of all documented modules with brief descriptions:
+
+
+ + + + diff --git a/doc/html/namespaces.js b/doc/html/namespaces.js new file mode 100644 index 0000000..222b973 --- /dev/null +++ b/doc/html/namespaces.js @@ -0,0 +1,4 @@ +var namespaces = +[ + [ "integral_core", "namespaceintegral__core.html", null ] +]; \ No newline at end of file diff --git a/doc/html/navtree.css b/doc/html/navtree.css index 0cc7e77..1a868b3 100644 --- a/doc/html/navtree.css +++ b/doc/html/navtree.css @@ -94,11 +94,8 @@ } .ui-resizable-e { - background-image:url("splitbar.png"); - background-size:100%; - background-repeat:no-repeat; - background-attachment: scroll; - cursor:ew-resize; + background:url("splitbar.png") repeat scroll right center transparent; + cursor:e-resize; height:100%; right:0; top:0; diff --git a/doc/html/navtree.js b/doc/html/navtree.js index e6d31b0..9df45a7 100644 --- a/doc/html/navtree.js +++ b/doc/html/navtree.js @@ -1,6 +1,4 @@ var navTreeSubIndices = new Array(); -var arrowDown = '▼'; -var arrowRight = '►'; function getData(varName) { @@ -73,17 +71,17 @@ function cachedLink() function getScript(scriptName,func,show) { - var head = document.getElementsByTagName("head")[0]; + var head = document.getElementsByTagName("head")[0]; var script = document.createElement('script'); script.id = scriptName; script.type = 'text/javascript'; - script.onload = func; - script.src = scriptName+'.js'; - if ($.browser.msie && $.browser.version<=8) { + script.onload = func; + script.src = scriptName+'.js'; + if ($.browser.msie && $.browser.version<=8) { // script.onload does not work with older versions of IE script.onreadystatechange = function() { - if (script.readyState=='complete' || script.readyState=='loaded') { - func(); if (show) showRoot(); + if (script.readyState=='complete' || script.readyState=='loaded') { + func(); if (show) showRoot(); } } } @@ -96,17 +94,18 @@ function createIndent(o,domNode,node,level) var n = node; while (n.parentNode) { level++; n=n.parentNode; } if (node.childrenData) { - var imgNode = document.createElement("span"); - imgNode.className = 'arrow'; + var imgNode = document.createElement("img"); imgNode.style.paddingLeft=(16*level).toString()+'px'; - imgNode.innerHTML=arrowRight; + imgNode.width = 16; + imgNode.height = 22; + imgNode.border = 0; node.plus_img = imgNode; node.expandToggle = document.createElement("a"); node.expandToggle.href = "javascript:void(0)"; node.expandToggle.onclick = function() { if (node.expanded) { $(node.getChildrenUL()).slideUp("fast"); - node.plus_img.innerHTML=arrowRight; + node.plus_img.src = node.relpath+"arrowright.png"; node.expanded = false; } else { expandNode(o, node, false, false); @@ -114,13 +113,15 @@ function createIndent(o,domNode,node,level) } node.expandToggle.appendChild(imgNode); domNode.appendChild(node.expandToggle); + imgNode.src = node.relpath+"arrowright.png"; } else { var span = document.createElement("span"); - span.className = 'arrow'; + span.style.display = 'inline-block'; span.style.width = 16*(level+1)+'px'; + span.style.height = '22px'; span.innerHTML = ' '; domNode.appendChild(span); - } + } } var animationInProgress = false; @@ -194,7 +195,7 @@ function newNode(o, po, text, link, childrenData, lastNode) var aname = '#'+link.split('#')[1]; var srcPage = stripPath(pathName()); var targetPage = stripPath(link.split('#')[0]); - a.href = srcPage!=targetPage ? url : "javascript:void(0)"; + a.href = srcPage!=targetPage ? url : "javascript:void(0)"; a.onclick = function(){ storeLink(link); if (!$(a).parent().parent().hasClass('selected')) @@ -212,7 +213,7 @@ function newNode(o, po, text, link, childrenData, lastNode) a.onclick = function() { storeLink(link); } } } else { - if (childrenData != null) + if (childrenData != null) { a.className = "nolink"; a.href = "javascript:void(0)"; @@ -261,13 +262,17 @@ function expandNode(o, node, imm, showRoot) } else { if (!node.childrenVisited) { getNode(o, node); - } if (imm || ($.browser.msie && $.browser.version>8)) { + } if (imm || ($.browser.msie && $.browser.version>8)) { // somehow slideDown jumps to the start of tree for IE9 :-( $(node.getChildrenUL()).show(); } else { $(node.getChildrenUL()).slideDown("fast"); } - node.plus_img.innerHTML = arrowDown; + if (node.isLast) { + node.plus_img.src = node.relpath+"arrowdown.png"; + } else { + node.plus_img.src = node.relpath+"arrowdown.png"; + } node.expanded = true; } } @@ -336,7 +341,7 @@ function showNode(o, node, index, hash) getNode(o, node); } $(node.getChildrenUL()).css({'display':'block'}); - node.plus_img.innerHTML = arrowDown; + node.plus_img.src = node.relpath+"arrowdown.png"; node.expanded = true; var n = node.children[o.breadcrumbs[index]]; if (index+1=desktop_vp) { - if (!collapsed) { - collapseExpand(); - } - } else if (width>desktop_vp && collapsedWidth0) { - restoreWidth(0); - collapsed=true; - } - else { - var width = readCookie('width'); - if (width>200 && width<$(window).width()) { restoreWidth(width); } else { restoreWidth(200); } - collapsed=false; - } - } +function resizeHeight() +{ + var headerHeight = header.outerHeight(); + var footerHeight = footer.outerHeight(); + var windowHeight = $(window).height() - headerHeight - footerHeight; + content.css({height:windowHeight + "px"}); + navtree.css({height:windowHeight + "px"}); + sidenav.css({height:windowHeight + "px"}); +} +function initResizable() +{ header = $("#top"); sidenav = $("#side-nav"); content = $("#doc-content"); navtree = $("#nav-tree"); footer = $("#nav-path"); $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); - $(sidenav).resizable({ minWidth: 0 }); $(window).resize(function() { resizeHeight(); }); - var device = navigator.userAgent.toLowerCase(); - var touch_device = device.match(/(iphone|ipod|ipad|android)/); - if (touch_device) { /* wider split bar for touch only devices */ - $(sidenav).css({ paddingRight:'20px' }); - $('.ui-resizable-e').css({ width:'20px' }); - $('#nav-sync').css({ right:'34px' }); - barWidth=20; - } var width = readCookie('width'); if (width) { restoreWidth(width); } else { resizeWidth(); } resizeHeight(); @@ -107,8 +76,22 @@ function initResizable() if (i>=0) window.location.hash=url.substr(i); var _preventDefault = function(evt) { evt.preventDefault(); }; $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); - $(".ui-resizable-handle").dblclick(collapseExpand); - $(window).load(resizeHeight); + $(document).bind('touchmove',function(e){ + var device = navigator.userAgent.toLowerCase(); + var ios = device.match(/(iphone|ipod|ipad)/); + if (ios) { + try { + var target = e.target; + while (target) { + if ($(target).css('-webkit-overflow-scrolling')=='touch') return; + target = target.parentNode; + } + e.preventDefault(); + } catch(err) { + e.preventDefault(); + } + } + }); } diff --git a/doc/html/search/all_0.html b/doc/html/search/all_0.html index f25360b..d54e0bd 100644 --- a/doc/html/search/all_0.html +++ b/doc/html/search/all_0.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_1.html b/doc/html/search/all_1.html index b13f0f7..8cc6a1d 100644 --- a/doc/html/search/all_1.html +++ b/doc/html/search/all_1.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_2.html b/doc/html/search/all_2.html index 9543c57..d15ac65 100644 --- a/doc/html/search/all_2.html +++ b/doc/html/search/all_2.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_3.html b/doc/html/search/all_3.html index 03405c0..9f526c6 100644 --- a/doc/html/search/all_3.html +++ b/doc/html/search/all_3.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_4.html b/doc/html/search/all_4.html index 8e1f4b9..7b814aa 100644 --- a/doc/html/search/all_4.html +++ b/doc/html/search/all_4.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_5.html b/doc/html/search/all_5.html index 89a879e..d8de556 100644 --- a/doc/html/search/all_5.html +++ b/doc/html/search/all_5.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_5.js b/doc/html/search/all_5.js index dfac999..9ad89bd 100644 --- a/doc/html/search/all_5.js +++ b/doc/html/search/all_5.js @@ -2,6 +2,25 @@ var searchData= [ ['ib_5fset_5fmax_5fsubintervals',['ib_set_max_subintervals',['../structintegral__core_1_1integrator__base.html#ac69c269ccbdea6f36ed2f5d1e10db416',1,'integral_core::integrator_base']]], ['initialize',['initialize',['../structintegral__core_1_1adaptive__integrator.html#a8228a58082b1656c4a3aec9e83d42690',1,'integral_core::adaptive_integrator']]], + ['int_5f15_5fpoint_5frule',['int_15_point_rule',['../namespaceintegral__core.html#a7d7872c112bce9111b36213fc38134d9',1,'integral_core']]], + ['int_5f21_5fpoint_5frule',['int_21_point_rule',['../namespaceintegral__core.html#a419da842f5f0c1ebaa1eaa37503a6ba3',1,'integral_core']]], + ['int_5f31_5fpoint_5frule',['int_31_point_rule',['../namespaceintegral__core.html#a96775e0f80a2c330e2a1cdf4c5f63bb7',1,'integral_core']]], + ['int_5f41_5fpoint_5frule',['int_41_point_rule',['../namespaceintegral__core.html#a6a1f9df773f00516d5ac025f2986db2d',1,'integral_core']]], + ['int_5f51_5fpoint_5frule',['int_51_point_rule',['../namespaceintegral__core.html#abe8f54162f989b88aeda031ef1047b79',1,'integral_core']]], + ['int_5f61_5fpoint_5frule',['int_61_point_rule',['../namespaceintegral__core.html#a276f6e1263695298509c7a918461d154',1,'integral_core']]], + ['int_5farray_5fsize_5fmismatch_5ferror',['int_array_size_mismatch_error',['../namespaceintegral__core.html#a532aa9f815458da6c88bde28c87380ef',1,'integral_core']]], + ['int_5fconvergence_5ferror',['int_convergence_error',['../namespaceintegral__core.html#abc3c540f7582a98f159ff17a4ea1c619',1,'integral_core']]], + ['int_5fcount_5fexceeded_5ferror',['int_count_exceeded_error',['../namespaceintegral__core.html#a543dce855b2a86b630132332d2fdae33',1,'integral_core']]], + ['int_5fdivergent_5ferror',['int_divergent_error',['../namespaceintegral__core.html#aadcd9e7a31ac8163c4dc0e8c38191556',1,'integral_core']]], + ['int_5fexcessive_5fwork_5ferror',['int_excessive_work_error',['../namespaceintegral__core.html#a1845347bcb9e0da787e92ff157fa3040',1,'integral_core']]], + ['int_5fimpractical_5ftolerance_5ferror',['int_impractical_tolerance_error',['../namespaceintegral__core.html#a4481c0212863f1621428a02695168101',1,'integral_core']]], + ['int_5fintegrand_5fbehavior_5ferror',['int_integrand_behavior_error',['../namespaceintegral__core.html#a0008a92daa8ba5ea391d5c8d12a5aef0',1,'integral_core']]], + ['int_5finvalid_5finput_5ferror',['int_invalid_input_error',['../namespaceintegral__core.html#add535b8bd708f7b22fd1964e7c17eea2',1,'integral_core']]], + ['int_5flack_5fof_5fdefinition_5ferror',['int_lack_of_definition_error',['../namespaceintegral__core.html#aed9cc61d46bc3eec836a67c6e4929475',1,'integral_core']]], + ['int_5fout_5fof_5fmemory_5ferror',['int_out_of_memory_error',['../namespaceintegral__core.html#a0c0e0f53b40d550d105fbc56a4a5b526',1,'integral_core']]], + ['int_5frepeated_5ferror_5ftest_5ffailure',['int_repeated_error_test_failure',['../namespaceintegral__core.html#a24784098c88969e0a24bf492f217d72d',1,'integral_core']]], + ['int_5fround_5foff_5ferror',['int_round_off_error',['../namespaceintegral__core.html#a00f12dd90b87d9f5568d6de4b2429f6d',1,'integral_core']]], + ['integral_5fcore',['integral_core',['../namespaceintegral__core.html',1,'']]], ['integrand',['integrand',['../interfaceintegral__core_1_1integrand.html',1,'integral_core']]], ['integrate',['integrate',['../structintegral__core_1_1finite__interval__integrator.html#a53be797ab6f37ba9e4e1f2596fb39486',1,'integral_core::finite_interval_integrator::integrate()'],['../structintegral__core_1_1adaptive__integrator.html#a040f90d46fdb4724df5f3b19ad0e71c7',1,'integral_core::adaptive_integrator::integrate()'],['../structintegral__core_1_1nonadaptive__integrator.html#a85fb400ce19f7ed619f9f150dbc0aab8',1,'integral_core::nonadaptive_integrator::integrate()'],['../structintegral__core_1_1ode__integrator.html#aa29c0067d3b5a56f084b1f5425356faa',1,'integral_core::ode_integrator::integrate()']]], ['integration_5fbehavior',['integration_behavior',['../structintegral__core_1_1integration__behavior.html',1,'integral_core']]], diff --git a/doc/html/search/all_6.html b/doc/html/search/all_6.html index 6afac06..9ba0cc2 100644 --- a/doc/html/search/all_6.html +++ b/doc/html/search/all_6.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_7.html b/doc/html/search/all_7.html index de19107..9384ec9 100644 --- a/doc/html/search/all_7.html +++ b/doc/html/search/all_7.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_8.html b/doc/html/search/all_8.html index 11e27cd..37566c5 100644 --- a/doc/html/search/all_8.html +++ b/doc/html/search/all_8.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_9.html b/doc/html/search/all_9.html index f8abbbe..c8c5102 100644 --- a/doc/html/search/all_9.html +++ b/doc/html/search/all_9.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/all_a.html b/doc/html/search/all_a.html index 9601fce..4cb31f0 100644 --- a/doc/html/search/all_a.html +++ b/doc/html/search/all_a.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/classes_0.html b/doc/html/search/classes_0.html index 1c3e406..025587a 100644 --- a/doc/html/search/classes_0.html +++ b/doc/html/search/classes_0.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/classes_1.html b/doc/html/search/classes_1.html index a8e7069..86dc4ff 100644 --- a/doc/html/search/classes_1.html +++ b/doc/html/search/classes_1.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/classes_2.html b/doc/html/search/classes_2.html index 5c09c96..014caf8 100644 --- a/doc/html/search/classes_2.html +++ b/doc/html/search/classes_2.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/classes_3.html b/doc/html/search/classes_3.html index 5faaeba..2e97201 100644 --- a/doc/html/search/classes_3.html +++ b/doc/html/search/classes_3.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/classes_4.html b/doc/html/search/classes_4.html index b3f11bc..776fee3 100644 --- a/doc/html/search/classes_4.html +++ b/doc/html/search/classes_4.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/functions_0.html b/doc/html/search/functions_0.html index 4e6d87d..6bc52b6 100644 --- a/doc/html/search/functions_0.html +++ b/doc/html/search/functions_0.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/functions_1.html b/doc/html/search/functions_1.html index b343e2d..648831f 100644 --- a/doc/html/search/functions_1.html +++ b/doc/html/search/functions_1.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/functions_2.html b/doc/html/search/functions_2.html index ecce2f3..c93d089 100644 --- a/doc/html/search/functions_2.html +++ b/doc/html/search/functions_2.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/functions_3.html b/doc/html/search/functions_3.html index 15f06ab..caa48ea 100644 --- a/doc/html/search/functions_3.html +++ b/doc/html/search/functions_3.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/functions_4.html b/doc/html/search/functions_4.html index 8985ff2..a9c64ad 100644 --- a/doc/html/search/functions_4.html +++ b/doc/html/search/functions_4.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/functions_5.html b/doc/html/search/functions_5.html index 0314918..9d135fa 100644 --- a/doc/html/search/functions_5.html +++ b/doc/html/search/functions_5.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/namespaces_0.html b/doc/html/search/namespaces_0.html new file mode 100644 index 0000000..f1b59ec --- /dev/null +++ b/doc/html/search/namespaces_0.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/html/search/namespaces_0.js b/doc/html/search/namespaces_0.js new file mode 100644 index 0000000..76eb690 --- /dev/null +++ b/doc/html/search/namespaces_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['integral_5fcore',['integral_core',['../namespaceintegral__core.html',1,'']]] +]; diff --git a/doc/html/search/search.css b/doc/html/search/search.css index 3cf9df9..4d7612f 100644 --- a/doc/html/search/search.css +++ b/doc/html/search/search.css @@ -6,12 +6,14 @@ #MSearchBox { white-space : nowrap; + position: absolute; float: none; + display: inline; margin-top: 8px; right: 0px; width: 170px; - height: 24px; z-index: 102; + background-color: white; } #MSearchBox .left @@ -46,13 +48,12 @@ height:19px; background:url('search_m.png') repeat-x; border:none; - width:115px; + width:111px; margin-left:20px; padding-left:4px; color: #909090; outline: none; font: 9pt Arial, Verdana, sans-serif; - -webkit-border-radius: 0px; } #FSearchBox #MSearchField { @@ -63,7 +64,7 @@ display:block; position:absolute; right:10px; - top:8px; + top:0px; width:20px; height:19px; background:url('search_r.png') no-repeat; @@ -101,7 +102,7 @@ left: 0; top: 0; border: 1px solid #90A5CE; background-color: #F9FAFC; - z-index: 10001; + z-index: 1; padding-top: 4px; padding-bottom: 4px; -moz-border-radius: 4px; @@ -164,7 +165,6 @@ iframe#MSearchResults { left: 0; top: 0; border: 1px solid #000; background-color: #EEF1F7; - z-index:10000; } /* ----------------------------------- */ diff --git a/doc/html/search/searchdata.js b/doc/html/search/searchdata.js index e541c05..bc9b7da 100644 --- a/doc/html/search/searchdata.js +++ b/doc/html/search/searchdata.js @@ -2,23 +2,26 @@ var indexSectionsWithContent = { 0: "adefgimnors", 1: "afino", - 2: "degirs", - 3: "ems" + 2: "i", + 3: "degirs", + 4: "eims" }; var indexSectionNames = { 0: "all", 1: "classes", - 2: "functions", - 3: "variables" + 2: "namespaces", + 3: "functions", + 4: "variables" }; var indexSectionLabels = { 0: "All", 1: "Classes", - 2: "Functions", - 3: "Variables" + 2: "Namespaces", + 3: "Functions", + 4: "Variables" }; diff --git a/doc/html/search/variables_0.html b/doc/html/search/variables_0.html index 74ce807..3835278 100644 --- a/doc/html/search/variables_0.html +++ b/doc/html/search/variables_0.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/variables_1.html b/doc/html/search/variables_1.html index 84237b6..3c65cf2 100644 --- a/doc/html/search/variables_1.html +++ b/doc/html/search/variables_1.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/variables_1.js b/doc/html/search/variables_1.js index c3bea20..fbd6731 100644 --- a/doc/html/search/variables_1.js +++ b/doc/html/search/variables_1.js @@ -1,28 +1,21 @@ var searchData= [ - ['m_5fabstol',['m_abstol',['../structintegral__core_1_1integrator__base.html#a4646a8f543f17af6e4a260c83a08ab20',1,'integral_core::integrator_base']]], - ['m_5falloutput',['m_alloutput',['../structintegral__core_1_1ode__integrator.html#afd08d71cc0d2d3aa2732439b162f953b',1,'integral_core::ode_integrator']]], - ['m_5fatol',['m_atol',['../structintegral__core_1_1ode__integrator.html#a4c49c35203fe6642ddb734b7c1296113',1,'integral_core::ode_integrator']]], - ['m_5fbreakpoints',['m_breakpoints',['../structintegral__core_1_1adaptive__integrator.html#ac8e4d4dc7702f43459677705eefa6acb',1,'integral_core::adaptive_integrator']]], - ['m_5fcanovershoot',['m_canovershoot',['../structintegral__core_1_1ode__integrator.html#af8b1acccaac658b793db41f332a391d3',1,'integral_core::ode_integrator']]], - ['m_5fconstraints',['m_constraints',['../structintegral__core_1_1ode__helper.html#a5f0785936c8edb94beb039537ace0114',1,'integral_core::ode_helper']]], - ['m_5fcount',['m_count',['../structintegral__core_1_1ode__helper.html#af7f666093f4952fd165bd6e634f715f5',1,'integral_core::ode_helper']]], - ['m_5fcriticalpoint',['m_criticalpoint',['../structintegral__core_1_1ode__integrator.html#a951b86dab49209492d2906a9ef3a16e3',1,'integral_core::ode_integrator']]], - ['m_5ffcn',['m_fcn',['../structintegral__core_1_1ode__helper.html#aa2466912c0bc7ff13a704073357f0a58',1,'integral_core::ode_helper']]], - ['m_5fistate',['m_istate',['../structintegral__core_1_1ode__auto.html#a57af60d28a09024a16287e13c77330f8',1,'integral_core::ode_auto']]], - ['m_5fiwork',['m_iwork',['../structintegral__core_1_1adaptive__integrator.html#ab436b7c59e3e7a6def496e6db3e76663',1,'integral_core::adaptive_integrator::m_iwork()'],['../structintegral__core_1_1ode__auto.html#af672d690a71a7658f25d7bf066fcea98',1,'integral_core::ode_auto::m_iwork()']]], - ['m_5fjac',['m_jac',['../structintegral__core_1_1ode__helper.html#a7c0bf3bde15337a0e22268ad58491a2f',1,'integral_core::ode_helper']]], - ['m_5flimitstepsize',['m_limitstepsize',['../structintegral__core_1_1ode__integrator.html#a17eb7e73feff89f1f42d7eacdfeca28a',1,'integral_core::ode_integrator']]], - ['m_5fmaxint',['m_maxint',['../structintegral__core_1_1integrator__base.html#aa1ada1422094ffc89d915d9f1752c1fc',1,'integral_core::integrator_base']]], - ['m_5fmaxstepcount',['m_maxstepcount',['../structintegral__core_1_1ode__integrator.html#a33ed8f41b14f6730d8cd5d1a81504ba8',1,'integral_core::ode_integrator']]], - ['m_5fmaxstepsize',['m_maxstepsize',['../structintegral__core_1_1ode__integrator.html#abe1441664da8e16de001b24bedba5265',1,'integral_core::ode_integrator']]], - ['m_5fminbuffersize',['m_minbuffersize',['../structintegral__core_1_1ode__integrator.html#adc71c097e606811693bd4a60d99481ca',1,'integral_core::ode_integrator']]], - ['m_5freltol',['m_reltol',['../structintegral__core_1_1integrator__base.html#a6d69a7f8d189666acb444667064dd557',1,'integral_core::integrator_base']]], - ['m_5frststats',['m_rststats',['../structintegral__core_1_1ode__auto.html#a27a6078feaf046439a3678844c37788d',1,'integral_core::ode_auto']]], - ['m_5frtol',['m_rtol',['../structintegral__core_1_1ode__integrator.html#a92d76347951a3539e19dffaccd6dafe7',1,'integral_core::ode_integrator']]], - ['m_5frts',['m_rts',['../structintegral__core_1_1ode__helper.html#a93817c5d4853f613234fac19ecf0d541',1,'integral_core::ode_helper']]], - ['m_5frule',['m_rule',['../structintegral__core_1_1nonadaptive__integrator.html#af11385657d8704d06d0dd0fb84ab6f2c',1,'integral_core::nonadaptive_integrator']]], - ['m_5frwork',['m_rwork',['../structintegral__core_1_1ode__auto.html#acf053c0ab90c954fbea452537ede1933',1,'integral_core::ode_auto']]], - ['m_5fuserdefinedbreaks',['m_userdefinedbreaks',['../structintegral__core_1_1adaptive__integrator.html#a92559ae1322790490c8aba2cf130e767',1,'integral_core::adaptive_integrator']]], - ['m_5fwork',['m_work',['../structintegral__core_1_1adaptive__integrator.html#a9c8a5e4f3af01645a788520805c5caae',1,'integral_core::adaptive_integrator']]] + ['int_5f15_5fpoint_5frule',['int_15_point_rule',['../namespaceintegral__core.html#a7d7872c112bce9111b36213fc38134d9',1,'integral_core']]], + ['int_5f21_5fpoint_5frule',['int_21_point_rule',['../namespaceintegral__core.html#a419da842f5f0c1ebaa1eaa37503a6ba3',1,'integral_core']]], + ['int_5f31_5fpoint_5frule',['int_31_point_rule',['../namespaceintegral__core.html#a96775e0f80a2c330e2a1cdf4c5f63bb7',1,'integral_core']]], + ['int_5f41_5fpoint_5frule',['int_41_point_rule',['../namespaceintegral__core.html#a6a1f9df773f00516d5ac025f2986db2d',1,'integral_core']]], + ['int_5f51_5fpoint_5frule',['int_51_point_rule',['../namespaceintegral__core.html#abe8f54162f989b88aeda031ef1047b79',1,'integral_core']]], + ['int_5f61_5fpoint_5frule',['int_61_point_rule',['../namespaceintegral__core.html#a276f6e1263695298509c7a918461d154',1,'integral_core']]], + ['int_5farray_5fsize_5fmismatch_5ferror',['int_array_size_mismatch_error',['../namespaceintegral__core.html#a532aa9f815458da6c88bde28c87380ef',1,'integral_core']]], + ['int_5fconvergence_5ferror',['int_convergence_error',['../namespaceintegral__core.html#abc3c540f7582a98f159ff17a4ea1c619',1,'integral_core']]], + ['int_5fcount_5fexceeded_5ferror',['int_count_exceeded_error',['../namespaceintegral__core.html#a543dce855b2a86b630132332d2fdae33',1,'integral_core']]], + ['int_5fdivergent_5ferror',['int_divergent_error',['../namespaceintegral__core.html#aadcd9e7a31ac8163c4dc0e8c38191556',1,'integral_core']]], + ['int_5fexcessive_5fwork_5ferror',['int_excessive_work_error',['../namespaceintegral__core.html#a1845347bcb9e0da787e92ff157fa3040',1,'integral_core']]], + ['int_5fimpractical_5ftolerance_5ferror',['int_impractical_tolerance_error',['../namespaceintegral__core.html#a4481c0212863f1621428a02695168101',1,'integral_core']]], + ['int_5fintegrand_5fbehavior_5ferror',['int_integrand_behavior_error',['../namespaceintegral__core.html#a0008a92daa8ba5ea391d5c8d12a5aef0',1,'integral_core']]], + ['int_5finvalid_5finput_5ferror',['int_invalid_input_error',['../namespaceintegral__core.html#add535b8bd708f7b22fd1964e7c17eea2',1,'integral_core']]], + ['int_5flack_5fof_5fdefinition_5ferror',['int_lack_of_definition_error',['../namespaceintegral__core.html#aed9cc61d46bc3eec836a67c6e4929475',1,'integral_core']]], + ['int_5fout_5fof_5fmemory_5ferror',['int_out_of_memory_error',['../namespaceintegral__core.html#a0c0e0f53b40d550d105fbc56a4a5b526',1,'integral_core']]], + ['int_5frepeated_5ferror_5ftest_5ffailure',['int_repeated_error_test_failure',['../namespaceintegral__core.html#a24784098c88969e0a24bf492f217d72d',1,'integral_core']]], + ['int_5fround_5foff_5ferror',['int_round_off_error',['../namespaceintegral__core.html#a00f12dd90b87d9f5568d6de4b2429f6d',1,'integral_core']]] ]; diff --git a/doc/html/search/variables_2.html b/doc/html/search/variables_2.html index 5c9de1a..7b43e0a 100644 --- a/doc/html/search/variables_2.html +++ b/doc/html/search/variables_2.html @@ -1,7 +1,7 @@ - + diff --git a/doc/html/search/variables_2.js b/doc/html/search/variables_2.js index 9f63964..c3bea20 100644 --- a/doc/html/search/variables_2.js +++ b/doc/html/search/variables_2.js @@ -1,4 +1,28 @@ var searchData= [ - ['subinterval_5fcount',['subinterval_count',['../structintegral__core_1_1integration__behavior.html#af119d968518a0f9d11c5ce1b6a30b31f',1,'integral_core::integration_behavior']]] + ['m_5fabstol',['m_abstol',['../structintegral__core_1_1integrator__base.html#a4646a8f543f17af6e4a260c83a08ab20',1,'integral_core::integrator_base']]], + ['m_5falloutput',['m_alloutput',['../structintegral__core_1_1ode__integrator.html#afd08d71cc0d2d3aa2732439b162f953b',1,'integral_core::ode_integrator']]], + ['m_5fatol',['m_atol',['../structintegral__core_1_1ode__integrator.html#a4c49c35203fe6642ddb734b7c1296113',1,'integral_core::ode_integrator']]], + ['m_5fbreakpoints',['m_breakpoints',['../structintegral__core_1_1adaptive__integrator.html#ac8e4d4dc7702f43459677705eefa6acb',1,'integral_core::adaptive_integrator']]], + ['m_5fcanovershoot',['m_canovershoot',['../structintegral__core_1_1ode__integrator.html#af8b1acccaac658b793db41f332a391d3',1,'integral_core::ode_integrator']]], + ['m_5fconstraints',['m_constraints',['../structintegral__core_1_1ode__helper.html#a5f0785936c8edb94beb039537ace0114',1,'integral_core::ode_helper']]], + ['m_5fcount',['m_count',['../structintegral__core_1_1ode__helper.html#af7f666093f4952fd165bd6e634f715f5',1,'integral_core::ode_helper']]], + ['m_5fcriticalpoint',['m_criticalpoint',['../structintegral__core_1_1ode__integrator.html#a951b86dab49209492d2906a9ef3a16e3',1,'integral_core::ode_integrator']]], + ['m_5ffcn',['m_fcn',['../structintegral__core_1_1ode__helper.html#aa2466912c0bc7ff13a704073357f0a58',1,'integral_core::ode_helper']]], + ['m_5fistate',['m_istate',['../structintegral__core_1_1ode__auto.html#a57af60d28a09024a16287e13c77330f8',1,'integral_core::ode_auto']]], + ['m_5fiwork',['m_iwork',['../structintegral__core_1_1adaptive__integrator.html#ab436b7c59e3e7a6def496e6db3e76663',1,'integral_core::adaptive_integrator::m_iwork()'],['../structintegral__core_1_1ode__auto.html#af672d690a71a7658f25d7bf066fcea98',1,'integral_core::ode_auto::m_iwork()']]], + ['m_5fjac',['m_jac',['../structintegral__core_1_1ode__helper.html#a7c0bf3bde15337a0e22268ad58491a2f',1,'integral_core::ode_helper']]], + ['m_5flimitstepsize',['m_limitstepsize',['../structintegral__core_1_1ode__integrator.html#a17eb7e73feff89f1f42d7eacdfeca28a',1,'integral_core::ode_integrator']]], + ['m_5fmaxint',['m_maxint',['../structintegral__core_1_1integrator__base.html#aa1ada1422094ffc89d915d9f1752c1fc',1,'integral_core::integrator_base']]], + ['m_5fmaxstepcount',['m_maxstepcount',['../structintegral__core_1_1ode__integrator.html#a33ed8f41b14f6730d8cd5d1a81504ba8',1,'integral_core::ode_integrator']]], + ['m_5fmaxstepsize',['m_maxstepsize',['../structintegral__core_1_1ode__integrator.html#abe1441664da8e16de001b24bedba5265',1,'integral_core::ode_integrator']]], + ['m_5fminbuffersize',['m_minbuffersize',['../structintegral__core_1_1ode__integrator.html#adc71c097e606811693bd4a60d99481ca',1,'integral_core::ode_integrator']]], + ['m_5freltol',['m_reltol',['../structintegral__core_1_1integrator__base.html#a6d69a7f8d189666acb444667064dd557',1,'integral_core::integrator_base']]], + ['m_5frststats',['m_rststats',['../structintegral__core_1_1ode__auto.html#a27a6078feaf046439a3678844c37788d',1,'integral_core::ode_auto']]], + ['m_5frtol',['m_rtol',['../structintegral__core_1_1ode__integrator.html#a92d76347951a3539e19dffaccd6dafe7',1,'integral_core::ode_integrator']]], + ['m_5frts',['m_rts',['../structintegral__core_1_1ode__helper.html#a93817c5d4853f613234fac19ecf0d541',1,'integral_core::ode_helper']]], + ['m_5frule',['m_rule',['../structintegral__core_1_1nonadaptive__integrator.html#af11385657d8704d06d0dd0fb84ab6f2c',1,'integral_core::nonadaptive_integrator']]], + ['m_5frwork',['m_rwork',['../structintegral__core_1_1ode__auto.html#acf053c0ab90c954fbea452537ede1933',1,'integral_core::ode_auto']]], + ['m_5fuserdefinedbreaks',['m_userdefinedbreaks',['../structintegral__core_1_1adaptive__integrator.html#a92559ae1322790490c8aba2cf130e767',1,'integral_core::adaptive_integrator']]], + ['m_5fwork',['m_work',['../structintegral__core_1_1adaptive__integrator.html#a9c8a5e4f3af01645a788520805c5caae',1,'integral_core::adaptive_integrator']]] ]; diff --git a/doc/html/search/variables_3.html b/doc/html/search/variables_3.html new file mode 100644 index 0000000..ea0392d --- /dev/null +++ b/doc/html/search/variables_3.html @@ -0,0 +1,26 @@ + + + + + + + + + +
+
Loading...
+
+ +
Searching...
+
No Matches
+ +
+ + diff --git a/doc/html/search/variables_3.js b/doc/html/search/variables_3.js new file mode 100644 index 0000000..9f63964 --- /dev/null +++ b/doc/html/search/variables_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['subinterval_5fcount',['subinterval_count',['../structintegral__core_1_1integration__behavior.html#af119d968518a0f9d11c5ce1b6a30b31f',1,'integral_core::integration_behavior']]] +]; diff --git a/doc/html/structintegral__core_1_1adaptive__integrator.html b/doc/html/structintegral__core_1_1adaptive__integrator.html index f1dc4a9..08d92c1 100644 --- a/doc/html/structintegral__core_1_1adaptive__integrator.html +++ b/doc/html/structintegral__core_1_1adaptive__integrator.html @@ -3,8 +3,7 @@ - - + integral: integral_core::adaptive_integrator Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@ - + - - - - + +
integral_core::adaptive_integrator Type Reference
@@ -97,7 +123,7 @@
- + integral_core::finite_interval_integrator integral_core::integrator_base @@ -124,58 +150,56 @@  Sets an array of user-defined breakpoints. Additionally, this array call set_use_breakpoints with an argument of true such that the integrator will use the breakpoints defined by this routine. More...
  - Public Member Functions inherited from integral_core::finite_interval_integrator - + procedure(finite_interval_fcn), deferred, pass, public integrate  Performs the actual integration.
  - Public Member Functions inherited from integral_core::integrator_base procedure, public get_abs_tol => ib_get_abs_tol - Gets the absolute tolerance value. More...
+ Gets the absolute tolerance value. More...
  procedure, public set_abs_tol => ib_set_abs_tol - Sets the absolute tolerance value. More...
+ Sets the absolute tolerance value. More...
  procedure, public get_rel_tol => ib_get_rel_tol - Gets the relative tolerance value. More...
+ Gets the relative tolerance value. More...
  procedure, public set_rel_tol => ib_set_rel_tol - Sets the relative tolerance value. More...
+ Sets the relative tolerance value. More...
  procedure, public get_max_subintervals => ib_get_max_subintervals - Gets the maximum number of subintervals into which the integrator may divide the problem region. More...
+ Gets the maximum number of subintervals into which the integrator may divide the problem region. More...
  procedure, public ib_set_max_subintervals => ib_set_max_subintervals - Sets the maximum number of subintervals into which the integrator may divide the problem region. More...
+ Sets the maximum number of subintervals into which the integrator may divide the problem region. More...
  - - - -

Private Attributes

+
real(real64), dimension(:), allocatable m_work
 A workspace array.
 
+
integer(int32), dimension(:), allocatable m_iwork
 A workspace array.
 
+
logical m_userdefinedbreaks = .false.
 True for user defined breakpoints; else, false.
 
+
real(real64), dimension(:), allocatable m_breakpoints
 A list of user-defined breakpoints.
 

Detailed Description

Defines an integrator that uses an adaptive Gauss-Kronrod method to compute the integral of a function of one variable over a finite interval.

-
Example
The following example illustrates how to use the adaptive_integrator to compute the integral of a function over a finite interval.
program example
use iso_fortran_env
use integral_core
implicit none
! Variables
real(real64) :: ans, y, pi, a, b
procedure(integrand), pointer :: fcn
type(adaptive_integrator) :: integrator
! Define the integration limits
pi = 2.0d0 * acos(0.0d0)
a = pi / 6.0d0
b = pi / 4.0d0
! Evaluate the integral
fcn => int_fcn
y = integrator%integrate(fcn, a, b)
! Display the results
ans = 5.0d0 * pi / 12.0d0 - 2.0d0 * sqrt(2.0d0) + 4.0d0 / sqrt(3.0d0)
print '(AEN13.5AEN13.5A)', "The solution is: ", ans, &
", the integrator computed: ", y, "."
contains
! This example is from http://tutorial.math.lamar.edu/Classes/CalcI/ComputingDefiniteIntegrals.aspx#Int_CompDef_Ex3a
! The integrand is: f(x) = 5 - 2 sec(x) tan(x).
! If the integral is considered over the range [pi/6, pi/4], the solution
! is 5 pi / 12 - 2 sqrt(2) + 4 / sqrt(3).
function int_fcn(x) result(f)
real(real64), intent(in) :: x
real(real64) :: f
f = 5.0d0 - 2.0d0 * tan(x) / cos(x) ! Remember, sec(x) = 1 / cos(x)
end function
end program
The above program produces the following output.
The solution is: 789.97089E-03, the integrator computed: 789.97089E-03.
+
Example
The following example illustrates how to use the adaptive_integrator to compute the integral of a function over a finite interval.
program example
use iso_fortran_env
implicit none
! Variables
real(real64) :: ans, y, pi, a, b
procedure(integrand), pointer :: fcn
type(adaptive_integrator) :: integrator
! Define the integration limits
pi = 2.0d0 * acos(0.0d0)
a = pi / 6.0d0
b = pi / 4.0d0
! Evaluate the integral
fcn => int_fcn
y = integrator%integrate(fcn, a, b)
! Display the results
ans = 5.0d0 * pi / 12.0d0 - 2.0d0 * sqrt(2.0d0) + 4.0d0 / sqrt(3.0d0)
print '(AEN13.5AEN13.5A)', "The solution is: ", ans, &
", the integrator computed: ", y, "."
contains
! This example is from http://tutorial.math.lamar.edu/Classes/CalcI/ComputingDefiniteIntegrals.aspx#Int_CompDef_Ex3a
! The integrand is: f(x) = 5 - 2 sec(x) tan(x).
! If the integral is considered over the range [pi/6, pi/4], the solution
! is 5 pi / 12 - 2 sqrt(2) + 4 / sqrt(3).
function int_fcn(x) result(f)
real(real64), intent(in) :: x
real(real64) :: f
f = 5.0d0 - 2.0d0 * tan(x) / cos(x) ! Remember, sec(x) = 1 / cos(x)
end function
end program
The above program produces the following output.
The solution is: 789.97089E-03, the integrator computed: 789.97089E-03.
-

Definition at line 351 of file integral_core.f90.

+

Definition at line 372 of file integral_core.f90.

Member Function/Subroutine Documentation

- -

◆ get_breakpoints()

- +
@@ -198,13 +222,11 @@

Returns
The array of points. This array will not be allocated if no points have been defined.
-

Definition at line 449 of file integral_core.f90.

+

Definition at line 470 of file integral_core.f90.

- -

◆ get_use_breakpoints()

- +

@@ -227,13 +249,11 @@

Returns
Returns true if the user-defined breakpoints should be used; else, false.
-

Definition at line 425 of file integral_core.f90.

+

Definition at line 446 of file integral_core.f90.

- -

◆ initialize()

- +

@@ -259,13 +279,11 @@

Definition at line 376 of file integral_core.f90.

+

Definition at line 397 of file integral_core.f90.

- -

◆ integrate()

- +

@@ -303,13 +321,11 @@

Returns
The value of the integral over the specified range.
Remarks
This routine utilizes the QUADPACK routine QAGS. For more information on this routine see http://www.netlib.org/quadpack/.
-

Definition at line 412 of file integral_core.f90.

+

Definition at line 433 of file integral_core.f90.

- -

◆ set_breakpoints()

- +

@@ -332,13 +348,11 @@

Definition at line 462 of file integral_core.f90.

+

Definition at line 483 of file integral_core.f90.

- -

◆ set_use_breakpoints()

- +

@@ -361,22 +375,22 @@

Definition at line 438 of file integral_core.f90.

+

Definition at line 459 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/structintegral__core_1_1finite__interval__integrator.html b/doc/html/structintegral__core_1_1finite__interval__integrator.html index 0a49058..7424657 100644 --- a/doc/html/structintegral__core_1_1finite__interval__integrator.html +++ b/doc/html/structintegral__core_1_1finite__interval__integrator.html @@ -3,8 +3,7 @@ - - + integral: integral_core::finite_interval_integrator Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@

- + - - - - + +
@@ -96,7 +122,7 @@
- + integral_core::integrator_base integral_core::adaptive_integrator integral_core::nonadaptive_integrator @@ -105,46 +131,46 @@ - - + - + - + - + - + - +

Public Member Functions

+
procedure(finite_interval_fcn), deferred, pass, public integrate
 Performs the actual integration.
 
- Public Member Functions inherited from integral_core::integrator_base
procedure, public get_abs_tol => ib_get_abs_tol
 Gets the absolute tolerance value. More...
 Gets the absolute tolerance value. More...
 
procedure, public set_abs_tol => ib_set_abs_tol
 Sets the absolute tolerance value. More...
 Sets the absolute tolerance value. More...
 
procedure, public get_rel_tol => ib_get_rel_tol
 Gets the relative tolerance value. More...
 Gets the relative tolerance value. More...
 
procedure, public set_rel_tol => ib_set_rel_tol
 Sets the relative tolerance value. More...
 Sets the relative tolerance value. More...
 
procedure, public get_max_subintervals => ib_get_max_subintervals
 Gets the maximum number of subintervals into which the integrator may divide the problem region. More...
 Gets the maximum number of subintervals into which the integrator may divide the problem region. More...
 
procedure, public ib_set_max_subintervals => ib_set_max_subintervals
 Sets the maximum number of subintervals into which the integrator may divide the problem region. More...
 Sets the maximum number of subintervals into which the integrator may divide the problem region. More...
 

Detailed Description

A type that defines an integrator meant to operate on integrands over a finite region.

-

Definition at line 266 of file integral_core.f90.

+

Definition at line 287 of file integral_core.f90.


The documentation for this type was generated from the following file:
diff --git a/doc/html/structintegral__core_1_1integration__behavior.html b/doc/html/structintegral__core_1_1integration__behavior.html index 6c934ef..36c6ab3 100644 --- a/doc/html/structintegral__core_1_1integration__behavior.html +++ b/doc/html/structintegral__core_1_1integration__behavior.html @@ -3,8 +3,7 @@ - - + integral: integral_core::integration_behavior Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@
- + - - - - + +
@@ -94,15 +120,15 @@ - - - @@ -110,19 +136,19 @@

Detailed Description

Provides information regarding the behavior of an integrator.

-

Definition at line 143 of file integral_core.f90.

+

Definition at line 164 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/structintegral__core_1_1integrator__base.html b/doc/html/structintegral__core_1_1integrator__base.html index d82cec7..c7c4d0d 100644 --- a/doc/html/structintegral__core_1_1integrator__base.html +++ b/doc/html/structintegral__core_1_1integrator__base.html @@ -3,8 +3,7 @@ - - +integral: integral_core::integrator_base Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@

Private Attributes

+
real(real64) error_estimate
 An estimate of the absolute error of the integration process.
 
+
integer(int32) evaluation_count
 The number of integrand evaluations.
 
+
integer(int32) subinterval_count
 The number of subintervals into which the integration region was divided.
 
- + - - - - + +
integral_core::integrator_base Type Reference
@@ -97,7 +123,7 @@
- + integral_core::finite_interval_integrator integral_core::adaptive_integrator integral_core::nonadaptive_integrator @@ -127,15 +153,15 @@ - - - @@ -143,11 +169,9 @@

Detailed Description

Defines a base type for integrator types.

-

Definition at line 157 of file integral_core.f90.

+

Definition at line 178 of file integral_core.f90.

Member Function/Subroutine Documentation

- -

◆ get_abs_tol()

- +

Private Attributes

+
real(real64) m_abstol = 1.0d-8
 The absolute tolerance.
 
+
real(real64) m_reltol = 1.0d-8
 The relative tolerance.
 
+
integer(int32) m_maxint = 10
 The maximum number of subintervals.
 
@@ -170,13 +194,11 @@

Returns
The tolerance value.
-

Definition at line 175 of file integral_core.f90.

+

Definition at line 196 of file integral_core.f90.

- -

◆ get_max_subintervals()

- +

@@ -199,13 +221,11 @@

Returns
The number of intervals.
-

Definition at line 216 of file integral_core.f90.

+

Definition at line 237 of file integral_core.f90.

- -

◆ get_rel_tol()

- +

@@ -228,13 +248,11 @@

Returns
The tolerance value.
-

Definition at line 195 of file integral_core.f90.

+

Definition at line 216 of file integral_core.f90.

- -

◆ ib_set_max_subintervals()

- +

@@ -257,13 +275,11 @@

Definition at line 227 of file integral_core.f90.

+

Definition at line 248 of file integral_core.f90.

- -

◆ set_abs_tol()

- +

@@ -286,13 +302,11 @@

Definition at line 185 of file integral_core.f90.

+

Definition at line 206 of file integral_core.f90.

- -

◆ set_rel_tol()

- +

@@ -315,22 +329,22 @@

Definition at line 205 of file integral_core.f90.

+

Definition at line 226 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/structintegral__core_1_1nonadaptive__integrator.html b/doc/html/structintegral__core_1_1nonadaptive__integrator.html index 16dd222..116a0fc 100644 --- a/doc/html/structintegral__core_1_1nonadaptive__integrator.html +++ b/doc/html/structintegral__core_1_1nonadaptive__integrator.html @@ -3,8 +3,7 @@ - - + integral: integral_core::nonadaptive_integrator Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@

- + - - - - + +
integral_core::nonadaptive_integrator Type Reference
@@ -97,7 +123,7 @@
- + integral_core::finite_interval_integrator integral_core::integrator_base @@ -115,33 +141,33 @@  Sets the integration rule being utilized. The default integration rule is given by INT_15_POINT_RULE. More...
  - Public Member Functions inherited from integral_core::finite_interval_integrator - + procedure(finite_interval_fcn), deferred, pass, public integrate  Performs the actual integration.
  - Public Member Functions inherited from integral_core::integrator_base procedure, public get_abs_tol => ib_get_abs_tol - Gets the absolute tolerance value. More...
+ Gets the absolute tolerance value. More...
  procedure, public set_abs_tol => ib_set_abs_tol - Sets the absolute tolerance value. More...
+ Sets the absolute tolerance value. More...
  procedure, public get_rel_tol => ib_get_rel_tol - Gets the relative tolerance value. More...
+ Gets the relative tolerance value. More...
  procedure, public set_rel_tol => ib_set_rel_tol - Sets the relative tolerance value. More...
+ Sets the relative tolerance value. More...
  procedure, public get_max_subintervals => ib_get_max_subintervals - Gets the maximum number of subintervals into which the integrator may divide the problem region. More...
+ Gets the maximum number of subintervals into which the integrator may divide the problem region. More...
  procedure, public ib_set_max_subintervals => ib_set_max_subintervals - Sets the maximum number of subintervals into which the integrator may divide the problem region. More...
+ Sets the maximum number of subintervals into which the integrator may divide the problem region. More...
  - @@ -149,11 +175,9 @@

Detailed Description

Defines an integrator that uses a non-adaptive Gauss-Kronrod method to compute the integral of a function of one variable over a finite interval.

-

Definition at line 508 of file integral_core.f90.

+

Definition at line 529 of file integral_core.f90.

Member Function/Subroutine Documentation

- -

◆ get_rule()

- +

Private Attributes

+
integer(int32) m_rule = INT_15_POINT_RULE
 The integration rule to use.
 
@@ -184,13 +208,11 @@

Definition at line 555 of file integral_core.f90.

+

Definition at line 576 of file integral_core.f90.

- -

◆ integrate()

- +

@@ -222,13 +244,11 @@

Returns
The value of the integral over the specified range.
Remarks
This routine utilizes the QUADPACK routine QAGS. For more information on this routine see http://www.netlib.org/quadpack/.
-

Definition at line 537 of file integral_core.f90.

+

Definition at line 558 of file integral_core.f90.

- -

◆ set_rule()

- +

@@ -263,22 +283,22 @@

Definition at line 578 of file integral_core.f90.

+

Definition at line 599 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/structintegral__core_1_1ode__auto.html b/doc/html/structintegral__core_1_1ode__auto.html index de73036..8f29569 100644 --- a/doc/html/structintegral__core_1_1ode__auto.html +++ b/doc/html/structintegral__core_1_1ode__auto.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_auto Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@

- + - - - - + +
integral_core::ode_auto Type Reference
@@ -98,7 +124,7 @@
- + integral_core::ode_integrator
@@ -116,106 +142,104 @@   - Public Member Functions inherited from integral_core::ode_integrator procedure, public integrate => oi_integrate - Performs the integration. More...
+ Performs the integration. More...
  procedure, public get_provide_all_output => oi_get_use_all_output - Gets a value determining if all integrator output should be reported. More...
+ Gets a value determining if all integrator output should be reported. More...
  procedure, public set_provide_all_output => oi_set_use_all_output - Sets a value determining if all integrator output should be reported. More...
+ Sets a value determining if all integrator output should be reported. More...
  procedure, public get_allow_overshoot => oi_get_allow_overshoot - Gets a value determining if the integrator can overshoot the integration limits and interpolate back to achieve the desired solution point. More...
+ Gets a value determining if the integrator can overshoot the integration limits and interpolate back to achieve the desired solution point. More...
  procedure, public set_allow_overshoot => oi_set_allow_overshoot - Sets a value determining if the integrator can overshoot the integration limits and interpolate back to achieve the desired solution point. More...
+ Sets a value determining if the integrator can overshoot the integration limits and interpolate back to achieve the desired solution point. More...
  procedure, public get_integration_limit => oi_get_critical_point - Gets a critical integration limit that the integrator is not allowed to step beyond. More...
+ Gets a critical integration limit that the integrator is not allowed to step beyond. More...
  procedure, public set_integration_limit => oi_set_critical_point - Sets a critical integration limit that the integrator is not allowed to step beyond. More...
+ Sets a critical integration limit that the integrator is not allowed to step beyond. More...
  procedure, public get_min_buffer_size => oi_get_min_buffer_size - Gets the minimum internal storage buffer size. More...
+ Gets the minimum internal storage buffer size. More...
  procedure, public set_min_buffer_size => oi_set_min_buffer_size - Sets the minimum internal storage buffer size. Properly sizing the buffer has the potential of improving the performance of the integrator. More...
+ Sets the minimum internal storage buffer size. Properly sizing the buffer has the potential of improving the performance of the integrator. More...
  procedure, public get_max_step_size => oi_get_max_step_size - Gets the maximum allowed step size. More...
+ Gets the maximum allowed step size. More...
  procedure, public set_max_step_size => oi_set_max_step_size - Sets the maximum allowed step size. This value is only honored if get_limit_step_size is set to true. More...
+ Sets the maximum allowed step size. This value is only honored if get_limit_step_size is set to true. More...
  procedure, public get_limit_step_size => oi_get_limit_step_size - Gets a value determining if the step size should be limited. More...
+ Gets a value determining if the step size should be limited. More...
  procedure, public set_limit_step_size => oi_set_limit_step_size - Sets a value determining if the step size should be limited. This value must be set to true to use the value defined by set_max_step_size. More...
+ Sets a value determining if the step size should be limited. This value must be set to true to use the value defined by set_max_step_size. More...
  procedure, public get_iteration_limit => oi_get_iteration_limit - Gets the limit on the number of iterations allowed per integration step. More...
+ Gets the limit on the number of iterations allowed per integration step. More...
  procedure, public set_iteration_limit => oi_set_iteration_limit - Sets the limit on the number of iterations allowed per integration step. More...
+ Sets the limit on the number of iterations allowed per integration step. More...
  procedure, public get_relative_tolerances => oi_get_rtol - Gets the relative tolerances for each ODE. More...
+ Gets the relative tolerances for each ODE. More...
  procedure, public set_relative_tolerances => oi_set_rtol - Sets the relative tolerances for each ODE. More...
+ Sets the relative tolerances for each ODE. More...
  procedure, public get_absolute_tolerances => oi_get_atol - Gets the absolute tolerances for each ODE. More...
+ Gets the absolute tolerances for each ODE. More...
  procedure, public set_absolute_tolerances => oi_set_atol - Sets the absolute tolerances for each ODE. More...
+ Sets the absolute tolerances for each ODE. More...
  procedure(ode_integrator_interface), deferred, pass, public step - Takes a single integration step towards the desired point. More...
+ Takes a single integration step towards the desired point. More...
  procedure(ode_integrator_reset), deferred, pass, public reset - Resets the state of the integrator. More...
+ Resets the state of the integrator. More...
  -

Private Member Functions

+
procedure, private init_workspace => oa_init_workspace
 
- - - -

Private Attributes

+
real(real64), dimension(:), allocatable m_rwork
 A workspace array.
 
+
integer(int32), dimension(:), allocatable m_iwork
 An integer workspace array.
 
+
integer(int32), dimension(:), allocatable m_rststats
 An array used to contain information regarding constraint status. A value of 1 indicates the constraint was satisfied; else, a value of 0 indicates the constraint wasn't satisfied. There is one entry in the array for each constraint.
 
+
integer(int32) m_istate = 1
 This flag is used directly by ODEPACK. Set to 1 for initial call.
 

Detailed Description

Defines an integrator for systems of first order ODEs that is capable of switching between an Adams method and a BDF method automatically. This integrator is able to handle both stiff and non-stiff systems of equations.

-
Example
The following example illustrates the use of this integrator to solve the Van Der Pol equation, which is a second-order ODE that does exhibit difficult and stiff behavior.
program example
use iso_fortran_env
use integral_core
use fplot_core
implicit none
! Local Variables
type(ode_helper) :: fcn
type(ode_auto) :: integrator
procedure(ode_fcn), pointer :: ptr
real(real64) :: ic(2), t(2)
real(real64), allocatable, dimension(:,:) :: x
type(plot_2d) :: plt
type(plot_data_2d) :: d1
class(plot_axis), pointer :: xaxis, yaxis
class(legend), pointer :: lgnd
! Set up the integrator
ptr => vdp
call fcn%define_equations(2, ptr)
! Define the initial conditions
t = [0.0d0, 8.0d1]
ic = [2.0d0, 0.0d0]
! Compute the solution
x = integrator%integrate(fcn, t, ic)
! Plot the solution
call plt%initialize()
call plt%set_font_size(14)
lgnd => plt%get_legend()
call lgnd%set_is_visible(.false.)
xaxis => plt%get_x_axis()
call xaxis%set_title("t")
yaxis => plt%get_y_axis()
call yaxis%set_title("x(t)")
call d1%set_name("x(t)")
call d1%set_line_width(2.0)
call d1%set_line_color(clr_blue)
call d1%define_data(x(:,1), x(:,2))
call plt%push(d1)
call plt%draw()
contains
! Van Der Pol Equation
! x" + x - mu * (1 - x**2) * x' = 0
subroutine vdp(t, x, dxdt)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: dxdt
real(real64), parameter :: mu = 20.0d0
dxdt(1) = x(2)
dxdt(2) = mu * (1.0d0 - x(1)**2) * x(2) - x(1)
end subroutine
end program
The above program produces the following output.
+
Example
The following example illustrates the use of this integrator to solve the Van Der Pol equation, which is a second-order ODE that does exhibit difficult and stiff behavior.
program example
use iso_fortran_env
use fplot_core
implicit none
! Local Variables
type(ode_helper) :: fcn
type(ode_auto) :: integrator
procedure(ode_fcn), pointer :: ptr
real(real64) :: ic(2), t(2)
real(real64), allocatable, dimension(:,:) :: x
type(plot_2d) :: plt
type(plot_data_2d) :: d1
class(plot_axis), pointer :: xaxis, yaxis
class(legend), pointer :: lgnd
! Set up the integrator
ptr => vdp
call fcn%define_equations(2, ptr)
! Define the initial conditions
t = [0.0d0, 8.0d1]
ic = [2.0d0, 0.0d0]
! Compute the solution
x = integrator%integrate(fcn, t, ic)
! Plot the solution
call plt%initialize()
call plt%set_font_size(14)
lgnd => plt%get_legend()
call lgnd%set_is_visible(.false.)
xaxis => plt%get_x_axis()
call xaxis%set_title("t")
yaxis => plt%get_y_axis()
call yaxis%set_title("x(t)")
call d1%set_name("x(t)")
call d1%set_line_width(2.0)
call d1%set_line_color(clr_blue)
call d1%define_data(x(:,1), x(:,2))
call plt%push(d1)
call plt%draw()
contains
! Van Der Pol Equation
! x" + x - mu * (1 - x**2) * x' = 0
subroutine vdp(t, x, dxdt)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: dxdt
real(real64), parameter :: mu = 20.0d0
dxdt(1) = x(2)
dxdt(2) = mu * (1.0d0 - x(1)**2) * x(2) - x(1)
end subroutine
end program
The above program produces the following output.
vanderpol_example.png
-

Definition at line 1541 of file integral_core.f90.

+

Definition at line 1562 of file integral_core.f90.

Member Function/Subroutine Documentation

- -

◆ get_constraint_status()

- +
@@ -238,13 +262,11 @@

Returns
An array containing the status of each constraint equation. A value of true indicates that the constraint was satisfied; else, a value of false indicates the constraint was not satisfied.
-

Definition at line 1615 of file integral_core.f90.

+

Definition at line 1636 of file integral_core.f90.

- -

◆ reset()

- +

@@ -266,13 +288,11 @@

Definition at line 1603 of file integral_core.f90.

+

Definition at line 1624 of file integral_core.f90.

- -

◆ step()

- +

@@ -310,22 +330,22 @@

Returns
Returns true if the integrator requests a stop; else, false, to continue as normal. A possible sitaution resulting in a true value is in the event a constraint has been satisfied.
-

Definition at line 1594 of file integral_core.f90.

+

Definition at line 1615 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/structintegral__core_1_1ode__helper.html b/doc/html/structintegral__core_1_1ode__helper.html index cbde4c8..1fd3212 100644 --- a/doc/html/structintegral__core_1_1ode__helper.html +++ b/doc/html/structintegral__core_1_1ode__helper.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_helper Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@

- + - - - - + +
integral_core::ode_helper Type Reference
@@ -116,7 +142,7 @@ procedure, public get_constraints_defined => oh_get_constraints_defined  Determines if any constraints have been defined. More...
  - + procedure, public evaluate_ode => oh_eval   procedure, public evaluate_jacobian => oh_eval_jac @@ -128,23 +154,23 @@ - - - - - @@ -152,11 +178,9 @@

Detailed Description

Defines a type used to pass information regarding the ODEs to the solver.

-

Definition at line 609 of file integral_core.f90.

+

Definition at line 630 of file integral_core.f90.

Member Function/Subroutine Documentation

- -

◆ define_constraints()

- +

Private Attributes

+
procedure(ode_fcn), pointer, nopass m_fcn => null()
 A pointer to the routine containing the ODEs to integrate.
 
+
procedure(ode_jacobian), pointer, nopass m_jac => null()
 A pointer to the routine containing the Jacobian.
 
+
procedure(ode_constraint), pointer, nopass m_rts => null()
 A pointer to a routine containing any constraint equations.
 
+
integer(int32) m_count = 0
 The number of first order ODEs to integrate.
 
+
integer(int32) m_constraints = 0
 The number of constraint equations.
 
@@ -179,18 +203,16 @@

Example
The following example illustrates how to employ constraints by modeling a bouncing ball.
program example
use iso_fortran_env
use integral_core
use fplot_core
implicit none
! Parameters
real(real64), parameter :: g = 9.81d0 ! Gravitational acceleration
real(real64), parameter :: k = -0.8d0 ! Coefficient of restitution
! Local Variables
procedure(ode_fcn), pointer :: ptr
procedure(ode_constraint), pointer :: cptr
type(ode_helper) :: fcn
type(ode_auto) :: integrator
integer(int32) :: n
real(real64) :: ic(2), t(2)
real(real64), allocatable, dimension(:,:) :: x1, x2, x3, x4
type(plot_2d) :: plt
type(plot_data_2d) :: d1, d2, d3, d4
class(plot_axis), pointer :: xaxis, yaxis
type(legend), pointer :: lgnd
! Set up the integrator
ptr => ball
cptr => ground_constraint
call fcn%define_equations(2, ptr)
call fcn%define_constraints(1, cptr)
call integrator%set_max_step_size(1.0d-3)
call integrator%set_limit_step_size(.true.)
! Compute the solution
t = [0.0d0, 1.0d1]
ic = [1.0d1, 5.0d0]
x1 = integrator%integrate(fcn, t, ic)
! The integrator stops when the ball first makes contact. As a result, lets
! reset the time limits and initial conditions to continue the integration
n = size(x1, 1)
t(1) = x1(n,1)
ic = [abs(x1(n,2)), k * x1(n,3)]
call integrator%reset()
x2 = integrator%integrate(fcn, t, ic)
! Again
n = size(x2, 1)
t(1) = x2(n,1)
ic = [abs(x2(n,2)), k * x2(n,3)]
call integrator%reset()
x3 = integrator%integrate(fcn, t, ic)
! Again
n = size(x3, 1)
t(1) = x3(n,1)
ic = [abs(x3(n,2)), k * x3(n,3)]
call integrator%reset()
x4 = integrator%integrate(fcn, t, ic)
! Plot the solution
call plt%initialize()
call plt%set_font_size(14)
lgnd => plt%get_legend()
call lgnd%set_is_visible(.false.)
xaxis => plt%get_x_axis()
call xaxis%set_title("t")
yaxis => plt%get_y_axis()
call yaxis%set_title("x(t)")
call d1%set_line_color(clr_blue)
call d1%set_line_width(2.0)
call d1%define_data(x1(:,1), x1(:,2))
call d2%set_line_color(clr_blue)
call d2%set_line_width(2.0)
call d2%define_data(x2(:,1), x2(:,2))
call d3%set_line_color(clr_blue)
call d3%set_line_width(2.0)
call d3%define_data(x3(:,1), x3(:,2))
call d4%set_line_color(clr_blue)
call d4%set_line_width(2.0)
call d4%define_data(x4(:,1), x4(:,2))
call plt%push(d1)
call plt%push(d2)
call plt%push(d3)
call plt%push(d4)
call plt%draw()
contains
! A bouncing ball can be described by the following equation:
! x" = -g
!
! Where g = gravitational acceleration
subroutine ball(t, x, dxdt)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: dxdt
dxdt(1) = x(2)
dxdt(2) = -g
end subroutine
! The constraint function
subroutine ground_constraint(t, x, f)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: f
f(1) = x(1) ! Find when x == 0
end subroutine
end program
The above program produces the following output.
+
Example
The following example illustrates how to employ constraints by modeling a bouncing ball.
program example
use iso_fortran_env
use fplot_core
implicit none
! Parameters
real(real64), parameter :: g = 9.81d0 ! Gravitational acceleration
real(real64), parameter :: k = -0.8d0 ! Coefficient of restitution
! Local Variables
procedure(ode_fcn), pointer :: ptr
procedure(ode_constraint), pointer :: cptr
type(ode_helper) :: fcn
type(ode_auto) :: integrator
integer(int32) :: n
real(real64) :: ic(2), t(2)
real(real64), allocatable, dimension(:,:) :: x1, x2, x3, x4
type(plot_2d) :: plt
type(plot_data_2d) :: d1, d2, d3, d4
class(plot_axis), pointer :: xaxis, yaxis
type(legend), pointer :: lgnd
! Set up the integrator
ptr => ball
cptr => ground_constraint
call fcn%define_equations(2, ptr)
call fcn%define_constraints(1, cptr)
call integrator%set_max_step_size(1.0d-3)
call integrator%set_limit_step_size(.true.)
! Compute the solution
t = [0.0d0, 1.0d1]
ic = [1.0d1, 5.0d0]
x1 = integrator%integrate(fcn, t, ic)
! The integrator stops when the ball first makes contact. As a result, lets
! reset the time limits and initial conditions to continue the integration
n = size(x1, 1)
t(1) = x1(n,1)
ic = [abs(x1(n,2)), k * x1(n,3)]
call integrator%reset()
x2 = integrator%integrate(fcn, t, ic)
! Again
n = size(x2, 1)
t(1) = x2(n,1)
ic = [abs(x2(n,2)), k * x2(n,3)]
call integrator%reset()
x3 = integrator%integrate(fcn, t, ic)
! Again
n = size(x3, 1)
t(1) = x3(n,1)
ic = [abs(x3(n,2)), k * x3(n,3)]
call integrator%reset()
x4 = integrator%integrate(fcn, t, ic)
! Plot the solution
call plt%initialize()
call plt%set_font_size(14)
lgnd => plt%get_legend()
call lgnd%set_is_visible(.false.)
xaxis => plt%get_x_axis()
call xaxis%set_title("t")
yaxis => plt%get_y_axis()
call yaxis%set_title("x(t)")
call d1%set_line_color(clr_blue)
call d1%set_line_width(2.0)
call d1%define_data(x1(:,1), x1(:,2))
call d2%set_line_color(clr_blue)
call d2%set_line_width(2.0)
call d2%define_data(x2(:,1), x2(:,2))
call d3%set_line_color(clr_blue)
call d3%set_line_width(2.0)
call d3%define_data(x3(:,1), x3(:,2))
call d4%set_line_color(clr_blue)
call d4%set_line_width(2.0)
call d4%define_data(x4(:,1), x4(:,2))
call plt%push(d1)
call plt%push(d2)
call plt%push(d3)
call plt%push(d4)
call plt%draw()
contains
! A bouncing ball can be described by the following equation:
! x" = -g
!
! Where g = gravitational acceleration
subroutine ball(t, x, dxdt)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: dxdt
dxdt(1) = x(2)
dxdt(2) = -g
end subroutine
! The constraint function
subroutine ground_constraint(t, x, f)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: f
f(1) = x(1) ! Find when x == 0
end subroutine
end program
The above program produces the following output.
bouncing_ball_example.png
-

Definition at line 883 of file integral_core.f90.

+

Definition at line 904 of file integral_core.f90.

- -

◆ define_equations()

- +

@@ -214,18 +236,16 @@

Example
The following example illustrates how to define and solve a system of differential equations. The Lorenz system is illustrated.
program example
use iso_fortran_env
use integral_core
use fplot_core
implicit none
! Local Variables
type(ode_auto) :: integrator
procedure(ode_fcn), pointer :: ptr
real(real64) :: ic(3), t(2)
real(real64), allocatable, dimension(:,:) :: x
type(plot_3d) :: plt
type(plot_data_3d) :: d1
class(plot_axis), pointer :: xaxis, yaxis, zaxis
! Set up the integrator
ptr => lorenz
call fcn%define_equations(3, ptr)
ic = [1.0d0, 1.0d0, 1.0d0]
t = [0.0d0, 1.0d2]
! Integrate
x = integrator%integrate(fcn, t, ic)
! Plot
call plt%initialize()
call plt%set_font_size(14)
xaxis => plt%get_x_axis()
call xaxis%set_title("x(t)")
yaxis => plt%get_y_axis()
call yaxis%set_title("y(t)")
zaxis => plt%get_z_axis()
call zaxis%set_title("z(t)")
call d1%set_line_color(clr_blue)
call d1%define_data(x(:,2), x(:,3), x(:,4))
call plt%push(d1)
call plt%draw()
contains
! The Lorenz system of equations:
! REF: https://en.wikipedia.org/wiki/Lorenz_system
!
! x' = s * (y - x)
! y' = x * (r - z) - y
! z' = x * y - b * z
subroutine lorenz(t, x, dxdt)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: dxdt
! Parameters
real(real64), parameter :: r = 28.0d0
real(real64), parameter :: s = 10.0d0
real(real64), parameter :: b = 8.0d0 / 3.0d0
! Equations
dxdt(1) = s * (x(2) - x(1))
dxdt(2) = x(1) * (r - x(3)) - x(2)
dxdt(3) = x(1) * x(2) - b * x(3)
end subroutine
end program
The above program produces the following output.
+
Example
The following example illustrates how to define and solve a system of differential equations. The Lorenz system is illustrated.
program example
use iso_fortran_env
use fplot_core
implicit none
! Local Variables
type(ode_helper) :: fcn
type(ode_auto) :: integrator
procedure(ode_fcn), pointer :: ptr
real(real64) :: ic(3), t(2)
real(real64), allocatable, dimension(:,:) :: x
type(plot_3d) :: plt
type(plot_data_3d) :: d1
class(plot_axis), pointer :: xaxis, yaxis, zaxis
! Set up the integrator
ptr => lorenz
call fcn%define_equations(3, ptr)
ic = [1.0d0, 1.0d0, 1.0d0]
t = [0.0d0, 1.0d2]
! Integrate
x = integrator%integrate(fcn, t, ic)
! Plot
call plt%initialize()
call plt%set_font_size(14)
xaxis => plt%get_x_axis()
call xaxis%set_title("x(t)")
yaxis => plt%get_y_axis()
call yaxis%set_title("y(t)")
zaxis => plt%get_z_axis()
call zaxis%set_title("z(t)")
call d1%set_line_color(clr_blue)
call d1%define_data(x(:,2), x(:,3), x(:,4))
call plt%push(d1)
call plt%draw()
contains
! The Lorenz system of equations:
! REF: https://en.wikipedia.org/wiki/Lorenz_system
!
! x' = s * (y - x)
! y' = x * (r - z) - y
! z' = x * y - b * z
subroutine lorenz(t, x, dxdt)
real(real64), intent(in) :: t
real(real64), intent(in), dimension(:) :: x
real(real64), intent(out), dimension(:) :: dxdt
! Parameters
real(real64), parameter :: r = 28.0d0
real(real64), parameter :: s = 10.0d0
real(real64), parameter :: b = 8.0d0 / 3.0d0
! Equations
dxdt(1) = s * (x(2) - x(1))
dxdt(2) = x(1) * (r - x(3)) - x(2)
dxdt(3) = x(1) * x(2) - b * x(3)
end subroutine
end program
The above program produces the following output.
lorenz_example.png
-

Definition at line 712 of file integral_core.f90.

+

Definition at line 733 of file integral_core.f90.

- -

◆ evaluate_constraints()

- +

@@ -250,13 +270,11 @@

Definition at line 948 of file integral_core.f90.

+

Definition at line 969 of file integral_core.f90.

- -

◆ evaluate_jacobian()

- +

@@ -281,13 +299,11 @@

Definition at line 933 of file integral_core.f90.

+

Definition at line 954 of file integral_core.f90.

- -

◆ get_constraint_count()

- +

@@ -310,13 +326,11 @@

Returns
The number of constraint equations.
-

Definition at line 893 of file integral_core.f90.

+

Definition at line 914 of file integral_core.f90.

- -

◆ get_constraints_defined()

- +

@@ -339,13 +353,11 @@

Returns
True if the constraint equation routine is defined; else, false.
-

Definition at line 904 of file integral_core.f90.

+

Definition at line 925 of file integral_core.f90.

- -

◆ get_equation_count()

- +

@@ -368,13 +380,11 @@

Returns
The number of ODEs.
-

Definition at line 722 of file integral_core.f90.

+

Definition at line 743 of file integral_core.f90.

- -

◆ get_equations_defined()

- +

@@ -397,13 +407,11 @@

Returns
Returns true if the equations have been defined (by calling define_equations); else, false if they have not yet been defined.
-

Definition at line 735 of file integral_core.f90.

+

Definition at line 756 of file integral_core.f90.

- -

◆ get_jacobian_defined()

- +

@@ -426,22 +434,22 @@

Returns
Returns true if the routine for computing the Jacobian has been defined (by calling define_equations); else, false if it has not.
-

Definition at line 748 of file integral_core.f90.

+

Definition at line 769 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/structintegral__core_1_1ode__integrator.html b/doc/html/structintegral__core_1_1ode__integrator.html index fbcd964..54ed575 100644 --- a/doc/html/structintegral__core_1_1ode__integrator.html +++ b/doc/html/structintegral__core_1_1ode__integrator.html @@ -3,8 +3,7 @@ - - + integral: integral_core::ode_integrator Type Reference @@ -15,10 +14,14 @@ + @@ -38,19 +41,42 @@

- + - - - - + +
integral_core::ode_integrator Type Reference
@@ -94,7 +120,7 @@
- + integral_core::ode_auto
@@ -167,50 +193,48 @@ - - - - - - - - -

Private Attributes

+
real(real64), dimension(:), allocatable m_rtol
 An array of relative error tolerance values for each ODE.
 
+
real(real64), dimension(:), allocatable m_atol
 An array of absolute error tolerance values for each ODE.
 
+
logical m_alloutput = .true.
 Determines if output should be provided wherever the integrator computes the solution as well as at user-specified points.
 
+
logical m_canovershoot = .true.
 Determines if the integrator is allowed to overshoot a critical point and interpolate back to achieve output at the correct location.
 
+
real(real64) m_criticalpoint = 0.0d0
 The critical point that cannot be overshot. This is only utilized in the event that m_canOvershoot is set to true.
 
+
integer(int32) m_minbuffersize = 500
 Defines the minimum buffer size.
 
+
real(real64) m_maxstepsize = 1.0d0
 The maximum allowable step size. This is only used if m_limitStepSize is set to true.
 
+
logical m_limitstepsize = .false.
 Determines if limits should be imposed upon maximum step size.
 
+
integer(int32) m_maxstepcount = 500
 Determines the iteration step limit per integration step.
 

Detailed Description

-

Definition at line 1015 of file integral_core.f90.

+

Definition at line 1036 of file integral_core.f90.

Member Function/Subroutine Documentation

- -

◆ get_absolute_tolerances()

- +
@@ -233,13 +257,11 @@

Returns
An array containing the tolerance value for each ODE.
-

Definition at line 1266 of file integral_core.f90.

+

Definition at line 1287 of file integral_core.f90.

- -

◆ get_allow_overshoot()

- +

@@ -262,13 +284,11 @@

Returns
Returns true if the integrator can overshoot; else, false.
-

Definition at line 1112 of file integral_core.f90.

+

Definition at line 1133 of file integral_core.f90.

- -

◆ get_integration_limit()

- +

@@ -291,13 +311,11 @@

Returns
The integration limit.
-

Definition at line 1136 of file integral_core.f90.

+

Definition at line 1157 of file integral_core.f90.

- -

◆ get_iteration_limit()

- +

@@ -320,13 +338,11 @@

Returns
The iteration limit.
-

Definition at line 1225 of file integral_core.f90.

+

Definition at line 1246 of file integral_core.f90.

- -

◆ get_limit_step_size()

- +

@@ -349,13 +365,11 @@

Returns
Returns true if the integrator's step size should be limited; else, false.
-

Definition at line 1201 of file integral_core.f90.

+

Definition at line 1222 of file integral_core.f90.

- -

◆ get_max_step_size()

- +

@@ -378,13 +392,11 @@

Returns
The maximum step size.
-

Definition at line 1179 of file integral_core.f90.

+

Definition at line 1200 of file integral_core.f90.

- -

◆ get_min_buffer_size()

- +

@@ -407,13 +419,11 @@

Returns
The minimum buffer size.
-

Definition at line 1157 of file integral_core.f90.

+

Definition at line 1178 of file integral_core.f90.

- -

◆ get_provide_all_output()

- +

@@ -436,13 +446,11 @@

Returns
Returns true if all integrator output should be reported; else, returns false.
-

Definition at line 1087 of file integral_core.f90.

+

Definition at line 1108 of file integral_core.f90.

- -

◆ get_relative_tolerances()

- +

@@ -465,13 +473,11 @@

Returns
An array containing the tolerance value for each ODE.
-

Definition at line 1246 of file integral_core.f90.

+

Definition at line 1267 of file integral_core.f90.

- -

◆ integrate()

- +

@@ -504,13 +510,11 @@

Returns
Returns the solution in a matrix of N+1 columns. The first column contains the values of the independent variable at which the solution was computed. The remaining columns contain the solution points for each ODE.
-

Definition at line 1075 of file integral_core.f90.

+

Definition at line 1096 of file integral_core.f90.

- -

◆ reset()

- +

@@ -532,13 +536,11 @@

Definition at line 1313 of file integral_core.f90.

+

Definition at line 1334 of file integral_core.f90.

- -

◆ set_absolute_tolerances()

- +

@@ -561,13 +563,11 @@

Definition at line 1276 of file integral_core.f90.

+

Definition at line 1297 of file integral_core.f90.

- -

◆ set_allow_overshoot()

- +

@@ -590,13 +590,11 @@

Definition at line 1125 of file integral_core.f90.

+

Definition at line 1146 of file integral_core.f90.

- -

◆ set_integration_limit()

- +

@@ -619,13 +617,11 @@

Definition at line 1147 of file integral_core.f90.

+

Definition at line 1168 of file integral_core.f90.

- -

◆ set_iteration_limit()

- +

@@ -648,13 +644,11 @@

Definition at line 1236 of file integral_core.f90.

+

Definition at line 1257 of file integral_core.f90.

- -

◆ set_limit_step_size()

- +

@@ -677,13 +671,11 @@

Definition at line 1214 of file integral_core.f90.

+

Definition at line 1235 of file integral_core.f90.

- -

◆ set_max_step_size()

- +

@@ -706,13 +698,11 @@

Definition at line 1190 of file integral_core.f90.

+

Definition at line 1211 of file integral_core.f90.

- -

◆ set_min_buffer_size()

- +

@@ -735,13 +725,11 @@

Definition at line 1169 of file integral_core.f90.

+

Definition at line 1190 of file integral_core.f90.

- -

◆ set_provide_all_output()

- +

@@ -764,13 +752,11 @@

Definition at line 1100 of file integral_core.f90.

+

Definition at line 1121 of file integral_core.f90.

- -

◆ set_relative_tolerances()

- +

@@ -793,13 +779,11 @@

Definition at line 1256 of file integral_core.f90.

+

Definition at line 1277 of file integral_core.f90.

- -

◆ step()

- +

@@ -829,22 +813,22 @@

Returns
Returns true if the integrator requests a stop; else, false, to continue as normal. A possible sitaution resulting in a true value is in the event a constraint has been satisfied.
-

Definition at line 1304 of file integral_core.f90.

+

Definition at line 1325 of file integral_core.f90.


The documentation for this type was generated from the following file: diff --git a/doc/html/tabs.css b/doc/html/tabs.css index bbde11e..9cf578f 100644 --- a/doc/html/tabs.css +++ b/doc/html/tabs.css @@ -1 +1,60 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:transparent}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0px/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.sm-dox{background-image:url("tab_b.png")}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0px 12px;padding-right:43px;font-family:"Lucida Grande","Geneva","Helvetica",Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255,255,255,0.9);color:#283A5D;outline:none}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a.current{color:#D23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255,255,255,0.5);border-radius:5px}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{border-radius:0}.sm-dox ul{background:rgba(162,162,162,0.1)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media (min-width: 768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url("tab_b.png");line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#283A5D transparent transparent transparent;background:transparent;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0px 12px;background-image:url("tab_s.png");background-repeat:no-repeat;background-position:right;border-radius:0 !important}.sm-dox a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox a:hover span.sub-arrow{border-color:#fff transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent #fff transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:#fff;border-radius:5px !important;box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555;background-image:none;border:0 !important;color:#555;background-image:none}.sm-dox ul a:hover{background-image:url("tab_a.png");background-repeat:repeat-x;color:#fff;text-shadow:0px 1px 1px #000}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent #fff}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:#fff;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #D23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#D23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url("tab_b.png")}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:#fff}} +.tabs, .tabs2, .tabs3 { + background-image: url('tab_b.png'); + width: 100%; + z-index: 101; + font-size: 13px; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +.tabs2 { + font-size: 10px; +} +.tabs3 { + font-size: 9px; +} + +.tablist { + margin: 0; + padding: 0; + display: table; +} + +.tablist li { + float: left; + display: table-cell; + background-image: url('tab_b.png'); + line-height: 36px; + list-style: none; +} + +.tablist a { + display: block; + padding: 0 20px; + font-weight: bold; + background-image:url('tab_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #283A5D; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; + outline: none; +} + +.tabs3 .tablist a { + padding: 0 10px; +} + +.tablist a:hover { + background-image: url('tab_h.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); + text-decoration: none; +} + +.tablist li.current a { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: #fff; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} diff --git a/doc/html/typeintegral__core_1_1adaptive__integrator-members.html b/doc/html/typeintegral__core_1_1adaptive__integrator-members.html new file mode 100644 index 0000000..f293d4a --- /dev/null +++ b/doc/html/typeintegral__core_1_1adaptive__integrator-members.html @@ -0,0 +1,144 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+

+ + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ + + + + + diff --git a/doc/html/typeintegral__core_1_1finite__interval__integrator-members.html b/doc/html/typeintegral__core_1_1finite__interval__integrator-members.html new file mode 100644 index 0000000..57b7755 --- /dev/null +++ b/doc/html/typeintegral__core_1_1finite__interval__integrator-members.html @@ -0,0 +1,135 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::finite_interval_integrator Member List
+
+ +
+ + + + diff --git a/doc/html/typeintegral__core_1_1integration__behavior-members.html b/doc/html/typeintegral__core_1_1integration__behavior-members.html new file mode 100644 index 0000000..60debb6 --- /dev/null +++ b/doc/html/typeintegral__core_1_1integration__behavior-members.html @@ -0,0 +1,131 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::integration_behavior Member List
+
+ +
+ + + + diff --git a/doc/html/typeintegral__core_1_1integrator__base-members.html b/doc/html/typeintegral__core_1_1integrator__base-members.html new file mode 100644 index 0000000..dae847e --- /dev/null +++ b/doc/html/typeintegral__core_1_1integrator__base-members.html @@ -0,0 +1,137 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::integrator_base Member List
+
+ +
+ + + + diff --git a/doc/html/typeintegral__core_1_1nonadaptive__integrator-members.html b/doc/html/typeintegral__core_1_1nonadaptive__integrator-members.html new file mode 100644 index 0000000..4fe4a58 --- /dev/null +++ b/doc/html/typeintegral__core_1_1nonadaptive__integrator-members.html @@ -0,0 +1,138 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::nonadaptive_integrator Member List
+
+ +
+ + + + diff --git a/doc/html/typeintegral__core_1_1ode__auto-members.html b/doc/html/typeintegral__core_1_1ode__auto-members.html new file mode 100644 index 0000000..c306363 --- /dev/null +++ b/doc/html/typeintegral__core_1_1ode__auto-members.html @@ -0,0 +1,155 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::ode_auto Member List
+
+
+ +

This is the complete list of members for integral_core::ode_auto, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_absolute_tolerances=> oi_get_atolintegral_core::ode_integrator
get_allow_overshoot=> oi_get_allow_overshootintegral_core::ode_integrator
get_constraint_status=> oa_get_constraint_infointegral_core::ode_auto
get_integration_limit=> oi_get_critical_pointintegral_core::ode_integrator
get_iteration_limit=> oi_get_iteration_limitintegral_core::ode_integrator
get_limit_step_size=> oi_get_limit_step_sizeintegral_core::ode_integrator
get_max_step_size=> oi_get_max_step_sizeintegral_core::ode_integrator
get_min_buffer_size=> oi_get_min_buffer_sizeintegral_core::ode_integrator
get_provide_all_output=> oi_get_use_all_outputintegral_core::ode_integrator
get_relative_tolerances=> oi_get_rtolintegral_core::ode_integrator
init_workspace=> oa_init_workspace (defined in integral_core::ode_auto)integral_core::ode_autoprivate
integrate=> oi_integrateintegral_core::ode_integrator
m_istateintegral_core::ode_autoprivate
m_iworkintegral_core::ode_autoprivate
m_rststatsintegral_core::ode_autoprivate
m_rworkintegral_core::ode_autoprivate
reset=> oa_reset_integratorintegral_core::ode_auto
set_absolute_tolerances=> oi_set_atolintegral_core::ode_integrator
set_allow_overshoot=> oi_set_allow_overshootintegral_core::ode_integrator
set_integration_limit=> oi_set_critical_pointintegral_core::ode_integrator
set_iteration_limit=> oi_set_iteration_limitintegral_core::ode_integrator
set_limit_step_size=> oi_set_limit_step_sizeintegral_core::ode_integrator
set_max_step_size=> oi_set_max_step_sizeintegral_core::ode_integrator
set_min_buffer_size=> oi_set_min_buffer_sizeintegral_core::ode_integrator
set_provide_all_output=> oi_set_use_all_outputintegral_core::ode_integrator
set_relative_tolerances=> oi_set_rtolintegral_core::ode_integrator
step=> oa_stepintegral_core::ode_auto
+
+ + + + diff --git a/doc/html/typeintegral__core_1_1ode__helper-members.html b/doc/html/typeintegral__core_1_1ode__helper-members.html new file mode 100644 index 0000000..6318eb4 --- /dev/null +++ b/doc/html/typeintegral__core_1_1ode__helper-members.html @@ -0,0 +1,143 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::ode_helper Member List
+
+ +
+ + + + diff --git a/doc/html/typeintegral__core_1_1ode__integrator-members.html b/doc/html/typeintegral__core_1_1ode__integrator-members.html new file mode 100644 index 0000000..5a9e834 --- /dev/null +++ b/doc/html/typeintegral__core_1_1ode__integrator-members.html @@ -0,0 +1,158 @@ + + + + + + +integral: Member List + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
integral +  1.0.0 +
+
A Fortran library providing integration routines for functions and differential equations.
+
+
+ + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
integral_core::ode_integrator Member List
+
+
+ +

This is the complete list of members for integral_core::ode_integrator, including all inherited members.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
get_absolute_tolerances=> oi_get_atolintegral_core::ode_integrator
get_allow_overshoot=> oi_get_allow_overshootintegral_core::ode_integrator
get_integration_limit=> oi_get_critical_pointintegral_core::ode_integrator
get_iteration_limit=> oi_get_iteration_limitintegral_core::ode_integrator
get_limit_step_size=> oi_get_limit_step_sizeintegral_core::ode_integrator
get_max_step_size=> oi_get_max_step_sizeintegral_core::ode_integrator
get_min_buffer_size=> oi_get_min_buffer_sizeintegral_core::ode_integrator
get_provide_all_output=> oi_get_use_all_outputintegral_core::ode_integrator
get_relative_tolerances=> oi_get_rtolintegral_core::ode_integrator
integrate=> oi_integrateintegral_core::ode_integrator
m_alloutputintegral_core::ode_integratorprivate
m_atolintegral_core::ode_integratorprivate
m_canovershootintegral_core::ode_integratorprivate
m_criticalpointintegral_core::ode_integratorprivate
m_limitstepsizeintegral_core::ode_integratorprivate
m_maxstepcountintegral_core::ode_integratorprivate
m_maxstepsizeintegral_core::ode_integratorprivate
m_minbuffersizeintegral_core::ode_integratorprivate
m_rtolintegral_core::ode_integratorprivate
resetintegral_core::ode_integrator
set_absolute_tolerances=> oi_set_atolintegral_core::ode_integrator
set_allow_overshoot=> oi_set_allow_overshootintegral_core::ode_integrator
set_integration_limit=> oi_set_critical_pointintegral_core::ode_integrator
set_iteration_limit=> oi_set_iteration_limitintegral_core::ode_integrator
set_limit_step_size=> oi_set_limit_step_sizeintegral_core::ode_integrator
set_max_step_size=> oi_set_max_step_sizeintegral_core::ode_integrator
set_min_buffer_size=> oi_set_min_buffer_sizeintegral_core::ode_integrator
set_provide_all_output=> oi_set_use_all_outputintegral_core::ode_integrator
set_relative_tolerances=> oi_set_rtolintegral_core::ode_integrator
stepintegral_core::ode_integrator
+
+ + + + diff --git a/examples/pendulum.f90 b/examples/pendulum.f90 index 3a527e4..a28e4d2 100644 --- a/examples/pendulum.f90 +++ b/examples/pendulum.f90 @@ -13,6 +13,7 @@ program example type(plot_2d) :: plt type(plot_data_2d) :: d1, d2 class(plot_axis), pointer :: xAxis, yAxis + type(legend), pointer :: lgnd real(real64) :: t(2), ic(4) real(real64), allocatable, dimension(:,:) :: s real(real64), allocatable, dimension(:) :: x1, y1, x2, y2 @@ -29,7 +30,7 @@ program example call fcn%define_equations(4, ptr) ! Compute the solution - t = [0.0d0, 60.0d0] + t = [0.0d0, 40.0d0] ic = [0.2d0, 0.0d0, 0.8d0, 0.0d0] s = integrator%integrate(fcn, t, ic) @@ -44,6 +45,10 @@ program example call plt%initialize() call plt%set_font_size(14) + lgnd => plt%get_legend() + call lgnd%set_horizontal_position(LEGEND_LEFT) + call lgnd%set_vertical_position(LEGEND_BOTTOM) + xAxis => plt%get_x_axis() call xAxis%set_title("t") @@ -64,6 +69,10 @@ program example ! ---------- call plt%clear_all() + call lgnd%set_horizontal_position(LEGEND_RIGHT) + call lgnd%set_vertical_position(LEGEND_TOP) + call lgnd%set_draw_inside_axes(.false.) + call lgnd%set_draw_border(.false.) call xAxis%set_title("") call yAxis%set_title("") diff --git a/images/double_pendulum_example.png b/images/double_pendulum_example.png new file mode 100644 index 0000000..11ad25b Binary files /dev/null and b/images/double_pendulum_example.png differ diff --git a/images/double_pendulum_example_no_legend.png b/images/double_pendulum_example_no_legend.png new file mode 100644 index 0000000..d3f5dfe Binary files /dev/null and b/images/double_pendulum_example_no_legend.png differ diff --git a/images/double_pendulum_example_short_time.png b/images/double_pendulum_example_short_time.png new file mode 100644 index 0000000..9f9e332 Binary files /dev/null and b/images/double_pendulum_example_short_time.png differ diff --git a/images/double_pendulum_example_short_time_no_legend.png b/images/double_pendulum_example_short_time_no_legend.png new file mode 100644 index 0000000..55f8b8a Binary files /dev/null and b/images/double_pendulum_example_short_time_no_legend.png differ diff --git a/images/double_pendulum_time_history_short.png b/images/double_pendulum_time_history_short.png new file mode 100644 index 0000000..891b3da Binary files /dev/null and b/images/double_pendulum_time_history_short.png differ diff --git a/src/integral_core.f90 b/src/integral_core.f90 index 5468ba6..a00f269 100644 --- a/src/integral_core.f90 +++ b/src/integral_core.f90 @@ -1,5 +1,20 @@ ! integral_core.f90 +!> @mainpage +!! +!! @section intro_sec Introduction +!! INTEGRAL is a Fortran library providing an easy-to-use, object-oriented +!! interface to several integration routines. Integration of functions of one +!! variable are provided by the QUADPACK library. Integration of systems of +!! ordinary differential equations are provided by the ODEPACK library. +!! +!! @image html double_pendulum_example_short_time_no_legend.png + +!> @brief \b integral_core +!! +!! @par Purpose +!! Provides types and routines allowing for the integration of functions and +!! systems of ordinary differential equations. module integral_core use, intrinsic :: iso_fortran_env, only : int32, real64 use ferror @@ -59,8 +74,14 @@ module integral_core integer(int32), parameter :: INT_LACK_OF_DEFINITION_ERROR = 8 !> @brief An error indicating an inappropriately sized array. integer(int32), parameter :: INT_ARRAY_SIZE_MISMATCH_ERROR = 9 + !> @brief An error indicating the too many iterations have been performed + !! suggesting that excessive amounts of work are required to continue the + !! solution process. integer(int32), parameter :: INT_EXCESSIVE_WORK_ERROR = 10 + !> @brief An error indicating that the user-defined tolerances are too + !! stringent to be practical for the problem at hand. integer(int32), parameter :: INT_IMPRACTICAL_TOLERANCE_ERROR = 11 + !> @brief An error that occurs if integrator error tests fail repeatadly. integer(int32), parameter :: INT_REPEATED_ERROR_TEST_FAILURE = 12 ! ------------------------------------------------------------------------------