66 real(kind=
rp),
pointer :: tlag(:) => null()
67 real(kind=
rp),
pointer :: dtlag(:) => null()
90 real(kind=
dp) :: t = 0d0
102 real(kind=
rp),
pointer :: msh_x(:,:,:,:) => null()
103 real(kind=
rp),
pointer :: msh_y(:,:,:,:) => null()
104 real(kind=
rp),
pointer :: msh_z(:,:,:,:) => null()
105 type(c_ptr) :: msh_x_d = c_null_ptr
106 type(c_ptr) :: msh_y_d = c_null_ptr
107 type(c_ptr) :: msh_z_d = c_null_ptr
108 real(kind=
rp),
pointer :: pivot_pos(:) => null()
109 real(kind=
rp),
pointer :: pivot_vel_lag(:,:) => null()
110 real(kind=
rp),
pointer :: blag(:,:,:,:) => null()
111 real(kind=
rp),
pointer :: blaglag(:,:,:,:) => null()
112 type(c_ptr) :: blag_d = c_null_ptr
113 type(c_ptr) :: blaglag_d = c_null_ptr
114 real(kind=
rp),
pointer :: basis_pos(:) => null()
115 real(kind=
rp),
pointer :: basis_vel_lag(:,:) => null()
209 class(
chkp_t),
intent(inout) :: this
213 associate(u => this%u, v => this%v, w => this%w, &
214 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag, &
217 if (
associated(this%u) .and.
associated(this%v) .and. &
218 associated(this%w) .and.
associated(this%p))
then
225 if (
associated(this%ulag) .and.
associated(this%vlag) .and. &
226 associated(this%wlag))
then
243 if (
associated(this%s))
then
252 if (
associated(this%wm_x) .and.
associated(this%wm_y) .and. &
253 associated(this%wm_z))
then
258 if (
associated(this%wm_x_lag) .and.
associated(this%wm_y_lag) &
259 .and.
associated(this%wm_z_lag))
then
277 if (
associated(this%msh_x) .and. c_associated(this%msh_x_d))
then
285 if (
associated(this%Blag) .and. c_associated(this%Blag_d))
then
286 call device_memcpy(this%Blag, this%Blag_d,
size(this%Blag), &
289 if (
associated(this%Blaglag) .and. c_associated(this%Blaglag_d))
then
296 do i = 1, this%scalar_lags%size()
300 slag => this%scalar_lags%get(i)
301 slag_size = slag%size()
309 if (
allocated(this%scalar_abx1) .and.
allocated(this%scalar_abx2))
then
310 do i = 1,
size(this%scalar_abx1)
318 call device_sync(glb_cmd_queue)
325 class(
chkp_t),
intent(inout) :: this
328 if (neko_bcknd_device .eq. 1)
then
329 associate(u => this%u, v => this%v, w => this%w, &
330 ulag => this%ulag, vlag => this%vlag, wlag => this%wlag, &
333 if (
associated(this%u) .and.
associated(this%v) .and. &
334 associated(this%w))
then
335 call u%copy_from(host_to_device, sync = .false.)
336 call v%copy_from(host_to_device, sync = .false.)
337 call w%copy_from(host_to_device, sync = .false.)
338 call p%copy_from(host_to_device, sync = .false.)
341 if (
associated(this%ulag) .and.
associated(this%vlag) .and. &
342 associated(this%wlag))
then
343 call ulag%lf(1)%copy_from(host_to_device, sync = .false.)
344 call ulag%lf(2)%copy_from(host_to_device, sync = .false.)
346 call vlag%lf(1)%copy_from(host_to_device, sync = .false.)
347 call vlag%lf(2)%copy_from(host_to_device, sync = .false.)
349 call wlag%lf(1)%copy_from(host_to_device, sync = .false.)
350 call wlag%lf(2)%copy_from(host_to_device, sync = .false.)
353 if (
associated(this%s))
then
354 call this%s%copy_from(host_to_device, sync = .false.)
356 call this%slag%lf(1)%copy_from(host_to_device, sync = .false.)
357 call this%slag%lf(2)%copy_from(host_to_device, sync = .false.)
358 call this%abs1%copy_from(host_to_device, sync = .false.)
359 call this%abs2%copy_from(host_to_device, sync = .false.)
363 if (
associated(this%wm_x) .and.
associated(this%wm_y) .and. &
364 associated(this%wm_z))
then
366 call this%wm_x%copy_from(host_to_device, sync = .false.)
367 call this%wm_y%copy_from(host_to_device, sync = .false.)
368 call this%wm_z%copy_from(host_to_device, sync = .false.)
370 if (
associated(this%wm_x_lag) .and. &
371 associated(this%wm_y_lag) .and. &
372 associated(this%wm_z_lag))
then
373 call this%wm_x_lag%lf(1)%copy_from(host_to_device, &
375 call this%wm_x_lag%lf(2)%copy_from(host_to_device, &
378 call this%wm_y_lag%lf(1)%copy_from(host_to_device, &
380 call this%wm_y_lag%lf(2)%copy_from(host_to_device, &
383 call this%wm_z_lag%lf(1)%copy_from(host_to_device, &
385 call this%wm_z_lag%lf(2)%copy_from(host_to_device, &
389 if (
associated(this%msh_x) .and. c_associated(this%msh_x_d))
then
390 call device_memcpy(this%msh_x, this%msh_x_d, &
391 size(this%msh_x), host_to_device, .false.)
392 call device_memcpy(this%msh_y, this%msh_y_d, &
393 size(this%msh_y), host_to_device, .false.)
394 call device_memcpy(this%msh_z, this%msh_z_d, &
395 size(this%msh_z), host_to_device, .false.)
398 if (
associated(this%Blag) .and. c_associated(this%Blag_d))
then
399 call device_memcpy(this%Blag, this%Blag_d,
size(this%Blag), &
400 host_to_device, .false.)
403 if (
associated(this%Blaglag) .and. &
404 c_associated(this%Blaglag_d))
then
405 call device_memcpy(this%Blaglag, this%Blaglag_d, &
406 size(this%Blaglag), host_to_device, .false.)
411 if (
allocated(this%scalar_lags%items) .and. &
412 this%scalar_lags%size() > 0)
then
413 do i = 1, this%scalar_lags%size()
415 type(field_series_t),
pointer :: slag
416 integer :: slag_size, dof_size
417 slag => this%scalar_lags%get(i)
418 slag_size = slag%size()
419 dof_size = slag%f%dof%size()
421 call slag%lf(j)%copy_from(host_to_device, sync = .false.)
428 if (
allocated(this%scalar_abx1) .and.
allocated(this%scalar_abx2))
then
429 do i = 1,
size(this%scalar_abx1)
430 call this%scalar_abx1(i)%ptr%copy_from(host_to_device, &
432 call this%scalar_abx2(i)%ptr%copy_from(host_to_device, &
500 Blag, Blaglag, Blag_d, Blaglag_d, wm_x, wm_y, wm_z, &
501 wm_x_lag, wm_y_lag, wm_z_lag, pivot_pos, pivot_vel_lag, &
502 basis_pos, basis_vel_lag)
503 class(
chkp_t),
intent(inout) :: this
504 type(field_t),
target,
intent(in) :: wm_x, wm_y, wm_z
505 real(kind=rp),
intent(in),
pointer :: pivot_pos(:), pivot_vel_lag(:,:)
506 type(field_series_t),
target,
intent(in) :: wm_x_lag, wm_y_lag, wm_z_lag
507 real(kind=rp),
intent(in),
pointer :: x(:,:,:,:), y(:,:,:,:), z(:,:,:,:)
508 real(kind=rp),
pointer,
intent(in) :: blag(:,:,:,:), blaglag(:,:,:,:)
509 real(kind=rp),
intent(in),
pointer :: basis_pos(:)
510 real(kind=rp),
intent(in),
pointer :: basis_vel_lag(:,:)
511 type(c_ptr),
intent(in),
value :: x_d, y_d, z_d
512 type(c_ptr),
intent(in),
value :: Blag_d, Blaglag_d
523 this%wm_x_lag => wm_x_lag
524 this%wm_y_lag => wm_y_lag
525 this%wm_z_lag => wm_z_lag
527 this%Blaglag => blaglag
529 this%Blaglag_d = blaglag_d
530 this%pivot_pos => pivot_pos
531 this%pivot_vel_lag => pivot_vel_lag
532 this%basis_pos => basis_pos
533 this%basis_vel_lag => basis_vel_lag
subroutine chkp_add_ale(this, x, y, z, x_d, y_d, z_d, blag, blaglag, blag_d, blaglag_d, wm_x, wm_y, wm_z, wm_x_lag, wm_y_lag, wm_z_lag, pivot_pos, pivot_vel_lag, basis_pos, basis_vel_lag)
Add mesh velocity and other required variables to checkpointing for ALE.