Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.4.16] - 2026-04-29

### Fixed

- `get_facet_owners(::DistributeDiscreteModel)` now chooses the owner with maximum gid. Since PR[#205](https://github.com/gridap/GridapDistributed.jl/pull/205).

## [0.4.15] - 2026-03-23

### Fixed
Expand Down
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GridapDistributed"
uuid = "f9701e48-63b3-45aa-9a63-9bc6c271f355"
authors = ["S. Badia <santiago.badia@monash.edu>", "A. F. Martin <alberto.f.martin@anu.edu.au>", "F. Verdugo <f.verdugo.rojano@vu.nl>"]
version = "0.4.15"
version = "0.4.16"

[deps]
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
Expand All @@ -21,14 +21,14 @@ BlockArrays = "1"
CircularArrays = "1.4.0"
FillArrays = "1"
ForwardDiff = "0.10, 1"
Gridap = "0.20.1"
Gridap = "0.20.6"
LinearAlgebra = "1"
MPI = "0.16, 0.17, 0.18, 0.19, 0.20"
PartitionedArrays = "0.3.3"
SparseArrays = "1.3"
SparseMatricesCSR = "0.6.6"
WriteVTK = "1.12.0"
julia = "1.3"
julia = "1.10"

[extras]
MPIPreferences = "3da0fdf6-3ccc-4f1b-acd9-58baa6c99267"
Expand Down
21 changes: 18 additions & 3 deletions src/Pullbacks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# simply go through the local FESpace constructor.
const PullbackReffes = Union{
GenericRefFE{RaviartThomas},
GenericRefFE{Nedelec},
GenericRefFE{<:Nedelec},
}

function DistributedSingleFieldFESpace(
Expand Down Expand Up @@ -89,7 +89,7 @@ function FESpaces.compute_cell_bases_changes(
poly = map(get_polytopes, local_views(model)) |> getany |> only
if (D==2) || is_simplex(poly)
# For these cases, we do not need to apply a sign flip
return nothing
return map(_->nothing,cell_reffe)
elseif (D==3) && is_n_cube(poly)
change = FESpaces.get_sign_flip(model, cell_reffe)
return map(c -> (c, c), change)
Expand All @@ -109,7 +109,22 @@ function FESpaces.compute_facet_owners(model::DistributedDiscreteModel)
Dc = num_cell_dims(model)
cell_ids = partition(get_cell_gids(model))
facet_ids = partition(get_face_gids(model, Dc-1))
facet_to_owner = map(FESpaces.compute_facet_owners, local_views(model))

function select_nbor_with_max_gid(nbor_lids, lid_to_gid)
max_lid, max_gid = -1, -1
for lid in nbor_lids
gid = lid_to_gid[lid]
if gid > max_gid
max_lid, max_gid = lid, gid
end
end
return max_lid
end
facet_to_owner = map(local_views(model), cell_ids) do model, cell_ids
lid_to_gid = local_to_global(cell_ids)
select_nbor = Base.Fix2(select_nbor_with_max_gid, lid_to_gid)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting ... I did not know that Fix2 method existed ... it is very handy here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I like the Fix structs a lot. In 1.13 they are introducing more of these, so you can have super performant closures.

return FESpaces.compute_facet_owners(model, select_nbor)
end

# Map local owners to global ids
map(facet_to_owner, cell_ids) do facet_to_owner, cell_ids
Expand Down
Loading