41 use,
intrinsic :: iso_c_binding
68 integer,
intent(in),
target :: order
95 real(kind=
rp),
intent(inout) :: t, t_past, t_future
96 type(
field_t),
intent(inout) :: f, f_past, f_future
97 real(kind=
rp) :: w_past, w_future
100 if (this%order .eq. 2)
then
103 w_past = ( t_future - t ) / ( t_future - t_past )
104 w_future = ( t - t_past ) / ( t_future - t_past )
110 call add3s2(f%x, f_past%x, f_future%x, w_past, w_future, n)
114 call neko_error(
"Time interpolation of required order &
115 &is not implemented")
129 real(kind=
rp),
intent(in) :: t
130 integer,
intent(in) :: n
131 real(kind=
rp),
dimension(n, 0:this%order - 1),
intent(in) :: f_n
132 real(kind=
rp),
dimension(n),
intent(inout) :: f_interpolated
133 real(kind=
rp),
dimension(0:this%order),
intent(in) :: tlag
137 integer,
parameter :: lwtmax = 10
138 real(kind=
rp) :: wt(0:lwtmax)
141 if (this%order .gt. lwtmax)
then
142 call neko_error(
"lwtmax is smaller than the number &
143 &of stored convecting fields")
148 call rzero(f_interpolated, n)
150 do concurrent(i = 1:n)
152 f_interpolated(i) = f_interpolated(i) + wt(l) * f_n(i,l)
subroutine, public device_add3s2(a_d, b_d, c_d, c1, c2, n)
Returns .
Fast diagonalization methods from NEKTON.
subroutine, public fd_weights_full(xi, x, n, m, c)
Compute finite-difference stencil weights for evaluating derivatives up to order at a point.
subroutine, public add3s2(a, b, c, c1, c2, n)
Returns .
subroutine, public rzero(a, n)
Zero a real vector.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Implements type time_interpolator_t.
subroutine time_interpolator_interpolate(this, t, f, t_past, f_past, t_future, f_future)
Interpolate a field at time t from fields at time t-dt and t+dt.
subroutine time_interpolator_free(this)
Destructor.
subroutine time_interpolator_init(this, order)
Constructor.
subroutine time_interpolator_scalar(this, t, f_interpolated, f_n, tlag, n)
Interpolate a scalar field at time t from known scalar fields at different time steps.
Provides a tool to perform interpolation in time.