Skip to content

Commit 3af4349

Browse files
committed
Bugfix on FESpaces with multiple reffes but nothing constraint
1 parent cbd7197 commit 3af4349

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/FESpaces.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -633,13 +633,15 @@ end
633633
function _add_distributed_constraint(
634634
F::DistributedFESpace,reffe::ReferenceFE,constraint
635635
)
636+
isnothing(constraint) && return F
636637
order = get_order(reffe)
637638
_add_distributed_constraint(F,order,constraint)
638639
end
639640

640641
function _add_distributed_constraint(
641642
F::DistributedFESpace,reffe::Tuple{<:ReferenceFEName,Any,Any},constraint
642643
)
644+
isnothing(constraint) && return F
643645
args = reffe[2]
644646
order = maximum(args[2])
645647
_add_distributed_constraint(F,order,constraint)
@@ -648,6 +650,7 @@ end
648650
function _add_distributed_constraint(
649651
F::DistributedFESpace,cell_reffe::AbstractArray,constraint
650652
)
653+
isnothing(constraint) && return F
651654
reffe = map(cell_reffe) do cell_reffe
652655
reffes, ctypes = compress_cell_data(cell_reffe)
653656
return only(reffes)
@@ -656,21 +659,19 @@ function _add_distributed_constraint(
656659
end
657660

658661
function _add_distributed_constraint(F::DistributedFESpace,order::Integer,constraint)
659-
if isnothing(constraint)
660-
V = F
661-
elseif constraint == :zeromean
662+
isnothing(constraint) && return F
663+
if constraint == :zeromean
662664
_trian = get_triangulation(F)
663665
model = get_background_model(_trian)
664666
trian = remove_ghost_cells(_trian,get_cell_gids(model))
665667
= Measure(trian,order)
666-
V = ZeroMeanFESpace(F,dΩ)
668+
return ZeroMeanFESpace(F,dΩ)
667669
else
668670
@unreachable """\n
669671
The passed option constraint=$constraint is not valid.
670672
Valid values for constraint: nothing, :zeromean
671673
"""
672674
end
673-
V
674675
end
675676

676677
# Assembly

0 commit comments

Comments
 (0)