66 smoothing_length_interpolation=smoothing_length,
77 is_boundary=false, boundary_compress_factor=1,
88 neighborhood_search=GridNeighborhoodSearch{ndims(shape)}(),
9- background_pressure, tlsph =false, fixed_system=false)
9+ background_pressure, place_on_shell =false, fixed_system=false)
1010
1111System to generate body-fitted particles for complex shapes.
1212For 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
1818- `background_pressure`: Constant background pressure to physically pack the particles.
1919 A large `background_pressure` can cause high accelerations
2020 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.
2526- `is_boundary`: When `shape` is inside the geometry that was used to create
2627 `signed_distance_field`, set `is_boundary=false`.
2728 Otherwise (`shape` is the sampled boundary), set `is_boundary=true`.
@@ -64,7 +65,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
6465 smoothing_kernel :: K
6566 smoothing_length_interpolation :: ELTYPE
6667 background_pressure :: ELTYPE
67- tlsph :: Bool
68+ place_on_shell :: Bool
6869 signed_distance_field :: S
6970 is_boundary :: Bool
7071 shift_length :: ELTYPE
@@ -79,7 +80,8 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
7980 # See the comments in general/gpu.jl for more details.
8081 function ParticlePackingSystem (initial_condition, mass, density, particle_spacing,
8182 smoothing_kernel, smoothing_length_interpolation,
82- background_pressure, tlsph, signed_distance_field,
83+ background_pressure, place_on_shell,
84+ signed_distance_field,
8385 is_boundary, shift_length, neighborhood_search,
8486 signed_distances, particle_refinement, buffer,
8587 update_callback_used, fixed_system, cache,
@@ -93,7 +95,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
9395 mass, density, particle_spacing,
9496 smoothing_kernel,
9597 smoothing_length_interpolation,
96- background_pressure, tlsph ,
98+ background_pressure, place_on_shell ,
9799 signed_distance_field, is_boundary,
98100 shift_length, neighborhood_search,
99101 signed_distances, particle_refinement,
@@ -108,7 +110,8 @@ function ParticlePackingSystem(shape::InitialCondition;
108110 smoothing_length_interpolation= smoothing_length,
109111 is_boundary= false , boundary_compress_factor= 1 ,
110112 neighborhood_search= GridNeighborhoodSearch {ndims(shape)} (),
111- background_pressure, tlsph= false , fixed_system= false )
113+ background_pressure, place_on_shell= false ,
114+ fixed_system= false )
112115 NDIMS = ndims (shape)
113116 ELTYPE = eltype (shape)
114117 mass = copy (shape. mass)
@@ -147,12 +150,12 @@ function ParticlePackingSystem(shape::InitialCondition;
147150 # Its value is negative if the particle is inside the geometry.
148151 # Otherwise (if outside), the value is positive.
149152 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
151154
152155 shift_length = - boundary_compress_factor *
153156 signed_distance_field. max_signed_distance - offset
154157 else
155- shift_length = tlsph ? zero (ELTYPE) : shape. particle_spacing / 2
158+ shift_length = place_on_shell ? zero (ELTYPE) : shape. particle_spacing / 2
156159 end
157160
158161 cache = (; create_cache_refinement (shape, particle_refinement, smoothing_length)... )
@@ -161,7 +164,7 @@ function ParticlePackingSystem(shape::InitialCondition;
161164
162165 return ParticlePackingSystem (shape, mass, density, shape. particle_spacing,
163166 smoothing_kernel, smoothing_length_interpolation,
164- background_pressure, tlsph , signed_distance_field,
167+ background_pressure, place_on_shell , signed_distance_field,
165168 is_boundary, shift_length, nhs,
166169 fill (zero (ELTYPE), nparticles (shape)), particle_refinement,
167170 nothing , Ref (false ), fixed_system, cache,
@@ -187,7 +190,7 @@ function Base.show(io::IO, ::MIME"text/plain", system::ParticlePackingSystem)
187190 system. neighborhood_search |> typeof |> nameof)
188191 summary_line (io, " #particles" , nparticles (system))
189192 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" )
191194 summary_line (io, " boundary" , system. is_boundary ? " yes" : " no" )
192195 summary_footer (io)
193196 end
@@ -349,8 +352,8 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector
349352 (; shift_length) = system
350353
351354 # 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`
354357 # For boundary particles:
355358 # `shift_length` is the thickness of the boundary.
356359 if distance_signed >= - shift_length
@@ -365,7 +368,7 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector
365368 system. is_boundary || return u
366369
367370 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
369372
370373 if distance_signed < shift_length_inner
371374 shift = (distance_signed - shift_length_inner) * normal_vector
0 commit comments