Skip to content

Commit

Permalink
Merge branch 'main' into particle-refinement-prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
LasNikas committed Nov 14, 2024
2 parents 0974472 + 4b7f515 commit 364dd0f
Show file tree
Hide file tree
Showing 36 changed files with 198 additions and 194 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
#
# julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version = "0.13.0"))'
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.45"))'
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.62"))'
julia -e 'using JuliaFormatter; format(".")'
- name: Format check
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/typos@v1.25.0
uses: crate-ci/typos@v1.26.8
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ git clone git@github.com:trixi-framework/TrixiParticles.jl.git
cd TrixiParticles.jl
mkdir run
julia --project=run -e 'using Pkg; Pkg.develop(PackageSpec(path="."))' # Add TrixiParticles.jl to `run` project
julia --project=run -e 'using Pkg; Pkg.add("OrdinaryDiffEq", "Plots")' # Add additional packages
julia --project=run -e 'using Pkg; Pkg.add(["OrdinaryDiffEq", "Plots"])' # Add additional packages
```

If you installed TrixiParticles.jl this way, you always have to start Julia with the
Expand Down
10 changes: 5 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ makedocs(sitename="TrixiParticles.jl",
"Examples" => "examples.md",
"Visualization" => "visualization.md",
"Preprocessing" => [
"Sampling of Geometries" => joinpath("preprocessing", "preprocessing.md"),
"Sampling of Geometries" => joinpath("preprocessing", "preprocessing.md")
],
"Components" => [
"Overview" => "overview.md",
Expand All @@ -127,7 +127,7 @@ makedocs(sitename="TrixiParticles.jl",
"Density Calculators" => joinpath("general", "density_calculators.md"),
"Smoothing Kernels" => joinpath("general", "smoothing_kernels.md"),
"Neighborhood Search" => joinpath("general", "neighborhood_search.md"),
"Util" => joinpath("general", "util.md"),
"Util" => joinpath("general", "util.md")
],
"Systems" => [
"Discrete Element Method (Solid)" => joinpath("systems",
Expand All @@ -138,18 +138,18 @@ makedocs(sitename="TrixiParticles.jl",
"entropically_damped_sph.md"),
"Total Lagrangian SPH (Elastic Structure)" => joinpath("systems",
"total_lagrangian_sph.md"),
"Boundary" => joinpath("systems", "boundary.md"),
"Boundary" => joinpath("systems", "boundary.md")
],
"Time Integration" => "time_integration.md",
"Callbacks" => "callbacks.md",
"TrixiBase.jl API Reference" => "reference-trixibase.md",
"PointNeighbors.jl API Reference" => "reference-pointneighbors.md",
"PointNeighbors.jl API Reference" => "reference-pointneighbors.md"
],
"Authors" => "authors.md",
"Contributing" => "contributing.md",
"Code of Conduct" => "code_of_conduct.md",
"License" => "license.md",
"References" => "references.md",
"References" => "references.md"
])

deploydocs(repo="github.com/trixi-framework/TrixiParticles.jl",
Expand Down
2 changes: 1 addition & 1 deletion docs/src/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ git clone git@github.com:trixi-framework/TrixiParticles.jl.git
cd TrixiParticles.jl
mkdir run
julia --project=run -e 'using Pkg; Pkg.develop(PackageSpec(path="."))' # Add TrixiParticles.jl to `run` project
julia --project=run -e 'using Pkg; Pkg.add("OrdinaryDiffEq", "Plots")' # Add additional packages
julia --project=run -e 'using Pkg; Pkg.add(["OrdinaryDiffEq", "Plots"])' # Add additional packages
```

If you installed TrixiParticles.jl this way, you always have to start Julia with the
Expand Down
8 changes: 6 additions & 2 deletions docs/src/visualization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ Follow these steps to view the exported VTK files in ParaView:
5. Hold the left mouse button to move the solution around.

