41 use,
intrinsic :: iso_c_binding
46 real(kind=
rp),
allocatable :: s(:,:,:,:)
48 type(c_ptr) :: s_d = c_null_ptr
59 real(kind=
rp),
intent(in) :: t
67 real(kind=
rp),
intent(inout) :: s
68 integer,
intent(in) :: j
69 integer,
intent(in) :: k
70 integer,
intent(in) :: l
71 integer,
intent(in) :: e
72 real(kind=
rp),
intent(in) :: t
81 type(
dofmap_t),
intent(in),
target :: dm
87 allocate(f%s(dm%Xh%lx, dm%Xh%ly, dm%Xh%lz, dm%msh%nelv))
101 if (
allocated(f%s))
then
107 if (c_associated(f%s_d))
then
125 call neko_error(
'Pointwise source_scalar terms not supported on accelerators')
128 f%eval_pw => f_eval_pw
135 real(kind=
rp),
intent(in) :: t
146 real(kind=
rp),
intent(in) :: t
147 integer :: j, k, l, e
148 integer :: jj,kk,ll,ee
150 do e = 1, f%dm%msh%nelv
158 call f%eval_pw(f%s(j,k,l,e), jj, kk, ll, ee, t)
Map a Fortran array to a device (allocate and associate)
Abstract interface defining how to compute a source_scalar term pointwise.
Abstract interface defining how to compute a source_scalar term.
subroutine, public device_rzero(a_d, n)
Zero a real vector.
Device abstraction, common interface for various accelerators.
subroutine, public device_free(x_d)
Deallocate memory on the device.
Defines a mapping of the degrees of freedom.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Source terms for scalars.
subroutine source_scalar_eval_noforce(f, t)
Eval routine for zero forcing.
subroutine source_scalar_free(f)
Deallocate a source_scalar term f.
subroutine source_scalar_init(f, dm)
Initialize a source_scalar term f.
subroutine source_scalar_set_type(f, f_eval)
Set the eval method for the source_scalar term f.
subroutine source_scalar_set_pw_type(f, f_eval_pw)
Set the pointwise eval method for the source_scalar term f.
subroutine source_scalar_eval_pw(f, t)
Driver for all pointwise source_scalar term evaluatons.
Defines a source term for the scalar transport equation term .