60 real(kind=
rp),
pointer :: tlag(:) => null()
61 real(kind=
rp),
pointer :: dtlag(:) => null()
80 real(kind=
rp) :: mesh2mesh_tol = 1d-6
96 class(
chkp_t),
intent(inout) :: this
97 type(
field_t),
intent(in),
target :: u
98 type(
field_t),
intent(in),
target :: v
99 type(
field_t),
intent(in),
target :: w
100 type(
field_t),
intent(in),
target :: p
104 if ( u%Xh .ne. v%Xh .or. &
105 u%Xh .ne. w%Xh )
then
106 call neko_error(
'Different function spaces for each velocity component')
110 if ( u%msh%nelv .ne. p%msh%nelv )
then
111 call neko_error(
'Velocity and pressure defined on different meshes')
125 type(
chkp_t),
intent(inout) :: this
140 class(
chkp_t),
intent(inout) :: this
143 associate(u=>this%u, v=>this%v, w=>this%w, &
144 ulag=>this%ulag, vlag=>this%vlag, wlag=>this%wlag, &
147 if (
associated(this%u) .and.
associated(this%v) .and. &
148 associated(this%w) .and.
associated(this%p))
then
155 if (
associated(this%ulag) .and.
associated(this%vlag) .and. &
156 associated(this%wlag))
then
184 if (
associated(this%s))
then
204 class(
chkp_t),
intent(inout) :: this
206 if (neko_bcknd_device .eq. 1)
then
207 associate(u=>this%u, v=>this%v, w=>this%w, &
208 ulag=>this%ulag, vlag=>this%vlag, wlag=>this%wlag,&
211 if (
associated(this%u) .and.
associated(this%v) .and. &
212 associated(this%w))
then
213 call device_memcpy(u%x, u%x_d, u%dof%size(), &
214 host_to_device, sync=.false.)
215 call device_memcpy(v%x, v%x_d, v%dof%size(), &
216 host_to_device, sync=.false.)
217 call device_memcpy(w%x, w%x_d, w%dof%size(), &
218 host_to_device, sync=.false.)
219 call device_memcpy(p%x, p%x_d, p%dof%size(), &
220 host_to_device, sync=.false.)
223 if (
associated(this%ulag) .and.
associated(this%vlag) .and. &
224 associated(this%wlag))
then
225 call device_memcpy(ulag%lf(1)%x, ulag%lf(1)%x_d, u%dof%size(), &
226 host_to_device, sync=.false.)
227 call device_memcpy(ulag%lf(2)%x, ulag%lf(2)%x_d, u%dof%size(), &
228 host_to_device, sync=.false.)
230 call device_memcpy(vlag%lf(1)%x, vlag%lf(1)%x_d, v%dof%size(), &
231 host_to_device, sync=.false.)
232 call device_memcpy(vlag%lf(2)%x, vlag%lf(2)%x_d, v%dof%size(), &
233 host_to_device, sync=.false.)
235 call device_memcpy(wlag%lf(1)%x, wlag%lf(1)%x_d, w%dof%size(), &
236 host_to_device, sync=.false.)
237 call device_memcpy(wlag%lf(2)%x, wlag%lf(2)%x_d, w%dof%size(), &
238 host_to_device, sync=.false.)
240 if (
associated(this%s))
then
241 call device_memcpy(this%s%x, this%s%x_d, this%s%dof%size(), &
242 host_to_device, sync=.false.)
244 call device_memcpy(this%slag%lf(1)%x, this%slag%lf(1)%x_d, &
245 this%s%dof%size(), host_to_device, sync=.false.)
246 call device_memcpy(this%slag%lf(2)%x, this%slag%lf(2)%x_d, &
247 this%s%dof%size(), host_to_device, sync=.false.)
248 call device_memcpy(this%abs1%x, this%abs1%x_d, &
249 w%dof%size(), host_to_device, sync=.false.)
250 call device_memcpy(this%abs2%x, this%abs2%x_d, &
251 w%dof%size(), host_to_device, sync=.false.)
260 class(
chkp_t),
intent(inout) :: this
261 type(field_series_t),
target :: ulag
262 type(field_series_t),
target :: vlag
263 type(field_series_t),
target :: wlag
273 class(
chkp_t),
intent(inout) :: this
274 type(field_t),
target :: s
283 class(
chkp_t),
intent(in) :: this
284 real(kind=dp) :: rtime
Copy data between host and device (or device and device)
Synchronize a device or stream.
subroutine chkp_sync_host(this)
Synchronize checkpoint with device.
subroutine chkp_init(this, u, v, w, p)
Initialize checkpoint structure with mandatory data.
subroutine chkp_sync_device(this)
Synchronize device with checkpoint.
subroutine chkp_add_scalar(this, s)
Add scalars.
pure real(kind=dp) function chkp_restart_time(this)
Return restart time from a loaded checkpoint.
subroutine chkp_free(this)
Reset checkpoint.
subroutine chkp_add_lag(this, ulag, vlag, wlag)
Add lagged velocity terms.
Device abstraction, common interface for various accelerators.
integer, parameter, public device_to_host
integer, parameter neko_bcknd_device
integer, parameter, public dp
integer, parameter, public rp
Global precision used in computations.
Defines a function space.
The function space for the SEM solution fields.