Skip to content

Commit 74aa573

Browse files
committed
Refactor update_systems and update_systems_and_nhs functions to disable unnecessary updates
1 parent 435f408 commit 74aa573

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/callbacks/split_integration.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,7 @@ function update_systems_split!(semi, v_ode, u_ode, t)
218218
# a lot of the speedup that we can gain with split integration.
219219
# We assume that the TLSPH particles move so little during the substeps
220220
# that the extrapolated pressure/density values can be treated as constant.
221-
update_systems!(v_ode, u_ode, semi, t;
222-
update_nhs=false,
223-
update_boundary_interpolation=false,
224-
update_inter_system=false)
221+
update_systems!(v_ode, u_ode, semi, t)
225222
end
226223

227224
function system_interaction_split!(dv_ode_split, v_ode, u_ode, semi,

src/general/semidiscretization.jl

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,9 @@ end
492492

493493
# Update the systems for a simulation before calling `interact!` to compute forces.
494494
function update_systems!(v_ode, u_ode, semi, t;
495-
update_nhs=true,
496-
update_boundary_interpolation=true,
497-
update_inter_system=true)
495+
update_nhs=false,
496+
update_boundary_interpolation=false,
497+
update_inter_system=false)
498498
# First update step before updating the NHS
499499
# (for example for writing the current coordinates in the TLSPH system)
500500
foreach_system_wrapped(semi, v_ode, u_ode) do system, v, u
@@ -540,7 +540,10 @@ end
540540
# Update the systems and neighborhood searches (NHS) for a simulation
541541
# before calling `interact!` to compute forces.
542542
function update_systems_and_nhs(v_ode, u_ode, semi, t)
543-
update_systems!(v_ode, u_ode, semi, t)
543+
update_systems!(v_ode, u_ode, semi, t;
544+
update_nhs=true,
545+
update_boundary_interpolation=true,
546+
update_inter_system=true)
544547
end
545548

546549
# The `SplitIntegrationCallback` overwrites `semi_wrap` to use a different

0 commit comments

Comments
 (0)