diff --git a/examples/Example212_PeriodicBoundary2D.jl b/examples/Example212_PeriodicBoundary2D.jl index e853ad79..24bd7bd9 100644 --- a/examples/Example212_PeriodicBoundary2D.jl +++ b/examples/Example212_PeriodicBoundary2D.jl @@ -153,7 +153,7 @@ function main(; return nothing end - coupling_matrix = get_periodic_coupling_matrix(FES, xgrid, reg_left, reg_right, give_opposite!) + coupling_matrix = get_periodic_coupling_matrix(FES, reg_left, reg_right, give_opposite!) display(coupling_matrix) assign_operator!(PD, CombineDofs(u, u, coupling_matrix; kwargs...)) end diff --git a/examples/Example312_PeriodicBoundary3D.jl b/examples/Example312_PeriodicBoundary3D.jl index 7e982702..671bc869 100644 --- a/examples/Example312_PeriodicBoundary3D.jl +++ b/examples/Example312_PeriodicBoundary3D.jl @@ -168,7 +168,7 @@ function main(; y[1] = width - x[1] return nothing end - coupling_matrix = get_periodic_coupling_matrix(FES, xgrid, reg_left, reg_right, give_opposite!) + coupling_matrix = get_periodic_coupling_matrix(FES, reg_left, reg_right, give_opposite!) display(coupling_matrix) assign_operator!(PD, CombineDofs(u, u, coupling_matrix; kwargs...)) end diff --git a/src/helper_functions.jl b/src/helper_functions.jl index 193cf061..e5f14186 100644 --- a/src/helper_functions.jl +++ b/src/helper_functions.jl @@ -347,6 +347,10 @@ function _get_periodic_coupling_matrix( fe_vector.entries[local_dof] = 1.0 # interpolate on the opposite boundary using x_trafo = give_opposite + if !haskey(search_areas, face_numbers_of_bfaces[i_boundary_face]) + throw("face $(face_numbers_of_bfaces[i_boundary_face]) is not on source boundary. Are the from/to regions and the give_opposite function correct?") + end + interpolate!( fe_vector_target[1], ON_FACES, eval_point,