Neko 1.99.3
A portable framework for high-order spectral element flow simulations
Loading...
Searching...
No Matches
iextm_time_scheme.f90
Go to the documentation of this file.
1! Copyright (c) 2026, The Neko Authors
2! All rights reserved.
3!
4! Redistribution and use in source and binary forms, with or without
5! modification, are permitted provided that the following conditions
6! are met:
7!
8! * Redistributions of source code must retain the above copyright
9! notice, this list of conditions and the following disclaimer.
10!
11! * Redistributions in binary form must reproduce the above
12! copyright notice, this list of conditions and the following
13! disclaimer in the documentation and/or other materials provided
14! with the distribution.
15!
16! * Neither the name of the authors nor the names of its
17! contributors may be used to endorse or promote products derived
18! from this software without specific prior written permission.
19!
20! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21! "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23! FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24! COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25! INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26! BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27! LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28! CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
30! ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
31! POSSIBILITY OF SUCH DAMAGE.
32!
33! Implemented as shown in:
34! Brandon E. Merrill, Yulia T. Peet, Paul F. Fischer, & James W. Lottes (2016).
35! A spectrally accurate method for overlapping grid solution of incompressible
36! Navier–Stokes equations. Journal of Computational Physics, 307, 60-93.
38 use num_types, only : rp
39 use time_scheme, only : time_scheme_t
40 use math, only : rzero
41 use utils, only : neko_error
42 implicit none
43 private
44
46 type, public, extends(time_scheme_t) :: iextm_time_scheme_t
47 contains
50 end type iextm_time_scheme_t
51
52contains
53
58 subroutine iextm_time_scheme_compute_coeffs(coeffs, dt, order)
59 implicit none
60 real(kind=rp), intent(out) :: coeffs(4)
61 real(kind=rp), intent(in) :: dt(10)
62 integer, intent(in) :: order
63 real(kind=rp) :: x(0:3), xtest
64 integer :: i, j
65 real(kind=rp) :: basis
66
67 call rzero(coeffs, 4)
68
69 ! This is the direct way, working for constant tstep
70 !select case (order)
71 !case (1)
72 ! coeffs(1) = 1.0_rp
73 !case (2)
74 ! coeffs(2) = -1.0_rp
75 ! coeffs(1) = 2.0_rp
76 !case (3)
77 ! coeffs(3) = 1.0_rp
78 ! coeffs(2) = -3.0_rp
79 ! coeffs(1) = 3.0_rp
80 !case default
81 ! call neko_error("The order of the IEXTm time scheme must be 1 to 3.")
82 !end select
83
84 if (order .lt. 1 .or. order .gt. 3) then
85 call neko_error("The order of the IEXTm time scheme must be 1 to 3.")
86 end if
87
88 ! Create the nodes to build the interpolation basis
89 ! This simply places old points as nodes in a 1d grid
90 x(0) = dt(1) ! Current timestep
91 do i = 1, order
92 x(i) = x(i-1) - dt(i)
93 end do
94 ! Define the test point
95 xtest = x(0)
96
98 do i = 1, order
99 basis = 1.0_rp
100 do j = 1, order
101 if (j .ne. i) then
102 basis = basis * (xtest - x(j)) / (x(i) - x(j))
103 end if
104 end do
105 coeffs(i) = basis
106 end do
107
109
110end module iextm_time_scheme
Interface for setting the scheme coefficients.
subroutine iextm_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:233
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 interface extrapolation scheme for overset grids.
Base abstract class for time integration schemes.