39 use,
intrinsic :: iso_c_binding, only : c_ptr
62 generic :: apply => apply_scalar, apply_vector
76 class(
bc_list_t),
intent(inout),
target :: this
77 integer,
optional :: size
82 if (
present(size))
then
88 allocate(this%items(n))
102 if (
allocated(this%items))
then
104 this%items(i)%ptr => null()
107 deallocate(this%items)
118 class(
bc_t),
intent(inout),
target :: bc
119 type(
bc_ptr_t),
allocatable :: tmp(:)
122 if(
bc%marked_facet%size() .eq. 0)
return
124 if (this%size .ge. this%capacity)
then
125 this%capacity = this%capacity * 2
126 allocate(tmp(this%capacity))
127 tmp(1:this%size) = this%items
128 call move_alloc(tmp, this%items)
131 this%size = this%size + 1
132 this%items(this%size)%ptr =>
bc
143 integer,
intent(in) :: n
144 real(kind=
rp),
intent(inout),
dimension(n) :: x
145 real(kind=
rp),
intent(in),
optional :: t
146 integer,
intent(in),
optional :: tstep
153 call this%items(i)%ptr%apply_scalar_dev(x_d, t, tstep)
157 call this%items(i)%ptr%apply_scalar(x, n, t, tstep)
171 integer,
intent(in) :: n
172 real(kind=
rp),
intent(inout),
dimension(n) :: x
173 real(kind=
rp),
intent(inout),
dimension(n) :: y
174 real(kind=
rp),
intent(inout),
dimension(n) :: z
175 real(kind=
rp),
intent(in),
optional :: t
176 integer,
intent(in),
optional :: tstep
187 call this%items(i)%ptr%apply_vector_dev(x_d, y_d, z_d, t, tstep)
191 call this%items(i)%ptr%apply_vector(x, y, z, n, t, tstep)
199 class(
bc_list_t),
intent(in),
target :: this
206 if (.not.
allocated(this%items(i)%ptr%msk))
then
207 call neko_error(
"bc not finalized, error in bc_list%is_empty")
210 if (this%items(i)%ptr%msk(0) > 0) is_empty = .false.
Return the device pointer for an associated Fortran array.
subroutine bc_list_apply_vector(this, x, y, z, n, t, tstep)
Apply a list of boundary conditions to a vector field.
subroutine bc_list_init(this, size)
Constructor.
subroutine bc_list_append(this, bc)
Append a condition to the end of the list.
subroutine bc_list_free(this)
Destructor.
logical function bc_list_is_empty(this)
Return whether the list is empty.
subroutine bc_list_apply_scalar(this, x, n, t, tstep)
Apply a list of boundary conditions to a scalar field.
Defines a boundary condition.
Device abstraction, common interface for various accelerators.
integer, parameter neko_bcknd_device
integer, parameter, public rp
Global precision used in computations.
Pointer to boundary condtiion.
Base type for a boundary condition.
A list of allocatable `bc_t`. Follows the standard interface of lists.