Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
svchb committed Jan 31, 2025
1 parent 6f30a9a commit b94742e
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions test/schemes/fluid/surface_normal_sph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -199,11 +199,9 @@ end

# Compare absolute value of computed curvature vs. expected
for i in surface_particles
@test isapprox(
abs(curvature[i]),
expected_curv;
atol=relative_curvature_error * expected_curv
)
@test isapprox(abs(curvature[i]),
expected_curv;
atol=relative_curvature_error * expected_curv)
end

# Optionally, test that interior particles have near-zero normals
Expand Down Expand Up @@ -245,7 +243,8 @@ end
# Create fluid system (no wall)
system, bnd_system, semi, ode = create_fluid_system(coordinates, velocity, mass,
density,
particle_spacing, SurfaceTensionMorris(surface_tension_coefficient=0.072);
particle_spacing,
SurfaceTensionMorris(surface_tension_coefficient=0.072);
NDIMS=NDIMS,
smoothing_length=3.0 *
particle_spacing,
Expand Down Expand Up @@ -322,11 +321,11 @@ end
end
end

function is_corner(x, y; tol=0.5*particle_spacing)
isleft = (x tol)
isright = (x width - tol)
function is_corner(x, y; tol=0.5 * particle_spacing)
isleft = (x tol)
isright = (x width - tol)
isbottom = (y tol)
istop = (y height - tol)
istop = (y height - tol)
return (isleft || isright) && (isbottom || istop)
end

Expand All @@ -343,7 +342,7 @@ end
# All other points (edges + interior) => near-zero curvature
# We ignore most points since the normal calculation is not accurate in the interior
if norm(computed_normals[:, i]) < 0.1
@test isapprox(curvature[i], 0.0; atol=1e-2)
@test isapprox(curvature[i], 0.0; atol=1e-2)
end
end
end

0 comments on commit b94742e

Please sign in to comment.