Skip to content

Add/remove Lagrangian particles #3884

Answered by ali-ramadhan
alesok asked this question in Helpdesk
Discussion options

You must be logged in to vote

Hi @alesok! Lagrangian particle advection should work even as you add and remove particles by modifying the particle.properties struct array as you seem to be doing.

I suspect you're seeing this error because there are zero particles left, and KernelAbstractions.jl is trying to partition the amount of work to be done but ends up dividing by zero somewhere using the div function. You can reproduce the same error easily:

julia> div(5, 0)
ERROR: DivideError: integer division error
Stacktrace:
 [1] div(x::Int64, y::Int64)
   @ Base ./int.jl:295
 [2] top-level scope
   @ REPL[3]:1

I'm not sure whether to classify this as a bug. Oceananigans could do nothing if there are zero particles. If thi…

Replies: 3 comments 21 replies

Comment options

You must be logged in to vote
8 replies
@glwagner
Comment options

@alesok
Comment options

@simone-silvestri
Comment options

@glwagner
Comment options

@glwagner
Comment options

Answer selected by alesok
Comment options

You must be logged in to vote
2 replies
@glwagner
Comment options

@glwagner
Comment options

Comment options

You must be logged in to vote
11 replies
@glwagner
Comment options

@glwagner
Comment options

@alesok
Comment options

@glwagner
Comment options

@glwagner
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants