Caltech-OCTO / Subzero.jl

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

Voronoi Tesselation Error #100

Open skygering opened 1 month ago

skygering commented 1 month ago

When I was running the Nares Strait simulation at timestep 20,000, I encountered this error. This is in the VoronoiCells package. I have been thinking of switching over to DelaunayTriangulation.jl for a while, but I think this has convinced me.

nested task error: KeyError: key -1 not found
    Stacktrace:
      [1] getindex
        @ ./dict.jl:498 [inlined]
      [2] raw_tesselation(pc::VoronoiCells.PointCollection{Point{2, Float64}}; edges::Nothing, rng::Xoshiro)
        @ VoronoiCells ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:54
      [3] raw_tesselation
        @ ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:33 [inlined]
      [4] voronoicells(pc::VoronoiCells.PointCollection{Point{2, Float64}}; edges::Nothing, rng::Xoshiro)
        @ VoronoiCells ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:87
      [5] voronoicells
        @ ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:86 [inlined]
      [6] #voronoicells#17
        @ ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:125 [inlined]
      [7] voronoicells
        @ ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:123 [inlined]
      [8] #voronoicells#18
        @ ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:136 [inlined]
      [9] voronoicells
        @ ~/.julia/packages/VoronoiCells/7DCvl/src/Cells.jl:129 [inlined]
     [10] generate_voronoi_coords(desired_points::Int64, scale_fac::Vector{…}, trans_vec::Vector{…}, domain_coords::Vector{…}, rng::Xoshiro, min_to_warn::Int64; max_tries::Int64)
        @ Subzero ~/.julia/packages/Subzero/XQTkt/src/simulation_components/floe.jl:488
     [11] generate_voronoi_coords
        @ ~/.julia/packages/Subzero/XQTkt/src/simulation_components/floe.jl:445 [inlined]
     [12] split_floe(floe::StructArrays.LazyRow{…}, rng::Xoshiro, fracture_settings::FractureSettings{…}, floe_settings::FloeSettings{…}, Δt::Int64)
        @ Subzero ~/.julia/packages/Subzero/XQTkt/src/physical_processes/fractures.jl:390
     [13] macro expansion
        @ ~/.julia/packages/Subzero/XQTkt/src/physical_processes/fractures.jl:510 [inlined]
     [14] (::Subzero.var"#273#threadsfor_fun#57"{Subzero.var"#273#threadsfor_fun#54#58"{…}})(tid::Int64; onethread::Bool)
        @ Subzero ./threadingconstructs.jl:215
     [15] #273#threadsfor_fun
        @ ./threadingconstructs.jl:182 [inlined]
     [16] (::Base.Threads.var"#1#2"{Subzero.var"#273#threadsfor_fun#57"{Subzero.var"#273#threadsfor_fun#54#58"{…}}, Int64})()
        @ Base.Threads ./threadingconstructs.jl:154
Stacktrace:
  [1] threading_run(fun::Subzero.var"#273#threadsfor_fun#57"{Subzero.var"#273#threadsfor_fun#54#58"{…}}, static::Bool)
    @ Base.Threads ./threadingconstructs.jl:172
  [2] macro expansion
    @ ./threadingconstructs.jl:220 [inlined]
  [3] fracture_floes!(floes::StructArrays.StructVector{…}, max_floe_id::Int64, rng::Xoshiro, fracture_settings::FractureSettings{…}, floe_settings::FloeSettings{…}, Δt::Int64)
    @ Subzero ~/.julia/packages/Subzero/XQTkt/src/physical_processes/fractures.jl:479
  [4] timestep_sim!(sim::Simulation{…}, tstep::Int64, start_tstep::Int64)
    @ Subzero ~/.julia/packages/Subzero/XQTkt/src/simulation_components/simulation.jl:173
  [5] timestep_sim!
    @ ~/.julia/packages/Subzero/XQTkt/src/simulation_components/simulation.jl:95 [inlined]
  [6] run_nares!(sim::Simulation{…}; logger::Nothing, messages_per_tstep::Int64)
    @ Main ~/Desktop/OCTO/SubzeroSimSetups.jl/nares_strait/nares_run.jl:167
  [7] run_nares!
    @ ~/Desktop/OCTO/SubzeroSimSetups.jl/nares_strait/nares_run.jl:154 [inlined]
  [8] macro expansion
    @ ./timing.jl:279 [inlined]
  [9] run_nares_time!(simulation::Simulation{…})
    @ Main ~/Desktop/OCTO/SubzeroSimSetups.jl/nares_strait/nares_run.jl:173
 [10] top-level scope
    @ ~/Desktop/OCTO/SubzeroSimSetups.jl/nares_strait/nares_run.jl:176
 [11] include(fname::String)
    @ Base.MainInclude ./client.jl:489
 [12] top-level scope
    @ REPL[1]:1
in expression starting at /Users/skylargering/Desktop/OCTO/SubzeroSimSetups.jl/nares_strait/nares_run.jl:176
Some type information was truncated. Use `show(err)` to see complete types.