You will now see the following:
![image](https://github.com/svchb/TrixiParticles.jl/assets/10238714/45c90fd2-984b-4eee-b130-e691cefb33ab)
![image](https://github.com/user-attachments/assets/383d323a-3020-4232-9dc3-682b0afe8653)

It is useful to make the particles larger.
For this, **first** make sure you have "fluid_1.pvd" highlighted in the "Pipeline Browser" then in the "Properties" window in the bottom left change "Point Size" to a larger value.
![image](https://github.com/user-attachments/assets/6e975d2c-82ed-4d53-936b-bb0beafaf515)

To now view the result variables **first** make sure you have "fluid_1.pvd" highlighted in the "Pipeline Browser" then select them in the variable selection combo box (see picture below).
Let's, for example, pick "density". To now view the time progression of the result hit the "play button" (see picture below).
![image](https://github.com/svchb/TrixiParticles.jl/assets/10238714/7565a13f-9532-4a69-9f81-e79505400b1c)
![image](https://github.com/user-attachments/assets/10dcf7eb-5808-4d4d-9db8-4beb25b5e51a)

## API

Expand Down
2 changes: 1 addition & 1 deletion examples/n_body/n_body_benchmark_trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ velocity = [0.0 1.66007664274403694e-3 -2.76742510726862411e-3 2.964601375647616

masses = [
1.0, 9.54791938424326609e-4, 2.85885980666130812e-4, 4.36624404335156298e-5,
5.15138902046611451e-5,
5.15138902046611451e-5
] * SOLAR_MASS

# Offset sun momentum
Expand Down
2 changes: 1 addition & 1 deletion examples/n_body/n_body_solar_system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ velocity = [-1.4663 -1.5205e+04 -3.4770e+04 2.9288e+04 2.4533e+04 -1.0724e+03 8.
4.8370 2.5180e+04 -316.8994 -172.5873 -1.9295e+03 -4.8696e+03 -1.3824e+03 2.4527e+03 1.9082e+03]

masses = [
1.99e30, 3.30e23, 4.87e24, 5.97e24, 6.42e23, 1.90e27, 5.68e26, 8.68e25, 1.02e26,
1.99e30, 3.30e23, 4.87e24, 5.97e24, 6.42e23, 1.90e27, 5.68e26, 8.68e25, 1.02e26
]

initial_condition = InitialCondition(; coordinates, velocity, density=1.0, mass=masses)
Expand Down
2 changes: 1 addition & 1 deletion examples/postprocessing/interpolation_point_line.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ println(interpolate_point([
[position_x, 0.1],
[position_x, 0.0],
[position_x, -0.01],
[position_x, -0.05],
[position_x, -0.05]
], semi, fluid_system, sol))

# It is also possible to interpolate along a line
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks/density_reinit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Base.show(io::IO, ::MIME"text/plain",
callback = cb.affect!
setup = [
"interval" => callback.interval,
"reinit_initial_solution" => callback.reinit_initial_solution,
"reinit_initial_solution" => callback.reinit_initial_solution
]
summary_box(io, "DensityReinitializationCallback", setup)
end
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks/info.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function Base.show(io::IO, ::MIME"text/plain", cb::DiscreteCallback{<:Any, <:Inf
callback = cb.affect!

setup = [
"interval" => callback.interval,
"interval" => callback.interval
]
summary_box(io, "InfoCallback", setup)
end
Expand Down
4 changes: 2 additions & 2 deletions src/callbacks/post_process.jl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ function Base.show(io::IO, ::MIME"text/plain",
"output directory" => callback.output_directory,
"append timestamp" => callback.append_timestamp ? "yes" : "no",
"write json file" => callback.write_csv ? "yes" : "no",
"write csv file" => callback.write_json ? "yes" : "no",
"write csv file" => callback.write_json ? "yes" : "no"
]

for (i, key) in enumerate(keys(callback.func))
Expand Down Expand Up @@ -193,7 +193,7 @@ function Base.show(io::IO, ::MIME"text/plain",
"output directory" => callback.output_directory,
"append timestamp" => callback.append_timestamp ? "yes" : "no",
"write json file" => callback.write_csv ? "yes" : "no",
"write csv file" => callback.write_json ? "yes" : "no",
"write csv file" => callback.write_json ? "yes" : "no"
]

for (i, key) in enumerate(keys(callback.func))
Expand Down
6 changes: 3 additions & 3 deletions src/callbacks/solution_saving.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function Base.show(io::IO, ::MIME"text/plain",
"save final solution" => solution_saving.save_final_solution ? "yes" :
"no",
"output directory" => abspath(solution_saving.output_directory),
"prefix" => solution_saving.prefix,
"prefix" => solution_saving.prefix
]
summary_box(io, "SolutionSavingCallback", setup)
end
Expand All @@ -275,7 +275,7 @@ function Base.show(io::IO, ::MIME"text/plain",
"save final solution" => solution_saving.save_final_solution ? "yes" :
"no",
"output directory" => abspath(solution_saving.output_directory),
"prefix" => solution_saving.prefix,
"prefix" => solution_saving.prefix
]
summary_box(io, "SolutionSavingCallback", setup)
end
Expand All @@ -300,7 +300,7 @@ function Base.show(io::IO, ::MIME"text/plain",
"save final solution" => solution_saving.save_final_solution ? "yes" :
"no",
"output directory" => abspath(solution_saving.output_directory),
"prefix" => solution_saving.prefix,
"prefix" => solution_saving.prefix
]
summary_box(io, "SolutionSavingCallback", setup)
end
Expand Down
2 changes: 1 addition & 1 deletion src/callbacks/stepsize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function Base.show(io::IO, ::MIME"text/plain",

setup = [
"is constant" => string(is_constant(stepsize_callback)),
"CFL number" => stepsize_callback.cfl_number,
"CFL number" => stepsize_callback.cfl_number
]
summary_box(io, "StepsizeCallback", setup)
end
Expand Down
4 changes: 2 additions & 2 deletions src/callbacks/update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function Base.show(io::IO, ::MIME"text/plain",
else
update_cb = cb.affect!
setup = [
"interval" => update_cb.interval,
"interval" => update_cb.interval
]
summary_box(io, "UpdateCallback", setup)
end
Expand All @@ -132,7 +132,7 @@ function Base.show(io::IO, ::MIME"text/plain",
else
update_cb = cb.affect!.affect!
setup = [
"dt" => update_cb.interval,
"dt" => update_cb.interval
]
summary_box(io, "UpdateCallback", setup)
end
Expand Down
8 changes: 4 additions & 4 deletions test/examples/dam_break_2d_corrections.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"gradient_summation_correction" => GradientCorrection(),
"mixed_kernel_gradient_summation_correction" => MixedKernelGradientCorrection(),
"gradient_continuity_correction" => GradientCorrection(),
"mixed_kernel_gradient_continuity_correction" => MixedKernelGradientCorrection(),
"mixed_kernel_gradient_continuity_correction" => MixedKernelGradientCorrection()
)

smoothing_length_dict = Dict(
Expand All @@ -29,7 +29,7 @@
"gradient_summation_correction" => 3.5 * particle_spacing,
"mixed_kernel_gradient_summation_correction" => 3.5 * particle_spacing,
"gradient_continuity_correction" => 4.5 * particle_spacing,
"mixed_kernel_gradient_continuity_correction" => 4.0 * particle_spacing,
"mixed_kernel_gradient_continuity_correction" => 4.0 * particle_spacing
)

density_calculator_dict = Dict(
Expand All @@ -43,7 +43,7 @@
"gradient_summation_correction" => SummationDensity(),
"gradient_continuity_correction" => ContinuityDensity(),
"mixed_kernel_gradient_summation_correction" => SummationDensity(),
"mixed_kernel_gradient_continuity_correction" => ContinuityDensity(),
"mixed_kernel_gradient_continuity_correction" => ContinuityDensity()
)

smoothing_kernel_dict = Dict(
Expand All @@ -57,7 +57,7 @@
"gradient_summation_correction" => WendlandC6Kernel{2}(),
"gradient_continuity_correction" => WendlandC6Kernel{2}(),
"mixed_kernel_gradient_summation_correction" => WendlandC6Kernel{2}(),
"mixed_kernel_gradient_continuity_correction" => WendlandC6Kernel{2}(),
"mixed_kernel_gradient_continuity_correction" => WendlandC6Kernel{2}()
)

@testset "continuity_reinit" begin
Expand Down
14 changes: 7 additions & 7 deletions test/examples/examples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
viscosity=ViscosityMorris(nu=0.0015),
density_calculator=ContinuityDensity(),
acceleration=(0.0,
-gravity)),),
-gravity)),)
)

for (test_description, kwargs) in hydrostatic_water_column_tests
Expand Down Expand Up @@ -157,7 +157,7 @@
correction=AkinciFreeSurfaceCorrection(fluid_density),
density_diffusion=nothing,
adhesion_coefficient=0.05,
sound_speed=100.0),
sound_speed=100.0)
)

for (test_description, kwargs) in dam_break_tests
Expand All @@ -170,7 +170,7 @@
"dam_break_2d.jl");
tspan=(0, 0.1), kwargs...) [
r"┌ Info: The desired tank length in y-direction .*\n",
r"└ New tank length in y-direction.*\n",
r"└ New tank length in y-direction.*\n"
]

