From 3af43495a79960c39590501da005f41905cbb576 Mon Sep 17 00:00:00 2001 From: Jordi Manyer Date: Tue, 24 Mar 2026 09:30:19 +1100 Subject: [PATCH 1/3] Bugfix on FESpaces with multiple reffes but nothing constraint --- src/FESpaces.jl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/FESpaces.jl b/src/FESpaces.jl index 74c16b2..832f3e4 100644 --- a/src/FESpaces.jl +++ b/src/FESpaces.jl @@ -633,6 +633,7 @@ 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 @@ -640,6 +641,7 @@ 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) @@ -648,6 +650,7 @@ end function _add_distributed_constraint( F::DistributedFESpace,cell_reffe::AbstractArray,constraint ) + isnothing(constraint) && return F reffe = map(cell_reffe) do cell_reffe reffes, ctypes = compress_cell_data(cell_reffe) return only(reffes) @@ -656,21 +659,19 @@ function _add_distributed_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 From 37cb194910b39f4644503bcd1decd6df39d51709 Mon Sep 17 00:00:00 2001 From: Jordi Manyer Date: Tue, 24 Mar 2026 10:20:03 +1100 Subject: [PATCH 2/3] Generise _add_distributed_constraint --- src/FESpaces.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/FESpaces.jl b/src/FESpaces.jl index 832f3e4..29465f2 100644 --- a/src/FESpaces.jl +++ b/src/FESpaces.jl @@ -651,11 +651,11 @@ function _add_distributed_constraint( F::DistributedFESpace,cell_reffe::AbstractArray,constraint ) isnothing(constraint) && return F - reffe = map(cell_reffe) do cell_reffe + 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) From fb5aa1ee6f5f1c48d0f1e34351b96d73cfcb9bf2 Mon Sep 17 00:00:00 2001 From: Jordi Manyer Date: Tue, 24 Mar 2026 10:23:38 +1100 Subject: [PATCH 3/3] Bump version --- NEWS.md | 6 ++++++ Project.toml | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 2136fc0..bf10ca4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -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 diff --git a/Project.toml b/Project.toml index a70000b..838dded 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "GridapDistributed" uuid = "f9701e48-63b3-45aa-9a63-9bc6c271f355" authors = ["S. Badia ", "A. F. Martin ", "F. Verdugo "] -version = "0.4.14" +version = "0.4.15" [deps] BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"