3 use ieee_arithmetic,
only: ieee_is_nan
11 type(user_t),
intent(inout) :: usr
18 subroutine user_ic(u, v, w, p, params)
19 type(field_t),
intent(inout) :: u
20 type(field_t),
intent(inout) :: v
21 type(field_t),
intent(inout) :: w
22 type(field_t),
intent(inout) :: p
23 type(json_file),
intent(inout) :: params
24 integer :: iel, ix, iy, iz
25 real(kind=rp) :: fcoeff(3), xl(2)
29 do iel = 1, u%msh%nelv
33 xl(1) = u%dof%x(ix, iy, iz, iel)
34 xl(2) = u%dof%y(ix, iy, iz, iel)
38 u%x(ix, iy, iz, iel) =
math_ran_dst(ix, iy, iz, iel, xl, &
43 v%x(ix, iy, iz, iel) =
math_ran_dst(ix, iy, iz, iel, xl, &
45 w%x(ix, iy, iz, iel) = 0.0_rp
51 call device_memcpy(u%x, u%x_d, u%size(), host_to_device, .true.)
52 call device_memcpy(v%x, v%x_d, v%size(), host_to_device, .true.)
53 call device_memcpy(w%x, w%x_d, w%size(), host_to_device, .true.)
77 integer ix, iy, iz, ieg
78 real(kind=rp) :: fcoeff(3), xl(2)
81 fcoeff(2)*ix*iy + fcoeff(3)*ix
User defined user region.
real function math_ran_dst(ix, iy, iz, ieg, xl, fcoeff)
Give random distribution depending on position.
subroutine user_ic(u, v, w, p, params)
subroutine user_setup(user)
Register user defined functions (see nekos user_intf.f90)