Skip to content

Commit 9dec9e9

Browse files
Update docs and example files (#64)
* update docs, filenames, and README * cleanup Project.toml for testing. Should make things faster * Apply suggestions from code review Co-authored-by: Patrick Ersing <[email protected]> --------- Co-authored-by: Patrick Ersing <[email protected]>
1 parent c488cbd commit 9dec9e9

File tree

7 files changed

+41
-34
lines changed

7 files changed

+41
-34
lines changed

README.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT)
77
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.15122147.svg)](https://doi.org/10.5281/zenodo.15122147)
88

9-
**TrixiBottomTopography.jl** is a supplementary package to the numerical solvers [Trixi.jl](https://github.com/trixi-framework/Trixi.jl) and [TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl), which enables use of real world geographical data for the bottom topography function of the shallow water equations.
9+
**TrixiBottomTopography.jl** is a supplementary package to the numerical solver [TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl), which enables use of real world geographical data for the bottom topography function of the shallow water equations.
1010

1111
The shallow water equations in one dimension
1212
```math
@@ -59,17 +59,18 @@ be installed in addition to TrixiBottomTopography
5959
julia> using Pkg; Pkg.add("GLMakie")
6060
```
6161

62-
To use TrixiBottomTopography.jl together with the numerical solver framework [Trixi.jl](https://github.com/trixi-framework/Trixi.jl),
63-
you need both Trixi.jl and a relevant time integration sub-package of
62+
To use TrixiBottomTopography.jl together with the numerical solver framework [TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl),
63+
you additionally need both [Trixi.jl](https://github.com/trixi-framework/Trixi.jl)
64+
and a relevant time integration sub-package of
6465
[OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl), e.g.,
6566
for high-order low-storage Runge-Kutta schemes. These can be added
6667
by executing
6768
```julia
68-
julia> using Pkg; Pkg.add(["Trixi", "OrdinaryDiffEqLowStorageRK"])
69+
julia> using Pkg; Pkg.add(["Trixi", "TrixiShallowWater", "OrdinaryDiffEqLowStorageRK"])
6970
```
70-
TrixiBottomTopography.jl can also be used together with
71-
[TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl), a solver suite specifically designed for shallow water flow applications.
72-
An example that combines TrixiBottomTopography.jl with wet/dry transitions and
71+
Two examples that combine TrixiBottomTopography.jl together with TrixiShallowWater.jl
72+
are available in the `examples` folder.
73+
An additional example that combines TrixiBottomTopography.jl with wet/dry transitions and
7374
shock capturing to model a tsunami runup is available as a
7475
[tutorial](https://trixi-framework.github.io/TrixiShallowWater.jl/stable/tutorials/elixir_shallowwater_monai_tsunami/)
7576
in TrixiShallowWater.jl.
@@ -83,7 +84,7 @@ cd TrixiBottomTopography.jl
8384
mkdir run
8485
cd run
8586
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path=".."))' # Install local TrixiBottomTopography.jl clone
86-
julia --project=. -e 'using Pkg; Pkg.add(["GLMakie", "Trixi", "OrdinaryDiffEqLowStorageRK"])' # Install additional packages
87+
julia --project=. -e 'using Pkg; Pkg.add(["GLMakie", "Trixi", "TrixiShallowWater", "OrdinaryDiffEqLowStorageRK"])' # Install additional packages
8788
```
8889
Note that the additional packages are optional and can be omitted.
8990

docs/Project.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
55
OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d"
66
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
77
TrixiBottomTopography = "86af9953-43df-404b-8eaa-d20d82623a82"
8+
TrixiShallowWater = "804cb1fc-5b08-4398-a671-a789bfe091b3"
89

910
[compat]
1011
CairoMakie = "0.13"
1112
Changelog = "1.1"
1213
Documenter = "1.3"
1314
OrdinaryDiffEqLowStorageRK = "1.3"
14-
Trixi = "0.11.12"
15+
Trixi = "0.12"
16+
TrixiShallowWater = "0.2"

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ makedocs(;
106106
"B-spline structure" => "structure.md",
107107
"B-spline function" => "function.md"
108108
],
109-
"Trixi.jl examples" => "trixi_jl_examples.md",
109+
"TrixiShallowWater.jl examples" => "trixishallowwater_jl_examples.md",
110110
"Advanced topics & developers" => ["Development" => "development.md",
111111
"Style guide" => "styleguide.md",
112112
"Testing" => "testing.md"],

docs/src/trixi_jl_examples.md renamed to docs/src/trixishallowwater_jl_examples.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
# Examples with Trixi.jl
1+
# Examples with TrixiShallowWater.jl
22

33
As mentioned in the [Home](https://trixi-framework.github.io/TrixiBottomTopography.jl/stable/)
4-
section of this documentation, TrixiBottomTopography.jl was initially developed as a
5-
supplementary package for the numerical solver [Trixi.jl](https://github.com/trixi-framework/Trixi.jl)
4+
section of this documentation, TrixiBottomTopography.jl was developed as a
5+
supplementary package for the numerical solver suite
6+
[TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl)
67
to enable the user to use real world geographical data for the bottom topography
78
function of the shallow water equations.
8-
TrixiBottomTopography.jl can also be used together with
9-
[TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl)
10-
a solver suite specifically designed for shallow water flow applications.
9+
TrixiShallowWater.jl itself is a spinoff of
10+
[Trixi.jl](https://github.com/trixi-framework/Trixi.jl)
11+
that is specifically designed for shallow water flow applications.
1112
An example that combines TrixiBottomTopography.jl with wet/dry transitions and
1213
shock capturing to model a tsunami runup is available as a
1314
[tutorial](https://trixi-framework.github.io/TrixiShallowWater.jl/stable/tutorials/elixir_shallowwater_monai_tsunami/)
@@ -16,10 +17,10 @@ in TrixiShallowWater.jl.
1617
## One dimensional dam break
1718

1819
In this section, a one dimensional example is presented which uses the functionalities of
19-
TrixiBottomTopography.jl with [Trixi.jl](https://github.com/trixi-framework/Trixi.jl)
20+
TrixiBottomTopography.jl with [TrixiShallowWater.jl](https://github.com/trixi-framework/TrixiShallowWater.jl)
2021
to simulate a dam break problem.
2122

22-
The underlying example file can be found [here](https://github.com/trixi-framework/TrixiBottomTopography.jl/blob/main/examples/trixi_dam_break_1D.jl).
23+
The underlying example file can be found [here](https://github.com/trixi-framework/TrixiBottomTopography.jl/blob/main/examples/trixishallowwater_dam_break_1D.jl).
2324

2425
First, all the necessary packages must be included at the beginning of the file.
2526

@@ -29,6 +30,7 @@ using TrixiBottomTopography
2930
using CairoMakie
3031
using OrdinaryDiffEqLowStorageRK
3132
using Trixi
33+
using TrixiShallowWater
3234
```
3335

3436
- [CairoMakie.jl](https://github.com/JuliaPlots/CairoMakie.jl)
@@ -58,14 +60,14 @@ const spline_struct = CubicBSpline(Rhine_data)
5860
spline_func(x::Float64) = spline_interpolation(spline_struct, x)
5961
```
6062

61-
Now that the B-spline interpolation function is determined, the one dimensional shallow water equations implemented in Trixi.jl can be defined by calling:
63+
Now that the B-spline interpolation function is determined, the one dimensional shallow water equations implemented in TrixiShallowWater.jl can be defined by calling:
6264

6365
```@example trixi1d
6466
# Defining one dimensional shallow water equations
65-
equations = ShallowWaterEquations1D(gravity_constant = 1.0, H0 = 55.0)
67+
equations = ShallowWaterEquations1D(gravity = 1.0, H0 = 55.0)
6668
```
6769

68-
Here the gravity constant has been chosen to be $1.0$, and the background
70+
Here the constant gravititational acceleration has been chosen to be $1.0$, and the background
6971
total water height $H_0$ has been set to $55.0$.
7072

7173
Next, the initial condition for the dam break problem can be defined.
@@ -93,7 +95,7 @@ end
9395

9496
After the initial condition, we can set the boundary conditions.
9597
In this case, a reflective wall condition is chosen, which is already implemented
96-
in Trixi.jl for the one dimensional shallow water equations.
98+
in TrixiShallowWater.jl for the one dimensional shallow water equations.
9799

98100
```@example trixi1d
99101
# Setting initial condition
@@ -105,7 +107,8 @@ boundary_condition = boundary_condition_slip_wall
105107

106108
The upcoming code parts will **not** be covered in full detail.
107109
To get a more profound understanding of the routines, please see the
108-
[Trixi.jl documentation](https://trixi-framework.github.io/TrixiDocumentation/stable/).
110+
[Trixi.jl documentation](https://trixi-framework.github.io/TrixiDocumentation/stable/)
111+
as well as the [TrixiShallowWater documentation](https://trixi-framework.github.io/TrixiShallowWater.jl/stable/).
109112

110113
The following code snippet sets up the discontinuous Galerkin spectral element method (DGSEM).
111114
In this solver type, we can specify which flux functions for the surface and volume fluxes
@@ -223,7 +226,7 @@ nothing #hide
223226

224227
## Two dimensional dam break
225228

226-
The underlying example file can be found [here](https://github.com/trixi-framework/TrixiBottomTopography.jl/blob/main/examples/trixi_dam_break_2D.jl).
229+
The underlying example file can be found [here](https://github.com/trixi-framework/TrixiBottomTopography.jl/blob/main/examples/trixishallowwater_dam_break_2D.jl).
227230

228231
The two dimensional example is similar to the one dimensional case.
229232

@@ -235,6 +238,7 @@ using TrixiBottomTopography
235238
using CairoMakie
236239
using OrdinaryDiffEqLowStorageRK
237240
using Trixi
241+
using TrixiShallowWater
238242
239243
Rhine_data = download("https://gist.githubusercontent.com/maxbertrand1996/a30db4dc9f5427c78160321d75a08166/raw/fa53ceb39ac82a6966cbb14e1220656cf7f97c1b/Rhine_data_2D_40.txt")
240244
nothing #hide
@@ -249,10 +253,14 @@ const spline_struct = BicubicBSpline(Rhine_data)
249253
spline_func(x::Float64, y::Float64) = spline_interpolation(spline_struct, x, y)
250254
```
251255

252-
Then the two dimensional shallow water equations are defined, where the gravitational constant has been chosen to be `3.0` and the initial water height `55.0`. Afterwards, the initial condition is defined. Similar to the one dimensional case, in the center of the domain, a circular part with a diameter of `100.0` is chosen where the initial water height is chosen to be `10.0` units higher.
256+
Then the two dimensional shallow water equations are defined, where the gravitational acceleration
257+
has been chosen to be `9.81` and the initial water height `55.0`.
258+
Afterwards, the initial condition is defined. Similar to the one dimensional case,
259+
in the center of the domain, a circular part with a diameter of `100.0` is chosen
260+
where the initial water height is chosen to be `10.0` units higher.
253261

254262
```@example trixi2d
255-
equations = ShallowWaterEquations2D(gravity_constant = 9.81, H0 = 55.0)
263+
equations = ShallowWaterEquations2D(gravity = 9.81, H0 = 55.0)
256264
257265
function initial_condition_wave(x, t, equations::ShallowWaterEquations2D)
258266

examples/trixi_dam_break_1D.jl renamed to examples/trixishallowwater_dam_break_1D.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using TrixiBottomTopography
88
using OrdinaryDiffEqLowStorageRK
99
using Trixi
10+
using TrixiShallowWater
1011

1112
# Download one dimensional Rhine bottom data from gist
1213
root_dir = pkgdir(TrixiBottomTopography)
@@ -18,7 +19,7 @@ spline_struct = CubicBSpline(Rhine_data)
1819
spline_func(x) = spline_interpolation(spline_struct, x)
1920

2021
# Defining one dimensional shallow water equations
21-
equations = ShallowWaterEquations1D(gravity_constant = 1.0, H0 = 55.0)
22+
equations = ShallowWaterEquations1D(gravity = 1.0, H0 = 55.0)
2223

2324
# Defining initial condition for the dam break problem
2425
function initial_condition_dam_break(x, t, equations::ShallowWaterEquations1D)

examples/trixi_dam_break_2D.jl renamed to examples/trixishallowwater_dam_break_2D.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using TrixiBottomTopography
88
using OrdinaryDiffEqLowStorageRK
99
using Trixi
10+
using TrixiShallowWater
1011

1112
# Download two dimensional Rhine bottom data from gist
1213
root_dir = pkgdir(TrixiBottomTopography)
@@ -17,7 +18,7 @@ Rhine_data = Trixi.download("https://gist.githubusercontent.com/maxbertrand1996/
1718
spline_struct = BicubicBSpline(Rhine_data)
1819
spline_func(x, y) = spline_interpolation(spline_struct, x, y)
1920

20-
equations = ShallowWaterEquations2D(gravity_constant = 9.81, H0 = 55.0)
21+
equations = ShallowWaterEquations2D(gravity = 9.81, H0 = 55.0)
2122

2223
function initial_condition_wave(x, t, equations::ShallowWaterEquations2D)
2324
inicenter = SVector(357490.0, 5646519.0)

test/Project.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
[deps]
2-
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
32
Downloads = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
4-
OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d"
53
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
6-
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
74

85
[compat]
9-
CairoMakie = "0.12, 0.13"
106
Downloads = "1.6"
11-
OrdinaryDiffEqLowStorageRK = "1.2"
127
Test = "1"
13-
Trixi = "0.11"

0 commit comments

Comments
 (0)