@@ -469,9 +469,11 @@ function kick!(dv_ode, v_ode, u_ode, semi, t)
469469 return dv_ode
470470end
471471
472- # Update the systems and neighborhood searches (NHS) for a simulation
473- # before calling `interact!` to compute forces.
474- function update_systems_and_nhs (v_ode, u_ode, semi, t)
472+ # Update the systems for a simulation before calling `interact!` to compute forces.
473+ function update_systems! (v_ode, u_ode, semi, t;
474+ update_nhs= true ,
475+ update_implicit_sph= true ,
476+ update_boundary_interpolation= true )
475477 # First update step before updating the NHS
476478 # (for example for writing the current coordinates in the TLSPH system)
477479 foreach_system (semi) do system
@@ -481,8 +483,9 @@ function update_systems_and_nhs(v_ode, u_ode, semi, t)
481483 update_positions! (system, v, u, v_ode, u_ode, semi, t)
482484 end
483485
484- # Update NHS
485- @trixi_timeit timer () " update nhs" update_nhs! (semi, u_ode)
486+ if update_nhs
487+ @trixi_timeit timer () " update nhs" update_nhs! (semi, u_ode)
488+ end
486489
487490 # Second update step.
488491 # This is used to calculate density and pressure of the fluid systems
@@ -495,7 +498,9 @@ function update_systems_and_nhs(v_ode, u_ode, semi, t)
495498 update_quantities! (system, v, u, v_ode, u_ode, semi, t)
496499 end
497500
498- update_implicit_sph! (semi, v_ode, u_ode, t)
501+ if update_implicit_sph
502+ update_implicit_sph! (semi, v_ode, u_ode, t)
503+ end
499504
500505 # Perform correction and pressure calculation
501506 foreach_system (semi) do system
@@ -507,11 +512,13 @@ function update_systems_and_nhs(v_ode, u_ode, semi, t)
507512
508513 # This update depends on the computed quantities of the fluid system and therefore
509514 # needs to be after `update_quantities!`.
510- foreach_system (semi) do system
511- v = wrap_v (v_ode, system, semi)
512- u = wrap_u (u_ode, system, semi)
515+ if update_boundary_interpolation
516+ foreach_system (semi) do system
517+ v = wrap_v (v_ode, system, semi)
518+ u = wrap_u (u_ode, system, semi)
513519
514- update_boundary_interpolation! (system, v, u, v_ode, u_ode, semi, t)
520+ update_boundary_interpolation! (system, v, u, v_ode, u_ode, semi, t)
521+ end
515522 end
516523
517524 # Final update step for all remaining systems
@@ -523,6 +530,15 @@ function update_systems_and_nhs(v_ode, u_ode, semi, t)
523530 end
524531end
525532
533+ # Update the systems and neighborhood searches (NHS) for a simulation
534+ # before calling `interact!` to compute forces.
535+ function update_systems_and_nhs (v_ode, u_ode, semi, t)
536+ return update_systems! (v_ode, u_ode, semi, t;
537+ update_nhs= true ,
538+ update_implicit_sph= true ,
539+ update_boundary_interpolation= true )
540+ end
541+
526542# The `SplitIntegrationCallback` overwrites `semi_wrap` to use a different
527543# semidiscretization for wrapping arrays.
528544# TODO `semi` is not used yet, but will be used when the source terms API is modified
0 commit comments