Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalize surface normal calc #539

Open
wants to merge 228 commits into
base: main
Choose a base branch
from

Conversation

svchb
Copy link
Collaborator

@svchb svchb commented May 29, 2024

Depends on #599
extracted from #584

NEWS.md Outdated Show resolved Hide resolved
src/schemes/boundary/dummy_particles/dummy_particles.jl Outdated Show resolved Hide resolved
@svchb svchb requested a review from efaulhaber December 2, 2024 11:36
docs/src/systems/fluid.md Outdated Show resolved Hide resolved
initial_condition :: IC
mass :: MA # Array{ELTYPE, 1}
pressure :: P # Array{ELTYPE, 1}
density_calculator :: DC
state_equation :: SE
smoothing_kernel :: K
smoothing_length :: ELTYPE
ideal_neighbor_count :: Int
color :: Int
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never used, is it? Same for EDAC.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes it will be used in #584

test/schemes/fluid/surface_normal_sph.jl Outdated Show resolved Hide resolved
test/schemes/fluid/surface_normal_sph.jl Outdated Show resolved Hide resolved

# After computation, check that surface normals have been computed
@test all(isfinite.(system.cache.surface_normal))
@test all(isfinite.(system.cache.neighbor_count))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this zero by default? Shouldn't you then check that this is not zero anymore?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inside will stay at 0.0. though.

test/schemes/fluid/surface_normal_sph.jl Outdated Show resolved Hide resolved
test/schemes/fluid/surface_normal_sph.jl Show resolved Hide resolved
test/schemes/fluid/surface_normal_sph.jl Outdated Show resolved Hide resolved
Comment on lines 144 to 146
for i in surface_particles
@test isapprox(computed_normals[:, i], expected_normals[:, i], atol=0.05)
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i in surface_particles
@test isapprox(computed_normals[:, i], expected_normals[:, i], atol=0.05)
end
@test isapprox(computed_normals, expected_normals, atol=0.05)

The loop will generate a lot of tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't work since the normals are not always exactly 0.0 on the inside.

Comment on lines +148 to +151
# Optionally, check that normals for interior particles are zero
# for i in setdiff(1:nparticles, surface_particles)
# @test isapprox(norm(system.cache.surface_normal[:, i]), 0.0, atol=1e-4)
# end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also part of #584

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I used it there but this is rather tricky... Even with the special conditions that are implemented in #584

@svchb svchb requested a review from efaulhaber December 4, 2024 12:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants