104 integer,
intent(in) :: lxd
105 type(
coef_t),
intent(inout),
target :: coef
106 integer :: nel, n_GL, n
108 call this%Xh_GL%init(
gl, lxd, lxd, lxd)
109 this%Xh_GLL => coef%Xh
110 this%coef_GLL => coef
111 call this%GLL_to_GL%init(this%Xh_GL, this%Xh_GLL)
113 call this%coef_GL%init(this%Xh_GL, coef%msh)
116 n_gl = nel*this%Xh_GL%lxyz
118 call this%GLL_to_GL%map(this%coef_GL%drdx, coef%drdx, nel, this%Xh_GL)
119 call this%GLL_to_GL%map(this%coef_GL%dsdx, coef%dsdx, nel, this%Xh_GL)
120 call this%GLL_to_GL%map(this%coef_GL%dtdx, coef%dtdx, nel, this%Xh_GL)
121 call this%GLL_to_GL%map(this%coef_GL%drdy, coef%drdy, nel, this%Xh_GL)
122 call this%GLL_to_GL%map(this%coef_GL%dsdy, coef%dsdy, nel, this%Xh_GL)
123 call this%GLL_to_GL%map(this%coef_GL%dtdy, coef%dtdy, nel, this%Xh_GL)
124 call this%GLL_to_GL%map(this%coef_GL%drdz, coef%drdz, nel, this%Xh_GL)
125 call this%GLL_to_GL%map(this%coef_GL%dsdz, coef%dsdz, nel, this%Xh_GL)
126 call this%GLL_to_GL%map(this%coef_GL%dtdz, coef%dtdz, nel, this%Xh_GL)
130 allocate(this%temp(n_gl))
131 allocate(this%tbf(n_gl))
132 allocate(this%tx(n_gl))
133 allocate(this%ty(n_gl))
134 allocate(this%tz(n_gl))
135 allocate(this%vr(n_gl))
136 allocate(this%vs(n_gl))
137 allocate(this%vt(n_gl))
240 type(
space_t),
intent(in) :: Xh
241 type(
coef_t),
intent(in) :: coef
242 type(
field_t),
intent(inout) :: vx, vy, vz
243 type(
field_t),
intent(inout) :: fx, fy, fz
244 integer,
intent(in) :: n
245 real(kind=
rp),
intent(in),
optional :: dt
247 real(kind=
rp),
dimension(this%Xh_GL%lxyz) :: tx, ty, tz
248 real(kind=
rp),
dimension(this%Xh_GL%lxyz) :: tfx, tfy, tfz
249 real(kind=
rp),
dimension(this%Xh_GL%lxyz) :: vr, vs, vt
250 real(kind=
rp),
dimension(this%Xh_GLL%lxyz) :: tempx, tempy, tempz
251 integer :: e, i, idx, nel, n_GL
254 n_gl = nel * this%Xh_GL%lxyz
257 associate(c_gl => this%coef_GL)
259 call this%GLL_to_GL%map(this%tx, vx%x, nel, this%Xh_GL)
260 call this%GLL_to_GL%map(this%ty, vy%x, nel, this%Xh_GL)
261 call this%GLL_to_GL%map(this%tz, vz%x, nel, this%Xh_GL)
263 call opgrad(this%vr, this%vs, this%vt, this%tx, c_gl)
264 call device_vdot3(this%tbf_d, this%vr_d, this%vs_d, this%vt_d, &
265 this%tx_d, this%ty_d, this%tz_d, n_gl)
266 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
270 call opgrad(this%vr, this%vs, this%vt, this%ty, c_gl)
271 call device_vdot3(this%tbf_d, this%vr_d, this%vs_d, this%vt_d, &
272 this%tx_d, this%ty_d, this%tz_d, n_gl)
273 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
276 call opgrad(this%vr, this%vs, this%vt, this%tz, c_gl)
277 call device_vdot3(this%tbf_d, this%vr_d, this%vs_d, this%vt_d, &
278 this%tx_d, this%ty_d, this%tz_d, n_gl)
279 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
284 call this%GLL_to_GL%map(this%tx, vx%x, nel, this%Xh_GL)
285 call this%GLL_to_GL%map(this%ty, vy%x, nel, this%Xh_GL)
286 call this%GLL_to_GL%map(this%tz, vz%x, nel, this%Xh_GL)
288 call opgrad(this%vr, this%vs, this%vt, this%tx, c_gl)
289 call vdot3(this%tbf, this%vr, this%vs, this%vt, &
290 this%tx, this%ty, this%tz, n_gl)
291 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
292 call sub2(fx%x, this%temp, n)
295 call opgrad(this%vr, this%vs, this%vt, this%ty, c_gl)
296 call vdot3(this%tbf, this%vr, this%vs, this%vt, &
297 this%tx, this%ty, this%tz, n_gl)
298 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
299 call sub2(fy%x, this%temp, n)
301 call opgrad(this%vr, this%vs, this%vt, this%tz, c_gl)
302 call vdot3(this%tbf, this%vr, this%vs, this%vt, &
303 this%tx, this%ty, this%tz, n_gl)
304 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
305 call sub2(fz%x, this%temp, n)
309 do e = 1, coef%msh%nelv
310 call this%GLL_to_GL%map(tx, vx%x(1,1,1,e), 1, this%Xh_GL)
311 call this%GLL_to_GL%map(ty, vy%x(1,1,1,e), 1, this%Xh_GL)
312 call this%GLL_to_GL%map(tz, vz%x(1,1,1,e), 1, this%Xh_GL)
314 call opgrad(vr, vs, vt, tx, c_gl, e, e)
315 do i = 1, this%Xh_GL%lxyz
316 tfx(i) = tx(i)*vr(i) + ty(i)*vs(i) + tz(i)*vt(i)
319 call opgrad(vr, vs, vt, ty, c_gl, e, e)
320 do i = 1, this%Xh_GL%lxyz
321 tfy(i) = tx(i)*vr(i) + ty(i)*vs(i) + tz(i)*vt(i)
324 call opgrad(vr, vs, vt, tz, c_gl, e, e)
325 do i = 1, this%Xh_GL%lxyz
326 tfz(i) = tx(i)*vr(i) + ty(i)*vs(i) + tz(i)*vt(i)
329 call this%GLL_to_GL%map(tempx, tfx, 1, this%Xh_GLL)
330 call this%GLL_to_GL%map(tempy, tfy, 1, this%Xh_GLL)
331 call this%GLL_to_GL%map(tempz, tfz, 1, this%Xh_GLL)
333 idx = (e-1)*this%Xh_GLL%lxyz+1
334 do concurrent(i = 0:this%Xh_GLL%lxyz-1)
335 fx%x(i+idx,1,1,1) = fx%x(i+idx,1,1,1) - tempx(i+1)
336 fy%x(i+idx,1,1,1) = fy%x(i+idx,1,1,1) - tempy(i+1)
337 fz%x(i+idx,1,1,1) = fz%x(i+idx,1,1,1) - tempz(i+1)
360 type(field_t),
intent(inout) :: vx, vy, vz
361 type(field_t),
intent(inout) :: s
362 type(field_t),
intent(inout) :: fs
363 type(space_t),
intent(in) :: Xh
364 type(coef_t),
intent(in) :: coef
365 integer,
intent(in) :: n
366 real(kind=rp),
intent(in),
optional :: dt
368 real(kind=rp),
dimension(this%Xh_GL%lxyz) :: vx_gl, vy_gl, vz_gl, s_gl
369 real(kind=rp),
dimension(this%Xh_GL%lxyz) :: dsdx, dsdy, dsdz
370 real(kind=rp),
dimension(this%Xh_GL%lxyz) :: f_gl
371 integer :: e, i, idx, nel, n_GL
372 real(kind=rp),
dimension(this%Xh_GLL%lxyz) :: temp
375 n_gl = nel * this%Xh_GL%lxyz
377 associate(c_gl => this%coef_GL)
378 if (neko_bcknd_device .eq. 1)
then
381 call this%GLL_to_GL%map(this%tx, vx%x, nel, this%Xh_GL)
382 call this%GLL_to_GL%map(this%ty, vy%x, nel, this%Xh_GL)
383 call this%GLL_to_GL%map(this%tz, vz%x, nel, this%Xh_GL)
386 call this%GLL_to_GL%map(this%temp, s%x, nel, this%Xh_GL)
389 call opgrad(this%vr, this%vs, this%vt, this%temp, c_gl)
392 call device_vdot3(this%tbf_d, this%vr_d, this%vs_d, this%vt_d, &
393 this%tx_d, this%ty_d, this%tz_d, n_gl)
396 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
399 call device_sub2(fs%x_d, this%temp_d, n)
401 else if ((neko_bcknd_sx .eq. 1) .or. (neko_bcknd_xsmm .eq. 1))
then
404 call this%GLL_to_GL%map(this%tx, vx%x, nel, this%Xh_GL)
405 call this%GLL_to_GL%map(this%ty, vy%x, nel, this%Xh_GL)
406 call this%GLL_to_GL%map(this%tz, vz%x, nel, this%Xh_GL)
409 call this%GLL_to_GL%map(this%temp, s%x, nel, this%Xh_GL)
412 call opgrad(this%vr, this%vs, this%vt, this%temp, c_gl)
415 call vdot3(this%tbf, this%vr, this%vs, this%vt, &
416 this%tx, this%ty, this%tz, n_gl)
419 call this%GLL_to_GL%map(this%temp, this%tbf, nel, this%Xh_GLL)
422 call sub2(fs%x, this%temp, n)
425 do e = 1, coef%msh%nelv
427 call this%GLL_to_GL%map(vx_gl, vx%x(1,1,1,e), 1, this%Xh_GL)
428 call this%GLL_to_GL%map(vy_gl, vy%x(1,1,1,e), 1, this%Xh_GL)
429 call this%GLL_to_GL%map(vz_gl, vz%x(1,1,1,e), 1, this%Xh_GL)
432 call this%GLL_to_GL%map(s_gl, s%x(1,1,1,e), 1, this%Xh_GL)
435 call opgrad(dsdx, dsdy, dsdz, s_gl, c_gl, e, e)
438 do i = 1, this%Xh_GL%lxyz
439 f_gl(i) = vx_gl(i)*dsdx(i) + vy_gl(i)*dsdy(i) + vz_gl(i)*dsdz(i)
443 call this%GLL_to_GL%map(temp, f_gl, 1, this%Xh_GLL)
445 idx = (e-1)*this%Xh_GLL%lxyz + 1
447 call sub2(fs%x(idx, 1, 1, 1), temp, this%Xh_GLL%lxyz)