Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make copy_to_coupled_boundary! threaded #1981

Merged
merged 5 commits into from
Jun 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/semidiscretization/semidiscretization_coupled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,14 @@ function copy_to_coupled_boundary!(boundary_condition::BoundaryConditionCoupled{
i_cell_start, i_cell_step = index_to_start_step_2d(indices[1], axes(mesh_other, 1))
j_cell_start, j_cell_step = index_to_start_step_2d(indices[2], axes(mesh_other, 2))

i_cell = i_cell_start
j_cell = j_cell_start
# We need indices starting at 1 for the handling of `i_cell` etc.
Base.require_one_based_indexing(cells)

@threaded for i in eachindex(cells)
cell = cells[i]
i_cell = i_cell_start + (i - 1) * i_cell_step
j_cell = j_cell_start + (i - 1) * j_cell_step

for cell in cells
i_node = i_node_start
j_node = j_node_start
element_id = linear_indices[i_cell, j_cell]
Expand All @@ -628,9 +632,6 @@ function copy_to_coupled_boundary!(boundary_condition::BoundaryConditionCoupled{
i_node += i_node_step
j_node += j_node_step
end

i_cell += i_cell_step
j_cell += j_cell_step
end
end

Expand Down
Loading