Skip to content

Commit 892dd3a

Browse files
committed
Merge branch 'refactor_update' into more_semi_refactor
2 parents 4d8c5a7 + 08c1e03 commit 892dd3a

File tree

125 files changed

+16707
-1614
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+16707
-1614
lines changed

.buildkite/pipeline.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ steps:
22
- label: "CUDA"
33
plugins:
44
- JuliaCI/julia#v1:
5-
version: "1.11"
5+
version: "1.12"
66
agents:
77
queue: "juliagpu"
88
cuda: "*"
@@ -16,7 +16,7 @@ steps:
1616
- label: "AMDGPU"
1717
plugins:
1818
- JuliaCI/julia#v1:
19-
version: "1.11"
19+
version: "1.12"
2020
agents:
2121
queue: "juliagpu"
2222
rocm: "*"
@@ -30,7 +30,7 @@ steps:
3030
- label: "Metal"
3131
plugins:
3232
- JuliaCI/julia#v1:
33-
version: "1.11"
33+
version: "1.12"
3434
agents:
3535
queue: "juliaecosystem"
3636
os: "macos"

.github/workflows/Documenter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
version: '1'
3939
show-versioninfo: true
40-
- uses: julia-actions/cache@v2
40+
- uses: julia-actions/cache@v3
4141
- name: Build package
4242
uses: julia-actions/julia-buildpkg@v1
4343
- name: Install dependencies

.github/workflows/FormatCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
with:
2020
version: '1'
2121
- run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)'
22-
- uses: julia-actions/cache@v2
22+
- uses: julia-actions/cache@v3
2323
- name: Install JuliaFormatter and format
2424
# This will use the latest version by default but you can set the version like so:
2525
#

.github/workflows/SpellCheck.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@ jobs:
1010
- name: Checkout Actions Repository
1111
uses: actions/checkout@v6
1212
- name: Check spelling
13-
uses: crate-ci/typos@v1.41.0
13+
uses: crate-ci/typos@v1.44.0

.github/workflows/ci.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
version:
4545
- '1.10'
4646
- '1.11'
47+
- '1.12'
4748
os:
4849
- ubuntu-latest
4950
include:
@@ -53,9 +54,9 @@ jobs:
5354
os: windows-latest
5455
- version: '1.10'
5556
os: macos-14
56-
- version: '1.11'
57+
- version: '1.12'
5758
os: windows-latest
58-
- version: '1.11'
59+
- version: '1.12'
5960
os: macos-14
6061

6162
steps:
@@ -70,7 +71,7 @@ jobs:
7071
- name: Display Julia version
7172
run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)'
7273

73-
- uses: julia-actions/cache@v2
74+
- uses: julia-actions/cache@v3
7475

7576
- name: Build package
7677
uses: julia-actions/julia-buildpkg@v1
@@ -94,7 +95,7 @@ jobs:
9495
- name: Upload unit coverage report to Codecov
9596
# Only run coverage in one Job (Ubuntu and latest Julia version)
9697
if: matrix.os == 'ubuntu-latest' && matrix.version == '1.11'
97-
uses: codecov/codecov-action@v5
98+
uses: codecov/codecov-action@v6
9899
with:
99100
files: lcov.info
100101
fail_ci_if_error: true
@@ -121,7 +122,7 @@ jobs:
121122
- name: Upload total coverage report to Codecov
122123
# Only run coverage in one Job (Ubuntu and latest Julia version)
123124
if: matrix.os == 'ubuntu-latest' && matrix.version == '1.11'
124-
uses: codecov/codecov-action@v5
125+
uses: codecov/codecov-action@v6
125126
with:
126127
files: lcov.info
127128
fail_ci_if_error: true

NEWS.md

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,30 @@ used in the Julia ecosystem. Notable changes will be documented in this file for
66

77
## Version 0.4.4
88

