-
Notifications
You must be signed in to change notification settings - Fork 12
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
Particle packing #529
base: main
Are you sure you want to change the base?
Particle packing #529
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #529 +/- ##
==========================================
- Coverage 68.51% 67.84% -0.68%
==========================================
Files 87 93 +6
Lines 5406 5852 +446
==========================================
+ Hits 3704 3970 +266
- Misses 1702 1882 +180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
- `is_boundary`: When `is_boundary=true`, boundary particles will be sampled | ||
and packed in an offset surface of the `boundary`. | ||
The thickness of the boundary is specified by passing the | ||
[`SignedDistanceField`](@ref) of `boundary` with: | ||
- `use_for_boundary_packing=true` | ||
- `max_signed_distance=boundary_thickness` |
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 don't understand this description. What is this option doing?
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.
If set to true
the ParticlePackingSystem
packs only boundary particles of the geometry.
If set to false
(default) the ParticlePackingSystem
packs the particles inside the geometry.
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.
So there is always only one system packed? Either inside or boundary? This is not clear to me from the docs.
And I still don't understand this description.
- `is_boundary`: When `is_boundary=true`, boundary particles will be sampled | |
and packed in an offset surface of the `boundary`. | |
The thickness of the boundary is specified by passing the | |
[`SignedDistanceField`](@ref) of `boundary` with: | |
- `use_for_boundary_packing=true` | |
- `max_signed_distance=boundary_thickness` | |
- `pack_boundary`: When `pack_boundary=false`, the particles in `boundary` | |
are fixed and the particles in `shape` are packed. | |
When `pack_boundary=true`, the particles in `shape` are fixed | |
and the particles in `boundary` are fixed. | |
It often makes sense to first pack the `shape` against the `boundary` | |
and then in the next step `boundary` against the packed `shape`. | |
The thickness of the boundary is specified by passing the | |
[`SignedDistanceField`](@ref) of `boundary` with: | |
- `use_for_boundary_packing=true` | |
- `max_signed_distance=boundary_thickness` |
Is this correct? Is it not possible to pack both at the same time?
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.
No, that's not correct.
I have two different systems. One is filled with the particles inside the geometry (fluid) and one is filled with particles outside the geometry (boundary). These are independent systems that interact with each other.
The only difference between these systems is the shift condition used to constrain particles onto the surface.
For example:
packing_system = ParticlePackingSystem(shape_sampled; boundary=geometry,
signed_distance_field, tlsph=tlsph,
background_pressure)
boundary_system = ParticlePackingSystem(boundary_sampled; boundary=geometry,
is_boundary=true, signed_distance_field,
tlsph=tlsph, background_pressure)
semi = Semidiscretization(packing_system, boundary_system)
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 still requires tests.
# Initialize neighborhood search with signed distances | ||
PointNeighbors.initialize_grid!(nhs, stack(signed_distance_field.positions)) |
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.
@efaulhaber should I use a full grid nhs here? The positions of the signed_distance_field
are of course static. Or what is the best choice here?
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, by default the nhs should be using a FullGridCellList
. You need to set this in the kwarg.
This cell list is faster and GPU-compatible. Only downsides are 1. one needs to specify a bounding box and 2. the domain is constrained to this bounding box. Here you know the bounding box and particles should never leave it, right?
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.
Here you know the bounding box and particles should never leave it, right?
Yes, exactly.
based on #439 and #436