45 use,
intrinsic :: iso_c_binding, only: c_ptr, c_null_ptr, c_associated
51 real(kind=
rp),
allocatable :: temp(:)
52 type(c_ptr) :: temp_d = c_null_ptr
63 procedure, pass(this) :: compute_scalar => &
73 type(
coef_t),
intent(in) :: coef
75 allocate(this%temp(coef%dof%size()))
78 call device_map(this%temp, this%temp_d, coef%dof%size())
87 if (
allocated(this%temp))
then
90 if (c_associated(this%temp_d))
then
110 type(
space_t),
intent(in) :: Xh
111 type(
coef_t),
intent(in) :: coef
112 type(
field_t),
intent(inout) :: vx, vy, vz
113 type(
field_t),
intent(inout) :: fx, fy, fz
114 integer,
intent(in) :: n
115 real(kind=
rp),
intent(in),
optional :: dt
119 call conv1(this%temp, vx%x, vx%x, vy%x, vz%x, xh, coef)
121 call conv1(this%temp, vy%x, vx%x, vy%x, vz%x, xh, coef)
123 if (coef%Xh%lz .eq. 1)
then
126 call conv1(this%temp, vz%x, vx%x, vy%x, vz%x, xh, coef)
130 call conv1(this%temp, vx%x, vx%x, vy%x, vz%x, xh, coef)
131 call subcol3 (fx%x, coef%B, this%temp, n)
132 call conv1(this%temp, vy%x, vx%x, vy%x, vz%x, xh, coef)
133 call subcol3 (fy%x, coef%B, this%temp, n)
134 if (coef%Xh%lz .eq. 1)
then
135 call rzero (this%temp, n)
137 call conv1(this%temp, vz%x, vx%x, vy%x, vz%x, xh, coef)
138 call subcol3(fz%x, coef%B, this%temp, n)
159 type(
field_t),
intent(inout) :: vx, vy, vz
160 type(
field_t),
intent(inout) :: s
161 type(
field_t),
intent(inout) :: fs
162 type(
space_t),
intent(in) :: Xh
163 type(
coef_t),
intent(in) :: coef
164 integer,
intent(in) :: n
165 real(kind=
rp),
intent(in),
optional :: dt
169 call conv1(this%temp, s%x, vx%x, vy%x, vz%x, xh, coef)
171 if (coef%Xh%lz .eq. 1)
then
176 call conv1(this%temp, s%x, vx%x, vy%x, vz%x, xh, coef)
179 call subcol3 (fs%x, coef%B, this%temp, n)
180 if (coef%Xh%lz .eq. 1)
then
181 call rzero (this%temp, n)
Return the device pointer for an associated Fortran array.
Map a Fortran array to a device (allocate and associate)
Subroutines to add advection terms to the RHS of a transport equation.
subroutine init_no_dealias(this, coef)
Constructor.
subroutine free_no_dealias(this)
Destructor.
subroutine compute_scalar_advection_no_dealias(this, vx, vy, vz, s, fs, xh, coef, n, dt)
Add the advection term for a scalar, i.e. , to the RHS.
subroutine compute_advection_no_dealias(this, vx, vy, vz, fx, fy, fz, xh, coef, n, dt)
Add the advection term for the fluid, i.e. to the RHS.
Subroutines to add advection terms to the RHS of a transport equation.
subroutine, public device_rzero(a_d, n)
Zero a real vector.
subroutine, public device_subcol3(a_d, b_d, c_d, n)
Returns .
Device abstraction, common interface for various accelerators.
subroutine, public device_free(x_d)
Deallocate memory on the device.
subroutine, public subcol3(a, b, c, n)
Returns .
subroutine, public rzero(a, n)
Zero a real vector.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
subroutine, public conv1(du, u, vx, vy, vz, xh, coef, es, ee)
Compute the advection term.
Defines a function space.
Type encapsulating advection routines with no dealiasing applied.
Base abstract type for computing the advection operator.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
The function space for the SEM solution fields.