37 use,
intrinsic :: iso_c_binding, only : c_ptr
49 real(kind=
rp),
allocatable,
private :: flux_(:)
67 integer,
intent(in) :: n
68 real(kind=
rp),
intent(inout),
dimension(n) :: x
69 real(kind=
rp),
intent(in),
optional :: t
70 integer,
intent(in),
optional :: tstep
71 integer :: i, m, k, facet
83 x(k) = x(k) + this%flux_(i)*this%coef%area(idx(2), idx(3), facet, idx(4))
85 x(k) = x(k) + this%flux_(i)*this%coef%area(idx(1), idx(3), facet, idx(4))
87 x(k) = x(k) + this%flux_(i)*this%coef%area(idx(1), idx(2), facet, idx(4))
96 integer,
intent(in) :: n
97 real(kind=
rp),
intent(inout),
dimension(n) :: x
98 real(kind=
rp),
intent(inout),
dimension(n) :: y
99 real(kind=
rp),
intent(inout),
dimension(n) :: z
100 real(kind=
rp),
intent(in),
optional :: t
101 integer,
intent(in),
optional :: tstep
103 call neko_error(
"Neumann bc not implemented for vectors")
110 class(
neumann_t),
intent(inout),
target :: this
112 real(kind=
rp),
intent(in),
optional :: t
113 integer,
intent(in),
optional :: tstep
115 call neko_error(
"Neumann bc not implemented on the device")
122 class(
neumann_t),
intent(inout),
target :: this
126 real(kind=
rp),
intent(in),
optional :: t
127 integer,
intent(in),
optional :: tstep
129 call neko_error(
"Neumann bc not implemented on the device")
135 class(
neumann_t),
target,
intent(inout) :: this
137 call this%free_base()
144 real(kind=
rp) :: flux(this%msk(0))
153 real(kind=
rp),
intent(in) :: flux
156 allocate(this%flux_(this%msk(0)))
158 call cfill(this%flux_, flux, this%msk(0))
__device__ void nonlinear_index(const int idx, const int lx, int *index)
Defines a boundary condition.
subroutine, public cfill(a, c, n)
Set all elements to a constant c .
Defines a Neumann boundary condition.
subroutine neumann_apply_vector(this, x, y, z, n, t, tstep)
Boundary condition apply for a generic Neumann condition to vectors x, y and z.
subroutine neumann_apply_scalar(this, x, n, t, tstep)
Boundary condition apply for a generic Neumann condition to a vector x.
subroutine neumann_apply_scalar_dev(this, x_d, t, tstep)
Boundary condition apply for a generic Neumann condition to a vector x (device version)
pure real(kind=rp) function, dimension(this%msk(0)) neumann_flux(this)
Get the flux.
subroutine neumann_finalize_neumann(this, flux)
Finalize by setting the flux.
subroutine neumann_apply_vector_dev(this, x_d, y_d, z_d, t, tstep)
Boundary condition apply for a generic Neumann condition to vectors x, y and z (device version)
subroutine neumann_free(this)
Destructor.
integer, parameter, public rp
Global precision used in computations.
Base type for a boundary condition.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Generic Neumann boundary condition. This sets the flux of the field to the chosen value.