49 class(
bc_ptr_t),
allocatable,
private :: items(:)
51 integer,
private :: size_
54 integer,
private :: capacity
74 generic :: apply => apply_scalar, apply_vector, &
75 apply_scalar_field, apply_vector_field
171 integer,
intent(in) :: n
172 real(kind=
rp),
intent(inout),
dimension(n) :: x
173 real(kind=
rp),
intent(in),
optional :: t
174 integer,
intent(in),
optional :: tstep
175 logical,
intent(in),
optional :: strong
182 if (
present(strong))
then
183 if (
present(t) .and.
present(tstep))
then
185 call this%items(i)%ptr%apply_scalar_dev(x_d, t, tstep, strong)
187 else if (
present(t))
then
189 call this%items(i)%ptr%apply_scalar_dev(x_d, t = t, &
192 else if (
present(tstep))
then
194 call this%items(i)%ptr%apply_scalar_dev(x_d, tstep = tstep, &
199 call this%items(i)%ptr%apply_scalar_dev(x_d)
203 if (
present(t) .and.
present(tstep))
then
205 call this%items(i)%ptr%apply_scalar_dev(x_d, t = t, &
208 else if (
present(t))
then
210 call this%items(i)%ptr%apply_scalar_dev(x_d, t = t)
212 else if (
present(tstep))
then
214 call this%items(i)%ptr%apply_scalar_dev(x_d, tstep = tstep)
218 call this%items(i)%ptr%apply_scalar_dev(x_d)
223 if (
present(strong))
then
224 if (
present(t) .and.
present(tstep))
then
226 call this%items(i)%ptr%apply_scalar(x, n, t, tstep, strong)
228 else if (
present(t))
then
230 call this%items(i)%ptr%apply_scalar(x, n, t = t, strong = strong)
232 else if (
present(tstep))
then
234 call this%items(i)%ptr%apply_scalar(x, n, tstep = tstep, &
239 call this%items(i)%ptr%apply_scalar(x, n, strong = strong)
243 if (
present(t) .and.
present(tstep))
then
245 call this%items(i)%ptr%apply_scalar(x, n, t = t, tstep = tstep)
247 else if (
present(t))
then
249 call this%items(i)%ptr%apply_scalar(x, n, t = t)
251 else if (
present(tstep))
then
253 call this%items(i)%ptr%apply_scalar(x, n, tstep = tstep)
257 call this%items(i)%ptr%apply_scalar(x, n)
275 integer,
intent(in) :: n
276 real(kind=
rp),
intent(inout),
dimension(n) :: x
277 real(kind=
rp),
intent(inout),
dimension(n) :: y
278 real(kind=
rp),
intent(inout),
dimension(n) :: z
279 real(kind=
rp),
intent(in),
optional :: t
280 integer,
intent(in),
optional :: tstep
281 logical,
intent(in),
optional :: strong
293 if (
present(strong))
then
294 if (
present(t) .and.
present(tstep))
then
296 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, t, &
299 else if (
present(t))
then
301 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, t = t, &
304 else if (
present(tstep))
then
306 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, &
307 tstep = tstep, strong = strong)
311 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, &
316 if (
present(t) .and.
present(tstep))
then
318 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, t, &
321 else if (
present(t))
then
323 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, t = t)
325 else if (
present(tstep))
then
327 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, &
332 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d)
337 if (
present(strong))
then
338 if (
present(t) .and.
present(tstep))
then
340 call this%items(i)%ptr%apply_vector(x, y, z, n, t, tstep, strong)
342 else if (
present(t))
then
344 call this%items(i)%ptr%apply_vector(x, y, z, n, t = t, &
347 else if (
present(tstep))
then
349 call this%items(i)%ptr%apply_vector(x, y, z, n, &
350 tstep = tstep, strong = strong)
354 call this%items(i)%ptr%apply_vector(x, y, z, n, strong = strong)
358 if (
present(t) .and.
present(tstep))
then
360 call this%items(i)%ptr%apply_vector(x, y, z, n, t, tstep)
362 else if (
present(t))
then
364 call this%items(i)%ptr%apply_vector(x, y, z, n, t = t)
366 else if (
present(tstep))
then
368 call this%items(i)%ptr%apply_vector(x, y, z, n, tstep = tstep)
372 call this%items(i)%ptr%apply_vector(x, y, z, n)
388 type(
field_t),
intent(inout) :: x
389 real(kind=
rp),
intent(in),
optional :: t
390 integer,
intent(in),
optional :: tstep
391 logical,
intent(in),
optional :: strong
396 if (
present(strong))
then
397 if (
present(t) .and.
present(tstep))
then
399 call this%items(i)%ptr%apply_scalar_dev(x%x_d, t, tstep, strong)
401 else if (
present(t))
then
403 call this%items(i)%ptr%apply_scalar_dev(x%x_d, t = t, &
406 else if (
present(tstep))
then
408 call this%items(i)%ptr%apply_scalar_dev(x%x_d, tstep = tstep, &
413 call this%items(i)%ptr%apply_scalar_dev(x%x_d, strong = strong)
417 if (
present(t) .and.
present(tstep))
then
419 call this%items(i)%ptr%apply_scalar_dev(x%x_d, t, tstep)
421 else if (
present(t))
then
423 call this%items(i)%ptr%apply_scalar_dev(x%x_d, t = t)
425 else if (
present(tstep))
then
427 call this%items(i)%ptr%apply_scalar_dev(x%x_d, tstep = tstep)
431 call this%items(i)%ptr%apply_scalar_dev(x%x_d)
437 call this%items(i)%ptr%apply_scalar(x%x, n, t, tstep, strong)
452 type(
field_t),
intent(inout) :: x
453 type(
field_t),
intent(inout) :: y
454 type(
field_t),
intent(inout) :: z
455 real(kind=
rp),
intent(in),
optional :: t
456 integer,
intent(in),
optional :: tstep
457 logical,
intent(in),
optional :: strong
459 character(len=256) :: msg
464 if (y%size() .ne. n .or. z%size() .ne. n)
then
465 msg =
"Fields x, y, z must have the same size in " // &
466 "bc_list_apply_vector_field"
471 if (
present(strong))
then
472 if (
present(t) .and.
present(tstep))
then
474 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
477 else if (
present(t))
then
479 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
480 t = t, strong = strong)
482 else if (
present(tstep))
then
484 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
485 tstep = tstep, strong = strong)
489 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
494 if (
present(t) .and.
present(tstep))
then
496 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
499 else if (
present(t))
then
501 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
504 else if (
present(tstep))
then
506 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d, &
511 call this%items(i)%ptr%apply_vector_dev(x%x_d, y%x_d, z%x_d)
516 if (
present(strong))
then
517 if (
present(t) .and.
present(tstep))
then
519 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, t, &
522 else if (
present(t))
then
524 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, &
525 t = t, strong = strong)
527 else if (
present(tstep))
then
529 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, &
530 tstep = tstep, strong = strong)
534 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, &
539 if (
present(t) .and.
present(tstep))
then
541 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, t, &
544 else if (
present(t))
then
546 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, &
549 else if (
present(tstep))
then
551 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n, &
556 call this%items(i)%ptr%apply_vector(x%x, y%x, z%x, n)
subroutine bc_list_apply_vector_array(this, x, y, z, n, t, tstep, strong)
Apply a list of boundary conditions to a vector field.