Skip to content

Commit

Permalink
MInor
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Nov 5, 2024
1 parent a820d9a commit 7b3a94f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions src/Assembly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -270,10 +270,7 @@ function create_from_nz_locally_assembled(
map(map_local_to_global!,I,test_ids)
map(map_local_to_global!,J,trial_ids)

# TODO: replace_ghost or union_ghost?
# Actually, do we want to change the ghosts at all? We could return the unpermuted trial_ids
J_owners = find_owner(trial_ids,J)
cols = map(replace_ghost,map(unpermute,trial_ids),J,J_owners)
cols = filter_and_replace_ghost(map(unpermute,trial_ids),J)

map(map_global_to_local!,I,rows)
map(map_global_to_local!,J,cols)
Expand Down
6 changes: 5 additions & 1 deletion src/PArraysExtras.jl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,10 @@ end
filter_and_replace_ghost(indices,gids)
Replace ghost ids in `indices` with the ghost ids within `gids`.
NOTE: The issue is that `replace_ghost` does not check if all gids are ghosts or whether
they are repeated. It also shifts ownership of the ghosts. Its all quite messy and not what we
would need. TODO: Make me better.
"""
function filter_and_replace_ghost(indices,gids)
owners = find_owner(indices,gids)
Expand All @@ -113,7 +117,7 @@ function filter_and_replace_ghost(indices,gids)
end

# Same as PartitionedArrays.filter_ghost, but we do not exclude ghost indices that
# belong to `indices`.
# belong to `indices`. This could eventually be a flag in the original function.
function _filter_ghost(indices,gids,owners)
ghosts = Set{Int}()
part_owner = part_id(indices)
Expand Down

0 comments on commit 7b3a94f

Please sign in to comment.