9+
### API Changes
10+
11+
- Custom quantities called in the `PostprocessCallback` are now passed CPU arrays when
12+
the simulation is run on a GPU (#1065).
13+
914
### Features
1015

11-
- Added `StateEquationAdaptiveCole` an adaptive sound speed version of the Cole state equation (#875)
16+
- Added `StateEquationAdaptiveCole` an adaptive sound speed version of the Cole state equation (#875).
17+
- Added `RigidBodySystem` that supports rigid body dynamics for FSI (#1076).
18+
- Added `RigidContactModel` that supports rigid-wall and rigid-rigid collisions (#1090, #1091).
19+
- Added a specialized neighborhood search for TLSPH self-interaction (#1016).
20+
- Added CFL condition for TLSPH and split integration (#1030).
21+
- Added new validation case hydrostatic water column (#724).
22+
- Added Carreau–Yasuda non-Newtonian viscosity model (#1010).
1223

24+
### Important Bugfixes
25+
26+
- Fixed the periodic array of cylinders example file (#975).
27+
- A `StepsizeCallback` can now be used with open boundaries (#1074).
28+
29+
### Documentation
30+
31+
- Added a new tutorial for rigid body dynamics (#1095).
32+
- Better overview page for tutorials (#1093).
1333

1434
## Version 0.4.3
1535

@@ -34,7 +54,7 @@ used in the Julia ecosystem. Notable changes will be documented in this file for
3454

3555
- Added GPU and FP32 support for DEM (#979).
3656

37-
57+
3858
### Performance
3959
- Improved GPU performance with shifting up to a factor of 10x (#974, #993).
4060

@@ -360,5 +380,3 @@ Features:
360380
#### TLSPH
361381

362382
An implementation of TLSPH (Total Lagrangian Smoothed Particle Hydrodynamics) for solid bodies enabling FSI (Fluid Structure Interactions).
363-
364-

Project.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
name = "TrixiParticles"
22
uuid = "66699cd8-9c01-4e9d-a059-b96c86d16b3a"
3-
version = "0.4.4-dev"
3+
version = "0.4.5-dev"
44
authors = ["erik.faulhaber <44124897+efaulhaber@users.noreply.github.com>"]
55

66
[deps]
7+
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
78
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
89
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
910
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
@@ -17,7 +18,6 @@ GPUArraysCore = "46192b85-c4d5-4398-a991-12ede77f4527"
1718
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
1819
KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
1920
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
20-
MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
2121
PointNeighbors = "1c4d5385-0a27-49de-8e2c-43b175c8985c"
2222
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588"
2323
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
@@ -36,13 +36,17 @@ WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"
3636
[weakdeps]
3737
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
3838
OrdinaryDiffEqCore = "bbf590c4-e513-4bbe-9b18-05decba2e5d8"
39+
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
3940

4041
[extensions]
4142
TrixiParticlesOrdinaryDiffEqExt = ["OrdinaryDiffEq", "OrdinaryDiffEqCore"]
43+
TrixiParticlesCUDAExt = "CUDA"
4244

4345
[compat]
46+
Accessors = "0.1.43"
4447
Adapt = "4"
4548
CSV = "0.10"
49+
CUDA = "5.9.1"
4650
DataFrames = "1.6"
4751
DelimitedFiles = "1"
4852
DiffEqCallbacks = "4"
@@ -52,9 +56,8 @@ ForwardDiff = "1"
5256
GPUArraysCore = "0.2"
5357
JSON = "1"
5458
KernelAbstractions = "0.9"
55-
MuladdMacro = "0.2"
5659
OrdinaryDiffEq = "6.91"
57-
OrdinaryDiffEqCore = "2"
60+
OrdinaryDiffEqCore = "2, 3"
5861
PointNeighbors = "0.6.5"
5962
Polyester = "0.7.10"
6063
ReadVTK = "0.2"

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ It offers intuitive configuration, robust pre- and post-processing, and vendor-a
3333
Implicit Incompressible SPH (IISPH)
3434
- Models: Surface Tension, Open Boundaries
3535
- Solid-body mechanics
36-
- Methods: Total Lagrangian SPH (TLSPH), Discrete Element Method (DEM)
36+
- Methods: Total Lagrangian SPH (TLSPH), Discrete Element Method (DEM), Rigid Body Dynamics (RBD)
3737
- Fluid-Structure Interaction
3838
- Particle sampling of complex geometries from `.stl` and `.asc` files.
3939
- Output formats:
@@ -178,7 +178,9 @@ or [create an issue](https://github.com/trixi-framework/TrixiParticles.jl/issues
178178
## Acknowledgments
179179
<p align="center">
180180
<img align="middle" src="https://github.com/trixi-framework/TrixiParticles.jl/assets/44124897/05132bf1-180f-4228-b30a-37dfb6e36ed5" width=20%/>&nbsp;&nbsp;&nbsp;
181-
<img align="middle" src="https://github.com/trixi-framework/TrixiParticles.jl/assets/44124897/ae2a91d1-7c10-4e0f-8b92-6ed1c43ddc28" width=20%/>&nbsp;&nbsp;&nbsp;
181+
<img align="middle" src="https://github.com/user-attachments/assets/480ceabe-b44c-4dc2-a4ce-d99ba49767f4" width=20%/>&nbsp;&nbsp;&nbsp;
182+
<img align="middle" src="https://github.com/user-attachments/assets/80e897bd-c3fc-4bfc-aafb-a6d5810e0206" width=20%/>&nbsp;&nbsp;&nbsp;
182183
</p>
183184

184-
The project has benefited from funding from [hereon](https://www.hereon.de/) and [HiRSE](https://www.helmholtz-hirse.de/).
185+
The project has benefited from funding from [hereon](https://www.hereon.de/), [HiRSE](https://www.helmholtz-hirse.de/), and through [ScienceServe](https://www.helmholtz.de/en/research/current-calls-for-applications/article/scienceserve-boosting-research-software-at-helmholtz/) for the MATRIX project.
186+

docs/literate/src/tut_custom_kernel.jl

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -60,29 +60,30 @@ struct MyGaussianKernel <: TrixiParticles.AbstractSmoothingKernel{2} end
6060

6161
# By looking at the implementation of existing kernels in TrixiParticles.jl,
6262
# we can see that a kernel implementation requires three functions.
63-
# `TrixiParticles.kernel`, which is the kernel function itself,
64-
# `TrixiParticles.kernel_deriv`, which is the derivative of the kernel function,
65-
# and `TrixiParticles.compact_support`, which defines the compact support of the
66-
# kernel in relation to the smoothing length.
63+
# `TrixiParticles.kernel_unsafe`, which is the kernel function itself,
64+
# `TrixiParticles.kernel_deriv_div_r_unsafe`, which is the derivative of the
65+
# kernel divided by ``r``, and `TrixiParticles.compact_support`, which defines
66+
# the compact support of the kernel in relation to the smoothing length.
6767
# The latter is relevant for determining the search radius of the neighborhood search.
68-
function TrixiParticles.kernel(kernel::MyGaussianKernel, r, h)
68+
#
69+
# We implement `kernel_deriv_div_r_unsafe` instead of `kernel_deriv` directly since
70+
# this avoids an extra division in the hot loop and is robust near ``r=0``.
71+
# The public function `TrixiParticles.kernel_deriv` is defined automatically by
72+
# TrixiParticles from this method (and multiplies by ``r`` again when needed).
73+
# In the unsafe functions, we do not check the compact support; this is handled in the
74+
# safe wrappers `TrixiParticles.kernel` and `TrixiParticles.kernel_deriv` based on the
75+
# compact support defined in `TrixiParticles.compact_support`.
76+
function TrixiParticles.kernel_unsafe(kernel::MyGaussianKernel, r::Real, h)
6977
q = r / h
7078

71-
if q < 2
72-
return 1 / (pi * h^2) * exp(-q^2)
73-
end
74-
75-
return 0.0
79+
return 1 / (pi * h^2) * exp(-q^2)
7680
end
7781

78-
function TrixiParticles.kernel_deriv(kernel::MyGaussianKernel, r, h)
82+
function TrixiParticles.kernel_deriv_div_r_unsafe(kernel::MyGaussianKernel, r::Real, h)
7983
q = r / h
8084

81-
if q < 2
82-
return 1 / (pi * h^2) * (-2 * q) * exp(-q^2) / h
83-
end
84-
85-
return 0.0
85+
kernel_deriv = 1 / (pi * h^2) * (-2 * q) * exp(-q^2) / h
86+
return kernel_deriv / r
8687
end
8788

8889
TrixiParticles.compact_support(::MyGaussianKernel, h) = 2 * h

docs/literate/src/tut_packing.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ plot!(geometry, linestyle=:dash, label=nothing, showaxis=false, color=:black,
125125
# ## Particle packing
126126

127127
# In the following, we will essentially follow the same steps described in the fluid tutorials.
128-
# That means we will generate systems that are then passed to the [`Semidiscretization`](@ref Semidiscretization).
129-
# The difference from a typical physical simulation is that we use [`ParticlePackingSystem`](@ref ParticlePackingSystem),
128+
# That means we will generate systems that are then passed to the [`Semidiscretization`](@ref).
129+
# The difference from a typical physical simulation is that we use [`ParticlePackingSystem`](@ref),
130130
# which does not represent any physical law. Instead, we only use the simulation framework to time-integrate
131131
# the packing process.
132132

0 commit comments

Comments
 (0)