Skip to content

Commit fb08e19

Browse files
committed
fix some markdown linting issues found by VSCode
1 parent ede92b1 commit fb08e19

File tree

6 files changed

+21
-16
lines changed

6 files changed

+21
-16
lines changed

docs/src/basic_example.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ Lastly, we define the physical domain as the interval from -130 to 20 and we cho
7272

7373
## Define numerical solver
7474

75-
In the next step, we build a [`Semidiscretization`](@ref) that bundles all ingredients for the spatial discretization of the model. Especially, we need to define a [`Solver`](@ref).
75+
In the next step, we build a [`Semidiscretization`](@ref) that bundles all ingredients for the spatial discretization of the model. Especially, we need to define a [`Solver`](@ref).
7676

7777
The simplest way to define a solver when working with [`boundary_condition_periodic`](@ref) is to call the constructor by providing the mesh and a desired order of accuracy.
7878

79-
In the following example, we use an accuracy order of 4. The default constructor simply creates periodic first-, second-, and third-derivative central finite difference summation-by-parts (SBP) operators of the provided order of accuracy.
79+
In the following example, we use an accuracy order of 4. The default constructor simply creates periodic first-, second-, and third-derivative central finite difference summation-by-parts (SBP) operators of the provided order of accuracy.
8080

8181
How to use other summation-by-parts operators, is described in the section on [how to customize the solver](@ref customize_solver). Note that for non-periodic boundary conditions, the solver also needs to be created with non-periodic
8282
operators, see, e.g. [examples/bbm\_bbm\_1d/bbm\_bbm\_1d\_basic\_reflecting.jl](https://github.com/NumericalMathematics/DispersiveShallowWater.jl/blob/main/examples/bbm_bbm_1d/bbm_bbm_1d_basic_reflecting.jl).
@@ -127,11 +127,10 @@ nothing # hide
127127

128128
![shoaling solution](shoaling_solution.png)
129129

130-
By default, this will plot the bathymetry, but not the initial (analytical) solution.
130+
By default, this will plot the bathymetry, but not the initial (analytical) solution.
131131

132132
You can adjust this by passing the boolean values `plot_bathymetry` (if `true`, always plot bathymetry in the first subplot) and `plot_initial`. Note that `plot_initial = true` will evaluate and plot the initial condition function at the same time `t` as the numerical solution being displayed (the final time by default). This means if your initial condition function represents an analytical solution, setting `plot_initial = true` will plot the analytical solution at that specific time for comparison.
133133

134-
135134
Plotting an animation over time can, e.g., be done by the following command, which uses `step` to plot the solution at a specific time step. Here `conversion = waterheight_total` makes it so that we only look at the waterheight ``\eta`` and not also the velocity ``v``. More on tutorials for plotting can be found in the chapter [Plotting Simulation Results](@ref plotting).
136135

137136
```@example overview
@@ -150,7 +149,6 @@ It is also possible to plot the solution variables at a fixed spatial point over
150149

151150
More examples sorted by the simulated equations can be found in the [examples/](https://github.com/NumericalMathematics/DispersiveShallowWater.jl/tree/main/examples) subdirectory.
152151

153-
154152
## [Plain program](@id overview-plain-program)
155153

156154
Here follows a version of the program without any comments.

docs/src/callbacks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Callbacks
22

33
Callbacks provide additional functionality during simulations, such as monitoring solution properties, analyzing errors, or ensuring conservation of physical quantities.
4-
[DispersiveShallowWater.jl](https://github.com/NumericalMathematics/DispersiveShallowWater.jl implements three main callback types that can be used individually or in combination to enhance simulation analysis and performance monitoring.
4+
[DispersiveShallowWater.jl](https://github.com/NumericalMathematics/DispersiveShallowWater.jl) implements three main callback types that can be used individually or in combination to enhance simulation analysis and performance monitoring.
55

66
When using multiple callbacks simultaneously, combine them using a `CallbackSet`:
77

88
```julia
99
callbacks = CallbackSet(analysis_callback, summary_callback)
1010
sol = solve(ode, Tsit5(), callback = callbacks)
1111
```
12+
1213
More information on the usage of callbacks within the SciML framework can be found [in the documentation](https://docs.sciml.ai/DiffEqDocs/stable/features/callback_functions/).
1314

1415
## Summary Callback
@@ -28,7 +29,7 @@ sol = solve(ode, Tsit5(), callback = summary_callback)
2829

2930
At the end of the simulation, the callback will display output similar to:
3031

31-
```
32+
```julia
3233
───────────────────────────────────────────────────────────────────────────────────────────
3334
DispersiveSWE Time Allocations
3435
─────────────────────── ────────────────────────
@@ -46,7 +47,6 @@ analyze solution 3 13.2ms 3.0% 4.39ms 147KiB 0.
4647
───────────────────────────────────────────────────────────────────────────────────────────
4748
```
4849

49-
5050
## Analysis Callback
5151

5252
The [`AnalysisCallback`](@ref) monitors solution quality and physical properties during the simulation. It computes error norms and tracks conservation of important physical quantities at specified time intervals.
@@ -189,4 +189,4 @@ For additional information on relaxation, how it works, and why and when it is u
189189
[^RanochaSayyariDalcinParsaniKetcheson2020]:
190190
Ranocha, Sayyari, Dalcin, Parsani, Ketcheson (2020):
191191
Relaxation Runge–Kutta Methods: Fully-Discrete Explicit Entropy-Stable Schemes for the Compressible Euler and Navier–Stokes Equations.
192-
[DOI: 10.1137/19M1263480](https://doi.org/10.1137/19M1263480)
192+
[DOI: 10.1137/19M1263480](https://doi.org/10.1137/19M1263480)

docs/src/dingemans.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,4 @@ plot(all_plots...,
318318
[^Dingemans1997]:
319319
Dingemans (1997):
320320
Water Wave Propagation Over Uneven Bottoms (In 2 Parts).
321-
[DOI: 10.1142/1241](https://doi.org/10.1142/1241)
321+
[DOI: 10.1142/1241](https://doi.org/10.1142/1241)

docs/src/overview.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,11 @@ The following table provides an overview of all available equation systems and t
2222
![water height and bathymetry](bathymetry.png)
2323

2424
- ``\eta``: Total water height
25-
- ``v``: Velocity in horizontal direction
25+
- ``v``: Velocity in horizontal direction
2626
- ``D``: Still-water depth
2727
- ``w``: Auxiliary variable in hyperbolic approximation (``\approx -h v_x``)
2828
- ``H``: Auxiliary variable in hyperbolic approximation (``\approx h``)
2929

30-
3130
## Abstract Shallow Water Equations Interface
3231

3332
Several equation systems in [DispersiveShallowWater.jl](https://github.com/NumericalMathematics/DispersiveShallowWater.jl) (`BBMBBMEquations1D`, `SvaerdKalischEquations1D`, `SerreGreenNaghdiEquations1D`, and `HyperbolicSerreGreenNaghdiEquations1D`) are subtypes of [`AbstractShallowWaterEquations`](@ref). This design reflects that these systems all contain the classical shallow water equations as a subsystem, extended with additional dispersive terms.

docs/src/plotting.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ nothing # hide
4141

4242
# [Plotting Simulation Results](@id plotting)
4343

44-
[DispersiveShallowWater.jl](https://github.com/NumericalMathematics/DispersiveShallowWater.jl) provides flexible plotting capabilities through [Plots.jl](https://github.com/JuliaPlots/Plots.jl) recipes. The plotting system supports various conversion functions, visualization options, and analysis tools.
44+
[DispersiveShallowWater.jl](https://github.com/NumericalMathematics/DispersiveShallowWater.jl) provides flexible plotting capabilities through [Plots.jl](https://github.com/JuliaPlots/Plots.jl) recipes. The plotting system supports various conversion functions, visualization options, and analysis tools.
4545

4646
[Makie.jl](https://docs.makie.org/stable/) is not supported yet. [Contributions are welcome](https://github.com/NumericalMathematics/DispersiveShallowWater.jl/issues/220).
4747

@@ -59,7 +59,7 @@ using Plots
5959
6060
t = 13.37 # plot solution at (roughly) t = 13.37s
6161
step_idx = argmin(abs.(saveat .- t)) # get the closest point to 13.37
62-
p1 = plot(semi => sol, conversion = prim2prim, plot_bathymetry = false,
62+
p1 = plot(semi => sol, conversion = prim2prim, plot_bathymetry = false,
6363
suptitle = "Primitive Variables", step = step_idx)
6464
p2 = plot(semi => sol, conversion = prim2cons, plot_bathymetry = false,
6565
suptitle = "Conservative Variables", step = step_idx)

docs/src/solvers.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ solver = Solver(D1, D2, D3)
4242
```
4343

4444
where:
45-
- `D1` is always required and must be an `AbstractDerivativeOperator`
45+
46+
- `D1` is always required and must be an `AbstractDerivativeOperator`
4647
- `D2` and `D3` are optional and can be either `AbstractDerivativeOperator`s, `AbstractMatrix`es, or `nothing`
4748

4849
## Reflecting Boundary Conditions
@@ -68,6 +69,7 @@ Other possible choices for sources can be found in the [documentation of Summati
6869
For equations that benefit from upwind discretizations (such as the Serre-Green-Naghdi equations), you can use [upwind SBP Operators](@ref upwind_sbp):
6970

7071
**For periodic boundary conditions:**
72+
7173
```julia
7274
using SummationByPartsOperators: upwind_operators, periodic_derivative_operator
7375

@@ -81,6 +83,7 @@ solver = Solver(D1)
8183
```
8284

8385
**For reflecting boundary conditions:**
86+
8487
```julia
8588
using SummationByPartsOperators: Mattsson2017, upwind_operators
8689

@@ -197,6 +200,7 @@ semi = Semidiscretization(mesh, equations, initial_condition, solver,
197200
```
198201

199202
The solver you choose should be compatible with your boundary conditions:
203+
200204
- Periodic operators (created with `periodic_derivative_operator` or `fourier_derivative_operator`) require `boundary_condition_periodic`
201205
- Non-periodic operators (created with `MattssonNordström2004`, etc.) are needed for `boundary_condition_reflecting`
202206

@@ -205,6 +209,7 @@ The solver you choose should be compatible with your boundary conditions:
205209
### Mismatched Operators and Boundary Conditions
206210

207211
**Problem**: Using periodic operators with reflecting boundary conditions or vice versa.
212+
208213
```julia
209214
# ❌ This will fail
210215
D1 = periodic_derivative_operator(1, 4, mesh.xmin, mesh.xmax, mesh.N)
@@ -214,9 +219,10 @@ semi = Semidiscretization(mesh, equations, initial_condition, solver,
214219
```
215220

216221
**Solution**: Match operator type to boundary conditions:
222+
217223
```julia
218224
# ✅ Correct approach
219-
D1 = derivative_operator(MattssonNordström2004(), derivative_order = 1,
225+
D1 = derivative_operator(MattssonNordström2004(), derivative_order = 1,
220226
accuracy_order = 4, xmin = mesh.xmin, xmax = mesh.xmax, N = mesh.N)
221227
solver = Solver(D1)
222228
semi = Semidiscretization(mesh, equations, initial_condition, solver,
@@ -226,6 +232,7 @@ semi = Semidiscretization(mesh, equations, initial_condition, solver,
226232
### Incorrect Grid Size for DG Methods
227233

228234
**Problem**: Grid size not divisible by polynomial degree + 1 for DG methods.
235+
229236
```julia
230237
# ❌ N = 101, p = 3, but 101 is not divisible by (3+1) = 4
231238
N = 101
@@ -234,6 +241,7 @@ mesh = Mesh1D(coordinates_min, coordinates_max, N) # Error in DG setup!
234241
```
235242

236243
**Solution**: Ensure `N` is divisible by `p + 1`:
244+
237245
```julia
238246
# ✅ Adjust N to be divisible by p + 1
239247
p = 3

0 commit comments

Comments
 (0)