45 use,
intrinsic :: iso_c_binding, only : c_ptr
69 real(kind=
rp) :: sx,sy,sz
70 real(kind=
rp),
parameter :: tol = 1d-3
77 call this%bc_x%init(this%coef)
78 call this%bc_y%init(this%coef)
79 call this%bc_z%init(this%coef)
81 associate(c=>this%coef, nx => this%coef%nx, ny => this%coef%ny, &
83 bfp => this%marked_facet%array()
84 do i = 1, this%marked_facet%size()
95 sx = sx + abs(abs(nx(l, j, facet, el)) - 1d0)
96 sy = sy + abs(abs(ny(l, j, facet, el)) - 1d0)
97 sz = sz + abs(abs(nz(l, j, facet, el)) - 1d0)
101 do l = 2, c%Xh%lx - 1
102 do j = 2, c%Xh%lx - 1
103 sx = sx + abs(abs(nx(l, j, facet, el)) - 1d0)
104 sy = sy + abs(abs(ny(l, j, facet, el)) - 1d0)
105 sz = sz + abs(abs(nz(l, j, facet, el)) - 1d0)
109 do l = 2, c%Xh%lx - 1
110 do j = 2, c%Xh%lx - 1
111 sx = sx + abs(abs(nx(l, j, facet, el)) - 1d0)
112 sy = sy + abs(abs(ny(l, j, facet, el)) - 1d0)
113 sz = sz + abs(abs(nz(l, j, facet, el)) - 1d0)
117 sx = sx / (c%Xh%lx - 2)**2
118 sy = sy / (c%Xh%lx - 2)**2
119 sz = sz / (c%Xh%lx - 2)**2
121 if (sx .lt. tol)
then
122 call this%bc_x%mark_facet(facet, el)
125 if (sy .lt. tol)
then
126 call this%bc_y%mark_facet(facet, el)
129 if (sz .lt. tol)
then
130 call this%bc_z%mark_facet(facet, el)
134 call this%bc_x%finalize()
135 call this%bc_x%set_g(0.0_rp)
136 call this%bc_y%finalize()
137 call this%bc_y%set_g(0.0_rp)
138 call this%bc_z%finalize()
139 call this%bc_z%set_g(0.0_rp)
146 call this%bc_x%free()
147 call this%bc_y%free()
148 call this%bc_z%free()
155 integer,
intent(in) :: n
156 real(kind=rp),
intent(inout),
dimension(n) :: x
157 real(kind=rp),
intent(in),
optional :: t
158 integer,
intent(in),
optional :: tstep
164 integer,
intent(in) :: n
165 real(kind=rp),
intent(inout),
dimension(n) :: x
166 real(kind=rp),
intent(inout),
dimension(n) :: y
167 real(kind=rp),
intent(inout),
dimension(n) :: z
168 real(kind=rp),
intent(in),
optional :: t
169 integer,
intent(in),
optional :: tstep
172 call this%bc_x%apply_scalar(x,n)
173 call this%bc_y%apply_scalar(y,n)
174 call this%bc_z%apply_scalar(z,n)
180 class(
symmetry_t),
intent(inout),
target :: this
182 real(kind=rp),
intent(in),
optional :: t
183 integer,
intent(in),
optional :: tstep
188 class(
symmetry_t),
intent(inout),
target :: this
192 real(kind=rp),
intent(in),
optional :: t
193 integer,
intent(in),
optional :: tstep
195 call device_symmetry_apply_vector(this%bc_x%msk_d, this%bc_y%msk_d, &
196 this%bc_z%msk_d, x_d, y_d, z_d, &
Defines a boundary condition.
Defines a dirichlet boundary condition.
integer, parameter, public rp
Global precision used in computations.
Implements a dynamic stack ADT.
Mixed Dirichlet-Neumann axis aligned symmetry plane.
subroutine symmetry_init_msk(this)
Initialize symmetry mask for each axis.
subroutine symmetry_apply_vector(this, x, y, z, n, t, tstep)
Apply symmetry conditions (axis aligned)
subroutine symmetry_apply_scalar(this, x, n, t, tstep)
No-op scalar apply.
subroutine symmetry_apply_scalar_dev(this, x_d, t, tstep)
No-op scalar apply (device version)
subroutine symmetry_free(this)
subroutine symmetry_apply_vector_dev(this, x_d, y_d, z_d, t, tstep)
Apply symmetry conditions (axis aligned) (device version)
Base type for a boundary condition.
Coefficients defined on a given (mesh, ) tuple. Arrays use indices (i,j,k,e): element e,...
Generic Dirichlet boundary condition on .
Mixed Dirichlet-Neumann symmetry plane condition.