@@ -218,7 +218,6 @@ Input:
218218 - give_opposite! Function in (y,x)
219219 - mask: (optional) vector of masking components
220220 - sparsity_tol: threshold for treating an interpolated value as zero
221- - heuristic_search: determine suitable interpolation faces on b_to for each face in b_from
222221
223222give_opposite!(y,x) has to be defined in a way that for each x ∈ b_from the resulting y is in the opposite boundary.
224223For each x in the grid, the resulting y has to be in the grid, too: incorporate some mirroring of the coordinates.
@@ -239,8 +238,7 @@ function get_periodic_coupling_matrix(
239238 b_to,
240239 give_opposite!:: Function ;
241240 mask = :auto ,
242- sparsity_tol = 1.0e-12 ,
243- heuristic_search = true ,
241+ sparsity_tol = 1.0e-12
244242 ) where {Tv, TvG, TiG}
245243
246244 @info " Computing periodic coupling matrix. This may take a while."
@@ -329,26 +327,24 @@ function get_periodic_coupling_matrix(
329327 coords = xgrid[Coordinates]
330328 facenodes = xgrid[FaceNodes]
331329 box_from = zeros (TvG, 2 )
332- if heuristic_search
333- for face_from in faces_in_b_from
334- coords_from = coords[:, facenodes[:, face_from]]
330+ for face_from in faces_in_b_from
331+ coords_from = coords[:, facenodes[:, face_from]]
335332
336- # transfer the coords_from to the other side
337- transfer_face! (coords_from)
333+ # transfer the coords_from to the other side
334+ transfer_face! (coords_from)
338335
339- # get the extrama in each component ( = bounding box of the face)
340- @views box_from = extrema (coords_from, dims = (2 ))[:]
336+ # get the extrama in each component ( = bounding box of the face)
337+ @views box_from = extrema (coords_from, dims = (2 ))[:]
341338
342- for face_to in faces_in_b_to
343- @views coords_to = coords[:, facenodes[:, face_to]]
344- @views box_to = extrema (coords_to, dims = (2 ))[:]
339+ for face_to in faces_in_b_to
340+ @views coords_to = coords[:, facenodes[:, face_to]]
341+ @views box_to = extrema (coords_to, dims = (2 ))[:]
345342
346- if do_boxes_overlap (box_from, box_to)
347- if ! haskey (search_areas, face_from)
348- search_areas[face_from] = []
349- end
350- push! (search_areas[face_from], face_to)
343+ if do_boxes_overlap (box_from, box_to)
344+ if ! haskey (search_areas, face_from)
345+ search_areas[face_from] = []
351346 end
347+ push! (search_areas[face_from], face_to)
352348 end
353349 end
354350 end
@@ -360,9 +356,6 @@ function get_periodic_coupling_matrix(
360356 if boundary_regions[i_boundary_face] == b_from
361357
362358 local_dofs = @views dofs_on_boundary[:, i_boundary_face]
363- if heuristic_search
364- # set_start(1)
365- end
366359 for local_dof in local_dofs
367360 # compute number of component
368361 if mask[1 + ((local_dof - 1 ) ÷ coffset)] == 0.0
@@ -377,8 +370,7 @@ function get_periodic_coupling_matrix(
377370
378371 # interpolate on the opposite boundary using x_trafo = give_opposite
379372 interpolate! (
380- fe_vector_target[1 ], ON_FACES, eval_point, items =
381- heuristic_search ? search_areas[face_numbers_of_bfaces[i_boundary_face]] : faces_in_b_to,
373+ fe_vector_target[1 ], ON_FACES, eval_point, items = search_areas[face_numbers_of_bfaces[i_boundary_face]],
382374 )
383375
384376 # deactivate entry
0 commit comments