File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed
src/schemes/boundary/open_boundary Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change 557557@inline deactivate_lost_particles! (system, :: Nothing , u, semi) = system
558558
559559@inline function deactivate_lost_particles! (system, :: AbstractShiftingTechnique , u, semi)
560+ (; particle_spacing) = system. initial_condition
560561 (; neighbor_counter) = system. cache
561562
562563 set_zero! (neighbor_counter)
@@ -572,10 +573,13 @@ end
572573 neighbor_counter[particle] += 1
573574 end
574575
576+ # Set 20% of the ideal neighbor count as threshold
577+ min_neighbors = ideal_neighbor_count (Val (ndims (system)), particle_spacing,
578+ compact_support (system, system)) / 5
579+
575580 @threaded semi for particle in each_integrated_particle (system)
576- # Deactivate particles that have three or fewer neighbors.
577- # The threshold of 3 also accounts for possible clustered pairs.
578- if neighbor_counter[particle] <= 3
581+ # Deactivate particles that have too few neighbors
582+ if neighbor_counter[particle] < min_neighbors
579583 @warn " deactivate particle $particle "
580584 deactivate_particle! (system, particle, u)
581585 end
You can’t perform that action at this time.
0 commit comments