47 use,
intrinsic :: iso_c_binding, only : c_ptr, c_null_ptr, c_associated
53 real(kind=
rp),
allocatable :: temp(:)
54 type(c_ptr) :: temp_d = c_null_ptr
65 procedure, pass(this) :: compute_scalar => &
80 type(
coef_t),
intent(in) :: coef
82 allocate(this%temp(coef%dof%size()))
85 call device_map(this%temp, this%temp_d, coef%dof%size())
94 if (
allocated(this%temp))
then
97 if (c_associated(this%temp_d))
then
117 type(
space_t),
intent(in) :: Xh
118 type(
coef_t),
intent(in) :: coef
119 type(
field_t),
intent(inout) :: vx, vy, vz
120 type(
field_t),
intent(inout) :: fx, fy, fz
121 integer,
intent(in) :: n
122 real(kind=
rp),
intent(in),
optional :: dt
126 call conv1(this%temp, vx%x, vx%x, vy%x, vz%x, xh, coef)
128 call conv1(this%temp, vy%x, vx%x, vy%x, vz%x, xh, coef)
130 if (coef%Xh%lz .eq. 1)
then
133 call conv1(this%temp, vz%x, vx%x, vy%x, vz%x, xh, coef)
137 call conv1(this%temp, vx%x, vx%x, vy%x, vz%x, xh, coef)
138 call subcol3 (fx%x, coef%B, this%temp, n)
139 call conv1(this%temp, vy%x, vx%x, vy%x, vz%x, xh, coef)
140 call subcol3 (fy%x, coef%B, this%temp, n)
141 if (coef%Xh%lz .eq. 1)
then
142 call rzero (this%temp, n)
144 call conv1(this%temp, vz%x, vx%x, vy%x, vz%x, xh, coef)
145 call subcol3(fz%x, coef%B, this%temp, n)
166 type(
field_t),
intent(inout) :: vx, vy, vz
167 type(
field_t),
intent(inout) :: s
168 type(
field_t),
intent(inout) :: fs
169 type(
space_t),
intent(in) :: Xh
170 type(
coef_t),
intent(in) :: coef
171 integer,
intent(in) :: n
172 real(kind=
rp),
intent(in),
optional :: dt
176 call conv1(this%temp, s%x, vx%x, vy%x, vz%x, xh, coef)
178 if (coef%Xh%lz .eq. 1)
then
183 call conv1(this%temp, s%x, vx%x, vy%x, vz%x, xh, coef)
186 call subcol3 (fs%x, coef%B, this%temp, n)
187 if (coef%Xh%lz .eq. 1)
then
188 call rzero (this%temp, n)
196 type(
coef_t),
intent(in) :: coef
197 logical,
intent(in) :: moving_boundary
202 wm_x, wm_y, wm_z, fx, fy, fz, Xh, coef, n, dt)
204 type(
field_t),
intent(inout) :: vx, vy, vz
205 type(
field_t),
intent(inout) :: wm_x, wm_y, wm_z
206 type(
field_t),
intent(inout) :: fx, fy, fz
207 type(
space_t),
intent(in) :: Xh
208 type(
coef_t),
intent(in) :: coef
209 type(
field_t),
pointer :: work_x, work_y, work_z
210 integer :: id_x, id_y, id_z
211 integer,
intent(in) :: n
212 real(kind=
rp),
intent(in),
optional :: dt
222 call div(this%temp, work_x%x, work_y%x, work_z%x, coef)
227 call addcol3(fx%x, coef%B, this%temp, n)
234 call div(this%temp, work_x%x, work_y%x, work_z%x, coef)
239 call addcol3(fy%x, coef%B, this%temp, n)
246 call div(this%temp, work_x%x, work_y%x, work_z%x, coef)
251 call addcol3(fz%x, coef%B, 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_ale_advection_no_dealias(this, vx, vy, vz, wm_x, wm_y, wm_z, fx, fy, fz, xh, coef, n, dt)
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 recompute_metrics_no_dealias(this, coef, moving_boundary)
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_addcol3(a_d, b_d, c_d, n, strm)
Returns .
subroutine, public device_rzero(a_d, n, strm)
Zero a real vector.
subroutine, public device_subcol3(a_d, b_d, c_d, n, strm)
Returns .
Device abstraction, common interface for various accelerators.
subroutine, public device_free(x_d)
Deallocate memory on the device.
subroutine, public field_col3(a, b, c, n)
Vector multiplication with 3 vectors .
subroutine, public subcol3(a, b, c, n)
Returns .
subroutine, public addcol3(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 div(res, ux, uy, uz, coef)
Compute the divergence of a vector field.
subroutine, public conv1(du, u, vx, vy, vz, xh, coef, es, ee)
Compute the advection term.
Defines a registry for storing and requesting temporary objects This can be used when you have a func...
type(scratch_registry_t), target, public neko_scratch_registry
Global scratch registry.
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.