@test sol.retcode == ReturnCode.Success
Expand All @@ -185,7 +185,7 @@
"dam_break_oil_film_2d.jl"),
tspan=(0.0, 0.05)) [
r"┌ Info: The desired tank length in y-direction .*\n",
r"└ New tank length in y-direction.*\n",
r"└ New tank length in y-direction.*\n"
]
@test sol.retcode == ReturnCode.Success
@test count_rhs_allocations(sol, semi) == 0
Expand Down Expand Up @@ -286,7 +286,7 @@
r"┌ Info: The desired tank length in y-direction .*\n",
r"└ New tank length in y-direction.*\n",
r"┌ Info: The desired tank length in z-direction .*\n",
r"└ New tank length in z-direction.*\n",
r"└ New tank length in z-direction.*\n"
]
@test sol.retcode == ReturnCode.Success
@test count_rhs_allocations(sol, semi) == 0
Expand Down Expand Up @@ -375,7 +375,7 @@
@test_nowarn_mod trixi_include(@__MODULE__,
joinpath(examples_dir(), "n_body",
"n_body_benchmark_trixi.jl")) [
r"WARNING: Method definition interact!.*\n",
r"WARNING: Method definition interact!.*\n"
]
end

Expand All @@ -402,7 +402,7 @@
r"WARNING: using deprecated binding PlotUtils.*\n",
r"WARNING: Makie.* is deprecated.*\n",
r" likely near none:1\n",
r", use .* instead.\n",
r", use .* instead.\n"
]
@test sol.retcode == ReturnCode.Success
end
Expand Down
Loading

0 comments on commit 364dd0f

Please sign in to comment.