Neko 1.99.2
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
ext_time_scheme.f90
Go to the documentation of this file.
1! Copyright (c) 2008-2020, UCHICAGO ARGONNE, LLC.
2!
3! The UChicago Argonne, LLC as Operator of Argonne National
4! Laboratory holds copyright in the Software. The copyright holder
5! reserves all rights except those expressly granted to licensees,
6! and U.S. Government license rights.
7!
8! Redistribution and use in source and binary forms, with or without
9! modification, are permitted provided that the following conditions
10! are met:
11!
12! 1. Redistributions of source code must retain the above copyright
13! notice, this list of conditions and the disclaimer below.
14!
15! 2. Redistributions in binary form must reproduce the above copyright
16! notice, this list of conditions and the disclaimer (as noted below)
17! in the documentation and/or other materials provided with the
18! distribution.
19!
20! 3. Neither the name of ANL nor the names of its contributors
21! may be used to endorse or promote products derived from this software
22! without specific prior written permission.
23!
24! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
28! UCHICAGO ARGONNE, LLC, THE U.S. DEPARTMENT OF
29! ENERGY OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30! SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
31! TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32! DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33! THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34! (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35! OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36!
37! Additional BSD Notice
38! ---------------------
39! 1. This notice is required to be provided under our contract with
40! the U.S. Department of Energy (DOE). This work was produced at
41! Argonne National Laboratory under Contract
42! No. DE-AC02-06CH11357 with the DOE.
43!
44! 2. Neither the United States Government nor UCHICAGO ARGONNE,
45! LLC nor any of their employees, makes any warranty,
46! express or implied, or assumes any liability or responsibility for the
47! accuracy, completeness, or usefulness of any information, apparatus,
48! product, or process disclosed, or represents that its use would not
49! infringe privately-owned rights.
50!
51! 3. Also, reference herein to any specific commercial products, process,
52! or services by trade name, trademark, manufacturer or otherwise does
53! not necessarily constitute or imply its endorsement, recommendation,
54! or favoring by the United States Government or UCHICAGO ARGONNE LLC.
55! The views and opinions of authors expressed
56! herein do not necessarily state or reflect those of the United States
57! Government or UCHICAGO ARGONNE, LLC, and shall
58! not be used for advertising or product endorsement purposes.
59!
62 use num_types, only : rp
63 use time_scheme, only : time_scheme_t
64 use math, only : rzero
65 use utils, only : neko_error
66 implicit none
67 private
68
83 type, public, extends(time_scheme_t) :: ext_time_scheme_t
84 contains
88 procedure, nopass :: compute_modified_coeffs => &
90 end type ext_time_scheme_t
91
92contains
93
97 subroutine ext_time_scheme_compute_coeffs(coeffs, dt, order)
98 implicit none
99 real(kind=rp), intent(out) :: coeffs(4)
100 real(kind=rp), intent(in) :: dt(10)
101 integer, intent(in) :: order
102
103 call rzero(coeffs, 4)
104
105 select case (order)
106 case (1)
107 coeffs(1) = 1.0_rp
108 case (2)
109 coeffs(2) = -dt(1) / dt(2)
110 coeffs(1) = 1.0_rp - coeffs(2)
111 case (3)
112 coeffs(3) = dt(1) / (dt(2) + dt(3)) * (dt(1) + dt(2)) / dt(3)
113 coeffs(2) = - dt(1) / dt(2) * (1.0_rp + dt(2) / dt(3) + dt(1) / dt(3))
114 coeffs(1) = 1.0_rp - coeffs(2) - coeffs(3)
115 case default
116 call neko_error("The order of the EXT time scheme must be 1 to 3.")
117 end select
118 end subroutine ext_time_scheme_compute_coeffs
119
123 implicit none
124 real(kind=rp), intent(out) :: coeffs(4)
125 real(kind=rp), intent(in) :: dt(10)
126 real(kind=rp) dta, dtb, dtc, dtd, dte, dts
127
128 call rzero(coeffs, 4)
129
130 dts = dt(2) + dt(3)
131 dta = dt(1) / dt(2)
132 dtb = dt(2) / dt(3)
133 dtc = dt(1) / dt(3)
134 dtd = dts / dt(2)
135 dte = dt(1) / dts
136 coeffs(3) = 2.0_rp / 3.0_rp * dtc * (1.0_rp / dtd + dte)
137 coeffs(2) = -dta - coeffs(3) * dtd
138 coeffs(1) = 1.0_rp - coeffs(2) - coeffs(3)
139
141end module ext_time_scheme
Interface for setting the scheme coefficients.
Explicit extrapolation scheme for time integration.
subroutine ext_time_scheme_compute_modified_coeffs(coeffs, dt)
Compute the modified scheme coefficients.
subroutine ext_time_scheme_compute_coeffs(coeffs, dt, order)
Compute the scheme coefficients.
Definition math.f90:60
subroutine, public rzero(a, n)
Zero a real vector.
Definition math.f90:205
integer, parameter, public rp
Global precision used in computations.
Definition num_types.f90:12
Base class for time integration schemes.
Utilities.
Definition utils.f90:35
Explicit extrapolation scheme for time integration.
Base abstract class for time integration schemes.