File tree Expand file tree Collapse file tree 2 files changed +8
-10
lines changed
src/schemes/structure/total_lagrangian_sph Expand file tree Collapse file tree 2 files changed +8
-10
lines changed Original file line number Diff line number Diff line change 2020 # Everything here is done in the initial coordinates
2121 system_coords = initial_coordinates (system)
2222 neighborhood_search = get_neighborhood_search (system, system, semi)
23+ backend = semi. parallelization_backend
2324
2425 # For `distance == 0`, the analytical gradient is zero, but the unsafe gradient
2526 # and the density diffusion divide by zero.
4748 dv_particle = Ref (zero (current_coords_a))
4849
4950 # Loop over all neighbors within the kernel cutoff
50- @inbounds PointNeighbors. foreach_neighbor (system_coords, system_coords,
51- neighborhood_search,
52- particle) do particle, neighbor,
53- initial_pos_diff,
54- initial_distance
51+ @inbounds foreach_neighbor (system_coords, system_coords, neighborhood_search,
52+ backend,particle) do particle, neighbor,
53+ initial_pos_diff, initial_distance
5554 # Skip neighbors with the same position because the kernel gradient is zero.
5655 # Note that `return` only exits the closure, i.e., skips the current neighbor.
5756 skip_zero_distance (system) && initial_distance < almostzero && return
Original file line number Diff line number Diff line change 490490 # Loop over all pairs of particles and neighbors within the kernel cutoff
491491 initial_coords = initial_coordinates (system)
492492 neighborhood_search = get_neighborhood_search (system, system, semi)
493+ backend = semi. parallelization_backend
493494
494495 @threaded semi for particle in each_integrated_particle (system)
495496 # We are looping over the particles of `system`, so it is guaranteed
504505 result = Ref (zero (L_a))
505506
506507 # Loop over all neighbors within the kernel cutoff
507- @inbounds PointNeighbors. foreach_neighbor (initial_coords, initial_coords,
508- neighborhood_search,
509- particle) do particle, neighbor,
510- initial_pos_diff,
511- initial_distance
508+ @inbounds foreach_neighbor (initial_coords, initial_coords, neighborhood_search,
509+ backend, particle) do particle, neighbor,
510+ initial_pos_diff, initial_distance
512511 # Skip neighbors with the same position because the kernel gradient is zero.
513512 # Note that `return` only exits the closure, i.e., skips the current neighbor.
514513 skip_zero_distance (system) && initial_distance < almostzero && return
You can’t perform that action at this time.
0 commit comments