69 subroutine dudxyz (du, u, dr, ds, dt, coef)
70 type(
coef_t),
intent(in),
target :: coef
71 real(kind=
rp),
dimension(coef%Xh%lx,coef%Xh%ly,coef%Xh%lz,coef%msh%nelv), &
73 real(kind=
rp),
dimension(coef%Xh%lx,coef%Xh%ly,coef%Xh%lz,coef%msh%nelv), &
74 intent(in) :: u, dr, ds, dt
99 subroutine opgrad(ux, uy, uz, u, coef, es, ee)
100 type(
coef_t),
intent(in) :: coef
101 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: ux
102 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: uy
103 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: uz
104 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: u
105 integer,
optional :: es, ee
106 integer :: eblk_start, eblk_end
108 if (
present(es))
then
114 if (
present(ee))
then
117 eblk_end = coef%msh%nelv
137 integer,
intent(in) :: n
138 integer,
intent(in) :: glb_n
139 real(kind=
rp),
dimension(n),
intent(inout) :: x
140 real(kind=
rp) :: rlam
142 rlam =
glsum(x, n)/glb_n
143 call cadd(x, -rlam, n)
156 subroutine cdtp (dtx, x, dr, ds, dt, coef)
157 type(
coef_t),
intent(in) :: coef
158 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: dtx
159 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(inout) :: x
160 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: dr
161 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: ds
162 real(kind=
rp),
dimension(coef%Xh%lxyz,coef%msh%nelv),
intent(in) :: dt
186 subroutine conv1(du, u, vx, vy, vz, Xh, coef, es, ee)
187 type(
space_t),
intent(inout) :: xh
188 type(
coef_t),
intent(inout) :: coef
189 real(kind=
rp),
intent(inout) :: du(xh%lxyz,coef%msh%nelv)
190 real(kind=
rp),
intent(inout) :: u(xh%lx,xh%ly,xh%lz,coef%msh%nelv)
191 real(kind=
rp),
intent(inout) :: vx(xh%lx,xh%ly,xh%lz,coef%msh%nelv)
192 real(kind=
rp),
intent(inout) :: vy(xh%lx,xh%ly,xh%lz,coef%msh%nelv)
193 real(kind=
rp),
intent(inout) :: vz(xh%lx,xh%ly,xh%lz,coef%msh%nelv)
194 integer,
optional :: es, ee
195 integer :: eblk_end, eblk_start
197 associate(nelv => coef%msh%nelv, gdim => coef%msh%gdim)
198 if (
present(es))
then
204 if (
present(ee))
then
207 eblk_end = coef%msh%nelv
211 call opr_sx_conv1(du, u, vx, vy, vz, xh, coef, nelv, gdim)
217 call opr_cpu_conv1(du, u, vx, vy, vz, xh, coef, eblk_start, eblk_end)
233 subroutine curl(w1, w2, w3, u1, u2, u3, work1, work2, coef)
234 type(field_t),
intent(inout) :: w1
235 type(field_t),
intent(inout) :: w2
236 type(field_t),
intent(inout) :: w3
237 type(field_t),
intent(inout) :: u1
238 type(field_t),
intent(inout) :: u2
239 type(field_t),
intent(inout) :: u3
240 type(field_t),
intent(inout) :: work1
241 type(field_t),
intent(inout) :: work2
242 type(coef_t),
intent(in) :: coef
244 if (neko_bcknd_sx .eq. 1)
then
245 call opr_sx_curl(w1, w2, w3, u1, u2, u3, work1, work2, coef)
246 else if (neko_bcknd_xsmm .eq. 1)
then
247 call opr_xsmm_curl(w1, w2, w3, u1, u2, u3, work1, work2, coef)
248 else if (neko_bcknd_device .eq. 1)
then
249 call opr_device_curl(w1, w2, w3, u1, u2, u3, work1, work2, coef)
251 call opr_cpu_curl(w1, w2, w3, u1, u2, u3, work1, work2, coef)
265 function cfl(dt, u, v, w, Xh, coef, nelv, gdim)
266 type(space_t),
intent(in) :: xh
267 type(coef_t),
intent(in) :: coef
268 integer,
intent(in) :: nelv, gdim
269 real(kind=rp),
intent(in) :: dt
270 real(kind=rp),
dimension(Xh%lx,Xh%ly,Xh%lz,nelv),
intent(in) :: u, v, w
274 if (neko_bcknd_sx .eq. 1)
then
275 cfl = opr_sx_cfl(dt, u, v, w, xh, coef, nelv, gdim)
276 else if (neko_bcknd_device .eq. 1)
then
277 cfl = opr_device_cfl(dt, u, v, w, xh, coef, nelv, gdim)
279 cfl = opr_cpu_cfl(dt, u, v, w, xh, coef, nelv, gdim)
282 if (.not. neko_device_mpi)
then
283 call mpi_allreduce(mpi_in_place,
cfl, 1, &
284 mpi_real_precision, mpi_max, neko_comm, ierr)
301 subroutine strain_rate(s11, s22, s33, s12, s13, s23, u, v, w, coef)
302 type(field_t),
intent(in) :: u, v, w
303 type(coef_t),
intent(in) :: coef
304 real(kind=rp),
intent(inout) :: s11(u%Xh%lx, u%Xh%ly, u%Xh%lz, u%msh%nelv)
305 real(kind=rp),
intent(inout) :: s22(u%Xh%lx, u%Xh%ly, u%Xh%lz, u%msh%nelv)
306 real(kind=rp),
intent(inout) :: s33(u%Xh%lx, u%Xh%ly, u%Xh%lz, u%msh%nelv)
307 real(kind=rp),
intent(inout) :: s12(u%Xh%lx, u%Xh%ly, u%Xh%lz, u%msh%nelv)
308 real(kind=rp),
intent(inout) :: s23(u%Xh%lx, u%Xh%ly, u%Xh%lz, u%msh%nelv)
309 real(kind=rp),
intent(inout) :: s13(u%Xh%lx, u%Xh%ly, u%Xh%lz, u%msh%nelv)
311 type(c_ptr) :: s11_d, s22_d, s33_d, s12_d, s23_d, s13_d
313 integer :: nelv, lxyz
315 if (neko_bcknd_device .eq. 1)
then
316 s11_d = device_get_ptr(s11)
317 s22_d = device_get_ptr(s22)
318 s33_d = device_get_ptr(s33)
319 s12_d = device_get_ptr(s12)
320 s23_d = device_get_ptr(s23)
321 s13_d = device_get_ptr(s13)
328 call dudxyz (s12, u%x, coef%drdy, coef%dsdy, coef%dtdy, coef)
329 call dudxyz (s11, v%x, coef%drdx, coef%dsdx, coef%dtdx, coef)
330 if (neko_bcknd_device .eq. 1)
then
331 call device_add2(s12_d, s11_d, nelv*lxyz)
333 call add2(s12, s11, nelv*lxyz)
336 call dudxyz (s13, u%x, coef%drdz, coef%dsdz, coef%dtdz, coef)
337 call dudxyz (s11, w%x, coef%drdx, coef%dsdx, coef%dtdx, coef)
338 if (neko_bcknd_device .eq. 1)
then
339 call device_add2(s13_d, s11_d, nelv*lxyz)
341 call add2(s13, s11, nelv*lxyz)
344 call dudxyz (s23, v%x, coef%drdz, coef%dsdz, coef%dtdz, coef)
345 call dudxyz (s11, w%x, coef%drdy, coef%dsdy, coef%dtdy, coef)
346 if (neko_bcknd_device .eq. 1)
then
347 call device_add2(s23_d, s11_d, nelv*lxyz)
349 call add2(s23, s11, nelv*lxyz)
352 call dudxyz (s11, u%x, coef%drdx, coef%dsdx, coef%dtdx, coef)
353 call dudxyz (s22, v%x, coef%drdy, coef%dsdy, coef%dtdy, coef)
354 call dudxyz (s33, w%x, coef%drdz, coef%dsdz, coef%dtdz, coef)
356 if (neko_bcknd_device .eq. 1)
then
357 call device_cmult(s11_d, 2.0_rp, nelv*lxyz)
358 call device_cmult(s22_d, 2.0_rp, nelv*lxyz)
359 call device_cmult(s33_d, 2.0_rp, nelv*lxyz)
361 call cmult(s11, 2.0_rp, nelv*lxyz)
362 call cmult(s22, 2.0_rp, nelv*lxyz)
363 call cmult(s33, 2.0_rp, nelv*lxyz)
375 type(coef_t),
intent(in) :: coef
376 type(field_t),
intent(inout) ::
lambda2
377 type(field_t),
intent(in) :: u, v, w
379 if (neko_bcknd_sx .eq. 1)
then
380 call opr_sx_lambda2(
lambda2, u, v, w, coef)
381 else if (neko_bcknd_device .eq. 1)
then
382 call opr_device_lambda2(
lambda2, u, v, w, coef)
384 call opr_cpu_lambda2(
lambda2, u, v, w, coef)
Return the device pointer for an associated Fortran array.
subroutine, public device_add2(a_d, b_d, n)
subroutine, public device_cmult(a_d, c, n)
Device abstraction, common interface for various accelerators.
A simulation component that computes lambda2 The values are stored in the field registry under the na...
subroutine, public cmult(a, c, n)
Multiplication by constant c .
subroutine, public cadd(a, s, n)
Add a scalar to vector .
real(kind=rp) function, public glsum(a, n)
Sum a vector of length n.
subroutine, public add2(a, b, n)
Vector addition .
integer, parameter neko_bcknd_sx
integer, parameter neko_bcknd_device
logical, parameter neko_device_mpi
integer, parameter neko_bcknd_xsmm
integer, parameter, public rp
Global precision used in computations.
subroutine, public cdtp(dtx, x, dr, ds, dt, coef)
Apply D^T to a scalar field, where D is the derivative matrix.
subroutine, public opgrad(ux, uy, uz, u, coef, es, ee)
Compute the gradient of a scalar field.
subroutine, public curl(w1, w2, w3, u1, u2, u3, work1, work2, coef)
subroutine, public strain_rate(s11, s22, s33, s12, s13, s23, u, v, w, coef)
Compute double the strain rate tensor, i.e du_i/dx_j + du_j/dx_i.
subroutine, public lambda2op(lambda2, u, v, w, coef)
Compute the Lambda2 field for a given velocity field.
subroutine, public ortho(x, n, glb_n)
Othogonalize with regard to vector (1,1,1,1,1,1...,1)^T.
subroutine, public dudxyz(du, u, dr, ds, dt, coef)
Compute derivative of a scalar field along a single direction.
real(kind=rp) function, public cfl(dt, u, v, w, Xh, coef, nelv, gdim)
subroutine, public conv1(du, u, vx, vy, vz, Xh, coef, es, ee)
Compute the advection term.
subroutine, public opr_cpu_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_Xh)
subroutine, public opr_cpu_dudxyz(du, u, dr, ds, dt, coef)
subroutine, public opr_cpu_conv1(du, u, vx, vy, vz, Xh, coef, e_start, e_end)
subroutine, public opr_cpu_cdtp(dtx, x, dr, ds, dt, coef)
subroutine, public opr_cpu_lambda2(lambda2, u, v, w, coef)
real(kind=rp) function, public opr_cpu_cfl(dt, u, v, w, Xh, coef, nelv, gdim)
subroutine, public opr_cpu_opgrad(ux, uy, uz, u, coef, e_start, e_end)
Operators accelerator backends.
real(kind=rp) function, public opr_device_cfl(dt, u, v, w, Xh, coef, nelv, gdim)
subroutine, public opr_device_cdtp(dtx, x, dr, ds, dt, coef)
subroutine, public opr_device_conv1(du, u, vx, vy, vz, Xh, coef, nelv, gdim)
subroutine, public opr_device_dudxyz(du, u, dr, ds, dt, coef)
subroutine, public opr_device_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_Xh)
subroutine, public opr_device_opgrad(ux, uy, uz, u, coef)
subroutine, public opr_device_lambda2(lambda2, u, v, w, coef)
Operators SX-Aurora backend.
subroutine, public opr_sx_conv1(du, u, vx, vy, vz, Xh, coef, nelv, gdim)
subroutine, public opr_sx_opgrad(ux, uy, uz, u, coef)
subroutine, public opr_sx_dudxyz(du, u, dr, ds, dt, coef)
real(kind=rp) function, public opr_sx_cfl(dt, u, v, w, Xh, coef, nelv, gdim)
subroutine, public opr_sx_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_Xh)
subroutine, public opr_sx_cdtp(dtx, x, dr, ds, dt, coef)
subroutine, public opr_sx_lambda2(lambda2, u, v, w, coef)
Operators libxsmm backend.
subroutine, public opr_xsmm_cdtp(dtx, x, dr, ds, dt, coef)
subroutine, public opr_xsmm_dudxyz(du, u, dr, ds, dt, coef)
subroutine, public opr_xsmm_opgrad(ux, uy, uz, u, coef)
subroutine, public opr_xsmm_curl(w1, w2, w3, u1, u2, u3, work1, work2, c_Xh)
subroutine, public opr_xsmm_conv1(du, u, vx, vy, vz, Xh, coef, nelv, gdim)
Defines a function space.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
The function space for the SEM solution fields.