6
6
smoothing_length_interpolation=smoothing_length,
7
7
is_boundary=false, boundary_compress_factor=1,
8
8
neighborhood_search=GridNeighborhoodSearch{ndims(shape)}(),
9
- background_pressure, tlsph =false, fixed_system=false)
9
+ background_pressure, place_on_shell =false, fixed_system=false)
10
10
11
11
System to generate body-fitted particles for complex shapes.
12
12
For more information on the methods, see [particle packing](@ref particle_packing).
@@ -18,10 +18,11 @@ For more information on the methods, see [particle packing](@ref particle_packin
18
18
- `background_pressure`: Constant background pressure to physically pack the particles.
19
19
A large `background_pressure` can cause high accelerations
20
20
which requires a properly adjusted time step.
21
- - `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed
22
- on the boundary of the shape and not half a particle spacing away,
23
- as for fluids. When `tlsph=true`, particles will be placed
24
- on the boundary of the shape.
21
+ - `place_on_shell`: If `place_on_shell=true`, particles will be placed
22
+ on the shell of the geometry. For example,
23
+ the [`TotalLagrangianSPHSystem`](@ref) requires particles to be placed
24
+ on the shell of the geometry and not half a particle spacing away,
25
+ as for fluids.
25
26
- `is_boundary`: When `shape` is inside the geometry that was used to create
26
27
`signed_distance_field`, set `is_boundary=false`.
27
28
Otherwise (`shape` is the sampled boundary), set `is_boundary=true`.
@@ -64,7 +65,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
64
65
smoothing_kernel :: K
65
66
smoothing_length_interpolation :: ELTYPE
66
67
background_pressure :: ELTYPE
67
- tlsph :: Bool
68
+ place_on_shell :: Bool
68
69
signed_distance_field :: S
69
70
is_boundary :: Bool
70
71
shift_length :: ELTYPE
@@ -79,7 +80,8 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
79
80
# See the comments in general/gpu.jl for more details.
80
81
function ParticlePackingSystem (initial_condition, mass, density, particle_spacing,
81
82
smoothing_kernel, smoothing_length_interpolation,
82
- background_pressure, tlsph, signed_distance_field,
83
+ background_pressure, place_on_shell,
84
+ signed_distance_field,
83
85
is_boundary, shift_length, neighborhood_search,
84
86
signed_distances, particle_refinement, buffer,
85
87
update_callback_used, fixed_system, cache,
@@ -93,7 +95,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
93
95
mass, density, particle_spacing,
94
96
smoothing_kernel,
95
97
smoothing_length_interpolation,
96
- background_pressure, tlsph ,
98
+ background_pressure, place_on_shell ,
97
99
signed_distance_field, is_boundary,
98
100
shift_length, neighborhood_search,
99
101
signed_distances, particle_refinement,
@@ -108,7 +110,8 @@ function ParticlePackingSystem(shape::InitialCondition;
108
110
smoothing_length_interpolation= smoothing_length,
109
111
is_boundary= false , boundary_compress_factor= 1 ,
110
112
neighborhood_search= GridNeighborhoodSearch {ndims(shape)} (),
111
- background_pressure, tlsph= false , fixed_system= false )
113
+ background_pressure, place_on_shell= false ,
114
+ fixed_system= false )
112
115
NDIMS = ndims (shape)
113
116
ELTYPE = eltype (shape)
114
117
mass = copy (shape. mass)
@@ -147,12 +150,12 @@ function ParticlePackingSystem(shape::InitialCondition;
147
150
# Its value is negative if the particle is inside the geometry.
148
151
# Otherwise (if outside), the value is positive.
149
152
if is_boundary
150
- offset = tlsph ? shape. particle_spacing : shape. particle_spacing / 2
153
+ offset = place_on_shell ? shape. particle_spacing : shape. particle_spacing / 2
151
154
152
155
shift_length = - boundary_compress_factor *
153
156
signed_distance_field. max_signed_distance - offset
154
157
else
155
- shift_length = tlsph ? zero (ELTYPE) : shape. particle_spacing / 2
158
+ shift_length = place_on_shell ? zero (ELTYPE) : shape. particle_spacing / 2
156
159
end
157
160
158
161
cache = (; create_cache_refinement (shape, particle_refinement, smoothing_length)... )
@@ -161,7 +164,7 @@ function ParticlePackingSystem(shape::InitialCondition;
161
164
162
165
return ParticlePackingSystem (shape, mass, density, shape. particle_spacing,
163
166
smoothing_kernel, smoothing_length_interpolation,
164
- background_pressure, tlsph , signed_distance_field,
167
+ background_pressure, place_on_shell , signed_distance_field,
165
168
is_boundary, shift_length, nhs,
166
169
fill (zero (ELTYPE), nparticles (shape)), particle_refinement,
167
170
nothing , Ref (false ), fixed_system, cache,
@@ -187,7 +190,7 @@ function Base.show(io::IO, ::MIME"text/plain", system::ParticlePackingSystem)
187
190
system. neighborhood_search |> typeof |> nameof)
188
191
summary_line (io, " #particles" , nparticles (system))
189
192
summary_line (io, " smoothing kernel" , system. smoothing_kernel |> typeof |> nameof)
190
- summary_line (io, " tlsph " , system. tlsph ? " yes" : " no" )
193
+ summary_line (io, " place_on_shell " , system. place_on_shell ? " yes" : " no" )
191
194
summary_line (io, " boundary" , system. is_boundary ? " yes" : " no" )
192
195
summary_footer (io)
193
196
end
@@ -349,8 +352,8 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector
349
352
(; shift_length) = system
350
353
351
354
# For fluid particles:
352
- # - `tlsph = true`: `shift_length = 0`
353
- # - `tlsph = false`: `shift_length = particle_spacing / 2`
355
+ # - `place_on_shell = true`: `shift_length = 0`
356
+ # - `place_on_shell = false`: `shift_length = particle_spacing / 2`
354
357
# For boundary particles:
355
358
# `shift_length` is the thickness of the boundary.
356
359
if distance_signed >= - shift_length
@@ -365,7 +368,7 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector
365
368
system. is_boundary || return u
366
369
367
370
particle_spacing = system. initial_condition. particle_spacing
368
- shift_length_inner = system. tlsph ? particle_spacing : particle_spacing / 2
371
+ shift_length_inner = system. place_on_shell ? particle_spacing : particle_spacing / 2
369
372
370
373
if distance_signed < shift_length_inner
371
374
shift = (distance_signed - shift_length_inner) * normal_vector
0 commit comments