Skip to content

Cannot use static arrays as indices for views #587

@aaortizb

Description

@aaortizb

I have a code that uses StaticArrays. It works fine in Julia 1.0.3, but the same code does not work in Julia 1.1.0. The issue is triggered when doing the following operation:

Kg[rows,rows] .+= Ke

where Ke is assembled on Kg. Here Kg[rows,rows] has the same dimension of Ke, but it is a standard Julia array. On the other hand, Ke is an Static Array. Any idea on how to resolve this issue?

The error thrown is the following:

ERROR: LoadError: ArgumentError: unable to check bounds for indices of type StaticArrays.StaticIndexing{StaticArrays.MArray{Tuple{2},Int64,1,2}} Stacktrace: [1] checkindex(::Type{Bool}, ::Base.OneTo{Int64}, ::StaticArrays.StaticIndexing{StaticArrays.MArray{Tuple{2},Int64,1,2}}) at .\abstractarray.jl:504 [2] checkbounds_indices at .\abstractarray.jl:475 [inlined] [3] checkbounds at .\abstractarray.jl:428 [inlined] [4] checkbounds at .\abstractarray.jl:449 [inlined] [5] view(::Array{Float64,2}, ::StaticArrays.MArray{Tuple{2},Int64,1,2}, ::StaticArrays.MArray{Tuple{2},Int64,1,2}) at .\subarray.jl:155 [6] maybeview(::Array{Float64,2}, ::StaticArrays.MArray{Tuple{2},Int64,1,2}, ::Vararg{StaticArrays.MArray{Tuple{2},Int64,1,2},N} where N) at .\views.jl:124 [7] dotview at .\broadcast.jl:1067 [inlined] [8] _dense_loop_over_elements!(::Array{Float64,2}, ::Array{Float64,1}, ::Array{Any,1}, ::Int64, ::Function, ::Function) at C:\Dropbox\Universidad\codes\Julia\GaLerKia\GaLerKia-0.1\src\FEMlia\FEMLiaLinElast\FEMLiaLinElastSolvers.jl:137 [9] f_linear_elastostatics_dense_solver!(::Dict{String,Any}) at C:\Dropbox\Universidad\codes\Julia\GaLerKia\GaLerKia-0.1\src\FEMlia\FEMLiaLinElast\FEMLiaLinElastSolvers.jl:68 [10] galerkia_solve!(::String, ::Dict{String,Any}) at C:\Dropbox\Universidad\codes\Julia\GaLerKia\GaLerKia-0.1\src\GalerkiaSolve.jl:11 [11] top-level scope at none:0 in expression starting at C:\Dropbox\Universidad\codes\Julia\GaLerKia\GaLerKia-0.1\test\femlia_test001_linelast_line1d_multistory_building.jl:93

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions