diff --git a/src/Arrays/LazyArrays.jl b/src/Arrays/LazyArrays.jl index 76b70f075..ce3d5df9b 100644 --- a/src/Arrays/LazyArrays.jl +++ b/src/Arrays/LazyArrays.jl @@ -177,7 +177,11 @@ end function _array_cache!(dict::Dict,a::LazyArray) @boundscheck begin - @notimplementedif ! all(map(isconcretetype, map(eltype, a.args))) + if ! all(map(isconcretetype, map(eltype, a.args))) + for n in 1:length(a.args) + @notimplementedif ! all(map(isconcretetype, map(eltype, a.args[n]))) + end + end if ! (eltype(a.maps) <: Function) @notimplementedif ! isconcretetype(eltype(a.maps)) end diff --git a/src/CellData/DomainContributions.jl b/src/CellData/DomainContributions.jl index 09837485e..2bf811042 100644 --- a/src/CellData/DomainContributions.jl +++ b/src/CellData/DomainContributions.jl @@ -13,14 +13,41 @@ get_domains(a::DomainContribution) = keys(a.dict) function get_contribution(a::DomainContribution,trian::Triangulation) if haskey(a.dict,trian) - return a.dict[trian] + return a.dict[trian] else - @unreachable """\n - There is not contribution associated with the given mesh in this DomainContribution object. - """ + for trian_a in get_domains(a) + if get_cell_node_ids(trian_a) == get_cell_node_ids(trian) + if hasproperty(trian,:a) + if hasproperty(trian.a,:subcells) + if isequivtrian(trian,trian_a) + return get_contribution(a,trian_a) + end + end + elseif hasproperty(trian,:subfacets) + if isequivtrian_subfacet(trian,trian_a) + return get_contribution(a,trian_a) + end + end + end + end + @unreachable """\n + There is not contribution associated with the given mesh in this DomainContribution object. + """ end end +function isequivtrian(trian1::AppendedTriangulation,trian2::AppendedTriangulation) + sc1 = trian1.a.subcells + sc2 = trian2.a.subcells + return (sc1.cell_to_points == sc2.cell_to_points && sc1.cell_to_bgcell == sc2.cell_to_bgcell && sc1.point_to_coords == sc2.point_to_coords && sc1.point_to_rcoords == sc2.point_to_rcoords ) +end + +function isequivtrian_subfacet(trian1,trian2) + sf1 = trian1.subfacets + sf2 = trian2.subfacets + return (sf1.facet_to_points == sf2.facet_to_points && sf1.facet_to_normal == sf2.facet_to_normal && sf1.point_to_coords == sf2.point_to_coords && sf1.point_to_rcoords == sf2.point_to_rcoords ) +end + Base.getindex(a::DomainContribution,trian::Triangulation) = get_contribution(a,trian) function add_contribution!(a::DomainContribution,trian::Triangulation,b::AbstractArray,op=+) diff --git a/src/Polynomials/MonomialBases.jl b/src/Polynomials/MonomialBases.jl index bd8a9966c..40e6fe5c0 100644 --- a/src/Polynomials/MonomialBases.jl +++ b/src/Polynomials/MonomialBases.jl @@ -195,7 +195,7 @@ function _evaluate!( f = fg.fa r, v, c, g = cache - z = zero(Mutable(VectorValue{D,eltype(T)})) + z = zero(Mutable(eltype(x))) np = length(x) ndof = length(f.terms) * num_components(T) n = 1 + _maximum(f.orders) diff --git a/test/PolynomialsTests/MonomialBasesTests.jl b/test/PolynomialsTests/MonomialBasesTests.jl index 5dab24542..07d4380b9 100644 --- a/test/PolynomialsTests/MonomialBasesTests.jl +++ b/test/PolynomialsTests/MonomialBasesTests.jl @@ -5,7 +5,7 @@ using Gridap.TensorValues using Gridap.Fields using Gridap.Polynomials -xi = Point(2,3) +xi = Point(2.0,3.0) np = 5 x = fill(xi,np)