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.15] - 2026-03-23

### Fixed

- Fixed `_add_distributed_constraint` in the case where the underlying `FESpace` has multiple (different) reffes. Since PR[#201](https://github.com/gridap/GridapDistributed.jl/pull/201).

## [0.4.14] - 2026-03-20

### Changed
Expand Down
2 changes: 1 addition & 1 deletion 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.14"
version = "0.4.15"

[deps]
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
Expand Down
17 changes: 9 additions & 8 deletions src/FESpaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -633,13 +633,15 @@ end
function _add_distributed_constraint(
F::DistributedFESpace,reffe::ReferenceFE,constraint
)
isnothing(constraint) && return F
order = get_order(reffe)
_add_distributed_constraint(F,order,constraint)
end

function _add_distributed_constraint(
F::DistributedFESpace,reffe::Tuple{<:ReferenceFEName,Any,Any},constraint
)
isnothing(constraint) && return F
args = reffe[2]
order = maximum(args[2])
_add_distributed_constraint(F,order,constraint)
Expand All @@ -648,29 +650,28 @@ end
function _add_distributed_constraint(
F::DistributedFESpace,cell_reffe::AbstractArray,constraint
)
reffe = map(cell_reffe) do cell_reffe
isnothing(constraint) && return F
order = map(cell_reffe) do cell_reffe
reffes, ctypes = compress_cell_data(cell_reffe)
return only(reffes)
return maximum(get_order,reffes;init=0)
end |> getany
_add_distributed_constraint(F,reffe,constraint)
_add_distributed_constraint(F,order,constraint)
end

function _add_distributed_constraint(F::DistributedFESpace,order::Integer,constraint)
if isnothing(constraint)
V = F
elseif constraint == :zeromean
isnothing(constraint) && return F
if constraint == :zeromean
_trian = get_triangulation(F)
model = get_background_model(_trian)
trian = remove_ghost_cells(_trian,get_cell_gids(model))
dΩ = Measure(trian,order)
V = ZeroMeanFESpace(F,dΩ)
return ZeroMeanFESpace(F,dΩ)
else
@unreachable """\n
The passed option constraint=$constraint is not valid.
Valid values for constraint: nothing, :zeromean
"""
end
V
end

# Assembly
Expand Down
Loading