35 use json_module,
only : json_file
44 use,
intrinsic :: iso_c_binding, only : c_ptr
55 real(kind=
rp) :: value(3) = 0.0_rp
68 procedure, pass(this) :: init_from_components => &
83 type(
coef_t),
target,
intent(in) :: coef
84 type(json_file),
intent(inout) ::json
85 real(kind=
rp),
allocatable :: value(:)
86 real(kind=
rp) :: value_3(3)
92 if (
size(
value) .ne. 3)
then
93 call neko_error(
"The non_normal boundary condition requires a " // &
94 "3-component value vector.")
97 call this%init_from_components(coef, value_3)
105 type(
coef_t),
target,
intent(in) :: coef
106 real(kind=
rp),
intent(in) :: value(3)
109 call this%init_base(coef)
121 integer,
intent(in) :: n
122 real(kind=
rp),
intent(inout),
dimension(n) :: x
124 logical,
intent(in),
optional :: strong
137 integer,
intent(in) :: n
138 real(kind=
rp),
intent(inout),
dimension(n) :: x
139 real(kind=
rp),
intent(inout),
dimension(n) :: y
140 real(kind=
rp),
intent(inout),
dimension(n) :: z
142 logical,
intent(in),
optional :: strong
145 real(kind=
rp) :: normal(3), t1(3), t2(3)
146 real(kind=
rp) :: u_n, g_t1, g_t2
149 call this%coef%require_facets(
'non_normal')
151 if (
present(strong))
then
157 if (.not. strong_)
return
159 m = this%resolved_msk%size()
162 k = this%resolved_msk%get(i)
163 normal = this%n%x(:, i)
168 u_n = x(k) * normal(1) + y(k) * normal(2) + z(k) * normal(3)
170 g_t1 = this%value(1) * t1(1) + this%value(2) * t1(2) + &
171 this%value(3) * t1(3)
172 g_t2 = this%value(1) * t2(1) + this%value(2) * t2(2) + &
173 this%value(3) * t2(3)
176 x(k) = u_n * normal(1) + g_t1 * t1(1) + g_t2 * t2(1)
177 y(k) = u_n * normal(2) + g_t1 * t1(2) + g_t2 * t2(2)
178 z(k) = u_n * normal(3) + g_t1 * t1(3) + g_t2 * t2(3)
190 type(c_ptr),
intent(inout) :: x_d
192 logical,
intent(in),
optional :: strong
193 type(c_ptr),
intent(inout) :: strm
208 type(c_ptr),
intent(inout) :: x_d
209 type(c_ptr),
intent(inout) :: y_d
210 type(c_ptr),
intent(inout) :: z_d
212 logical,
intent(in),
optional :: strong
213 type(c_ptr),
intent(inout) :: strm
217 if (
present(strong))
then
224 m = this%resolved_msk%size()
227 this%resolved_msk%get_d(), x_d, y_d, z_d, 0, 1, 1, &
228 this%n%x_d, this%t1%x_d, this%t2%x_d, this%value(1), &
229 this%value(2), this%value(3), m, strm)
238 call this%finalize_base()
245 call this%free_mixed()
246 call this%free_base()
Defines a boundary condition.
integer, parameter, public bc_mixed_constrains_tangent
Device wrappers for basis-aware mixed boundary-condition constraint kernels. These routines operate o...
subroutine, public device_constrain_mixed_bc_set_const(mixed_msk, x, y, z, constraint_n, constraint_t1, constraint_t2, n, t1, t2, value_n, value_t1, value_t2, m, strm)
Constrain mixed-boundary projections by assigning prescribed local components derived from a constant...
Utilities for retrieving parameters from the case files.
subroutine non_normal_finalize(this)
Finalize the boundary condition.
subroutine non_normal_init_from_components(this, coef, value)
Construct the boundary condition from a uniform global vector.
subroutine non_normal_apply_scalar_dev(this, x_d, time, strong, strm)
No-op scalar application on the device.
subroutine non_normal_init(this, coef, json)
Construct the boundary condition from JSON.
subroutine non_normal_apply_scalar(this, x, n, time, strong)
No-op scalar application.
subroutine non_normal_free(this)
Free the boundary condition and its mixed-bc storage.
subroutine non_normal_apply_vector(this, x, y, z, n, time, strong)
Strong application preserving the normal component while enforcing the tangential projections of the ...
subroutine non_normal_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
Apply the tangential components of the prescribed vector on the device.
integer, parameter, public rp
Global precision used in computations.
Module with things related to the simulation time.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Base type for mixed boundary conditions that need projector-provided local-basis data on the physical...
Mixed Dirichlet condition constraining the tangential vector components.
A struct that contains all info about the time, expand as needed.