diff --git a/src/semidiscretization/semidiscretization_coupled.jl b/src/semidiscretization/semidiscretization_coupled.jl index 956a9d9b62c..b4bef70746f 100644 --- a/src/semidiscretization/semidiscretization_coupled.jl +++ b/src/semidiscretization/semidiscretization_coupled.jl @@ -515,6 +515,7 @@ function mesh_equations_solver_cache(other_semi_index, i, semi_, semi_tuple...) if i == other_semi_index return mesh_equations_solver_cache(semi_) else + # Walk through semidiscretizations until we find `i` mesh_equations_solver_cache(other_semi_index, i + 1, semi_tuple...) end end @@ -560,11 +561,14 @@ function copy_to_coupled_boundary!(boundary_condition::BoundaryConditionCoupled{ element_id = linear_indices[i_cell, j_cell] for element_id in eachnode(solver) - x = @view cache.elements.node_coordinates[:, i_node, j_node, - linear_indices[i_cell, j_cell]] - u_node = u[:, i_node, j_node, linear_indices[i_cell, j_cell]] + x = get_node_coords(node_coordinates, equations, solver, i_node, j_node, + linear_indices[i_cell, j_cell]) + u_node = get_node_vars(u, equations, solver, i_node, j_node, + linear_indices[i_cell, j_cell]] converted_u = coupling_converter(x, u_node) - u_boundary[:, element_id, cell] = converted_u + @inbounds for i in eachindex(converted_u) + u_boundary[i, element_id, cell] = converted_u[i] + end i_node += i_node_step j_node += j_node_step end