From be905538babd07ac587e7dfbfff203b3a8ff8e34 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:24:22 +0200 Subject: [PATCH 1/9] rename --- examples/dem/collapsing_sand_pile_3d.jl | 2 +- examples/fsi/dam_break_gate_2d.jl | 6 +++--- examples/fsi/dam_break_plate_2d.jl | 6 +++--- examples/preprocessing/packing_3d.jl | 2 +- examples/solid/oscillating_beam_2d.jl | 6 +++--- src/general/interpolation.jl | 4 ++-- .../particle_packing/signed_distance.jl | 2 +- src/preprocessing/particle_packing/system.jl | 2 +- src/setups/complex_shape.jl | 10 +++++----- src/setups/extrude_geometry.jl | 6 +++--- src/setups/rectangular_shape.jl | 16 ++++++++-------- src/setups/sphere_shape.jl | 2 +- test/setups/extrude_geometry.jl | 6 +++--- test/setups/rectangular_shape.jl | 4 ++-- test/setups/sphere_shape.jl | 8 ++++---- 15 files changed, 41 insertions(+), 41 deletions(-) diff --git a/examples/dem/collapsing_sand_pile_3d.jl b/examples/dem/collapsing_sand_pile_3d.jl index feb2510fd5..62087d91d9 100644 --- a/examples/dem/collapsing_sand_pile_3d.jl +++ b/examples/dem/collapsing_sand_pile_3d.jl @@ -51,7 +51,7 @@ min_coords_floor = (min_boundary[1] - boundary_thickness, floor_particles = RectangularShape(particle_spacing, (n_particles_floor_x, n_particles_floor_y, n_particles_floor_z), - min_coords_floor; density=boundary_density, tlsph=true) + min_coords_floor; density=boundary_density, place_on_shell=true) boundary_particles = floor_particles # ========================================================================================== diff --git a/examples/fsi/dam_break_gate_2d.jl b/examples/fsi/dam_break_gate_2d.jl index 487857c05b..caadca4e5a 100644 --- a/examples/fsi/dam_break_gate_2d.jl +++ b/examples/fsi/dam_break_gate_2d.jl @@ -76,17 +76,17 @@ n_particles_y = round(Int, length_beam / solid_particle_spacing) + 1 # The bottom layer is sampled separately below. Note that the `RectangularShape` puts the # first particle half a particle spacing away from the boundary, which is correct for fluids, -# but not for solids. We therefore need to pass `tlsph=true`. +# but not for solids. We therefore need to pass `place_on_shell=true`. # # The right end of the plate is 0.2 from the right end of the tank. plate_position = 0.6 - n_particles_x * solid_particle_spacing plate = RectangularShape(solid_particle_spacing, (n_particles_x, n_particles_y - 1), (plate_position, solid_particle_spacing), - density=solid_density, tlsph=true) + density=solid_density, place_on_shell=true) fixed_particles = RectangularShape(solid_particle_spacing, (n_particles_x, 1), (plate_position, 0.0), - density=solid_density, tlsph=true) + density=solid_density, place_on_shell=true) solid = union(plate, fixed_particles) diff --git a/examples/fsi/dam_break_plate_2d.jl b/examples/fsi/dam_break_plate_2d.jl index 4ac1a4a085..c01b3f0833 100644 --- a/examples/fsi/dam_break_plate_2d.jl +++ b/examples/fsi/dam_break_plate_2d.jl @@ -52,14 +52,14 @@ n_particles_y = round(Int, length_beam / solid_particle_spacing) + 1 # The bottom layer is sampled separately below. Note that the `RectangularShape` puts the # first particle half a particle spacing away from the boundary, which is correct for fluids, -# but not for solids. We therefore need to pass `tlsph=true`. +# but not for solids. We therefore need to pass `place_on_shell=true`. plate = RectangularShape(solid_particle_spacing, (n_particles_x, n_particles_y - 1), (2initial_fluid_size[1], solid_particle_spacing), - density=solid_density, tlsph=true) + density=solid_density, place_on_shell=true) fixed_particles = RectangularShape(solid_particle_spacing, (n_particles_x, 1), (2initial_fluid_size[1], 0.0), - density=solid_density, tlsph=true) + density=solid_density, place_on_shell=true) solid = union(plate, fixed_particles) diff --git a/examples/preprocessing/packing_3d.jl b/examples/preprocessing/packing_3d.jl index 0331d3c0a0..0ca9bf7d8c 100644 --- a/examples/preprocessing/packing_3d.jl +++ b/examples/preprocessing/packing_3d.jl @@ -15,5 +15,5 @@ boundary_thickness = 8 * particle_spacing trixi_include(joinpath(examples_dir(), "preprocessing", "packing_2d.jl"), density=1000.0, particle_spacing=particle_spacing, file=file, - boundary_thickness=boundary_thickness, tlsph=true, + boundary_thickness=boundary_thickness, place_on_shell=true, save_intervals=false) diff --git a/examples/solid/oscillating_beam_2d.jl b/examples/solid/oscillating_beam_2d.jl index 15ad8c99e7..aa25f64c2c 100644 --- a/examples/solid/oscillating_beam_2d.jl +++ b/examples/solid/oscillating_beam_2d.jl @@ -23,7 +23,7 @@ fixed_particles = SphereShape(particle_spacing, clamp_radius + particle_spacing (0.0, elastic_beam.thickness / 2), material.density, cutout_min=(0.0, 0.0), cutout_max=(clamp_radius, elastic_beam.thickness), - tlsph=true) + place_on_shell=true) n_particles_clamp_x = round(Int, clamp_radius / particle_spacing) @@ -33,9 +33,9 @@ n_particles_per_dimension = (round(Int, elastic_beam.length / particle_spacing) # Note that the `RectangularShape` puts the first particle half a particle spacing away # from the boundary, which is correct for fluids, but not for solids. -# We therefore need to pass `tlsph=true`. +# We therefore need to pass `place_on_shell=true`. beam = RectangularShape(particle_spacing, n_particles_per_dimension, - (0.0, 0.0), density=material.density, tlsph=true) + (0.0, 0.0), density=material.density, place_on_shell=true) solid = union(beam, fixed_particles) diff --git a/src/general/interpolation.jl b/src/general/interpolation.jl index a17cddddba..868dcc77fd 100644 --- a/src/general/interpolation.jl +++ b/src/general/interpolation.jl @@ -191,9 +191,9 @@ function interpolate_plane_2d(min_corner, max_corner, resolution, semi, ref_syst x_range = range(min_corner[1], max_corner[1], length=n_points_per_dimension[1]) y_range = range(min_corner[2], max_corner[2], length=n_points_per_dimension[2]) - # Generate points within the plane. Use `tlsph=true` to generate points on the boundary + # Generate points within the plane. Use `place_on_shell=true` to generate points on the boundary point_coords = rectangular_shape_coords(resolution, n_points_per_dimension, min_corner, - tlsph=true) + place_on_shell=true) results = interpolate_points(point_coords, semi, ref_system, v_ode, u_ode, smoothing_length=smoothing_length, diff --git a/src/preprocessing/particle_packing/signed_distance.jl b/src/preprocessing/particle_packing/signed_distance.jl index 7e957e124d..082deced5a 100644 --- a/src/preprocessing/particle_packing/signed_distance.jl +++ b/src/preprocessing/particle_packing/signed_distance.jl @@ -59,7 +59,7 @@ function SignedDistanceField(geometry, particle_spacing; particle_spacing)) grid = rectangular_shape_coords(particle_spacing, n_particles_per_dimension, - min_corner; tlsph=true) + min_corner; place_on_shell=true) points = reinterpret(reshape, SVector{NDIMS, ELTYPE}, grid) end diff --git a/src/preprocessing/particle_packing/system.jl b/src/preprocessing/particle_packing/system.jl index be6697fb13..96eb158b88 100644 --- a/src/preprocessing/particle_packing/system.jl +++ b/src/preprocessing/particle_packing/system.jl @@ -20,7 +20,7 @@ For more information on the methods, see [particle packing](@ref particle_packin which requires a properly adjusted time step. - `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed on the boundary of the shape and not half a particle spacing away, - as for fluids. When `tlsph=true`, particles will be placed + as for fluids. When `place_on_shell=true`, particles will be placed on the boundary of the shape. - `is_boundary`: When `shape` is inside the geometry that was used to create `signed_distance_field`, set `is_boundary=false`. diff --git a/src/setups/complex_shape.jl b/src/setups/complex_shape.jl index 2c515157d1..efa9db78fe 100644 --- a/src/setups/complex_shape.jl +++ b/src/setups/complex_shape.jl @@ -79,7 +79,7 @@ end """ sample_boundary(signed_distance_field::SignedDistanceField; - boundary_thickness::Real, tlsph=true) + boundary_thickness::Real, place_on_shell=true) Sample boundary particles of a complex geometry by using the [`SignedDistanceField`](@ref) of the geometry. @@ -89,9 +89,9 @@ of the geometry. # Keywords - `boundary_thickness`: Thickness of the boundary -- `tlsph` : When `tlsph=true`, boundary particles will be placed +- `tlsph` : When `place_on_shell=true`, boundary particles will be placed one particle spacing from the surface of the geometry. - Otherwise when `tlsph=true` (simulating fluid particles), + Otherwise when `place_on_shell=true` (simulating fluid particles), boundary particles will be placed half particle spacing away from the surface. @@ -117,7 +117,7 @@ boundary_sampled = sample_boundary(signed_distance_field; boundary_density=1.0, ``` """ function sample_boundary(signed_distance_field; - boundary_density, boundary_thickness, tlsph=true) + boundary_density, boundary_thickness, place_on_shell=true) (; max_signed_distance, boundary_packing, positions, distances, particle_spacing) = signed_distance_field @@ -157,6 +157,6 @@ function particle_grid(geometry, particle_spacing; end grid = rectangular_shape_coords(particle_spacing, n_particles_per_dimension, - min_corner; tlsph=true) + min_corner; place_on_shell=true) return reinterpret(reshape, SVector{ndims(geometry), eltype(geometry)}, grid) end diff --git a/src/setups/extrude_geometry.jl b/src/setups/extrude_geometry.jl index 498266ecd0..aab098b514 100644 --- a/src/setups/extrude_geometry.jl +++ b/src/setups/extrude_geometry.jl @@ -32,7 +32,7 @@ Returns an [`InitialCondition`](@ref). will be overwritten when using an initial pressure function in the system. - `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed on the boundary of the shape and not one particle radius away, as for fluids. - When `tlsph=true`, particles will be placed on the boundary of the shape. + When `place_on_shell=true`, particles will be placed on the boundary of the shape. # Examples ```jldoctest; output = false @@ -123,7 +123,7 @@ function sample_plane(geometry::AbstractMatrix, particle_spacing; tlsph) if size(geometry, 1) == 2 # Extruding a 2D shape results in a 3D shape - # When `tlsph=true`, particles will be placed on the x-y plane + # When `place_on_shell=true`, particles will be placed on the x-y plane coords = vcat(geometry, fill(tlsph ? 0 : particle_spacing / 2, size(geometry, 2))') # TODO: 2D shapes not only in x-y plane but in any user-defined plane @@ -137,7 +137,7 @@ function sample_plane(shape::InitialCondition, particle_spacing; tlsph) if ndims(shape) == 2 # Extruding a 2D shape results in a 3D shape - # When `tlsph=true`, particles will be placed on the x-y plane + # When `place_on_shell=true`, particles will be placed on the x-y plane coords = vcat(shape.coordinates, fill(tlsph ? 0 : particle_spacing / 2, size(shape.coordinates, 2))') diff --git a/src/setups/rectangular_shape.jl b/src/setups/rectangular_shape.jl index 98160bcac9..68857157ce 100644 --- a/src/setups/rectangular_shape.jl +++ b/src/setups/rectangular_shape.jl @@ -3,7 +3,7 @@ velocity=zeros(length(n_particles_per_dimension)), mass=nothing, density=nothing, pressure=0.0, acceleration=nothing, state_equation=nothing, - tlsph=false, loop_order=nothing) + place_on_shell=false, loop_order=nothing) Rectangular shape filled with particles. Returns an [`InitialCondition`](@ref). @@ -40,9 +40,9 @@ Rectangular shape filled with particles. Returns an [`InitialCondition`](@ref). - `state_equation`: When calculating a hydrostatic pressure gradient by setting `acceleration`, the `state_equation` will be used to set the corresponding density. Cannot be used together with `density`. -- `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed +- `place_on_shell`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed on the boundary of the shape and not one particle radius away, as for fluids. - When `tlsph=true`, particles will be placed on the boundary of the shape. + When `place_on_shell=true`, particles will be placed on the boundary of the shape. - `coordinates_perturbation`: Add a small random displacement to the particle positions, where the amplitude is `coordinates_perturbation * particle_spacing`. @@ -75,7 +75,7 @@ function RectangularShape(particle_spacing, n_particles_per_dimension, min_coord coordinates_perturbation=nothing, mass=nothing, density=nothing, pressure=0.0, acceleration=nothing, state_equation=nothing, - tlsph=false, loop_order=nothing) + place_on_shell=false, loop_order=nothing) if particle_spacing < eps() throw(ArgumentError("`particle_spacing` needs to be positive and larger than $(eps())")) end @@ -95,7 +95,7 @@ function RectangularShape(particle_spacing, n_particles_per_dimension, min_coord n_particles = prod(n_particles_per_dimension) coordinates = rectangular_shape_coords(particle_spacing, n_particles_per_dimension, - min_coordinates, tlsph=tlsph, + min_coordinates, place_on_shell=place_on_shell, loop_order=loop_order) if !isnothing(coordinates_perturbation) @@ -190,15 +190,15 @@ function loop_permutation(loop_order, NDIMS::Val{3}) end function rectangular_shape_coords(particle_spacing, n_particles_per_dimension, - min_coordinates; tlsph=false, loop_order=nothing) + min_coordinates; place_on_shell=false, loop_order=nothing) ELTYPE = eltype(particle_spacing) NDIMS = length(n_particles_per_dimension) coordinates = Array{ELTYPE, 2}(undef, NDIMS, prod(n_particles_per_dimension)) - # With TLSPH, particles need to be AT the min coordinates and not half a particle + # With place_on_shell, particles need to be AT the min coordinates and not half a particle # spacing away from it. - if tlsph + if place_on_shell min_coordinates = min_coordinates .- 0.5particle_spacing end diff --git a/src/setups/sphere_shape.jl b/src/setups/sphere_shape.jl index 4889e13464..d70025882a 100644 --- a/src/setups/sphere_shape.jl +++ b/src/setups/sphere_shape.jl @@ -37,7 +37,7 @@ coordinate directions as `cutout_min` and `cutout_max`. cut out of the sphere. - `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed on the boundary of the shape and not one particle radius away, as for fluids. - When `tlsph=true`, particles will be placed on the boundary of the shape. + When `place_on_shell=true`, particles will be placed on the boundary of the shape. - `velocity`: Either a function mapping each particle's coordinates to its velocity, or, for a constant fluid velocity, a vector holding this velocity. Velocity is constant zero by default. diff --git a/test/setups/extrude_geometry.jl b/test/setups/extrude_geometry.jl index e695f2e170..1c94cf789c 100644 --- a/test/setups/extrude_geometry.jl +++ b/test/setups/extrude_geometry.jl @@ -28,7 +28,7 @@ ] @testset "Direction $i" for i in eachindex(directions) - shape = extrude_geometry((point1, point2); direction=directions[i], tlsph=true, + shape = extrude_geometry((point1, point2); direction=directions[i], place_on_shell=true, particle_spacing=0.15, n_extrude=5, density=1.0) @test shape.coordinates ≈ expected_coords[i] @@ -68,7 +68,7 @@ end @testset "Direction $i" for i in eachindex(directions) shape = extrude_geometry(geometry; direction=directions[i], particle_spacing, - n_extrude=5, tlsph=true, density=1.0) + n_extrude=5, place_on_shell=true, density=1.0) @test shape.coordinates ≈ expected_coords[i] end @@ -86,7 +86,7 @@ end 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.06666666666666667 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.13333333333333333 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.26666666666666666 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.3333333333333333 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.4666666666666667 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.5333333333333333 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.6666666666666666 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.7333333333333333 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.8666666666666667 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 0.9333333333333333 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.092709445701687 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.15937611236835367 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.22604277903502035 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.292709445701687 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.35937611236835365 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.4260427790350203 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.492709445701687 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.5593761123683537 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.6260427790350204 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.692709445701687 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.7593761123683537 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8260427790350203 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.8927094457016871 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 0.9593761123683537 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.0260427790350204 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 1.092709445701687 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.185418891403374 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.2520855580700407 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.31875222473670733 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.38541889140337404 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.4520855580700407 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.5187522247367073 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.585418891403374 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.6520855580700406 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.7187522247367073 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.785418891403374 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.8520855580700406 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.9187522247367073 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 0.985418891403374 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.0520855580700408 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.1187522247367074 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 1.185418891403374 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.278128337105061 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.34479500377172767 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.4114616704383943 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.47812833710506103 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.5447950037717277 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.6114616704383944 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.678128337105061 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.7447950037717277 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.8114616704383943 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.878128337105061 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 0.9447950037717276 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0114616704383943 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.0781283371050612 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.1447950037717276 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.2114616704383945 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061 1.278128337105061] shape = extrude_geometry((p1, p2, p3); direction, particle_spacing=0.1, n_extrude=4, - density=1000.0, tlsph=true) + density=1000.0, place_on_shell=true) @test shape.coordinates ≈ expected_coords end diff --git a/test/setups/rectangular_shape.jl b/test/setups/rectangular_shape.jl index f3e77043b0..bf908431cb 100644 --- a/test/setups/rectangular_shape.jl +++ b/test/setups/rectangular_shape.jl @@ -41,7 +41,7 @@ ] @testset "$(loop_orders[i])" for i in eachindex(loop_orders) - shape = RectangularShape(1.0, (2, 2), (0.0, 0.0), density=1.0, tlsph=true, + shape = RectangularShape(1.0, (2, 2), (0.0, 0.0), density=1.0, place_on_shell=true, loop_order=loop_orders[i]) @test shape.coordinates == expected_coords[i] @@ -242,7 +242,7 @@ end @testset "$(loop_orders[i])" for i in eachindex(loop_orders) shape = RectangularShape(1.0, (2, 2, 2), (0.0, 0.0, 0.0), density=1.0, - tlsph=true, loop_order=loop_orders[i]) + place_on_shell=true, loop_order=loop_orders[i]) @test shape.coordinates == expected_coords[i] end diff --git a/test/setups/sphere_shape.jl b/test/setups/sphere_shape.jl index 57d904a376..c8b87d76db 100644 --- a/test/setups/sphere_shape.jl +++ b/test/setups/sphere_shape.jl @@ -106,14 +106,14 @@ SphereShape(1.0, 1.1, (0.2, -1.0, 0.3), 1000.0, sphere_type=RoundSphere()), SphereShape(1.0, 1.2, (-0.3, 0.1, 0.8), 1000.0, sphere_type=RoundSphere()), SphereShape(0.1, 0.5, (0.3, 0.4, 0.5), 1000.0, cutout_min=(0.18, 0.4, 0.5), - cutout_max=(0.42, 10.0, 1.0), tlsph=true), - SphereShape(0.1, 0.5, (0.3, 0.4, 0.5), 1000.0, n_layers=2, tlsph=true), + cutout_max=(0.42, 10.0, 1.0), place_on_shell=true), + SphereShape(0.1, 0.5, (0.3, 0.4, 0.5), 1000.0, n_layers=2, place_on_shell=true), SphereShape(0.1, 0.5, (0.3, 0.4, 0.5), 1000.0, n_layers=2, - layer_outwards=true, tlsph=true), + layer_outwards=true, place_on_shell=true), SphereShape(0.1, 0.5, (0.3, 0.4, 0.5), 1000.0, n_layers=2, sphere_type=RoundSphere()), SphereShape(0.1, 0.55, (0.3, 0.4, 0.5), 1000.0, n_layers=2, layer_outwards=true, - sphere_type=RoundSphere(), tlsph=true) + sphere_type=RoundSphere(), place_on_shell=true) ] expected_coords = [ From 490b689cf6769eaae9305892112757ce92517081 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:28:45 +0200 Subject: [PATCH 2/9] format --- examples/dem/collapsing_sand_pile_3d.jl | 3 ++- examples/fsi/dam_break_gate_2d.jl | 4 ++-- test/setups/extrude_geometry.jl | 3 ++- test/setups/rectangular_shape.jl | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/dem/collapsing_sand_pile_3d.jl b/examples/dem/collapsing_sand_pile_3d.jl index 62087d91d9..457134ce9b 100644 --- a/examples/dem/collapsing_sand_pile_3d.jl +++ b/examples/dem/collapsing_sand_pile_3d.jl @@ -51,7 +51,8 @@ min_coords_floor = (min_boundary[1] - boundary_thickness, floor_particles = RectangularShape(particle_spacing, (n_particles_floor_x, n_particles_floor_y, n_particles_floor_z), - min_coords_floor; density=boundary_density, place_on_shell=true) + min_coords_floor; density=boundary_density, + place_on_shell=true) boundary_particles = floor_particles # ========================================================================================== diff --git a/examples/fsi/dam_break_gate_2d.jl b/examples/fsi/dam_break_gate_2d.jl index caadca4e5a..483723d835 100644 --- a/examples/fsi/dam_break_gate_2d.jl +++ b/examples/fsi/dam_break_gate_2d.jl @@ -75,8 +75,8 @@ solid_particle_spacing = thickness / (n_particles_x - 1) n_particles_y = round(Int, length_beam / solid_particle_spacing) + 1 # The bottom layer is sampled separately below. Note that the `RectangularShape` puts the -# first particle half a particle spacing away from the boundary, which is correct for fluids, -# but not for solids. We therefore need to pass `place_on_shell=true`. +# first particle half a particle spacing away from the shell of the geometry, which is +# correct for fluids, but not for solids. We therefore need to pass `place_on_shell=true`. # # The right end of the plate is 0.2 from the right end of the tank. plate_position = 0.6 - n_particles_x * solid_particle_spacing diff --git a/test/setups/extrude_geometry.jl b/test/setups/extrude_geometry.jl index 1c94cf789c..5a927dbee4 100644 --- a/test/setups/extrude_geometry.jl +++ b/test/setups/extrude_geometry.jl @@ -28,7 +28,8 @@ ] @testset "Direction $i" for i in eachindex(directions) - shape = extrude_geometry((point1, point2); direction=directions[i], place_on_shell=true, + shape = extrude_geometry((point1, point2); direction=directions[i], + place_on_shell=true, particle_spacing=0.15, n_extrude=5, density=1.0) @test shape.coordinates ≈ expected_coords[i] diff --git a/test/setups/rectangular_shape.jl b/test/setups/rectangular_shape.jl index bf908431cb..7c2fd6875b 100644 --- a/test/setups/rectangular_shape.jl +++ b/test/setups/rectangular_shape.jl @@ -41,7 +41,8 @@ ] @testset "$(loop_orders[i])" for i in eachindex(loop_orders) - shape = RectangularShape(1.0, (2, 2), (0.0, 0.0), density=1.0, place_on_shell=true, + shape = RectangularShape(1.0, (2, 2), (0.0, 0.0), density=1.0, + place_on_shell=true, loop_order=loop_orders[i]) @test shape.coordinates == expected_coords[i] From 5d130f447697c7a5afbb2d6d9089829d63a5e427 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:38:06 +0200 Subject: [PATCH 3/9] forgot some --- examples/fsi/dam_break_plate_2d.jl | 4 +- src/general/interpolation.jl | 3 +- src/preprocessing/particle_packing/system.jl | 33 ++++++------- src/setups/extrude_geometry.jl | 50 ++++++++++---------- src/setups/rectangular_shape.jl | 7 +-- src/setups/sphere_shape.jl | 45 +++++++++--------- 6 files changed, 74 insertions(+), 68 deletions(-) diff --git a/examples/fsi/dam_break_plate_2d.jl b/examples/fsi/dam_break_plate_2d.jl index c01b3f0833..bbc9c81ff6 100644 --- a/examples/fsi/dam_break_plate_2d.jl +++ b/examples/fsi/dam_break_plate_2d.jl @@ -51,8 +51,8 @@ solid_particle_spacing = thickness / (n_particles_x - 1) n_particles_y = round(Int, length_beam / solid_particle_spacing) + 1 # The bottom layer is sampled separately below. Note that the `RectangularShape` puts the -# first particle half a particle spacing away from the boundary, which is correct for fluids, -# but not for solids. We therefore need to pass `place_on_shell=true`. +# first particle half a particle spacing away from the shell of the geometry, which is +# correct for fluids, but not for solids. We therefore need to pass `place_on_shell=true`. plate = RectangularShape(solid_particle_spacing, (n_particles_x, n_particles_y - 1), (2initial_fluid_size[1], solid_particle_spacing), diff --git a/src/general/interpolation.jl b/src/general/interpolation.jl index 868dcc77fd..21f4929afb 100644 --- a/src/general/interpolation.jl +++ b/src/general/interpolation.jl @@ -191,7 +191,8 @@ function interpolate_plane_2d(min_corner, max_corner, resolution, semi, ref_syst x_range = range(min_corner[1], max_corner[1], length=n_points_per_dimension[1]) y_range = range(min_corner[2], max_corner[2], length=n_points_per_dimension[2]) - # Generate points within the plane. Use `place_on_shell=true` to generate points on the boundary + # Generate points within the plane. Use `place_on_shell=true` to generate points + # on the shell of the geometry point_coords = rectangular_shape_coords(resolution, n_points_per_dimension, min_corner, place_on_shell=true) diff --git a/src/preprocessing/particle_packing/system.jl b/src/preprocessing/particle_packing/system.jl index 96eb158b88..0e0c05f051 100644 --- a/src/preprocessing/particle_packing/system.jl +++ b/src/preprocessing/particle_packing/system.jl @@ -6,7 +6,7 @@ smoothing_length_interpolation=smoothing_length, is_boundary=false, boundary_compress_factor=1, neighborhood_search=GridNeighborhoodSearch{ndims(shape)}(), - background_pressure, tlsph=false, fixed_system=false) + background_pressure, place_on_shell=false, fixed_system=false) System to generate body-fitted particles for complex shapes. 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 - `background_pressure`: Constant background pressure to physically pack the particles. A large `background_pressure` can cause high accelerations which requires a properly adjusted time step. -- `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed - on the boundary of the shape and not half a particle spacing away, - as for fluids. When `place_on_shell=true`, particles will be placed - on the boundary of the shape. +- `place_on_shell`: If `place_on_shell=true`, particles will be placed + on the shell of the geometry. For example, + the [`TotalLagrangianSPHSystem`](@ref) requires particles to be placed + on the shell of the geometry and not half a particle spacing away, + as for fluids. - `is_boundary`: When `shape` is inside the geometry that was used to create `signed_distance_field`, set `is_boundary=false`. Otherwise (`shape` is the sampled boundary), set `is_boundary=true`. @@ -64,7 +65,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV, smoothing_kernel :: K smoothing_length_interpolation :: ELTYPE background_pressure :: ELTYPE - tlsph :: Bool + place_on_shell :: Bool signed_distance_field :: S is_boundary :: Bool shift_length :: ELTYPE @@ -79,7 +80,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV, # See the comments in general/gpu.jl for more details. function ParticlePackingSystem(initial_condition, mass, density, particle_spacing, smoothing_kernel, smoothing_length_interpolation, - background_pressure, tlsph, signed_distance_field, + background_pressure, place_on_shell, signed_distance_field, is_boundary, shift_length, neighborhood_search, signed_distances, particle_refinement, buffer, update_callback_used, fixed_system, cache, @@ -93,7 +94,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV, mass, density, particle_spacing, smoothing_kernel, smoothing_length_interpolation, - background_pressure, tlsph, + background_pressure, place_on_shell, signed_distance_field, is_boundary, shift_length, neighborhood_search, signed_distances, particle_refinement, @@ -108,7 +109,7 @@ function ParticlePackingSystem(shape::InitialCondition; smoothing_length_interpolation=smoothing_length, is_boundary=false, boundary_compress_factor=1, neighborhood_search=GridNeighborhoodSearch{ndims(shape)}(), - background_pressure, tlsph=false, fixed_system=false) + background_pressure, place_on_shell=false, fixed_system=false) NDIMS = ndims(shape) ELTYPE = eltype(shape) mass = copy(shape.mass) @@ -147,12 +148,12 @@ function ParticlePackingSystem(shape::InitialCondition; # Its value is negative if the particle is inside the geometry. # Otherwise (if outside), the value is positive. if is_boundary - offset = tlsph ? shape.particle_spacing : shape.particle_spacing / 2 + offset = place_on_shell ? shape.particle_spacing : shape.particle_spacing / 2 shift_length = -boundary_compress_factor * signed_distance_field.max_signed_distance - offset else - shift_length = tlsph ? zero(ELTYPE) : shape.particle_spacing / 2 + shift_length = place_on_shell ? zero(ELTYPE) : shape.particle_spacing / 2 end cache = (; create_cache_refinement(shape, particle_refinement, smoothing_length)...) @@ -161,7 +162,7 @@ function ParticlePackingSystem(shape::InitialCondition; return ParticlePackingSystem(shape, mass, density, shape.particle_spacing, smoothing_kernel, smoothing_length_interpolation, - background_pressure, tlsph, signed_distance_field, + background_pressure, place_on_shell, signed_distance_field, is_boundary, shift_length, nhs, fill(zero(ELTYPE), nparticles(shape)), particle_refinement, nothing, Ref(false), fixed_system, cache, @@ -187,7 +188,7 @@ function Base.show(io::IO, ::MIME"text/plain", system::ParticlePackingSystem) system.neighborhood_search |> typeof |> nameof) summary_line(io, "#particles", nparticles(system)) summary_line(io, "smoothing kernel", system.smoothing_kernel |> typeof |> nameof) - summary_line(io, "tlsph", system.tlsph ? "yes" : "no") + summary_line(io, "place_on_shell", system.place_on_shell ? "yes" : "no") summary_line(io, "boundary", system.is_boundary ? "yes" : "no") summary_footer(io) end @@ -349,8 +350,8 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector (; shift_length) = system # For fluid particles: - # - `tlsph = true`: `shift_length = 0` - # - `tlsph = false`: `shift_length = particle_spacing / 2` + # - `place_on_shell = true`: `shift_length = 0` + # - `place_on_shell = false`: `shift_length = particle_spacing / 2` # For boundary particles: # `shift_length` is the thickness of the boundary. if distance_signed >= -shift_length @@ -365,7 +366,7 @@ function constrain_particle!(u, system, particle, distance_signed, normal_vector system.is_boundary || return u particle_spacing = system.initial_condition.particle_spacing - shift_length_inner = system.tlsph ? particle_spacing : particle_spacing / 2 + shift_length_inner = system.place_on_shell ? particle_spacing : particle_spacing / 2 if distance_signed < shift_length_inner shift = (distance_signed - shift_length_inner) * normal_vector diff --git a/src/setups/extrude_geometry.jl b/src/setups/extrude_geometry.jl index aab098b514..af5b85e4e3 100644 --- a/src/setups/extrude_geometry.jl +++ b/src/setups/extrude_geometry.jl @@ -30,9 +30,11 @@ Returns an [`InitialCondition`](@ref). - `pressure`: Scalar to set the pressure of all particles to this value. This is only used by the [`EntropicallyDampedSPHSystem`](@ref) and will be overwritten when using an initial pressure function in the system. -- `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed - on the boundary of the shape and not one particle radius away, as for fluids. - When `place_on_shell=true`, particles will be placed on the boundary of the shape. +- `place_on_shell`: If `place_on_shell=true`, particles will be placed + on the shell of the geometry. For example, + the [`TotalLagrangianSPHSystem`](@ref) requires particles to be placed + on the shell of the geometry and not half a particle spacing away, + as for fluids. # Examples ```jldoctest; output = false @@ -79,7 +81,7 @@ shape = extrude_geometry(shape; direction, particle_spacing=0.1, n_extrude=4, de This is an experimental feature and may change in any future releases. """ function extrude_geometry(geometry; particle_spacing=-1, direction, n_extrude::Integer, - velocity=zeros(length(direction)), tlsph=false, + velocity=zeros(length(direction)), place_on_shell=false, mass=nothing, density=nothing, pressure=0.0) direction_ = normalize(direction) NDIMS = length(direction_) @@ -95,9 +97,9 @@ function extrude_geometry(geometry; particle_spacing=-1, direction, n_extrude::I throw(ArgumentError("`particle_spacing` must be specified when not extruding an `InitialCondition`")) end - geometry = shift_plane_corners(geometry, direction_, particle_spacing, tlsph) + geometry = shift_plane_corners(geometry, direction_, particle_spacing, place_on_shell) - face_coords, particle_spacing_ = sample_plane(geometry, particle_spacing; tlsph=tlsph) + face_coords, particle_spacing_ = sample_plane(geometry, particle_spacing; place_on_shell=place_on_shell) if !isapprox(particle_spacing, particle_spacing_, rtol=5e-2) @info "The desired size is not a multiple of the particle spacing $particle_spacing." * @@ -119,12 +121,12 @@ end # For corners/endpoints of a plane/line, sample the plane/line with particles. # For 2D coordinates or an `InitialCondition`, add a third dimension. -function sample_plane(geometry::AbstractMatrix, particle_spacing; tlsph) +function sample_plane(geometry::AbstractMatrix, particle_spacing; place_on_shell) if size(geometry, 1) == 2 # Extruding a 2D shape results in a 3D shape # When `place_on_shell=true`, particles will be placed on the x-y plane - coords = vcat(geometry, fill(tlsph ? 0 : particle_spacing / 2, size(geometry, 2))') + coords = vcat(geometry, fill(place_on_shell ? 0 : particle_spacing / 2, size(geometry, 2))') # TODO: 2D shapes not only in x-y plane but in any user-defined plane return coords, particle_spacing @@ -133,13 +135,13 @@ function sample_plane(geometry::AbstractMatrix, particle_spacing; tlsph) return geometry, particle_spacing end -function sample_plane(shape::InitialCondition, particle_spacing; tlsph) +function sample_plane(shape::InitialCondition, particle_spacing; place_on_shell) if ndims(shape) == 2 # Extruding a 2D shape results in a 3D shape # When `place_on_shell=true`, particles will be placed on the x-y plane coords = vcat(shape.coordinates, - fill(tlsph ? 0 : particle_spacing / 2, size(shape.coordinates, 2))') + fill(place_on_shell ? 0 : particle_spacing / 2, size(shape.coordinates, 2))') # TODO: 2D shapes not only in x-y plane but in any user-defined plane return coords, particle_spacing @@ -148,13 +150,13 @@ function sample_plane(shape::InitialCondition, particle_spacing; tlsph) return shape.coordinates, particle_spacing end -function sample_plane(plane_points, particle_spacing; tlsph=nothing) +function sample_plane(plane_points, particle_spacing; place_on_shell=nothing) # Convert to tuple - return sample_plane(tuple(plane_points...), particle_spacing; tlsph=nothing) + return sample_plane(tuple(plane_points...), particle_spacing; place_on_shell=nothing) end -function sample_plane(plane_points::NTuple{2}, particle_spacing; tlsph=nothing) +function sample_plane(plane_points::NTuple{2}, particle_spacing; place_on_shell=nothing) # Verify that points are in 2D space if any(length.(plane_points) .!= 2) throw(ArgumentError("all points must be 2D coordinates")) @@ -168,7 +170,7 @@ function sample_plane(plane_points::NTuple{2}, particle_spacing; tlsph=nothing) return coords, particle_spacing_new end -function sample_plane(plane_points::NTuple{3}, particle_spacing; tlsph=nothing) +function sample_plane(plane_points::NTuple{3}, particle_spacing; place_on_shell=nothing) # Verify that points are in 3D space if any(length.(plane_points) .!= 3) throw(ArgumentError("all points must be 3D coordinates")) @@ -209,21 +211,21 @@ function sample_plane(plane_points::NTuple{3}, particle_spacing; tlsph=nothing) return coords, particle_spacing_new end -# Shift corners of the plane/line inwards by half a particle spacing with `tlsph=false` +# Shift corners of the plane/line inwards by half a particle spacing with `place_on_shell=false` # because fluid particles need to be half a particle spacing away from the boundary of the shape. function shift_plane_corners(geometry::Union{AbstractMatrix, InitialCondition}, - direction, particle_spacing, tlsph) + direction, particle_spacing, place_on_shell) return geometry end -function shift_plane_corners(plane_points, direction, particle_spacing, tlsph) - shift_plane_corners(tuple(plane_points...), direction, particle_spacing, tlsph) +function shift_plane_corners(plane_points, direction, particle_spacing, place_on_shell) + shift_plane_corners(tuple(plane_points...), direction, particle_spacing, place_on_shell) end -function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacing, tlsph) - # With TLSPH, particles need to be AT the min coordinates and not half a particle +function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacing, place_on_shell) + # With place_on_shell, particles need to be AT the min coordinates and not half a particle # spacing away from it. - (tlsph) && (return plane_points) + (place_on_shell) && (return plane_points) plane_point1 = copy(plane_points[1]) plane_point2 = copy(plane_points[2]) @@ -238,10 +240,10 @@ function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacin return (plane_point1, plane_point2) end -function shift_plane_corners(plane_points::NTuple{3}, direction, particle_spacing, tlsph) - # With TLSPH, particles need to be AT the min coordinates and not half a particle +function shift_plane_corners(plane_points::NTuple{3}, direction, particle_spacing, place_on_shell) + # With place_on_shell, particles need to be AT the min coordinates and not half a particle # spacing away from it. - (tlsph) && (return plane_points) + (place_on_shell) && (return plane_points) plane_point1 = copy(plane_points[1]) plane_point2 = copy(plane_points[2]) diff --git a/src/setups/rectangular_shape.jl b/src/setups/rectangular_shape.jl index 68857157ce..1c30ef5c1b 100644 --- a/src/setups/rectangular_shape.jl +++ b/src/setups/rectangular_shape.jl @@ -40,9 +40,10 @@ Rectangular shape filled with particles. Returns an [`InitialCondition`](@ref). - `state_equation`: When calculating a hydrostatic pressure gradient by setting `acceleration`, the `state_equation` will be used to set the corresponding density. Cannot be used together with `density`. -- `place_on_shell`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed - on the boundary of the shape and not one particle radius away, as for fluids. - When `place_on_shell=true`, particles will be placed on the boundary of the shape. +- `place_on_shell`: If `place_on_shell=true`, particles will be placed on the shell of the shape. + For example, the [`TotalLagrangianSPHSystem`](@ref) requires particles + to be placed on the shell of the shape and not half a particle spacing away, + as for fluids. - `coordinates_perturbation`: Add a small random displacement to the particle positions, where the amplitude is `coordinates_perturbation * particle_spacing`. diff --git a/src/setups/sphere_shape.jl b/src/setups/sphere_shape.jl index d70025882a..b41bc64557 100644 --- a/src/setups/sphere_shape.jl +++ b/src/setups/sphere_shape.jl @@ -1,7 +1,7 @@ """ SphereShape(particle_spacing, radius, center_position, density; sphere_type=VoxelSphere(), n_layers=-1, layer_outwards=false, - cutout_min=(0.0, 0.0), cutout_max=(0.0, 0.0), tlsph=false, + cutout_min=(0.0, 0.0), cutout_max=(0.0, 0.0), place_on_shell=false, velocity=zeros(length(center_position)), mass=nothing, pressure=0.0) Generate a sphere that is either completely filled (by default) @@ -35,18 +35,19 @@ coordinate directions as `cutout_min` and `cutout_max`. cut out of the sphere. - `cutout_max`: Corner in positive coordinate directions of a cuboid that is to be cut out of the sphere. -- `tlsph`: With the [`TotalLagrangianSPHSystem`](@ref), particles need to be placed - on the boundary of the shape and not one particle radius away, as for fluids. - When `place_on_shell=true`, particles will be placed on the boundary of the shape. -- `velocity`: Either a function mapping each particle's coordinates to its velocity, - or, for a constant fluid velocity, a vector holding this velocity. - Velocity is constant zero by default. -- `mass`: Either `nothing` (default) to automatically compute particle mass from particle - density and spacing, or a function mapping each particle's coordinates to its mass, - or a scalar for a constant mass over all particles. -- `pressure`: Either a function mapping each particle's coordinates to its pressure, - or a scalar for a constant pressure over all particles. This is optional and - only needed when using the [`EntropicallyDampedSPHSystem`](@ref). +- `place_on_shell`: If `place_on_shell=true`, particles will be placed on the shell of the shape. + For example, the [`TotalLagrangianSPHSystem`](@ref) requires particles + to be placed on the shell of the shape and not half a particle spacing away, + as for fluids. +- `velocity`: Either a function mapping each particle's coordinates to its velocity, + or, for a constant fluid velocity, a vector holding this velocity. + Velocity is constant zero by default. +- `mass`: Either `nothing` (default) to automatically compute particle mass from particle + density and spacing, or a function mapping each particle's coordinates to its mass, + or a scalar for a constant mass over all particles. +- `pressure`: Either a function mapping each particle's coordinates to its pressure, + or a scalar for a constant pressure over all particles. This is optional and + only needed when using the [`EntropicallyDampedSPHSystem`](@ref). # Examples ```jldoctest; output = false @@ -89,7 +90,7 @@ SphereShape(0.1, 0.5, (0.2, 0.4, 0.3), 1000.0, sphere_type=RoundSphere()) """ function SphereShape(particle_spacing, radius, center_position, density; sphere_type=VoxelSphere(), n_layers=-1, layer_outwards=false, - cutout_min=(0.0, 0.0), cutout_max=(0.0, 0.0), tlsph=false, + cutout_min=(0.0, 0.0), cutout_max=(0.0, 0.0), place_on_shell=false, velocity=zeros(length(center_position)), mass=nothing, pressure=0.0) if particle_spacing < eps() throw(ArgumentError("`particle_spacing` needs to be positive and larger than $(eps())")) @@ -99,7 +100,7 @@ function SphereShape(particle_spacing, radius, center_position, density; coordinates = sphere_shape_coords(sphere_type, particle_spacing, radius, SVector{NDIMS}(center_position), - n_layers, layer_outwards, tlsph) + n_layers, layer_outwards, place_on_shell) # Convert tuples to vectors cutout_min_ = collect(cutout_min) @@ -169,13 +170,13 @@ struct RoundSphere{AR} end function sphere_shape_coords(::VoxelSphere, particle_spacing, radius, center_position, - n_layers, layer_outwards, tlsph) + n_layers, layer_outwards, place_on_shell) if n_layers > 0 if layer_outwards inner_radius = radius outer_radius = radius + n_layers * particle_spacing - if !tlsph + if !place_on_shell # Put first layer of particles half a particle spacing outside of `radius` inner_radius += 0.5particle_spacing outer_radius += 0.5particle_spacing @@ -184,7 +185,7 @@ function sphere_shape_coords(::VoxelSphere, particle_spacing, radius, center_pos inner_radius = radius - n_layers * particle_spacing outer_radius = radius - if !tlsph + if !place_on_shell # Put first layer of particles half a particle spacing inside of `radius` inner_radius -= 0.5particle_spacing outer_radius -= 0.5particle_spacing @@ -194,7 +195,7 @@ function sphere_shape_coords(::VoxelSphere, particle_spacing, radius, center_pos outer_radius = radius inner_radius = -1.0 - if !tlsph + if !place_on_shell # Put first layer of particles half a particle spacing inside of `radius` outer_radius -= 0.5particle_spacing end @@ -225,7 +226,7 @@ function sphere_shape_coords(::VoxelSphere, particle_spacing, radius, center_pos end function sphere_shape_coords(sphere::RoundSphere, particle_spacing, radius, center, - n_layers, layer_outwards, tlsph) + n_layers, layer_outwards, place_on_shell) if n_layers > 0 if layer_outwards inner_radius = radius @@ -233,12 +234,12 @@ function sphere_shape_coords(sphere::RoundSphere, particle_spacing, radius, cent inner_radius = radius - n_layers * particle_spacing end - if !tlsph + if !place_on_shell # Put first layer of particles half a particle spacing outside of inner radius inner_radius += 0.5particle_spacing end else - if tlsph + if place_on_shell # Just create a sphere that is 0.5 particle spacing larger radius += 0.5particle_spacing end From 76b819afb74fb6393fdc44edd9ce80ad5b87dd82 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:38:17 +0200 Subject: [PATCH 4/9] format --- src/preprocessing/particle_packing/system.jl | 8 +++++--- src/setups/extrude_geometry.jl | 16 +++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/preprocessing/particle_packing/system.jl b/src/preprocessing/particle_packing/system.jl index 0e0c05f051..f91336036b 100644 --- a/src/preprocessing/particle_packing/system.jl +++ b/src/preprocessing/particle_packing/system.jl @@ -65,7 +65,7 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV, smoothing_kernel :: K smoothing_length_interpolation :: ELTYPE background_pressure :: ELTYPE - place_on_shell :: Bool + place_on_shell :: Bool signed_distance_field :: S is_boundary :: Bool shift_length :: ELTYPE @@ -80,7 +80,8 @@ struct ParticlePackingSystem{S, F, NDIMS, ELTYPE <: Real, PR, C, AV, # See the comments in general/gpu.jl for more details. function ParticlePackingSystem(initial_condition, mass, density, particle_spacing, smoothing_kernel, smoothing_length_interpolation, - background_pressure, place_on_shell, signed_distance_field, + background_pressure, place_on_shell, + signed_distance_field, is_boundary, shift_length, neighborhood_search, signed_distances, particle_refinement, buffer, update_callback_used, fixed_system, cache, @@ -109,7 +110,8 @@ function ParticlePackingSystem(shape::InitialCondition; smoothing_length_interpolation=smoothing_length, is_boundary=false, boundary_compress_factor=1, neighborhood_search=GridNeighborhoodSearch{ndims(shape)}(), - background_pressure, place_on_shell=false, fixed_system=false) + background_pressure, place_on_shell=false, + fixed_system=false) NDIMS = ndims(shape) ELTYPE = eltype(shape) mass = copy(shape.mass) diff --git a/src/setups/extrude_geometry.jl b/src/setups/extrude_geometry.jl index af5b85e4e3..07dbdc2764 100644 --- a/src/setups/extrude_geometry.jl +++ b/src/setups/extrude_geometry.jl @@ -99,7 +99,9 @@ function extrude_geometry(geometry; particle_spacing=-1, direction, n_extrude::I geometry = shift_plane_corners(geometry, direction_, particle_spacing, place_on_shell) - face_coords, particle_spacing_ = sample_plane(geometry, particle_spacing; place_on_shell=place_on_shell) + face_coords, + particle_spacing_ = sample_plane(geometry, particle_spacing; + place_on_shell=place_on_shell) if !isapprox(particle_spacing, particle_spacing_, rtol=5e-2) @info "The desired size is not a multiple of the particle spacing $particle_spacing." * @@ -126,7 +128,8 @@ function sample_plane(geometry::AbstractMatrix, particle_spacing; place_on_shell # Extruding a 2D shape results in a 3D shape # When `place_on_shell=true`, particles will be placed on the x-y plane - coords = vcat(geometry, fill(place_on_shell ? 0 : particle_spacing / 2, size(geometry, 2))') + coords = vcat(geometry, + fill(place_on_shell ? 0 : particle_spacing / 2, size(geometry, 2))') # TODO: 2D shapes not only in x-y plane but in any user-defined plane return coords, particle_spacing @@ -141,7 +144,8 @@ function sample_plane(shape::InitialCondition, particle_spacing; place_on_shell) # When `place_on_shell=true`, particles will be placed on the x-y plane coords = vcat(shape.coordinates, - fill(place_on_shell ? 0 : particle_spacing / 2, size(shape.coordinates, 2))') + fill(place_on_shell ? 0 : particle_spacing / 2, + size(shape.coordinates, 2))') # TODO: 2D shapes not only in x-y plane but in any user-defined plane return coords, particle_spacing @@ -222,7 +226,8 @@ function shift_plane_corners(plane_points, direction, particle_spacing, place_on shift_plane_corners(tuple(plane_points...), direction, particle_spacing, place_on_shell) end -function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacing, place_on_shell) +function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacing, + place_on_shell) # With place_on_shell, particles need to be AT the min coordinates and not half a particle # spacing away from it. (place_on_shell) && (return plane_points) @@ -240,7 +245,8 @@ function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacin return (plane_point1, plane_point2) end -function shift_plane_corners(plane_points::NTuple{3}, direction, particle_spacing, place_on_shell) +function shift_plane_corners(plane_points::NTuple{3}, direction, particle_spacing, + place_on_shell) # With place_on_shell, particles need to be AT the min coordinates and not half a particle # spacing away from it. (place_on_shell) && (return plane_points) From 403341d1505600be9558b6c382722a8464084bfd Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:39:10 +0200 Subject: [PATCH 5/9] naming --- examples/fsi/dam_break_gate_2d.jl | 2 +- examples/fsi/dam_break_plate_2d.jl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/fsi/dam_break_gate_2d.jl b/examples/fsi/dam_break_gate_2d.jl index 483723d835..654f5016e4 100644 --- a/examples/fsi/dam_break_gate_2d.jl +++ b/examples/fsi/dam_break_gate_2d.jl @@ -75,7 +75,7 @@ solid_particle_spacing = thickness / (n_particles_x - 1) n_particles_y = round(Int, length_beam / solid_particle_spacing) + 1 # The bottom layer is sampled separately below. Note that the `RectangularShape` puts the -# first particle half a particle spacing away from the shell of the geometry, which is +# first particle half a particle spacing away from the shell of the shape, which is # correct for fluids, but not for solids. We therefore need to pass `place_on_shell=true`. # # The right end of the plate is 0.2 from the right end of the tank. diff --git a/examples/fsi/dam_break_plate_2d.jl b/examples/fsi/dam_break_plate_2d.jl index bbc9c81ff6..7b1ca18b75 100644 --- a/examples/fsi/dam_break_plate_2d.jl +++ b/examples/fsi/dam_break_plate_2d.jl @@ -51,7 +51,7 @@ solid_particle_spacing = thickness / (n_particles_x - 1) n_particles_y = round(Int, length_beam / solid_particle_spacing) + 1 # The bottom layer is sampled separately below. Note that the `RectangularShape` puts the -# first particle half a particle spacing away from the shell of the geometry, which is +# first particle half a particle spacing away from the shell of the shape, which is # correct for fluids, but not for solids. We therefore need to pass `place_on_shell=true`. plate = RectangularShape(solid_particle_spacing, (n_particles_x, n_particles_y - 1), From 6babe34250664c9ed85e40ef82e9ee05b1e2d86d Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:50:06 +0200 Subject: [PATCH 6/9] forgot some more --- examples/preprocessing/packing_2d.jl | 9 +++++---- src/setups/complex_shape.jl | 2 +- test/systems/packing_system.jl | 6 +++--- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/examples/preprocessing/packing_2d.jl b/examples/preprocessing/packing_2d.jl index b26f950573..85227dc109 100644 --- a/examples/preprocessing/packing_2d.jl +++ b/examples/preprocessing/packing_2d.jl @@ -6,7 +6,7 @@ file = pkgdir(TrixiParticles, "examples", "preprocessing", "data", filename * ". # ========================================================================================== # ==== Packing parameters -tlsph = false +place_on_shell = false # ========================================================================================== # ==== Resolution @@ -36,7 +36,7 @@ shape_sampled = ComplexShape(geometry; particle_spacing, density, # Returns `InitialCondition` boundary_sampled = sample_boundary(signed_distance_field; boundary_density=density, - boundary_thickness, tlsph=tlsph) + boundary_thickness, place_on_shell=place_on_shell) trixi2vtk(shape_sampled) trixi2vtk(boundary_sampled, filename="boundary") @@ -52,12 +52,13 @@ background_pressure = 1.0 smoothing_length = 0.8 * particle_spacing packing_system = ParticlePackingSystem(shape_sampled; smoothing_length=smoothing_length, - signed_distance_field, tlsph=tlsph, + signed_distance_field, place_on_shell=place_on_shell, background_pressure) boundary_system = ParticlePackingSystem(boundary_sampled; smoothing_length=smoothing_length, is_boundary=true, signed_distance_field, - tlsph=tlsph, boundary_compress_factor=0.8, + place_on_shell=place_on_shell, + boundary_compress_factor=0.8, background_pressure) # ========================================================================================== diff --git a/src/setups/complex_shape.jl b/src/setups/complex_shape.jl index efa9db78fe..594b3b4f37 100644 --- a/src/setups/complex_shape.jl +++ b/src/setups/complex_shape.jl @@ -89,7 +89,7 @@ of the geometry. # Keywords - `boundary_thickness`: Thickness of the boundary -- `tlsph` : When `place_on_shell=true`, boundary particles will be placed +- `place_on_shell`: When `place_on_shell=true`, boundary particles will be placed one particle spacing from the surface of the geometry. Otherwise when `place_on_shell=true` (simulating fluid particles), boundary particles will be placed half particle spacing away from the surface. diff --git a/test/systems/packing_system.jl b/test/systems/packing_system.jl index d55afd559a..a068451b6c 100644 --- a/test/systems/packing_system.jl +++ b/test/systems/packing_system.jl @@ -19,7 +19,7 @@ │ neighborhood search: ………………………… GridNeighborhoodSearch │ │ #particles: ………………………………………………… 307 │ │ smoothing kernel: ………………………………… SchoenbergQuinticSplineKernel │ - │ tlsph: ……………………………………………………………… no │ + │ place_on_shell: ……………………………………………………………… no │ │ boundary: ……………………………………………………… no │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" @test repr("text/plain", system) == show_box @@ -36,7 +36,7 @@ │ neighborhood search: ………………………… GridNeighborhoodSearch │ │ #particles: ………………………………………………… 307 │ │ smoothing kernel: ………………………………… SchoenbergQuinticSplineKernel │ - │ tlsph: ……………………………………………………………… no │ + │ place_on_shell: ……………………………………………………………… no │ │ boundary: ……………………………………………………… yes │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" @test repr("text/plain", system) == show_box @@ -52,7 +52,7 @@ │ neighborhood search: ………………………… Nothing │ │ #particles: ………………………………………………… 307 │ │ smoothing kernel: ………………………………… SchoenbergQuinticSplineKernel │ - │ tlsph: ……………………………………………………………… no │ + │ place_on_shell: ……………………………………………………………… no │ │ boundary: ……………………………………………………… no │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" end From 215a126d8e64b6ce2f07b985dea07fc642ae2e20 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Thu, 22 May 2025 10:58:48 +0200 Subject: [PATCH 7/9] fix test --- test/systems/packing_system.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/systems/packing_system.jl b/test/systems/packing_system.jl index a068451b6c..b42e534275 100644 --- a/test/systems/packing_system.jl +++ b/test/systems/packing_system.jl @@ -19,7 +19,7 @@ │ neighborhood search: ………………………… GridNeighborhoodSearch │ │ #particles: ………………………………………………… 307 │ │ smoothing kernel: ………………………………… SchoenbergQuinticSplineKernel │ - │ place_on_shell: ……………………………………………………………… no │ + │ place_on_shell: ……………………………………… no │ │ boundary: ……………………………………………………… no │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" @test repr("text/plain", system) == show_box @@ -36,7 +36,7 @@ │ neighborhood search: ………………………… GridNeighborhoodSearch │ │ #particles: ………………………………………………… 307 │ │ smoothing kernel: ………………………………… SchoenbergQuinticSplineKernel │ - │ place_on_shell: ……………………………………………………………… no │ + │ place_on_shell: ……………………………………… no │ │ boundary: ……………………………………………………… yes │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" @test repr("text/plain", system) == show_box @@ -52,7 +52,7 @@ │ neighborhood search: ………………………… Nothing │ │ #particles: ………………………………………………… 307 │ │ smoothing kernel: ………………………………… SchoenbergQuinticSplineKernel │ - │ place_on_shell: ……………………………………………………………… no │ + │ place_on_shell: ……………………………………… no │ │ boundary: ……………………………………………………… no │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" end From 442f8dfa947f5b0d80cd674ee3942aac536fa689 Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Mon, 26 May 2025 13:28:23 +0200 Subject: [PATCH 8/9] incorporate review comments --- src/general/interpolation.jl | 2 +- src/setups/extrude_geometry.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/general/interpolation.jl b/src/general/interpolation.jl index 21f4929afb..fd9d4494fb 100644 --- a/src/general/interpolation.jl +++ b/src/general/interpolation.jl @@ -192,7 +192,7 @@ function interpolate_plane_2d(min_corner, max_corner, resolution, semi, ref_syst y_range = range(min_corner[2], max_corner[2], length=n_points_per_dimension[2]) # Generate points within the plane. Use `place_on_shell=true` to generate points - # on the shell of the geometry + # on the shell of the geometry. point_coords = rectangular_shape_coords(resolution, n_points_per_dimension, min_corner, place_on_shell=true) diff --git a/src/setups/extrude_geometry.jl b/src/setups/extrude_geometry.jl index 07dbdc2764..6d169762c7 100644 --- a/src/setups/extrude_geometry.jl +++ b/src/setups/extrude_geometry.jl @@ -228,7 +228,7 @@ end function shift_plane_corners(plane_points::NTuple{2}, direction, particle_spacing, place_on_shell) - # With place_on_shell, particles need to be AT the min coordinates and not half a particle + # With `place_on_shell`, particles need to be AT the min coordinates and not half a particle # spacing away from it. (place_on_shell) && (return plane_points) @@ -247,7 +247,7 @@ end function shift_plane_corners(plane_points::NTuple{3}, direction, particle_spacing, place_on_shell) - # With place_on_shell, particles need to be AT the min coordinates and not half a particle + # With `place_on_shell`, particles need to be AT the min coordinates and not half a particle # spacing away from it. (place_on_shell) && (return plane_points) From 59444e2d7c27c6b1ee2f2dbbbec3e0fac81254eb Mon Sep 17 00:00:00 2001 From: Sven Berger Date: Fri, 13 Jun 2025 14:33:39 +0200 Subject: [PATCH 9/9] format --- src/setups/sphere_shape.jl | 1 - 1 file changed, 1 deletion(-) diff --git a/src/setups/sphere_shape.jl b/src/setups/sphere_shape.jl index 80e95c8379..3c6a7466d5 100644 --- a/src/setups/sphere_shape.jl +++ b/src/setups/sphere_shape.jl @@ -92,7 +92,6 @@ function SphereShape(particle_spacing, radius, center_position, density; sphere_type=VoxelSphere(), n_layers=-1, layer_outwards=false, cutout_min=(0.0, 0.0), cutout_max=(0.0, 0.0), place_on_shell=false, velocity=zeros(length(center_position)), mass=nothing, pressure=0) - if particle_spacing < eps() throw(ArgumentError("`particle_spacing` needs to be positive and larger than $(eps())")) end