Skip to content

Commit 0b07413

Browse files
committed
allows arrays of bregions
1 parent b8ce68a commit 0b07413

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

src/helper_functions.jl

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ function _get_periodic_coupling_matrix(
221221

222222
@info "Computing periodic coupling matrix. This may take a while."
223223

224+
if typeof(b_from) <: Int
225+
b_from = [b_from]
226+
end
227+
228+
if typeof(b_to) <: Int
229+
b_to = [b_to]
230+
end
231+
224232
# total number of grid boundary faces
225233
boundary_nodes = xgrid[BFaceNodes]
226234
n_boundary_faces = size(boundary_nodes, 2)
@@ -250,9 +258,9 @@ function _get_periodic_coupling_matrix(
250258
faces_in_b_to = TiG[]
251259
faces_in_b_from = TiG[]
252260
for (i, region) in enumerate(boundary_regions)
253-
if region == b_to
261+
if region in b_to
254262
push!(faces_in_b_to, face_numbers_of_bfaces[i])
255-
elseif region == b_from
263+
elseif region in b_from
256264
push!(faces_in_b_from, face_numbers_of_bfaces[i])
257265
end
258266
end
@@ -354,7 +362,7 @@ function _get_periodic_coupling_matrix(
354362
for i_boundary_face in 1:n_boundary_faces
355363

356364
# for each boundary face: check if in b_from
357-
if boundary_regions[i_boundary_face] == b_from
365+
if boundary_regions[i_boundary_face] in b_from
358366

359367
local_dofs = @views dofs_on_boundary[:, i_boundary_face]
360368
for local_dof in local_dofs

0 commit comments

Comments
 (0)