Caltech-OCTO / Subzero.jl

Native Julia Discrete Element Sea Ice Model
MIT License
7 stars 1 forks source link

Collision Tuple Bug #68

Closed skygering closed 1 year ago

skygering commented 1 year ago
ERROR: LoadError: TaskFailedException

    nested task error: BoundsError: attempt to access Tuple{Matrix{Float64}, Matrix{Float64}, Vector{Float64}} at index [4]
    Stacktrace:
     [1] indexed_iterate
       @ ./tuple.jl:88 [inlined]
     [2] floe_floe_interaction!(ifloe::StructArrays.LazyRow{Floe{Float64}, 1, NamedTuple{(:centroid, :coords, :height, :area, :mass, :rmax, :moment, :angles, :mc_x, :mc_y, :α, :u, :v, :ξ, :status, :id, :ghost_id, :parent_ids, :ghosts, :fxOA, :fyOA, :trqOA, :hflx_factor, :overarea, :collision_force, :collision_trq, :interactions, :stress, :stress_history, :strain, :p_dxdt, :p_dydt, :p_dudt, :p_dvdt, :p_dξdt, :p_dαdt), Tuple{Vector{Vector{Float64}}, Vector{Vector{Vector{Vector{Float64}}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Subzero.Status}, Vector{Int64}, Vector{Int64}, Vector{Vector{Int64}}, Vector{Vector{Int64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Matrix{Float64}}, Vector{Subzero.StressCircularBuffer{Float64}}, Vector{Matrix{Float64}}, Vararg{Vector{Float64}, 6}}}, Int64}, i::Int64, jfloe::StructArrays.LazyRow{Floe{Float64}, 1, NamedTuple{(:centroid, :coords, :height, :area, :mass, :rmax, :moment, :angles, :mc_x, :mc_y, :α, :u, :v, :ξ, :status, :id, :ghost_id, :parent_ids, :ghosts, :fxOA, :fyOA, :trqOA, :hflx_factor, :overarea, :collision_force, :collision_trq, :interactions, :stress, :stress_history, :strain, :p_dxdt, :p_dydt, :p_dudt, :p_dvdt, :p_dξdt, :p_dαdt), Tuple{Vector{Vector{Float64}}, Vector{Vector{Vector{Vector{Float64}}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Subzero.Status}, Vector{Int64}, Vector{Int64}, Vector{Vector{Int64}}, Vector{Vector{Int64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Matrix{Float64}}, Vector{Subzero.StressCircularBuffer{Float64}}, Vector{Matrix{Float64}}, Vararg{Vector{Float64}, 6}}}, Int64}, j::Int64, nfloes::Int64, consts::Constants{Float64}, Δt::Int64, max_overlap::Float64)
       @ Subzero ~/.julia/packages/Subzero/PocJf/src/physical_processes/collisions.jl:299
     [3] macro expansion
       @ ~/.julia/packages/Subzero/PocJf/src/physical_processes/collisions.jl:844 [inlined]
     [4] (::Subzero.var"#337#threadsfor_fun#58"{Subzero.var"#337#threadsfor_fun#56#59"{Float64, StructArrays.StructVector{Floe{Float64}, NamedTuple{(:centroid, :coords, :height, :area, :mass, :rmax, :moment, :angles, :mc_x, :mc_y, :α, :u, :v, :ξ, :status, :id, :ghost_id, :parent_ids, :ghosts, :fxOA, :fyOA, :trqOA, :hflx_factor, :overarea, :collision_force, :collision_trq, :interactions, :stress, :stress_history, :strain, :p_dxdt, :p_dydt, :p_dudt, :p_dvdt, :p_dξdt, :p_dαdt), Tuple{Vector{Vector{Float64}}, Vector{Vector{Vector{Vector{Float64}}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Subzero.Status}, Vector{Int64}, Vector{Int64}, Vector{Vector{Int64}}, Vector{Vector{Int64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Matrix{Float64}}, Vector{Subzero.StressCircularBuffer{Float64}}, Vector{Matrix{Float64}}, Vararg{Vector{Float64}, 6}}}, Int64}, Int64, Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, Constants{Float64}, Int64, CollisionSettings{Float64}, Base.Threads.SpinLock, Dict{Tuple{Int64, Int64}, Tuple{Int64, Int64}}, Base.OneTo{Int64}}})(tid::Int64; onethread::Bool)
       @ Subzero ./threadingconstructs.jl:163
     [5] #337#threadsfor_fun
       @ ./threadingconstructs.jl:130 [inlined]
     [6] (::Base.Threads.var"#1#2"{Subzero.var"#337#threadsfor_fun#58"{Subzero.var"#337#threadsfor_fun#56#59"{Float64, StructArrays.StructVector{Floe{Float64}, NamedTuple{(:centroid, :coords, :height, :area, :mass, :rmax, :moment, :angles, :mc_x, :mc_y, :α, :u, :v, :ξ, :status, :id, :ghost_id, :parent_ids, :ghosts, :fxOA, :fyOA, :trqOA, :hflx_factor, :overarea, :collision_force, :collision_trq, :interactions, :stress, :stress_history, :strain, :p_dxdt, :p_dydt, :p_dudt, :p_dvdt, :p_dξdt, :p_dαdt), Tuple{Vector{Vector{Float64}}, Vector{Vector{Vector{Vector{Float64}}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Subzero.Status}, Vector{Int64}, Vector{Int64}, Vector{Vector{Int64}}, Vector{Vector{Int64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Matrix{Float64}}, Vector{Subzero.StressCircularBuffer{Float64}}, Vector{Matrix{Float64}}, Vararg{Vector{Float64}, 6}}}, Int64}, Int64, Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, Constants{Float64}, Int64, CollisionSettings{Float64}, Base.Threads.SpinLock, Dict{Tuple{Int64, Int64}, Tuple{Int64, Int64}}, Base.OneTo{Int64}}}, Int64})()
       @ Base.Threads ./threadingconstructs.jl:108
Stacktrace:
 [1] threading_run(fun::Subzero.var"#337#threadsfor_fun#58"{Subzero.var"#337#threadsfor_fun#56#59"{Float64, StructArrays.StructVector{Floe{Float64}, NamedTuple{(:centroid, :coords, :height, :area, :mass, :rmax, :moment, :angles, :mc_x, :mc_y, :α, :u, :v, :ξ, :status, :id, :ghost_id, :parent_ids, :ghosts, :fxOA, :fyOA, :trqOA, :hflx_factor, :overarea, :collision_force, :collision_trq, :interactions, :stress, :stress_history, :strain, :p_dxdt, :p_dydt, :p_dudt, :p_dvdt, :p_dξdt, :p_dαdt), Tuple{Vector{Vector{Float64}}, Vector{Vector{Vector{Vector{Float64}}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Subzero.Status}, Vector{Int64}, Vector{Int64}, Vector{Vector{Int64}}, Vector{Vector{Int64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Matrix{Float64}}, Vector{Subzero.StressCircularBuffer{Float64}}, Vector{Matrix{Float64}}, Vararg{Vector{Float64}, 6}}}, Int64}, Int64, Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, Constants{Float64}, Int64, CollisionSettings{Float64}, Base.Threads.SpinLock, Dict{Tuple{Int64, Int64}, Tuple{Int64, Int64}}, Base.OneTo{Int64}}}, static::Bool)
   @ Base.Threads ./threadingconstructs.jl:120
 [2] macro expansion
   @ ./threadingconstructs.jl:168 [inlined]
 [3] timestep_collisions!(floes::StructArrays.StructVector{Floe{Float64}, NamedTuple{(:centroid, :coords, :height, :area, :mass, :rmax, :moment, :angles, :mc_x, :mc_y, :α, :u, :v, :ξ, :status, :id, :ghost_id, :parent_ids, :ghosts, :fxOA, :fyOA, :trqOA, :hflx_factor, :overarea, :collision_force, :collision_trq, :interactions, :stress, :stress_history, :strain, :p_dxdt, :p_dydt, :p_dudt, :p_dvdt, :p_dξdt, :p_dαdt), Tuple{Vector{Vector{Float64}}, Vector{Vector{Vector{Vector{Float64}}}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Vector{Float64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Subzero.Status}, Vector{Int64}, Vector{Int64}, Vector{Vector{Int64}}, Vector{Vector{Int64}}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Float64}, Vector{Matrix{Float64}}, Vector{Matrix{Float64}}, Vector{Subzero.StressCircularBuffer{Float64}}, Vector{Matrix{Float64}}, Vararg{Vector{Float64}, 6}}}, Int64}, n_init_floes::Int64, domain::Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, consts::Constants{Float64}, Δt::Int64, collision_settings::CollisionSettings{Float64}, spinlock::Base.Threads.SpinLock)
   @ Subzero ~/.julia/packages/Subzero/PocJf/src/physical_processes/collisions.jl:815
 [4] timestep_sim!(sim::Simulation{Float64, RegRectilinearGrid{Float64}, Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, HiblerYieldCurve{Float64}, Random.Xoshiro, StructArrays.StructVector{InitialStateOutputWriter, NamedTuple{(:filepath, :overwrite), Tuple{Vector{String}, Vector{Bool}}}, Int64}, StructArrays.StructVector{FloeOutputWriter, NamedTuple{(:outputs, :Δtout, :filepath, :overwrite), Tuple{Vector{Vector{Symbol}}, Vector{Int64}, Vector{String}, Vector{Bool}}}, Int64}, StructArrays.StructVector{GridOutputWriter, NamedTuple{(:outputs, :Δtout, :filepath, :overwrite, :xg, :yg, :data, :average), Tuple{Vector{Vector{Symbol}}, Vector{Int64}, Vector{String}, Vector{Bool}, Vector{Vector{FT} where FT<:AbstractFloat}, Vector{Vector{FT} where FT<:AbstractFloat}, Vector{Array{FT, 3} where FT<:AbstractFloat}, Vector{Bool}}}, Int64}, StructArrays.StructVector{CheckpointOutputWriter, NamedTuple{(:Δtout, :filepath, :overwrite), Tuple{Vector{Int64}, Vector{String}, Vector{Bool}}}, Int64}}, tstep::Int64)
   @ Subzero ~/.julia/packages/Subzero/PocJf/src/simulation.jl:104
 [5] run!(sim::Simulation{Float64, RegRectilinearGrid{Float64}, Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, HiblerYieldCurve{Float64}, Random.Xoshiro, StructArrays.StructVector{InitialStateOutputWriter, NamedTuple{(:filepath, :overwrite), Tuple{Vector{String}, Vector{Bool}}}, Int64}, StructArrays.StructVector{FloeOutputWriter, NamedTuple{(:outputs, :Δtout, :filepath, :overwrite), Tuple{Vector{Vector{Symbol}}, Vector{Int64}, Vector{String}, Vector{Bool}}}, Int64}, StructArrays.StructVector{GridOutputWriter, NamedTuple{(:outputs, :Δtout, :filepath, :overwrite, :xg, :yg, :data, :average), Tuple{Vector{Vector{Symbol}}, Vector{Int64}, Vector{String}, Vector{Bool}, Vector{Vector{FT} where FT<:AbstractFloat}, Vector{Vector{FT} where FT<:AbstractFloat}, Vector{Array{FT, 3} where FT<:AbstractFloat}, Vector{Bool}}}, Int64}, StructArrays.StructVector{CheckpointOutputWriter, NamedTuple{(:Δtout, :filepath, :overwrite), Tuple{Vector{Int64}, Vector{String}, Vector{Bool}}}, Int64}}; logger::Nothing, messages_per_tstep::Int64)
   @ Subzero ~/.julia/packages/Subzero/PocJf/src/simulation.jl:245
 [6] run!(sim::Simulation{Float64, RegRectilinearGrid{Float64}, Domain{Float64, CompressionBoundary{North, Float64}, CompressionBoundary{South, Float64}, CollisionBoundary{East, Float64}, CollisionBoundary{West, Float64}}, HiblerYieldCurve{Float64}, Random.Xoshiro, StructArrays.StructVector{InitialStateOutputWriter, NamedTuple{(:filepath, :overwrite), Tuple{Vector{String}, Vector{Bool}}}, Int64}, StructArrays.StructVector{FloeOutputWriter, NamedTuple{(:outputs, :Δtout, :filepath, :overwrite), Tuple{Vector{Vector{Symbol}}, Vector{Int64}, Vector{String}, Vector{Bool}}}, Int64}, StructArrays.StructVector{GridOutputWriter, NamedTuple{(:outputs, :Δtout, :filepath, :overwrite, :xg, :yg, :data, :average), Tuple{Vector{Vector{Symbol}}, Vector{Int64}, Vector{String}, Vector{Bool}, Vector{Vector{FT} where FT<:AbstractFloat}, Vector{Vector{FT} where FT<:AbstractFloat}, Vector{Array{FT, 3} where FT<:AbstractFloat}, Vector{Bool}}}, Int64}, StructArrays.StructVector{CheckpointOutputWriter, NamedTuple{(:Δtout, :filepath, :overwrite), Tuple{Vector{Int64}, Vector{String}, Vector{Bool}}}, Int64}})
   @ Subzero ~/.julia/packages/Subzero/PocJf/src/simulation.jl:240
 [7] top-level scope
   @ ~/Desktop/Caltech SURF/Code/stress_strain_v2.jl:106
 [8] include(fname::String)
   @ Base.MainInclude ./client.jl:478
 [9] top-level scope
   @ REPL[1]:1
in expression starting at /Users/rohaizharis/Desktop/Caltech SURF/Code/stress_strain_v2.jl:106