Skip to content

Commit c24c033

Browse files
committed
Reformat
1 parent 41a397f commit c24c033

File tree

1 file changed

+18
-14
lines changed
  • src/schemes/fluid/weakly_compressible_sph

1 file changed

+18
-14
lines changed

src/schemes/fluid/weakly_compressible_sph/rhs.jl

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ function interact!(dv, v_particle_system, u_particle_system,
3232

3333
# In 3D, this function can combine velocity and density load into one wide load,
3434
# which gives a significant speedup on GPUs.
35-
v_a, rho_a = @inbounds velocity_and_density(v_particle_system, particle_system,
36-
particle)
35+
(v_a,
36+
rho_a) = @inbounds velocity_and_density(v_particle_system, particle_system,
37+
particle)
3738

3839
# Accumulate the RHS contributions over all neighbors before writing to `dv`,
3940
# to reduce the number of memory writes.
@@ -52,8 +53,9 @@ function interact!(dv, v_particle_system, u_particle_system,
5253

5354
# `foreach_neighbor` makes sure that `neighbor` is in bounds of `neighbor_system`
5455
m_b = @inbounds hydrodynamic_mass(neighbor_system, neighbor)
55-
v_b, rho_b = @inbounds velocity_and_density(v_neighbor_system, neighbor_system,
56-
neighbor)
56+
(v_b,
57+
rho_b) = @inbounds velocity_and_density(v_neighbor_system, neighbor_system,
58+
neighbor)
5759
rho_mean = (rho_a + rho_b) / 2
5860
vdiff = v_a - v_b
5961

@@ -88,17 +90,19 @@ function interact!(dv, v_particle_system, u_particle_system,
8890

8991
dv_surface_tension = surface_tension_force(surface_tension_a, surface_tension_b,
9092
particle_system, neighbor_system,
91-
particle, neighbor, pos_diff, distance,
92-
rho_a, rho_b, grad_kernel)
93+
particle, neighbor, pos_diff,
94+
distance, rho_a, rho_b, grad_kernel)
9395

94-
dv_adhesion = adhesion_force(surface_tension_a, particle_system, neighbor_system,
96+
dv_adhesion = adhesion_force(surface_tension_a, particle_system,
97+
neighbor_system,
9598
particle, neighbor, pos_diff, distance)
9699

97100
# Determine correction factors.
98101
# This can usually be ignored, as these are all 1 when no correction is used.
99102
(viscosity_correction, pressure_correction,
100-
surface_tension_correction) = free_surface_correction(correction, particle_system,
101-
rho_mean)
103+
surface_tension_correction) = free_surface_correction(correction,
104+
particle_system,
105+
rho_mean)
102106

103107
# Accumulate contributions over all neighbors
104108
dv_particle[] += dv_pressure * pressure_correction +
@@ -108,11 +112,11 @@ function interact!(dv, v_particle_system, u_particle_system,
108112

109113
# TODO If variable smoothing_length is used, this should use the neighbor smoothing length
110114
# Propagate `@inbounds` to the continuity equation, which accesses particle data
111-
@inbounds continuity_equation!(drho_particle, density_calculator, particle_system,
112-
neighbor_system, v_particle_system,
113-
v_neighbor_system, particle, neighbor,
114-
pos_diff, distance, m_b, rho_a, rho_b, vdiff,
115-
grad_kernel)
115+
@inbounds continuity_equation!(drho_particle, density_calculator,
116+
particle_system, neighbor_system,
117+
v_particle_system, v_neighbor_system,
118+
particle, neighbor, pos_diff, distance,
119+
m_b, rho_a, rho_b, vdiff, grad_kernel)
116120
end
117121

118122
for i in eachindex(dv_particle[])

0 commit comments

Comments
 (0)