Closed amartinhuertas closed 4 years ago
@amartinhuertas This looks like there is a 0-lengh array degenerated case that is not properly handled in the code, right?
Yes, it is definitely a corner case. Reproduced whenever you try to evaluate a SourceFETerm on a void boundary mesh.
It's definitively a bug. I am fixing it. As you very well noticed, it is related with testitem
It's definitively a bug. I am fixing it. As you very well noticed, it is related with testitem
Great! Thanks! Note that there is a reproducer above to simplify things up.
Some day (not urgent) I would like that you give me some keys on the machinery that is in charge of the lazy evaluation of FETerms ... I think if I could grasp better what the code is doing, I could debug it myself, and better understand the side-effects.
Some day (not urgent) I would like that you give me some keys on the machinery that is in charge of the lazy evaluation of FETerms ... I think if I could grasp better what the code is doing, I could debug it myself, and better understand the side-effects.
yes sure!
solved via #329
Hi @fverdugo,
Thanks for your work!
Let me just note that, after pulling your bug fix, I am still having issues with DistributedStokesTests.jl
. I just found the error, and have to dig deeper into into. However, it wouldn't be mad to claim that it might be related to this thread, because the error message triggered is the same as the one that we had so far. Interestingly enough, it happens during the second execution to run
(https://github.com/gridap/GridapDistributed.jl/blob/66e4ada6c3aaf0c4848bfc55ed2088f91bab5afb/test/DistributedStokesTests.jl#L150), that uses OwnedCellsStrategy
. The only difference of OwnedCellsStrategy
w.r.t. RowsComputedLocally
is that the former restricts (a void) boundary triangulation to the cells owned by the processor (remove_ghost_cells_if_needed
). Does it tell you anything? If not, I will try to debug the code and find a reproducer in order to find where the source of the error can come from.
Thanks!
julia> include("test/DistributedStokesTests.jl")
1.3061638074924613e-30 < 1.0e-9
ERROR: LoadError: AssertionError: lincom: Number of fields in basis needs to be equal to number of coefs.
Stacktrace:
[1] _lincomb_checks(::Array{Float64,2}, ::Array{Gridap.TensorValues.VectorValue{2,Float64},1}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/Lincomb.jl:38
[2] kernel_cache(::Gridap.Fields.LinCom, ::Array{Float64,2}, ::Array{Gridap.TensorValues.VectorValue{2,Float64},1}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/Lincomb.jl:25
[3] kernel_testitem(::Gridap.Fields.LinCom, ::Array{Float64,2}, ::Vararg{Any,N} where N) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Arrays/Kernels.jl:179
[4] Gridap.Arrays.AppliedArray(::FillArrays.Fill{Gridap.Fields.LinCom,1,Tuple{Base.OneTo{Int64}}}, ::Gridap.Arrays.CompressedArray{Array{Float64,2},1,Array{Array{Float64,2},1},Array{Int8,1}}, ::Vararg{AbstractArray,N} where N) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Arrays/Apply.jl:176
[5] apply at /home/amartin/.julia/packages/Gridap/XnE1b/src/Arrays/Apply.jl:105 [inlined]
[6] apply at /home/amartin/.julia/packages/Gridap/XnE1b/src/Arrays/Apply.jl:61 [inlined]
[7] apply_lincomb at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/Lincomb.jl:115 [inlined]
[8] kernel_evaluate(::Gridap.Fields.LinComValued, ::Gridap.Arrays.CompressedArray{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1,Array{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}, ::Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}}, ::Gridap.Arrays.Reindexed{Array{Gridap.TensorValues.VectorValue{2,Float64},1},1,Gridap.Geometry.FaceCellCoordinates{2,Float64,true},Array{Int64,1}}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/Lincomb.jl:107
[9] evaluate_field_array at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:79 [inlined]
[10] kernel_evaluate(::Gridap.Fields.CompFieldArray, ::Gridap.Arrays.CompressedArray{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1,Array{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}, ::Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Geometry.CartesianMap{2,Float64,4},Array{Int64,1}},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.AddMap,1,Tuple{Base.OneTo{Int64}}}}, ::Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Array{Gridap.TensorValues.VectorValue{2,Float64},1},1,Gridap.Geometry.FaceCellCoordinates{2,Float64,true},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/Compose.jl:109
[11] evaluate_field_array(::Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.CompField{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Geometry.CartesianMap{2,Float64,4},Array{Int64,1}},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.AddMap,1,Tuple{Base.OneTo{Int64}}}},Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Array{Gridap.TensorValues.VectorValue{2,Float64},1},1,Gridap.Geometry.FaceCellCoordinates{2,Float64,true},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.CompFieldArray,1,Tuple{Base.OneTo{Int64}}}}, ::Gridap.Arrays.CompressedArray{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1,Array{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:79
[12] _evaluate_field_arrays at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:57 [inlined]
[13] evaluate_field_arrays at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:47 [inlined]
[14] _evaluate_field_arrays at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:52 [inlined]
[15] evaluate_field_arrays(::Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.Comp{Main.DistributedStokesTests.var"#s#13"{Main.DistributedStokesTests.var"#sx#11",Main.DistributedStokesTests.var"#sy#12"}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.LocalToGlobalArray{Gridap.TensorValues.VectorValue{2,Float64},1,1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Table{Int64,Int32},Array{Int64,1}},Array{Int64,1}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.Valued{Gridap.Fields.Comp{Main.DistributedStokesTests.var"#s#13"{Main.DistributedStokesTests.var"#sx#11",Main.DistributedStokesTests.var"#sy#12"}}},1,Tuple{Base.OneTo{Int64}}}},Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.CompField{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Geometry.CartesianMap{2,Float64,4},Array{Int64,1}},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.AddMap,1,Tuple{Base.OneTo{Int64}}}},Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Array{Gridap.TensorValues.VectorValue{2,Float64},1},1,Gridap.Geometry.FaceCellCoordinates{2,Float64,true},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.CompFieldArray,1,Tuple{Base.OneTo{Int64}}}}}, ::Gridap.Arrays.CompressedArray{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1,Array{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:47
[16] kernel_evaluate(::Gridap.Fields.Valued{Gridap.Fields.FieldBinOp{typeof(LinearAlgebra.dot)}}, ::Gridap.Arrays.CompressedArray{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1,Array{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}, ::Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.Comp{Main.DistributedStokesTests.var"#s#13"{Main.DistributedStokesTests.var"#sx#11",Main.DistributedStokesTests.var"#sy#12"}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.LocalToGlobalArray{Gridap.TensorValues.VectorValue{2,Float64},1,1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Table{Int64,Int32},Array{Int64,1}},Array{Int64,1}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.Valued{Gridap.Fields.Comp{Main.DistributedStokesTests.var"#s#13"{Main.DistributedStokesTests.var"#sx#11",Main.DistributedStokesTests.var"#sy#12"}}},1,Tuple{Base.OneTo{Int64}}}}, ::Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.CompField{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Geometry.CartesianMap{2,Float64,4},Array{Int64,1}},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.AddMap,1,Tuple{Base.OneTo{Int64}}}},Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Array{Gridap.TensorValues.VectorValue{2,Float64},1},1,Gridap.Geometry.FaceCellCoordinates{2,Float64,true},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.CompFieldArray,1,Tuple{Base.OneTo{Int64}}}}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:274
[17] evaluate_field_array at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/FieldArrays.jl:79 [inlined]
[18] integrate(::Gridap.Arrays.AppliedArray{Gridap.Geometry.UnimplementedField,1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.Comp{Main.DistributedStokesTests.var"#s#13"{Main.DistributedStokesTests.var"#sx#11",Main.DistributedStokesTests.var"#sy#12"}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.LocalToGlobalArray{Gridap.TensorValues.VectorValue{2,Float64},1,1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Table{Int64,Int32},Array{Int64,1}},Array{Int64,1}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.Valued{Gridap.Fields.Comp{Main.DistributedStokesTests.var"#s#13"{Main.DistributedStokesTests.var"#sx#11",Main.DistributedStokesTests.var"#sy#12"}}},1,Tuple{Base.OneTo{Int64}}}},Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.CompField{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}}},Tuple{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}}},1,Tuple{Gridap.Arrays.AppliedArray{Gridap.Fields.AppliedField{Gridap.Fields.MapGrad,Tuple{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},Gridap.Fields.AffineMap{2,Float64,4}}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{2,Gridap.TensorValues.VectorValue{2,Float64}},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Arrays.Reindexed{Gridap.Fields.AffineMap{2,Float64,4},1,Gridap.Geometry.CartesianMap{2,Float64,4},Array{Int64,1}},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.AddMap,1,Tuple{Base.OneTo{Int64}}}},Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1,Array{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}},1},Array{Int8,1}},Gridap.Arrays.Reindexed{Array{Gridap.TensorValues.VectorValue{2,Float64},1},1,Gridap.Geometry.FaceCellCoordinates{2,Float64,true},Array{Int64,1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.CompFieldArray,1,Tuple{Base.OneTo{Int64}}}}},FillArrays.Fill{Gridap.Fields.Valued{Gridap.Fields.FieldBinOp{typeof(LinearAlgebra.dot)}},1,Tuple{Base.OneTo{Int64}}}}, ::Gridap.Arrays.CompressedArray{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1,Array{Array{Gridap.TensorValues.VectorValue{1,Float64},1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}, ::Gridap.Arrays.CompressedArray{Array{Float64,1},1,Array{Array{Float64,1},1},Gridap.Arrays.Reindexed{Int8,1,Gridap.Arrays.Reindexed{Int8,1,Array{Int8,1},Array{Int64,1}},Array{Int64,1}}}, ::Gridap.Arrays.AppliedArray{Gridap.Fields.LinComField{Gridap.Fields.FieldGrad{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}},1,Tuple{Gridap.Arrays.CompressedArray{Gridap.Fields.FieldGrad{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}}},1,Array{Gridap.Fields.FieldGrad{Gridap.Polynomials.BasisFromChangeOfBasis{Gridap.Polynomials.MonomialBasis{1,Float64},Array{Float64,2}}},1},Array{Int8,1}},Gridap.Arrays.LocalToGlobalArray{Gridap.TensorValues.VectorValue{2,Float64},1,1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Reindexed{Array{Int64,1},1,Gridap.Arrays.Table{Int64,Int32},Array{Int64,1}},Array{Int64,1}},Array{Gridap.TensorValues.VectorValue{2,Float64},1}}},FillArrays.Fill{Gridap.Fields.LinComValued,1,Tuple{Base.OneTo{Int64}}}}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/Fields/Integrate.jl:17
[19] integrate(::Gridap.FESpaces.GenericCellBasis{false,true}, ::Gridap.Geometry.TriangulationPortion{1,2,Gridap.Geometry.GenericBoundaryTriangulation{1,2,Gridap.Geometry.TriangulationPortion{1,2,Gridap.Geometry.UnstructuredGrid{1,2,Float64,false}},Gridap.Geometry.CartesianGrid{2,Float64,typeof(identity)},true,Int64}}, ::Gridap.Geometry.CellQuadrature) at /home/amartin/.julia/packages/Gridap/XnE1b/src/FESpaces/CellBases.jl:358
[20] integrate(::Gridap.MultiField.CellBasisWithFieldID{false,true}, ::Gridap.Geometry.TriangulationPortion{1,2,Gridap.Geometry.GenericBoundaryTriangulation{1,2,Gridap.Geometry.TriangulationPortion{1,2,Gridap.Geometry.UnstructuredGrid{1,2,Float64,false}},Gridap.Geometry.CartesianGrid{2,Float64,typeof(identity)},true,Int64}}, ::Gridap.Geometry.CellQuadrature) at /home/amartin/.julia/packages/Gridap/XnE1b/src/MultiField/MultiFieldCellBases.jl:175
[21] get_cell_vector(::Gridap.FESpaces.FESourceFromIntegration, ::Gridap.MultiField.MultiCellBasis{false,true}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/FESpaces/FETerms.jl:394
[22] _get_cell_vector_tmp_hack at /home/amartin/.julia/packages/Gridap/XnE1b/src/FESpaces/FETerms.jl:114 [inlined]
[23] get_cell_matrix_and_vector(::Gridap.FESpaces.FESourceFromIntegration, ::Gridap.MultiField.MultiFieldFEFunction, ::Gridap.MultiField.MultiCellBasis{true,true}, ::Gridap.MultiField.MultiCellBasis{false,true}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/FESpaces/FETerms.jl:108
[24] collect_cell_matrix_and_vector(::Gridap.MultiField.MultiFieldFEFunction, ::Gridap.MultiField.MultiCellBasis{true,true}, ::Gridap.MultiField.MultiCellBasis{false,true}, ::Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}) at /home/amartin/.julia/packages/Gridap/XnE1b/src/FESpaces/FETerms.jl:236
[25] (::GridapDistributed.var"#145#146")(::Int64, ::Gridap.MultiField.MultiFieldFEFunction, ::Gridap.MultiField.MultiCellBasis{true,true}, ::Gridap.MultiField.MultiCellBasis{false,true}, ::Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}) at /home/amartin/git-repos/GridapDistributed.jl/src/DistributedFETerms.jl:33
[26] (::GridapDistributed.var"#7#9"{GridapDistributed.var"#145#146",GridapDistributed.SequentialCommunicator,Tuple{GridapDistributed.DistributedFEFunction{Array{Float64,1}},GridapDistributed.DistributedCellBasis,GridapDistributed.DistributedCellBasis,GridapDistributed.SequentialDistributedData{Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}}}})(::Int64) at ./array.jl:0
[27] iterate at ./generator.jl:47 [inlined]
[28] collect_to!(::Array{Tuple{Tuple{Array{Any,1},Array{Any,1},Array{Any,1}},Tuple{Array{Any,1},Array{Any,1},Array{Any,1}},Tuple{Array{Any,1},Array{Any,1}}},1}, ::Base.Generator{UnitRange{Int64},GridapDistributed.var"#7#9"{GridapDistributed.var"#145#146",GridapDistributed.SequentialCommunicator,Tuple{GridapDistributed.DistributedFEFunction{Array{Float64,1}},GridapDistributed.DistributedCellBasis,GridapDistributed.DistributedCellBasis,GridapDistributed.SequentialDistributedData{Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}}}}}, ::Int64, ::Int64) at ./array.jl:710
[29] collect_to_with_first!(::Array{Tuple{Tuple{Array{Any,1},Array{Any,1},Array{Any,1}},Tuple{Array{Any,1},Array{Any,1},Array{Any,1}},Tuple{Array{Any,1},Array{Any,1}}},1}, ::Tuple{Tuple{Array{Any,1},Array{Any,1},Array{Any,1}},Tuple{Array{Any,1},Array{Any,1},Array{Any,1}},Tuple{Array{Any,1},Array{Any,1}}}, ::Base.Generator{UnitRange{Int64},GridapDistributed.var"#7#9"{GridapDistributed.var"#145#146",GridapDistributed.SequentialCommunicator,Tuple{GridapDistributed.DistributedFEFunction{Array{Float64,1}},GridapDistributed.DistributedCellBasis,GridapDistributed.DistributedCellBasis,GridapDistributed.SequentialDistributedData{Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}}}}}, ::Int64) at ./array.jl:689
[30] collect(::Base.Generator{UnitRange{Int64},GridapDistributed.var"#7#9"{GridapDistributed.var"#145#146",GridapDistributed.SequentialCommunicator,Tuple{GridapDistributed.DistributedFEFunction{Array{Float64,1}},GridapDistributed.DistributedCellBasis,GridapDistributed.DistributedCellBasis,GridapDistributed.SequentialDistributedData{Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}}}}}) at ./array.jl:670
[31] GridapDistributed.DistributedData(::Function, ::GridapDistributed.SequentialCommunicator, ::GridapDistributed.DistributedFEFunction{Array{Float64,1}}, ::Vararg{Any,N} where N) at /home/amartin/git-repos/GridapDistributed.jl/src/SequentialDistributedData.jl:19
[32] GridapDistributed.DistributedData(::Function, ::GridapDistributed.DistributedFEFunction{Array{Float64,1}}, ::Vararg{Any,N} where N) at /home/amartin/git-repos/GridapDistributed.jl/src/DistributedData.jl:31
[33] collect_cell_matrix_and_vector(::GridapDistributed.DistributedFEFunction{Array{Float64,1}}, ::GridapDistributed.DistributedCellBasis, ::GridapDistributed.DistributedCellBasis, ::GridapDistributed.SequentialDistributedData{Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}}) at /home/amartin/git-repos/GridapDistributed.jl/src/DistributedFETerms.jl:32
[34] Gridap.FESpaces.AffineFEOperator(::GridapDistributed.DistributedAssembler{SparseArrays.SparseMatrixCSC{Float64,Int64},Array{Float64,1},GridapDistributed.OwnedCellsStrategy{false}}, ::GridapDistributed.SequentialDistributedData{Tuple{Gridap.FESpaces.AffineFETermFromIntegration,Gridap.FESpaces.FESourceFromIntegration}}) at /home/amartin/git-repos/GridapDistributed.jl/src/DistributedFEOperators.jl:12
[35] run(::GridapDistributed.SequentialCommunicator, ::Tuple{Int64,Int64}, ::String, ::Bool) at /home/amartin/git-repos/GridapDistributed.jl/test/DistributedStokesTests.jl:122
[36] (::Main.DistributedStokesTests.var"#23#24")(::GridapDistributed.SequentialCommunicator) at /home/amartin/git-repos/GridapDistributed.jl/test/DistributedStokesTests.jl:150
[37] GridapDistributed.SequentialCommunicator(::Main.DistributedStokesTests.var"#23#24", ::Tuple{Int64,Int64}) at /home/amartin/git-repos/GridapDistributed.jl/src/SequentialCommunicators.jl:8
[38] top-level scope at /home/amartin/git-repos/GridapDistributed.jl/test/DistributedStokesTests.jl:148
[39] include(::String) at ./client.jl:439
[40] top-level scope at REPL[1]:1
in expression starting at /home/amartin/git-repos/GridapDistributed.jl/test/DistributedStokesTests.jl:148
Yes, it is related with the degenerated case of triangulations with 0 cells. In PR #329, I have added some methods in the Kernel
interface in order to handle these cases, but as you can see, I have not implemented them for all the specializations of Kernel
we have in the library (I implemented only the ones needed for your previous reproducers.). Implementing it for the LinCom
kernel should be easy.
Hope this fixes it: PR #331
Hope this fixes it: PR #331
Seems that implementing the methods for the appropriate realization of Kernel
solves the issue:
https://travis-ci.com/github/gridap/GridapDistributed.jl/jobs/364455303#L918
Thanks! Closing the issue.
Hi @fverdugo, @santiagobadia,
while working in
GridapDistributed.jl
, I think I found a BUG in Gridap v.0.12.0 in the call path rooted atfunction AppliedArray(g::AbstractArray,f::AbstractArray...)
.Let me call it BUG from now on, even if we don't still have a confirmation.
This BUG can be reproduced with the following minimal Julia code snippet, that synthetizes an actual call path status in a much more complex scenario (see below for a full Julia script in which this issue is spotted).
The BUG comes in the form of an
AssertionError
triggered in a final node of the call path, namely,with
nb==0
andna==2
.Tracing back where do
a
andb
come from, it turns out that they come from:In particular, with
g
as above, andf==(f1,f2)
, then we getNote that the first entry of the tuple returned by
testitems((f1,f2)...)
plays the role of the argumenta
in_lincomb_checks
, and thus the error is triggered.Finally, this scenario was originally triggered from the following Gridap driver that solves the stokes problem. Note that the boundary triangulation has 0 faces (i.e., it is void) as there are not faces that belong to entity 10 (as this entity does not exist). The same situation happens in parallel for those subdomains which are not in contact with the Neumman boundary. So it seems the code is not handling correctly this corner case.
Can you please confirm whether this is a BUG? I am not sure about the solution ... I dont feel myself confident enough with the side-effects that a hack to fix this partciular scenario could have for the global consistency of the project.