Skip to content

Commit 8ecbf34

Browse files
author
LasNikas
committed
add comments
1 parent 5835cde commit 8ecbf34

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

src/general/neighborhood_search.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ function deactivate_out_of_bounds_particles!(system, buffer, nhs, cell_list, v,
2222
return system
2323
end
2424

25+
# `GridNeighborhoodSearch` with a `FullGridCellList` requires a bounding box.
26+
# This function deactivates particles that move outside this bounding box to prevent
27+
# simulation crashes.
28+
# Note that simply deactivating particles is only possible in combination with a 'SystemBuffer'.
2529
function deactivate_out_of_bounds_particles!(system, ::SystemBuffer, nhs,
2630
cell_list::FullGridCellList, v, u, semi)
2731
@trixi_timeit timer() "deactivate out of bounds particle" begin

src/schemes/boundary/open_boundary/system.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,11 @@ end
311311

312312
function update_positions!(system::OpenBoundarySystem, v, u, v_ode, u_ode, semi, t)
313313
nhs = get_neighborhood_search(system, semi)
314+
315+
# `GridNeighborhoodSearch` with a `FullGridCellList` requires a bounding box.
316+
# This function deactivates particles that move outside this bounding box to prevent
317+
# simulation crashes.
318+
# Note that simply deactivating particles is only possible in combination with a 'SystemBuffer'.
314319
deactivate_out_of_bounds_particles!(system, buffer(system), nhs, v, u, semi)
315320
end
316321

src/schemes/fluid/fluid.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,11 @@ end
117117

118118
function update_positions!(system::AbstractFluidSystem, v, u, v_ode, u_ode, semi, t)
119119
nhs = get_neighborhood_search(system, semi)
120+
121+
# `GridNeighborhoodSearch` with a `FullGridCellList` requires a bounding box.
122+
# This function deactivates particles that move outside this bounding box to prevent
123+
# simulation crashes.
124+
# Note that simply deactivating particles is only possible in combination with a 'SystemBuffer'.
120125
deactivate_out_of_bounds_particles!(system, buffer(system), nhs, v, u, semi)
121126
end
122127

0 commit comments

Comments
 (0)