diff --git a/src/Assembly.jl b/src/Assembly.jl index 021e815..a538eaa 100644 --- a/src/Assembly.jl +++ b/src/Assembly.jl @@ -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) diff --git a/src/PArraysExtras.jl b/src/PArraysExtras.jl index 05c8216..b139a54 100644 --- a/src/PArraysExtras.jl +++ b/src/PArraysExtras.jl @@ -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) @@ -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)