Skip to content

Commit 3a8c3fe

Browse files
author
LasNikas
committed
implement suggestions
1 parent faa652c commit 3a8c3fe

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

docs/literate/src/tut_packing.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ sdf_ic = InitialCondition(; coordinates=stack(signed_distance_field.positions),
5353

5454
plot(sdf_ic, zcolor=signed_distance_field.distances, label=nothing, color=:coolwarm)
5555
plot!(geometry, linestyle=:dash, label=nothing, showaxis=false, color=:black,
56-
seriestype=:path)
56+
seriestype=:path, linewidth=2)
5757
plot!(right_margin=5Plots.mm) #hide
5858

5959
# Since we will later also pack boundary particles, we need to extend the SDF to the outside.
@@ -69,7 +69,7 @@ sdf_ic = InitialCondition(; coordinates=stack(signed_distance_field.positions),
6969
plot(sdf_ic, zcolor=signed_distance_field.distances, label=nothing, color=:coolwarm)
7070

7171
plot!(geometry, linestyle=:dash, label=nothing, showaxis=false, color=:black,
72-
seriestype=:path)
72+
seriestype=:path, linewidth=2)
7373
plot!(right_margin=5Plots.mm) #hide
7474

7575
# ## Creating an initial configuration of boundary particles
@@ -87,7 +87,7 @@ boundary_sampled = sample_boundary(signed_distance_field; boundary_density=densi
8787
## Plotting the initial configuration of the boundary particles
8888
plot(boundary_sampled, label=nothing)
8989
plot!(geometry, linestyle=:dash, label=nothing, showaxis=false, color=:black,
90-
seriestype=:path)
90+
seriestype=:path, linewidth=2)
9191

9292
# ## Creating an initial configuration of interior particles
9393

@@ -116,16 +116,15 @@ shape_sampled.mass .= density * TrixiParticles.volume(geometry) / nparticles(sha
116116
# together with the boundary particles.
117117
plot(shape_sampled, boundary_sampled, label=nothing)
118118
plot!(geometry, linestyle=:dash, label=nothing, showaxis=false, color=:black,
119-
seriestype=:path)
119+
seriestype=:path, linewidth=2)
120120

121121
# As shown in the plot, the interface of the geometry surface is not well resolved yet.
122122
# In other words, there is no body-fitted configuration.
123123
# This is where the particle packing will come into play.
124124

125125
# ## Particle packing
126126

127-
# In the following, we will essentially follow the same steps described in
128-
# "Setting up your simulation from scratch" (TODO: ref).
127+
# In the following, we will essentially follow the same steps described in the fluid tutorials.
129128
# That means we will generate systems that are then passed to the [`Semidiscretization`](@ref Semidiscretization).
130129
# The difference from a typical physical simulation is that we use [`ParticlePackingSystem`](@ref ParticlePackingSystem),
131130
# which does not represent any physical law. Instead, we only use the simulation framework to time-integrate
@@ -153,7 +152,7 @@ packing_system = ParticlePackingSystem(shape_sampled;
153152
signed_distance_field=nothing, background_pressure)
154153

155154
# We now proceed with the familiar steps
156-
# "Semidiscretization" and "Time integration" from the tutorial (TODO: ref)
155+
# "Semidiscretization" and "Time integration" from the fluid tutorials.
157156
semi = Semidiscretization(packing_system)
158157

159158
## Use a high `tspan` to guarantee that the simulation runs for at least `maxiters`
@@ -201,7 +200,7 @@ packed_ic = InitialCondition(sol, packing_system, semi)
201200

202201
## Plotting the final configuration
203202
plot(packed_ic)
204-
plot!(geometry, seriestype=:path, color=:black, label=nothing)
203+
plot!(geometry, seriestype=:path, color=:black, label=nothing, linewidth=2)
205204

206205
# We can see that the particles now stay inside the geometry,
207206
# but their distribution near the surface can still be improved by adding boundary particles [neher2025robustefficientpreprocessingtechniques](@cite).
@@ -241,7 +240,7 @@ packed_boundary_ic = InitialCondition(sol, boundary_system, semi)
241240

242241
## Plotting the final configuration
243242
plot(packed_ic, packed_boundary_ic)
244-
plot!(geometry, seriestype=:path, color=:black, linestyle=:dash, label=nothing)
243+
plot!(geometry, seriestype=:path, color=:black, linestyle=:dash, linewidth=2, label=nothing)
245244

246245
# ## Multi-body packing
247246

0 commit comments

Comments
 (0)