40 use json_module,
only : json_file
41 use,
intrinsic :: iso_c_binding, only : c_ptr
63 procedure, pass(this) :: init_from_components => &
77 class(
symmetry_t),
intent(inout),
target :: this
78 type(
coef_t),
target,
intent(in) :: coef
79 type(json_file),
intent(inout) :: json
81 call this%init_from_components(coef)
87 class(
symmetry_t),
intent(inout),
target :: this
88 type(
coef_t),
target,
intent(in) :: coef
92 call this%init_base(coef)
98 class(
symmetry_t),
target,
intent(inout) :: this
101 call this%coef%require_facets(
'symmetry')
103 call this%finalize_base()
113 integer,
intent(in) :: n
114 real(kind=
rp),
intent(inout),
dimension(n) :: x
116 logical,
intent(in),
optional :: strong
130 integer,
intent(in) :: n
131 real(kind=
rp),
intent(inout),
dimension(n) :: x
132 real(kind=
rp),
intent(inout),
dimension(n) :: y
133 real(kind=
rp),
intent(inout),
dimension(n) :: z
135 logical,
intent(in),
optional :: strong
138 real(kind=
rp) :: normal(3), u_n
140 if (
present(strong))
then
147 m = this%resolved_msk%size()
150 k = this%resolved_msk%get(i)
151 normal = this%n%x(:,i)
152 u_n = x(k) * normal(1) + y(k) * normal(2) + z(k) * normal(3)
154 x(k) = x(k) - u_n * normal(1)
155 y(k) = y(k) - u_n * normal(2)
156 z(k) = z(k) - u_n * normal(3)
167 class(
symmetry_t),
intent(inout),
target :: this
168 type(c_ptr),
intent(inout) :: x_d
170 logical,
intent(in),
optional :: strong
171 type(c_ptr),
intent(inout) :: strm
184 class(
symmetry_t),
intent(inout),
target :: this
185 type(c_ptr),
intent(inout) :: x_d
186 type(c_ptr),
intent(inout) :: y_d
187 type(c_ptr),
intent(inout) :: z_d
189 logical,
intent(in),
optional :: strong
190 type(c_ptr),
intent(inout) :: strm
194 if (
present(strong))
then
201 m = this%resolved_msk%size()
204 x_d, y_d, z_d, 1, 0, 0, this%n%x_d, this%t1%x_d, &
205 this%t2%x_d, m, strm)
212 class(
symmetry_t),
target,
intent(inout) :: this
214 call this%free_mixed()
215 call this%free_base()
Defines a boundary condition.
integer, parameter, public bc_mixed_constrains_normal
Device wrappers for basis-aware mixed boundary-condition constraint kernels. These routines operate o...
subroutine, public device_constrain_mixed_bc_zero(mixed_msk, x, y, z, constraint_n, constraint_t1, constraint_t2, n, t1, t2, m, strm)
Constrain mixed-boundary projections by zeroing the selected local components on the device.
integer, parameter, public rp
Global precision used in computations.
subroutine symmetry_apply_vector(this, x, y, z, n, time, strong)
Remove the normal component on the CPU.
subroutine symmetry_apply_scalar(this, x, n, time, strong)
No-op scalar application.
subroutine symmetry_init_from_components(this, coef)
Construct the boundary condition from its components.
subroutine symmetry_init(this, coef, json)
Construct the boundary condition from JSON.
subroutine symmetry_apply_scalar_dev(this, x_d, time, strong, strm)
No-op scalar application on the device.
subroutine symmetry_finalize(this)
Finalize the boundary condition.
subroutine symmetry_apply_vector_dev(this, x_d, y_d, z_d, time, strong, strm)
Remove the normal component on the device.
subroutine symmetry_free(this)
Free the boundary condition and its mixed-bc storage.
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...
Symmetry boundary condition constraining the normal vector component.
A struct that contains all info about the time, expand as needed.