-
Notifications
You must be signed in to change notification settings - Fork 10
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
base: main
Are you sure you want to change the base?
Generalize surface normal calc #539
Conversation
Conflicts: src/schemes/fluid/weakly_compressible_sph/system.jl
…vchb/TrixiParticles.jlOpen into generalize_surface_normal_calc
Conflicts: examples/fluid/dam_break_oil_film_2d.jl src/schemes/fluid/weakly_compressible_sph/state_equations.jl
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
||
# After computation, check that surface normals have been computed | ||
@test all(isfinite.(system.cache.surface_normal)) | ||
@test all(isfinite.(system.cache.neighbor_count)) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
for i in surface_particles | ||
@test isapprox(computed_normals[:, i], expected_normals[:, i], atol=0.05) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
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.
# 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
…vchb/TrixiParticles.jlOpen into generalize_surface_normal_calc
Depends on #599
extracted from #584