Skip to content

Commit 457d069

Browse files
committed
Throw error for empty search area
1 parent b516cf2 commit 457d069

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/helper_functions.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,13 @@ function _get_periodic_coupling_matrix(
355355
append!(searchareas, view(faces_to, 1:nfaces_to))
356356
end
357357

358+
# throw error if no search area had been found for a bface
359+
for source in 1:num_sources(searchareas)
360+
if num_targets(searchareas, source) == 0
361+
throw("bface $source has no valid search area on the opposite side of the grid. Are from/to regions and give_opposite! function correct?")
362+
end
363+
end
364+
358365
# we are only interest in global bface numbers on the "from" boundary
359366
bfaces_of_interest = filter(face -> boundary_regions[face] in b_from, 1:n_boundary_faces)
360367
n_bface_of_interest = length(bfaces_of_interest)

0 commit comments

Comments
 (0)