Skip to content

Commit a90414a

Browse files
svchbefaulhaber
andauthored
Update Docs (#1085)
* correct language and general update pass * Clarify GPU support for devices Removed 'Experimental' from GPU support description. * implement suggestions * update with rigid body feature * small h * break line --------- Co-authored-by: Erik Faulhaber <44124897+efaulhaber@users.noreply.github.com>
1 parent f883a8a commit a90414a

12 files changed

Lines changed: 111 additions & 96 deletions

File tree

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,31 @@
1515
<img src="https://github.com/trixi-framework/TrixiParticles.jl/assets/10238714/479ff0c6-3c65-44fe-b3e0-2ed653e7e3a5" alt="TrixiP_logo" width="40%"/>
1616
</p>
1717

18-
**TrixiParticles.jl** is a high-performance numerical simulation framework for particle-based methods, focused on the simulation of complex multiphysics problems, and written in [Julia](https://julialang.org).
18+
**TrixiParticles.jl** is a high-performance numerical simulation framework for particle-based methods in complex multiphysics applications, written in [Julia](https://julialang.org).
19+
It combines an accessible user interface with an extensible architecture for developing new methods, while offering high performance on both CPU and GPU.
1920

2021
TrixiParticles.jl focuses on the following use cases:
21-
- Accurate and efficient physics-based modelling of complex multiphysics problems.
22+
23+
- Accurate and efficient physics-based modeling of complex multiphysics problems.
2224
- Development of new particle-based methods and models.
23-
- Easy setup of accessible simulations for educational purposes, including student projects, coursework, and thesis work.
25+
- Accessible simulation setup for educational purposes, including student projects, coursework, and thesis work.
2426

25-
It offers intuitive configuration, robust pre- and post-processing, and vendor-agnostic GPU-support based on the Julia package [KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl).
27+
It offers intuitive configuration, robust pre- and post-processing, and vendor-agnostic GPU support based on the Julia package [KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl).
2628

2729
[![YouTube](https://github.com/user-attachments/assets/dc2be627-a799-4bfd-9226-2077f737c4b0)](https://www.youtube.com/watch?v=V7FWl4YumcA&t=4667s)
2830

2931
## Features
30-
- Incompressible Navier-Stokes
31-
- Methods: Weakly Compressible Smoothed Particle Hydrodynamics (WCSPH),
32-
Entropically Damped Artificial Compressibility (EDAC),
33-
Implicit Incompressible SPH (IISPH)
32+
- Incompressible Navier-Stokes flows
33+
- Methods: Weakly Compressible Smoothed Particle Hydrodynamics (WCSPH), Entropically Damped Artificial Compressibility (EDAC),
34+
Implicit Incompressible Smoothed Particle Hydrodynamics (IISPH)
3435
- Models: Surface Tension, Open Boundaries
35-
- Solid-body mechanics
36-
- Methods: Total Lagrangian SPH (TLSPH), Discrete Element Method (DEM), Rigid Body Dynamics (RBD)
37-
- Fluid-Structure Interaction
38-
- Particle sampling of complex geometries from `.stl` and `.asc` files.
36+
- Structural mechanics
37+
- Methods: Total Lagrangian SPH (TLSPH), Discrete Element Method (DEM), Rigid Body Dynamics (RBD)
38+
- Fluid-Structure Interaction with elastic structures and rigid bodies
39+
- Particle sampling of complex geometries from `.stl`, `.asc`, and `.dxf` files.
3940
- Output formats:
4041
- VTK
41-
- Support for GPUs by Nvidia, AMD and Apple (experimental)
42+
- GPU support for NVIDIA, AMD, and Apple devices
4243

4344
## Examples
4445
We provide several example simulation setups in the `examples` folder (which can be accessed from Julia via `examples_dir()`).
@@ -68,7 +69,7 @@ We provide several example simulation setups in the `examples` folder (which can
6869

6970

7071
## Installation
71-
If you have not yet installed Julia, please [follow the instructions for your
72+
If you have not installed Julia yet, please [follow the instructions for your
7273
operating system](https://julialang.org/downloads/platform/). TrixiParticles.jl works
7374
with Julia v1.10 and newer. We recommend using the latest stable release of Julia.
7475

@@ -116,7 +117,12 @@ Then start the simulation by executing
116117
julia> trixi_include(joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"))
117118
```
118119

119-
This will open a new window with a 2D visualization of the final solution:
120+
To visualize the result quickly, use Plots.jl:
121+
```julia
122+
julia> using Plots; plot(sol)
123+
```
124+
125+
This opens a new window with a 2D visualization of the final solution:
120126
<img src="https://github.com/trixi-framework/TrixiParticles.jl/assets/44124897/95821154-577d-4323-ba57-16ef02ea24e0" width="400">
121127

122128
Further details can be found in the [documentation](https://trixi-framework.github.io/TrixiParticles.jl/stable).

docs/literate/src/tut_rigid_body_fsi.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,12 +381,12 @@ nothing # hide
381381
# ### Loading Geometries from Files
382382
#
383383
# Instead of using predefined shapes like `RectangularShape` or `SphereShape`, you can load
384-
# custom geometries from external files. For 2D, `TrixiParticles.jl` supports a simple
384+
# custom geometries from external files. For 2D, TrixiParticles.jl supports a simple
385385
# ASCII format with the extension `.asc`.
386386
#
387387
# An `.asc` file should contain a list of 2D coordinates, with x and y values separated by a space,
388388
# and one point per line. The points should form a closed polygon.
389-
# `TrixiParticles.jl` includes some example files in the `examples/preprocessing/data` directory.
389+
# TrixiParticles.jl includes some example files in the `examples/preprocessing/data` directory.
390390
#
391391
# Here is how you can load the `hexagon.asc` file from this directory, create a `ComplexShape` from it,
392392
# and then use it in a simulation.
@@ -432,7 +432,7 @@ nothing # hide
432432
#
433433
# You can find the `.asc` files used in this tutorial and other examples in the
434434
# [`examples/preprocessing/data`](https://github.com/trixi-framework/TrixiParticles.jl/blob/main/examples/preprocessing/data/)
435-
# directory of the `TrixiParticles.jl` repository.
435+
# directory of the TrixiParticles.jl repository.
436436
#
437437
# Some files can be found in examples/preprocessing/data.
438438
# To use them, you can use `pkgdir` as shown above, for example:

docs/make.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ makedocs(sitename="TrixiParticles.jl",
127127
"implicit_incompressible_sph.md")
128128
],
129129
"Discrete Element Method (Solid)" => joinpath("systems", "dem.md"),
130-
"Rigid Body SPH (Rigid Structure)" => joinpath("systems",
131-
"rigid_body.md"),
130+
"Rigid Body Dynamics (Rigid Structure)" => joinpath("systems",
131+
"rigid_body.md"),
132132
"Total Lagrangian SPH (Elastic Structure)" => joinpath("systems",
133133
"total_lagrangian_sph.md"),
134134
"Boundary" => joinpath("systems", "boundary.md")

docs/src/development.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33

44
## Preview of the documentation
55

6-
To generate the Documentation, first instantiate the `docs` environment
7-
by executing the following command from the TrixiParticles.jl root directory:
6+
To build the documentation, first instantiate the `docs` environment by running the
7+
following command from the TrixiParticles.jl root directory:
88
```bash
99
julia --project=docs -e "using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()"
1010
```
11-
This command only has to be run once. After that, maintain the `docs` environment
11+
You only need to run this command once. After that, maintain the `docs` environment
1212
as described under [Installation](@ref installation-issues).
1313

14-
With an instantiated `docs` environment, generate the docs with the following command (again from the TrixiParticles.jl root directory):
14+
Once the `docs` environment is instantiated, build the documentation with the following
15+
command (again from the TrixiParticles.jl root directory):
1516
```bash
1617
julia --project=docs --color=yes docs/make.jl
1718
```
18-
You can then open the generated files in `docs/build` with your webbrowser.
19+
You can then open the generated files in `docs/build` in your web browser.
1920
Alternatively, run
2021
```bash
2122
python3 -m http.server -d docs/build
2223
```
23-
and open `localhost:8000` in your webbrowser.
24+
and open `localhost:8000` in your web browser.
2425

2526

2627
## Release management

docs/src/examples.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<img src="https://github.com/trixi-framework/TrixiParticles.jl/assets/10238714/f9a542bf-956b-4647-843b-94cbb085a4fa" width="60%"/>
4343
```
4444

45-
## Fluid Structure Interaction
45+
## Fluid-Structure Interaction
4646

4747
### Dam Break with Elastic Plate (`fsi/dam_break_plate_2d.jl`)
4848
```@raw html
@@ -59,7 +59,7 @@
5959
<img src="https://github.com/trixi-framework/TrixiParticles.jl/assets/10238714/b3964f68-2782-43e6-b6ff-be96f9f224ae" width="60%"/>
6060
```
6161

62-
## Structure Mechanics
62+
## Structural Mechanics
6363

6464
### Oscillating Beam (`solid/oscillating_beam_2d.jl`)
6565
```@raw html

docs/src/general/neighborhood_search.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
# Neighborhood Search
22

3-
The neighborhood search is the most essential component for performance.
3+
The neighborhood search is one of the most performance-critical components.
44
We provide several implementations in the package
55
[PointNeighbors.jl](https://github.com/trixi-framework/PointNeighbors.jl).
6-
See the docs of this package for an overview and a comparison of different implementations.
6+
See the PointNeighbors.jl documentation for an overview and a comparison of the
7+
different implementations.
78

89
!!! note "Usage"
9-
To run a simulation with a neighborhood search implementation, pass a template of the
10-
neighborhood search to the constructor of the [`Semidiscretization`](@ref).
10+
To run a simulation with a neighborhood search implementation, pass a neighborhood
11+
search template to the constructor of the [`Semidiscretization`](@ref).
1112
A template is just an empty neighborhood search with search radius `0.0`.
1213
See [`copy_neighborhood_search`](@ref) and the examples below for more details.
1314
```jldoctest semi_example; output=false, setup = :(using TrixiParticles; trixi_include(@__MODULE__, joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"), sol=nothing); system1 = fluid_system; system2 = boundary_system)

docs/src/getting_started.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# [Getting started](@id getting_started)
2-
If you have not installed TrixiParticles.jl, please follow the instructions given [here](install.md).
2+
If you have not installed TrixiParticles.jl yet, please follow the instructions in [Installation](@ref installation).
33

4-
In the following sections, we will give a short introduction. For a more thorough discussion, take a look at our [Tutorials](tutorial.md).
4+
This page provides a short introduction. For a broader introduction, take a look at our [Tutorials](tutorial.md).
55

66
## Running an Example
7-
The easiest way to run a simulation is to run one of our predefined example files.
7+
The easiest way to start is to run one of the predefined example files.
88
We will run the file `examples/fluid/hydrostatic_water_column_2d.jl`, which simulates a fluid resting in a rectangular tank.
99
Since TrixiParticles.jl uses multithreading, you should start Julia with the flag `--threads auto` (or, e.g. `--threads 4` for 4 threads).
1010

11-
In the Julia REPL, first load the package TrixiParticles.jl.
11+
In the Julia REPL, first load TrixiParticles.jl.
1212
```jldoctest getting_started
1313
julia> using TrixiParticles
1414
```
@@ -29,27 +29,27 @@ This will open a new window with a 2D visualization of the final solution:
2929
For more information about visualization, see [Visualization](visualization.md).
3030

3131
## Running other Examples
32-
You can find a list of our other predefined examples under [Examples](examples.md).
33-
Execute them as follows from the Julia REPL by replacing `subfolder` and `example_name`
32+
You can find more predefined examples under [Examples](examples.md).
33+
Run them from the Julia REPL by replacing `subfolder` and `example_name`:
3434
```julia
3535
julia> trixi_include(joinpath(examples_dir(), "subfolder", "example_name.jl"))
3636
```
3737

3838
## Modifying an example
3939
You can pass keyword arguments to the function `trixi_include` to overwrite assignments in the file.
4040

41-
With `trixi_include`, we can overwrite variables defined in the example file to run a different simulation without modifying the example file.
41+
With `trixi_include`, we can overwrite variables defined in the example file to run a different simulation without modifying the file itself.
4242
```jldoctest getting_started; filter = r".*"s
4343
julia> trixi_include(joinpath(examples_dir(), "fluid", "hydrostatic_water_column_2d.jl"), initial_fluid_size=(1.0, 0.5))
4444
```
45-
This for example, will change the fluid size from ``(0.9, 1.0)`` to ``(1.0, 0.5)``.
45+
This, for example, changes the fluid size from ``(0.9, 1.0)`` to ``(1.0, 0.5)``.
4646

47-
To understand why, take a look into the file `hydrostatic_water_column_2d.jl` in the subfolder `fluid` inside the examples directory, which is the file that we executed earlier.
47+
To understand why, take a look at the file `hydrostatic_water_column_2d.jl` in the `fluid` subdirectory of the examples directory, which is the file we executed earlier.
4848
You can see that the initial size of the fluid is defined in the variable `initial_fluid_size`, which we could overwrite with the `trixi_include` call above.
4949
Another variable that is worth experimenting with is `fluid_particle_spacing`, which controls the resolution of the simulation in this case.
5050
A lower value will increase the resolution and the runtime.
5151

52-
## Set up you first simulation from scratch
52+
## Set Up Your First Simulation from Scratch
5353
See [Set up your first simulation](tutorials/tut_setup.md).
5454

55-
Find an overview over the available tutorials under [Tutorials](tutorial.md).
55+
An overview of the available tutorials is available under [Tutorials](tutorial.md).

docs/src/gpu.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
# [GPU Support](@id gpu_support)
22

3-
GPU support is still an experimental feature that is actively being worked on.
43
Currently, the [`WeaklyCompressibleSPHSystem`](@ref), [`TotalLagrangianSPHSystem`](@ref)
54
and [`WallBoundarySystem`](@ref) support GPU execution.
6-
We have tested GPU support on Nvidia, AMD and Apple GPUs.
5+
We have tested GPU support on NVIDIA, AMD, and Apple GPUs.
76
Note that most Apple GPUs do not support `Float64`.
87
See [below on how to run single precision simulations](@ref single_precision).
98

@@ -42,14 +41,14 @@ semi = Semidiscretization(fluid_system, boundary_system,
4241
└──────────────────────────────────────────────────────────────────────────────────────────────────┘
4342
```
4443

45-
At this point, we should run the simulation and make sure that it still works and that
46-
the bounding box is large enough.
44+
At this point, run the simulation and make sure that it still works and that the
45+
bounding box is large enough.
4746
For some simulations where particles move outside the initial tank coordinates,
4847
for example when the tank is not closed or when the tank is moving, an appropriate
4948
bounding box has to be specified.
5049

51-
Then, we only need to specify the parallelization backend that is used for the simulation.
52-
On an Nvidia GPU, we specify:
50+
Then, we only need to specify the parallelization backend used for the simulation.
51+
On an NVIDIA GPU, we specify:
5352
```julia
5453
using CUDA
5554
semi = Semidiscretization(fluid_system, boundary_system,
@@ -65,7 +64,7 @@ semi = Semidiscretization(fluid_system, boundary_system,
6564
```
6665
Now, we can run the simulation as usual.
6766
All data is transferred to the GPU during initialization and all loops over particles
68-
and their neighbors will be executed on the GPU as kernels generated by KernelAbstractions.jl.
67+
and their neighbors are executed on the GPU as kernels generated by KernelAbstractions.jl.
6968
Data is only copied to the CPU for saving VTK files via the [`SolutionSavingCallback`](@ref).
7069

7170
## Run an existing example file on the GPU
@@ -84,7 +83,7 @@ Note that in `examples/fluid/dam_break_2d.jl`, we explicitly set
8483
so that we can use `trixi_include` to replace this value.
8584

8685
To run this simulation on a GPU, simply update `parallelization_backend` to the backend
87-
of the installed GPU. We can run this simulation on an Nvidia GPU as follows.
86+
of the installed GPU. We can run this simulation on an NVIDIA GPU as follows.
8887
```julia
8988
using CUDA
9089
trixi_include(joinpath(examples_dir(), "fluid", "dam_break_2d_gpu.jl"), parallelization_backend=CUDABackend())
@@ -94,7 +93,7 @@ For AMD GPUs, use
9493
using AMDGPU
9594
trixi_include(joinpath(examples_dir(), "fluid", "dam_break_2d_gpu.jl"), parallelization_backend=ROCBackend())
9695
```
97-
For Apple GPUs (which don't support double precision, see below), use
96+
For Apple GPUs (which do not support double precision, see below), use
9897
```julia
9998
using Metal
10099
trixi_include_changeprecision(Float32,
@@ -110,7 +109,7 @@ which is significantly faster on most GPUs and required for many Apple GPUs.
110109

111110
To run a simulation with single precision, all `Float64` literals in an example file
112111
must be converted to `Float32` (e.g. `0.0` to `0.0f0`).
113-
TrixiParticles provides a function to automate this conversion:
112+
TrixiParticles.jl provides a function to automate this conversion:
114113
```@docs
115114
trixi_include_changeprecision
116115
```

0 commit comments

Comments
 (0)