You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've found a bug that seems to be caused by the combination of p4est models AND :zeromean constraints AND block assembly. If we run the following code, the last weakform produces the error below.
If we uncomment one of the commented lines, i.e if
we run in serial (or MPI with a single processor)
OR we run with a distributed cartesian model
OR we run without the :zeromean space
OR we run without BlockAssembly
the error message goes away and everything runs fine. So it's activated by a combination of all four. My guess is that something must be going on with the ghost dof ids of the individual fespaces we create.
using Gridap
using Gridap.ReferenceFEs, Gridap.Algebra, Gridap.Geometry, Gridap.FESpaces
using Gridap.CellData, Gridap.MultiField, Gridap.Algebra
using PartitionedArrays
using GridapDistributed
using GridapP4est
np =4
parts =with_mpi() do distribute
distribute(LinearIndices((np,)))
end
nc = (8,8)
domain = (0,1,0,1)
cmodel =CartesianDiscreteModel(domain,nc)
num_refs_coarse =0
model =OctreeDistributedDiscreteModel(parts,cmodel,num_refs_coarse)
#model = CartesianDiscreteModel(parts,(2,2),domain,nc) # ALL TESTS RUN OK
order =2
reffe_u =ReferenceFE(lagrangian,VectorValue{2,Float64},order)
reffe_p =ReferenceFE(lagrangian,Float64,order-1,space=:P)
V =TestFESpace(model,reffe_u)
Q =TestFESpace(model,reffe_p;conformity=:L2,constraint=:zeromean)
#Q = TestFESpace(model,reffe_p;conformity=:L2) # ALL TESTS RUN OK
mfs = Gridap.MultiField.BlockMultiFieldStyle()
#mfs = Gridap.MultiField.ConsecutiveMultiFieldStyle() # ALL TESTS RUN OK
X =MultiFieldFESpace([V,Q];style=mfs)
Y =MultiFieldFESpace([Q,Q];style=mfs)
qdegree =4
Ω =Triangulation(model)
dΩ =Measure(Ω,qdegree)
m(p,q) =∫(p*q)dΩ
M =assemble_matrix(m,Q,Q) # OKn(u,q) =∫((∇⋅u)*q)dΩ
N =assemble_matrix(n,V,Q) # OKl((p1,p2),(q1,q2)) =∫(p1*q1 + p2*q2 + p1*q2)dΩ
L =assemble_matrix(l,Y,Y) # OKb((u,p),(v,q)) =∫(∇(v)⊙∇(u))dΩ +m(p,q)
B =assemble_matrix(b,X,X) # OKa((u,p),(v,q)) =∫(∇(v)⊙∇(u))dΩ +m(p,q) -∫((∇⋅v)*p)dΩ -∫((∇⋅u)*q)dΩ
A =assemble_matrix(a,X,X) # FAILS
This is caused by a bug in distributed block-assembly. It has nothing to do with p4est, but rather p4est's dof ordering was activating the bug in GridapDistrbuted. Fixed by gridap/GridapDistributed.jl#147
It is a convoluted one...
I've found a bug that seems to be caused by the combination of p4est models AND :zeromean constraints AND block assembly. If we run the following code, the last weakform produces the error below.
If we uncomment one of the commented lines, i.e if
the error message goes away and everything runs fine. So it's activated by a combination of all four. My guess is that something must be going on with the ghost dof ids of the individual fespaces we create.
The text was updated successfully, but these errors were encountered: