@@ -633,13 +633,15 @@ end
633633function _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)
638639end
639640
640641function _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)
648650function _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(
656659end
657660
658661function _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 dΩ = 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
674675end
675676
676677# Assembly
0 commit comments