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
@@ -78,7 +79,8 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
7879 # See the comments in general/gpu.jl for more details.
7980 function ParticlePackingSystem (initial_condition, mass, density, particle_spacing,
8081 smoothing_kernel, smoothing_length_interpolation,
81- background_pressure, tlsph, signed_distance_field,
82+ background_pressure, place_on_shell,
83+ signed_distance_field,
8284 is_boundary, shift_length, neighborhood_search,
8385 signed_distances, particle_refinement, buffer,
8486 fixed_system, cache, advection_velocity)
@@ -90,7 +92,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV,
9092 mass, density, particle_spacing,
9193 smoothing_kernel,
9294 smoothing_length_interpolation,
93- background_pressure, tlsph ,
95+ background_pressure, place_on_shell ,
9496 signed_distance_field, is_boundary,
9597 shift_length, neighborhood_search,
9698 signed_distances, particle_refinement,
@@ -105,7 +107,8 @@ function ParticlePackingSystem(shape::InitialCondition;
105107 smoothing_length_interpolation= smoothing_length,
106108 is_boundary= false , boundary_compress_factor= 1 ,
107109 neighborhood_search= GridNeighborhoodSearch {ndims(shape)} (),
108- background_pressure, tlsph= false , fixed_system= false )
110+ background_pressure, place_on_shell= false ,
111+ fixed_system= false )
109112 NDIMS = ndims (shape)
110113 ELTYPE = eltype (shape)
111114 mass = copy (shape. mass)
@@ -144,12 +147,12 @@ function ParticlePackingSystem(shape::InitialCondition;
144147 # Its value is negative if the particle is inside the geometry.
145148 # Otherwise (if outside), the value is positive.
146149 if is_boundary
147- offset = tlsph ? shape. particle_spacing : shape. particle_spacing / 2
150+ offset = place_on_shell ? shape. particle_spacing : shape. particle_spacing / 2
148151
149152 shift_length = - boundary_compress_factor *
150153 signed_distance_field. max_signed_distance - offset
151154 else
152- shift_length = tlsph ? zero (ELTYPE) : shape. particle_spacing / 2
155+ shift_length = place_on_shell ? zero (ELTYPE) : shape. particle_spacing / 2
153156 end
154157
155158 cache = (; create_cache_refinement (shape, particle_refinement, smoothing_length)... )
@@ -158,7 +161,7 @@ function ParticlePackingSystem(shape::InitialCondition;
158161
159162 return ParticlePackingSystem (shape, mass, density, shape. particle_spacing,
160163 smoothing_kernel, smoothing_length_interpolation,
161- background_pressure, tlsph , signed_distance_field,
164+ background_pressure, place_on_shell , signed_distance_field,
162165 is_boundary, shift_length, nhs,
163166 fill (zero (ELTYPE), nparticles (shape)), particle_refinement,
164167 nothing , fixed_system, cache, advection_velocity)
@@ -183,7 +186,7 @@ function Base.show(io::IO, ::MIME"text/plain", system::ParticlePackingSystem)
183186 system. neighborhood_search |> typeof |> nameof)
184187 summary_line (io, " #particles" , nparticles (system))
185188 summary_line (io, " smoothing kernel" , system. smoothing_kernel |> typeof |> nameof)
186- summary_line (io, " tlsph " , system. tlsph ? " yes" : " no" )
189+ summary_line (io, " place_on_shell " , system. place_on_shell ? " yes" : " no" )
187190 summary_line (io, " boundary" , system. is_boundary ? " yes" : " no" )
188191 summary_footer (io)
189192 end
@@ -330,8 +333,8 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector
330333 (; shift_length) = system
331334
332335 # For fluid particles:
333- # - `tlsph = true`: `shift_length = 0`
334- # - `tlsph = false`: `shift_length = particle_spacing / 2`
336+ # - `place_on_shell = true`: `shift_length = 0`
337+ # - `place_on_shell = false`: `shift_length = particle_spacing / 2`
335338 # For boundary particles:
336339 # `shift_length` is the thickness of the boundary.
337340 if distance_signed >= - shift_length
@@ -346,7 +349,7 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector
346349 system. is_boundary || return u
347350
348351 particle_spacing = system. initial_condition. particle_spacing
349- shift_length_inner = system. tlsph ? particle_spacing : particle_spacing / 2
352+ shift_length_inner = system. place_on_shell ? particle_spacing : particle_spacing / 2
350353
351354 if distance_signed < shift_length_inner
352355 shift = (distance_signed - shift_length_inner) * normal_vector
0 commit comments