gridap / Gridap.jl

Grid-based approximation of partial differential equations in Julia
MIT License
714 stars 97 forks source link

Summation of LazyArrays #610

Closed zjwegert closed 3 years ago

zjwegert commented 3 years ago

Suppose we are contracting, operating then integrating on tensors generated from an FE function. Then you can encounter very complex LazyArrays such as the example below. This is fine unless you want to sum up the array. Summing an array such as the one below can take almost 60 seconds - not a surprise given the typing.

Is there a faster way we could sum such an array? Maybe not given the nature of LazyArrays but I thought it worth the question.

27000-element LazyArray{FillArrays.Fill{IntegrationMap, 1, Tuple{Base.OneTo{Int64}}}, SymFourthOrderTensorValue{3, Float64, 36}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{var"#1545#tmp_operation#97"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{LazyArray{FillArrays.Fill{typeof(constant_field), 1, Tuple{Base.OneTo{Int64}}}, ConstantField{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{Vector{SymFourthOrderTensorValue{3, Float64, 36}}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(symmetric_part)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(symmetric_part)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(symmetric_part)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(symmetric_part)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(symmetric_part)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(symmetric_part)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{var"#1560#tmp_operation#98"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{SymFourthOrderTensorValue{3, Float64, 36}}, 1, Tuple{LazyArray{LazyArray{FillArrays.Fill{typeof(constant_field), 1, Tuple{Base.OneTo{Int64}}}, ConstantField{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(+)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{Float64}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{Float64}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{Float64}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{Float64}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{Float64}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(outer)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{ThirdOrderTensorValue{3, 3, 3, Float64, 27}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(-)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{typeof(dot)}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.BroadcastingFieldOpMap{Gridap.Fields.var"#k#58"}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{Float64}, 1, Tuple{Base.OneTo{Int64}}}}}, FillArrays.Fill{Vector{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}, LazyArray{FillArrays.Fill{Gridap.Fields.LinearCombinationMap{Colon}, 1, Tuple{Base.OneTo{Int64}}}, Vector{VectorValue{3, Float64}}, 1, Tuple{LazyArray{FillArrays.Fill{Broadcasting{PosNegReindex{SubVector{Float64, Vector{Float64}}, Vector{Float64}}}, 1, Tuple{Base.OneTo{Int64}}}, Vector{Float64}, 1, Tuple{Table{Int32, Vector{Int32}, Vector{Int32}}}}, FillArrays.Fill{Matrix{VectorValue{3, Float64}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{SymTensorValue{3, Float64, 6}}, 1, Tuple{Base.OneTo{Int64}}}}}}}}}}}, FillArrays.Fill{Vector{Float64}, 1, Tuple{Base.OneTo{Int64}}}, FillArrays.Fill{Vector{TensorValue{3, 3, Float64, 9}}, 1, Tuple{Base.OneTo{Int64}}}}}:
             SymFourthOrderTensorValue{3, Float64, 36}(3.273361479588833e6, -740.122829432466, -936.8797363088888, 1.6413684942583223e6, -1120.3984398496532, 1.486966319968383e6, -672.4862375276082, 505998.7811930531, -538.7295718177018, -672.4862375246939, -538.7295718117452, -644.1564534963699, -1004.4821961488708, -541.3551224072149, 443729.5272445973, -1086.50020287286, -510.25676099138366, -828.4757632545636, 1.6413684942583246e6, -740.1228294300234, -1120.398439850752, 3.2733614795888397e6, -936.8797363057807, 1.4869663199683775e6, -1086.500202872317, -541.3551224054404, -510.25676101776565, -1004.4821961430748, 443729.52724462206, -828.4757632581118, 1.472538503001343e6, -715.0693925362964, -863.7419156983156, 1.4725385030013449e6, -863.7419156639043, 2.8222173564799055e6)
 SymFourthOrderTensorValue{3, Float64, 36}(3.2802920105320057e6, -2093.1705368250377, -2662.1148696688256, 1.6481302881736972e6, -1133.0619208699713, 1.4926884954602101e6, -1845.0931118333426, 510873.57909317466, -534.4334076675867, -1749.288021378355, -1498.970393337442, -1770.5469920066264, -2783.850620496901, -537.787120572569, 448991.89051474136, -3017.1956935753283, -1417.2930274547534, -2228.98458396963, 1.6542200387956207e6, -1865.6090036628975, -3107.9979155475617, 3.2194849492984465e6, -964.6541765208177, 1.4719419952323155e6, -1088.8104953658683, -1520.425761485622, -1434.2558161531188, -1028.212984245416, 430438.44578777644, -849.7599634645692, 1.487077271795157e6, -1958.3385011829155, -2245.1298152796085, 1.4587775733867728e6, -890.6519445154531, 2.7754430589987407e6)
        SymFourthOrderTensorValue{3, Float64, 36}(3.2922091288947253e6, -3204.700424506224, -4102.670866485291, 1.6599193980600047e6, -1156.6727294604043, 1.5026261152917873e6, -2718.5238432410947, 519152.5122139559, -530.9921109742596, -2429.792236519893, -2250.257453573809, -2624.747985554038, -4152.366973174351, -535.551680499019, 458076.4522738514, -4523.833565511346, -2123.451725514598, -3229.9094754881476, 1.669052798424595e6, -2484.62529771713, -4681.5359124519455, 3.1656264348176843e6, -1014.4425246329647, 1.4554389178806085e6, -1114.4477321519344, -2337.827968047305, -2208.613417224831, -1085.3303851384733, 414983.61662915524, -900.3036274608301, 1.5017614507184236e6, -2905.5948194456873, -3114.345059260166, 1.4424114741413696e6, -938.4420413468681, 2.7274236594735864e6)
    SymFourthOrderTensorValue{3, Float64, 36}(3.307927238171419e6, -4092.2315332215376, -5272.029101371247, 1.6754747897149955e6, -1189.1203464869227, 1.5157645273045776e6, -3353.6934629428215, 529849.6001295899, -529.7138076819792, -2892.1243769927614, -2829.106822033231, -3272.9260769649995, -5175.948426844792, -535.7049725571757, 469971.6620519545, -5686.472102757378, -2665.800440307687, -3974.6060331266885, 1.6851119247683592e6, -2835.9538131411255, -5920.472731666385, 3.113060580329421e6, -1077.1266507319028, 1.4382344731069007e6, -1157.533790531954, -3013.367551454535, -2851.9045067276993, -1164.1867437994742, 398098.03864534345, -970.3941487109017, 1.516239554926333e6, -3636.1334248034473, -3681.7397034319138, 1.4244088933311247e6, -999.1298591051323, 2.6794580644026576e6)
         SymFourthOrderTensorValue{3, Float64, 36}(3.326384578763471e6, -4759.3544980681345, -6167.650941781467, 1.693776614065742e6, -1227.877257218452, 1.531264691898475e6, -3779.854729449922, 542253.4090725114, -530.4746890119259, -3190.4921063851352, -3250.2808523188583, -3737.005565550824, -5886.9680308637535, -537.908183461847, 483908.3780002144, -6533.444834607315, -3059.1468374898564, -4504.332859775663, 1.7018457652267972e6, -3008.2461183225732, -6846.257571967067, 3.062641175679626e6, -1148.3079316656294, 1.4209029136101587e6, -1213.2733723875529, -3546.198726956928, -3362.2779431057897, -1258.8235599589864, 380384.08277454483, -1054.950789298228, 1.530296210147906e6, -4172.723090937761, -4026.8574184916047, 1.4055213424563357e6, -1068.768126272976, 2.632497905400063e6)
      SymFourthOrderTensorValue{3, Float64, 36}(3.3466026252167015e6, -5205.200819199078, -6782.163246934287, 1.7139191187198877e6, -1270.6065413025794, 1.5483707489247227e6, -4017.079686872544, 555775.0988049415, -532.7904483019988, -3351.9512458928884, -3521.900403248447, -4028.761431470265, -6307.763206242114, -541.5043853529265, 499224.4393065773, -7079.371305741866, -3311.685250045529, -4837.744354864576, 1.7187993267841213e6, -3051.777056988192, -7465.893370415349, 3.0150410232423046e6, -1224.9641359261163, 1.4039216919709716e6, -1277.5711126731944, -3930.1396507496574, -3732.7964633905026, -1364.7651598752443, 362376.7942328957, -1150.0772228687656, 1.5437766040128712e6, -4525.0761660479475, -4194.784062896052, 1.3863982050509031e6, -1144.543809447282, 2.587344747750941e6)
         SymFourthOrderTensorValue{3, Float64, 36}(3.3676689523434713e6, -5428.61526958627, -7108.643660852372, 1.7350571403207441e6, -1315.1259548094142, 1.566368692536873e6, -4081.4436955030174, 569888.3456477347, -536.0384523576939, -3391.1307286924366, -3649.0970973026256, -4155.540862527714, -6456.947350807289, -545.7437094788849, 515311.03350705636, -7333.304494308704, -3428.606854765093, -4983.747732145853, 1.735562681369823e6, -2996.3583594693073, -7781.158723021312, 2.9708161732618897e6, -1304.5201678329718, 1.3876937057812454e6, -1346.747826592952, -4157.440105368586, -3955.070477242333, -1477.9621854408906, 344565.9087687789, -1252.172933159658, 1.5565452506191335e6, -4697.16279430294, -4212.494773305011, 1.3676112235539071e6, -1223.9654055675423, 2.5446999205947863e6)
            SymFourthOrderTensorValue{3, Float64, 36}(3.3887335996942627e6, -5431.357142930173, -7144.587770047008, 1.756383639951613e6, -1359.4249259511835, 1.5845697372450097e6, -3988.115156732475, 584097.5927563623, -539.5792290025983, -3316.8546287444265, -3636.005902447941, -4123.478931219762, -6352.988061056594, -549.910910363957, 531584.9643210084, -7303.23874436059, -3414.0531500104307, -4947.562280322702, 1.7517470696825925e6, -2859.6083150720847, -7793.657967815888, 2.93043602457425e6, -1384.5175336932823, 1.3725583533809234e6, -1417.4228080299663, -4221.029700410234, -4021.4480583104382, -1594.3849389906854, 327406.26870701497, -1357.59465832557, 1.5684665892404811e6, -4691.274171718862, -4096.414304020433, 1.3496658780662536e6, -1304.5675674864276, 2.50518685485439e6)
       SymFourthOrderTensorValue{3, Float64, 36}(3.409012487137491e6, -5219.872725670288, -6894.380080218616, 1.7771230625817738e6, -1401.7016501251042, 1.6023065424619552e6, -3752.7346854476577, 597922.0538691466, -542.8595941783569, -3135.566002174715, -3487.2942060378823, -3939.450444490091, -6016.071576812299, -553.4324162696911, 547475.6801504487, -6999.174697348097, -3272.5899012366262, -4734.160847361182, 1.7669747812215313e6, -2651.626372486862, -7508.234547270816, 2.8942985611590995e6, -1462.4705476579643, 1.3587978272773195e6, -1486.4858890537128, -4116.4629334755355, -3926.910475285614, -1709.8599733323272, 311321.96157150075, -1462.5226189007626, 1.5793964150503967e6, -4510.597032282769, -3856.865318636369, 1.3330065728787486e6, -1383.780423236567, 2.46936078932391e6)
       SymFourthOrderTensorValue{3, Float64, 36}(3.4277945967731443e6, -4806.251606978683, -6370.764678980203, 1.7965356358815043e6, -1440.406204178059, 1.6189384920989436e6, -3391.9851419113406, 610891.4030084062, -545.4916556803585, -2853.6307373821182, -3209.4995110508617, -3612.504980219735, -5469.059553028207, -555.9544705826866, 562423.6879246178, -6435.536599256001, -3010.4800891201553, -4350.795168123712, 1.7808783474566897e6, -2378.4531295238094, -6935.729628965639, 2.862739097061107e6, -1535.833499174563, 1.3466420216775273e6, -1551.1189097789272, -3843.7906316455023, -3670.8961834919787, -1820.0573505939203, 296706.038758809, -1562.9579064472134, 1.5891806635209022e6, -4161.264928737063, -3501.53655700315, 1.3180192227685184e6, -1458.9045227705928, 2.437712480998013e6)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            ⋮
        SymFourthOrderTensorValue{3, Float64, 36}(3.409012487137491e6, -5219.87272567049, -6894.380080219174, 1.777123062581774e6, -1401.7016501250462, 1.602306542461955e6, -3752.734685447677, 597922.0538691469, -542.8595941784106, -3135.5660021748718, -3487.29420603787, -3939.4504444900213, -6016.071576812223, -553.4324162697105, 547475.6801504483, -6999.174697348194, -3272.5899012367495, -4734.160847360774, 1.7669747812215316e6, -2651.6263724867954, -7508.234547270988, 2.8942985611590995e6, -1462.4705476577876, 1.3587978272773202e6, -1486.4858890535509, -4116.462933475656, -3926.9104752850753, -1709.8599733322549, 311321.96157150075, -1462.5226189004995, 1.5793964150503967e6, -4510.597032282755, -3856.865318635771, 1.333006572878749e6, -1383.7804232366313, 2.4693607893239106e6)
              SymFourthOrderTensorValue{3, Float64, 36}(3.3887335996942627e6, -5431.357142930486, -7144.587770047171, 1.7563836399516133e6, -1359.4249259512592, 1.5845697372450095e6, -3988.115156732245, 584097.5927563625, -539.57922900243, -3316.8546287444738, -3636.005902448129, -4123.478931219661, -6352.98806105624, -549.9109103639266, 531584.9643210098, -7303.238744360567, -3414.053150010534, -4947.5622803224915, 1.751747069682593e6, -2859.608315072541, -7793.657967815687, 2.9304360245742495e6, -1384.517533693313, 1.3725583533809236e6, -1417.4228080299172, -4221.029700410201, -4021.448058310507, -1594.384938990582, 327406.2687070149, -1357.594658325505, 1.5684665892404816e6, -4691.274171719032, -4096.414304019393, 1.3496658780662538e6, -1304.5675674865633, 2.505186854854391e6)
        SymFourthOrderTensorValue{3, Float64, 36}(3.367668952343471e6, -5428.6152695867595, -7108.643660852413, 1.7350571403207441e6, -1315.1259548094602, 1.5663686925368723e6, -4081.4436955029505, 569888.345647735, -536.038452357843, -3391.130728692722, -3649.097097302863, -4155.540862527685, -6456.947350807133, -545.743709478971, 515311.0335070562, -7333.304494308651, -3428.6068547653417, -4983.747732145499, 1.7355626813698227e6, -2996.358359470033, -7781.1587230209825, 2.9708161732618893e6, -1304.5201678329029, 1.3876937057812451e6, -1346.7478265929403, -4157.440105368533, -3955.070477243151, -1477.9621854407378, 344565.9087687789, -1252.1729331596905, 1.556545250619133e6, -4697.162794303185, -4212.4947733041445, 1.3676112235539071e6, -1223.9654055676588, 2.5446999205947854e6)
        SymFourthOrderTensorValue{3, Float64, 36}(3.346602625216702e6, -5205.200819199981, -6782.163246934278, 1.713919118719888e6, -1270.606541302594, 1.5483707489247224e6, -4017.079686872525, 555775.098804941, -532.7904483019544, -3351.951245893399, -3521.9004032485436, -4028.7614314704124, -6307.763206241783, -541.5043853527802, 499224.43930657755, -7079.371305741709, -3311.685250045806, -4837.744354864494, 1.7187993267841218e6, -3051.7770569880777, -7465.893370415091, 3.015041023242304e6, -1224.9641359259012, 1.403921691970972e6, -1277.5711126731758, -3930.1396507496515, -3732.7964633908086, -1364.7651598750617, 362376.7942328958, -1150.0772228687654, 1.543776604012871e6, -4525.076166048025, -4194.7840628963295, 1.3863982050509034e6, -1144.5438094474298, 2.5873447477509417e6)
         SymFourthOrderTensorValue{3, Float64, 36}(3.326384578763472e6, -4759.354498069034, -6167.650941781898, 1.6937766140657421e6, -1227.8772572185187, 1.531264691898474e6, -3779.8547294498626, 542253.4090725112, -530.4746890120374, -3190.4921063854044, -3250.2808523191684, -3737.005565550921, -5886.968030863616, -537.9081834620076, 483908.378000215, -6533.444834607184, -3059.146837490184, -4504.332859775186, 1.7018457652267967e6, -3008.2461183218784, -6846.25757196701, 3.0626411756796264e6, -1148.3079316655576, 1.420902913610159e6, -1213.2733723874962, -3546.198726956854, -3362.277943105761, -1258.8235599588681, 380384.082774545, -1054.9507892981542, 1.5302962101479059e6, -4172.723090937569, -4026.8574184926333, 1.4055213424563352e6, -1068.7681262730769, 2.6324979054000624e6)
        SymFourthOrderTensorValue{3, Float64, 36}(3.307927238171419e6, -4092.231533223082, -5272.029101372774, 1.6754747897149946e6, -1189.120346487391, 1.515764527304576e6, -3353.6934629426487, 529849.6001295896, -529.7138076818842, -2892.1243769929747, -2829.1068220335455, -3272.926076965264, -5175.948426844651, -535.7049725573326, 469971.66205195605, -5686.47210275731, -2665.800440308476, -3974.6060331268504, 1.685111924768359e6, -2835.9538131409245, -5920.47273166682, 3.1130605803294205e6, -1077.1266507319096, 1.4382344731069012e6, -1157.5337905319304, -3013.3675514548063, -2851.9045067277993, -1164.1867437995147, 398098.03864534333, -970.394148711003, 1.516239554926333e6, -3636.133424803255, -3681.7397034327887, 1.4244088933311244e6, -999.1298591053936, 2.6794580644026576e6)
   SymFourthOrderTensorValue{3, Float64, 36}(3.2922091288947263e6, -3204.7004245095964, -4102.670866486398, 1.6599193980600042e6, -1156.6727294613215, 1.502626115291784e6, -2718.523843240932, 519152.5122139548, -530.9921109742608, -2429.7922365201953, -2250.2574535742665, -2624.7479855545607, -4152.366973173972, -535.5516804995716, 458076.45227385336, -4523.833565511555, -2123.451725516238, -3229.909475487784, 1.6690527984245946e6, -2484.6252977178833, -4681.535912451936, 3.165626434817684e6, -1014.4425246331558, 1.4554389178806087e6, -1114.447732151855, -2337.8279680475634, -2208.6134172245834, -1085.3303851384785, 414983.61662915495, -900.3036274607767, 1.5017614507184234e6, -2905.5948194457355, -3114.3450592592208, 1.4424114741413693e6, -938.4420413472095, 2.727423659473587e6)
  SymFourthOrderTensorValue{3, Float64, 36}(3.2802920105320076e6, -2093.170536830325, -2662.1148696711707, 1.6481302881736977e6, -1133.0619208716075, 1.4926884954602055e6, -1845.0931118331237, 510873.57909317187, -534.4334076676331, -1749.288021378917, -1498.9703933388087, -1770.5469920090375, -2783.8506204957484, -537.7871205750372, 448991.8905147459, -3017.1956935756425, -1417.293027458986, -2228.984583969984, 1.6542200387956211e6, -1865.6090036613864, -3107.997915548268, 3.2194849492984475e6, -964.654176519693, 1.4719419952323171e6, -1088.810495365108, -1520.4257614861776, -1434.2558161547654, -1028.2129842448821, 430438.4457877767, -849.7599634649001, 1.4870772717951578e6, -1958.3385011818073, -2245.1298152817108, 1.4587775733867737e6, -890.6519445150162, 2.775443058998742e6)
      SymFourthOrderTensorValue{3, Float64, 36}(3.2733614795888294e6, -740.122829451769, -936.8797363137926, 1.6413684942583162e6, -1120.3984398478979, 1.4869663199683565e6, -672.4862375295417, 505998.78119303775, -538.7295718180377, -672.4862375325815, -538.7295718240928, -644.1564534998853, -1004.4821961458681, -541.3551224120052, 443729.52724463114, -1086.5002028736806, -510.2567610042307, -828.4757632571135, 1.6413684942583137e6, -740.1228294544629, -1120.3984398466541, 3.2733614795888215e6, -936.8797363170631, 1.4869663199683614e6, -1086.5002028743436, -541.3551224135616, -510.25676097809355, -1004.4821961514798, 443729.52724460047, -828.4757632536881, 1.4725385030013407e6, -715.0693925465622, -863.7419156470814, 1.4725385030013374e6, -863.7419156815893, 2.822217356479897e6)
fverdugo commented 3 years ago

Hi @Omega-xyZac Can you share the code that generates this?

fverdugo commented 3 years ago

It should be possible to have arbitrarily complex operations at gauss point level without blowing up the complexity of the type signature of the lazy array.

zjwegert commented 3 years ago

Hi @fverdugo, thank you for the fast reply. I have a very large code base so sharing isn't really an option. However, that example is generated using the below:

    ....
    A = (ε((1/k_0)*data_1.uh) + δⁱʲ(1,1)) ⊗ δⁱʲ(1,1)+
          (ε((1/k_0)*data_2.uh) + δⁱʲ(2,2)) ⊗ δⁱʲ(2,2)+
          (ε((1/k_0)*data_3.uh) + δⁱʲ(3,3)) ⊗ δⁱʲ(3,3)+
          (ε((1/k_0)*data_4.uh) + 1/2*δⁱʲ(1,2)) ⊗ δⁱʲ(1,2)+
          (ε((1/k_0)*data_5.uh) + 1/2*δⁱʲ(1,3)) ⊗ δⁱʲ(1,3)+
          (ε((1/k_0)*data_6.uh) + 1/2*δⁱʲ(2,3)) ⊗ δⁱʲ(2,3)

    ℬ = ε((1/k_0)*data_7.uh) ⊗ eᵢ(1) +
          ε((1/k_0)*data_8.uh) ⊗ eᵢ(2) +
          ε((1/k_0)*data_9.uh) ⊗ eᵢ(3)

    𝒢 = (-∇((1/α_0)*data_1.ϕh)) ⊗ δⁱʲ(1,1)+
         (-∇((1/α_0)*data_2.ϕh)) ⊗ δⁱʲ(2,2)+
         (-∇((1/α_0)*data_3.ϕh)) ⊗ δⁱʲ(3,3)+
         (-∇((1/α_0)*data_4.ϕh)) ⊗ δⁱʲ(1,2)+
         (-∇((1/α_0)*data_5.ϕh)) ⊗ δⁱʲ(1,3)+
         (-∇((1/α_0)*data_6.ϕh)) ⊗ δⁱʲ(2,3)

    H = (-∇((1/α_0)*data_7.ϕh) + eᵢ(1)) ⊗ eᵢ(1) +
        (-∇((1/α_0)*data_8.ϕh) + eᵢ(2)) ⊗ eᵢ(2) +
        (-∇((1/α_0)*data_9.ϕh) + eᵢ(3)) ⊗ eᵢ(3)

    # Base Material
    C_b = material.C;  # (4-tensor)
    e_b = material.e;  # (3-tensor)
    Κ_b = material.Κ; # (2-tensor)
    nely,nelx,nelz = size(struc,1),size(struc,2),size(struc,3);
    density = data_1.density_vector
    Pᵤᵤ,Pᵤᵩ,Pᵩᵩ=penal; Pᵩᵤ = Pᵤᵩ;

    C = density.^Pᵤᵤ.*fill(C_b,nely*nelx*nelz)
    e = density.^Pᵤᵩ.*fill(e_b,nely*nelx*nelz)
    Κ = density.^Pᵩᵩ.*fill(Κ_b,nely*nelx*nelz)
    # Averaging
    dΩ = data_1.measure
    @GTensor CA[i,j,k,l] = C[i,j,m,p]*A[m,p,k,l]; @GTensor e𝒢[i,j,k,l] = e[m,i,j]*𝒢[m,k,l]
    Cᵉ = get_array(∫(CA - e𝒢)dΩ);
    ....

where data_1,data_2,... are of data type

struct SolverFEData
  loading::Int8
  vol::Float64
  uh::SingleFieldFEFunction
  ϕh::SingleFieldFEFunction
  X::Array
  Uϕ::FESpace
  trian::CartesianGrid
  measure::Measure
  density_vector::Any
  material_vals::Any
end

and the @GTensor macro is the script that I've mentioned in a previous issue for doing general contractions by leveraging the TensorOperations package. Though, these particular operations could be replaced by something like .⋅² and .⋅.

Hopefully that is decipherable..

fverdugo commented 3 years ago

I cannot decipher the code, but it seems that you are implementing complex operations in a not so efficient way for the gridap backend.

You need to implement the complex operation in a function f that takes values at a generic integration point, and then use Operation(f)(...) or f\circ(....) just like in the linear elasticity or the hyperelasticity tutorial

zjwegert commented 3 years ago

Thank you for the suggestion! I think I've found a faster way to do this by integrating the quantities A, ℬ, etc. prior to contractions. I will also try your suggestion. I'll close this issue for now :).

zjwegert commented 3 years ago

Hi again @fverdugo, I tried your suggestion and implemented some functions that take values at generic integration points:

Af(εuh...) = (((1/k_0)*εuh[1]) + δⁱʲ(1,1)) ⊗ δⁱʲ(1,1)+
            (((1/k_0)*εuh[2]) + δⁱʲ(2,2)) ⊗ δⁱʲ(2,2)+
            (((1/k_0)*εuh[3]) + δⁱʲ(3,3)) ⊗ δⁱʲ(3,3)+
            (((1/k_0)*εuh[4]) + 1/2*δⁱʲ(1,2)) ⊗ δⁱʲ(1,2)+
            (((1/k_0)*εuh[5]) + 1/2*δⁱʲ(1,3)) ⊗ δⁱʲ(1,3)+
            (((1/k_0)*εuh[6]) + 1/2*δⁱʲ(2,3)) ⊗ δⁱʲ(2,3);
    ℬf(εuh...) = ((1/k_0)*εuh[1]) ⊗ eᵢ(1) +
          ((1/k_0)*εuh[2]) ⊗ eᵢ(2) +
          ((1/k_0)*εuh[3]) ⊗ eᵢ(3)
    𝒢f(∇ϕh...) = (-((1/α_0)*∇ϕh[1])) ⊗ δⁱʲ(1,1)+
       (-((1/α_0)*∇ϕh[2])) ⊗ δⁱʲ(2,2)+
       (-((1/α_0)*∇ϕh[3])) ⊗ δⁱʲ(3,3)+
       (-((1/α_0)*∇ϕh[4])) ⊗ δⁱʲ(1,2)+
       (-((1/α_0)*∇ϕh[5])) ⊗ δⁱʲ(1,3)+
       (-((1/α_0)*∇ϕh[6])) ⊗ δⁱʲ(2,3)
    Hf(∇ϕh...) = (-((1/α_0)*∇ϕh[1]) + eᵢ(1)) ⊗ eᵢ(1) +
      (-((1/α_0)*∇ϕh[2]) + eᵢ(2)) ⊗ eᵢ(2) +
      (-((1/α_0)*∇ϕh[3]) + eᵢ(3)) ⊗ eᵢ(3)

    A = Af ∘ (ε(data_1.uh),ε(data_2.uh),ε(data_3.uh),ε(data_4.uh),ε(data_5.uh),ε(data_6.uh))
    ℬ = ℬf ∘ (ε(data_7.uh),ε(data_8.uh),ε(data_9.uh))
    𝒢 = 𝒢f ∘ (∇(data_1.ϕh),∇(data_2.ϕh),∇(data_3.ϕh),∇(data_4.ϕh),∇(data_5.ϕh),∇(data_6.ϕh))
    H = Hf ∘ (∇(data_7.ϕh),∇(data_8.ϕh),∇(data_9.ϕh))

    # Base Material
    C_b = material.C; e_b = material.e; Κ_b = material.Κ;
    nely,nelx,nelz = size(struc,1),size(struc,2),size(struc,3);
    density = data_1.density_vector
    Pᵤᵤ,Pᵤᵩ,Pᵩᵩ=penal; Pᵩᵤ = Pᵤᵩ;

    C = density.^Pᵤᵤ.*fill(C_b,nely*nelx*nelz)
    e = density.^Pᵤᵩ.*fill(e_b,nely*nelx*nelz)
    Κ = density.^Pᵩᵩ.*fill(Κ_b,nely*nelx*nelz)
    # Averaging
    dΩ = data_1.measure

    @GTensor CA[i,j,k,l] = C[i,j,m,p]*A[m,p,k,l]; @GTensor e𝒢[i,j,k,l] = e[m,i,j]*𝒢[m,k,l]
    Cᵉ = ∫(CA - e𝒢)dΩ; sum_C = sum(Cᵉ)
    @GTensor eA[i,j,k] = e[i,l,m]*A[l,m,j,k]; @GTensor Κ𝒢[i,j,k] = Κ[i,l]*𝒢[l,j,k]
    eᵉ = ∫(eA + Κ𝒢)dΩ; sum_e = sum(eᵉ)
    @GTensor eℬ[i,j] = e[i,l,m]*ℬ[l,m,j]; @GTensor ΚH[i,j] = Κ[i,l]*H[l,j]
    Κᵉ = ∫(eℬ + ΚH)dΩ; sum_Κ = sum(Κᵉ)

Is this along the lines of what you meant? Do you have any other ideas for how to speed this up? Appreciate any suggestions you might have.