162 integer,
intent(in) :: n
163 real(kind=
rp),
intent(inout),
dimension(n) :: x
164 real(kind=
rp),
intent(inout),
dimension(n) :: y
165 real(kind=
rp),
intent(inout),
dimension(n) :: z
166 real(kind=
rp),
intent(in),
optional :: t
167 integer,
intent(in),
optional :: tstep
168 logical,
intent(in),
optional :: strong
169 integer :: i, m, k, idx(4), facet, tstep_
171 logical :: strong_ = .true.
173 if (
present(strong)) strong_ = strong
181 if (
present(tstep))
then
188 xc => this%coef%dof%x, yc => this%coef%dof%y, zc => this%coef%dof%z, &
189 nx => this%coef%nx, ny => this%coef%ny, nz => this%coef%nz, &
190 lx => this%coef%Xh%lx)
195 facet = this%facet(i)
199 call this%eval(x(k), y(k), z(k), &
200 xc(idx(1), idx(2), idx(3), idx(4)), &
201 yc(idx(1), idx(2), idx(3), idx(4)), &
202 zc(idx(1), idx(2), idx(3), idx(4)), &
203 nx(idx(2), idx(3), facet, idx(4)), &
204 ny(idx(2), idx(3), facet, idx(4)), &
205 nz(idx(2), idx(3), facet, idx(4)), &
206 idx(1), idx(2), idx(3), idx(4), &
209 call this%eval(x(k), y(k), z(k), &
210 xc(idx(1), idx(2), idx(3), idx(4)), &
211 yc(idx(1), idx(2), idx(3), idx(4)), &
212 zc(idx(1), idx(2), idx(3), idx(4)), &
213 nx(idx(1), idx(3), facet, idx(4)), &
214 ny(idx(1), idx(3), facet, idx(4)), &
215 nz(idx(1), idx(3), facet, idx(4)), &
216 idx(1), idx(2), idx(3), idx(4), &
219 call this%eval(x(k), y(k), z(k), &
220 xc(idx(1), idx(2), idx(3), idx(4)), &
221 yc(idx(1), idx(2), idx(3), idx(4)), &
222 zc(idx(1), idx(2), idx(3), idx(4)), &
223 nx(idx(1), idx(2), facet, idx(4)), &
224 ny(idx(1), idx(2), facet, idx(4)), &
225 nz(idx(1), idx(2), facet, idx(4)), &
226 idx(1), idx(2), idx(3), idx(4), &
240 real(kind=rp),
intent(in),
optional :: t
241 integer,
intent(in),
optional :: tstep
242 logical,
intent(in),
optional :: strong
243 integer :: i, m, k, idx(4), facet, tstep_
244 integer(c_size_t) :: s
246 real(kind=rp),
allocatable :: x(:)
247 real(kind=rp),
allocatable :: y(:)
248 real(kind=rp),
allocatable :: z(:)
249 logical :: strong_ = .true.
251 if (
present(strong)) strong_ = strong
259 if (
present(tstep))
then
266 xc => this%coef%dof%x, yc => this%coef%dof%y, zc => this%coef%dof%z, &
267 nx => this%coef%nx, ny => this%coef%ny, nz => this%coef%nz, &
268 lx => this%coef%Xh%lx, usr_x_d => this%usr_x_d, &
269 usr_y_d => this%usr_y_d, usr_z_d => this%usr_z_d)
275 if (.not. c_associated(usr_x_d) .and. strong_ .and. &
276 (this%msk(0) .gt. 0))
then
277 allocate(x(m), y(m), z(m))
281 call device_alloc(usr_x_d, s)
282 call device_alloc(usr_y_d, s)
283 call device_alloc(usr_z_d, s)
285 associate(xc => this%coef%dof%x, yc => this%coef%dof%y, &
286 zc => this%coef%dof%z, &
287 nx => this%coef%nx, ny => this%coef%ny, nz => this%coef%nz, &
288 lx => this%coef%Xh%lx)
291 facet = this%facet(i)
295 call this%eval(x(i), y(i), z(i), &
296 xc(idx(1), idx(2), idx(3), idx(4)), &
297 yc(idx(1), idx(2), idx(3), idx(4)), &
298 zc(idx(1), idx(2), idx(3), idx(4)), &
299 nx(idx(2), idx(3), facet, idx(4)), &
300 ny(idx(2), idx(3), facet, idx(4)), &
301 nz(idx(2), idx(3), facet, idx(4)), &
302 idx(1), idx(2), idx(3), idx(4), &
305 call this%eval(x(i), y(i), z(i), &
306 xc(idx(1), idx(2), idx(3), idx(4)), &
307 yc(idx(1), idx(2), idx(3), idx(4)), &
308 zc(idx(1), idx(2), idx(3), idx(4)), &
309 nx(idx(1), idx(3), facet, idx(4)), &
310 ny(idx(1), idx(3), facet, idx(4)), &
311 nz(idx(1), idx(3), facet, idx(4)), &
312 idx(1), idx(2), idx(3), idx(4), &
315 call this%eval(x(i), y(i), z(i), &
316 xc(idx(1), idx(2), idx(3), idx(4)), &
317 yc(idx(1), idx(2), idx(3), idx(4)), &
318 zc(idx(1), idx(2), idx(3), idx(4)), &
319 nx(idx(1), idx(2), facet, idx(4)), &
320 ny(idx(1), idx(2), facet, idx(4)), &
321 nz(idx(1), idx(2), facet, idx(4)), &
322 idx(1), idx(2), idx(3), idx(4), &
328 call device_memcpy(x, usr_x_d, m, host_to_device, sync = .false.)
329 call device_memcpy(y, usr_y_d, m, host_to_device, sync = .false.)
330 call device_memcpy(z, usr_z_d, m, host_to_device, sync = .true.)
335 if (strong_ .and. (this%msk(0) .gt. 0))
then
336 call device_inhom_dirichlet_apply_vector(this%msk_d, x_d, y_d, z_d, &
337 usr_x_d, usr_y_d, usr_z_d, m)