Skip to content

Commit

Permalink
Use OrdinaryDiffEqTsit5.jl and OrdinaryDiffEqLowStorageRK.jl (#163)
Browse files Browse the repository at this point in the history
* use OrdinaryDiffEqTsit5.jl everywhere

* also use OrdinaryDiffEqLowStorageRK where necessary

* drop support for Julia v1.9

* skipt Test

* compat bound for OrdinaryDiffEqLowStorage

* bump compat of DiffEqBase

* bump compat of SciMLBase

* bump compat of FastBroadcast to 0.3.1

* bump compat of RecursiveArrayTools

* bump compat of RecipesBase

* bump compat of FastBroadcast

* bump compat of RecursiveArrayTools

* bump compat of Interpolations

* bump compat of Reexport

* bump compat of FastBroadcast

* bump compat of RecursiveArrayToools

* bump compat of StaticArrays

* bump compat of DiffEqBase

* bump compat of SciMLBase

* bump compat of OrdinaryDiffEq*

* try (temporarily) fixing benchmark

* remove OrdinaryDiffEq again

* allow higher allocations

Julia v1.11 reports more allocations in some cases
  • Loading branch information
JoshuaLampert authored Dec 4, 2024
1 parent 7db41d9 commit 83a753a
Show file tree
Hide file tree
Showing 47 changed files with 95 additions and 67 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
- macos-latest
- windows-latest
include:
- version: '1.9'
- version: '1.11'
os: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/Documenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1.9'
version: '1.10'
show-versioninfo: true
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/Downgrade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fail-fast: false
matrix:
version:
- '1.9'
- '1.10'
# - '~1.9.0-0' # including development versions
# - 'nightly'
os:
Expand All @@ -49,7 +49,7 @@ jobs:
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-downgrade-compat@v1
with:
skip: LinearAlgebra,Printf,SparseArrays
skip: LinearAlgebra,Printf,SparseArrays,Test
projects: ., test
- uses: julia-actions/julia-buildpkg@v1
env:
Expand Down
18 changes: 9 additions & 9 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,21 @@ TrixiBase = "9a0f1c46-06d5-4909-a5a3-ce25d3fa3284"

[compat]
BandedMatrices = "1"
DiffEqBase = "6.143"
FastBroadcast = "0.2.8, 0.3"
Interpolations = "0.14.2, 0.15"
DiffEqBase = "6.157"
FastBroadcast = "0.3.5"
Interpolations = "0.15.1"
LinearAlgebra = "1"
PolynomialBases = "0.4.15"
Printf = "1"
RecipesBase = "1.2"
RecursiveArrayTools = "3.3"
Reexport = "1.0"
RecipesBase = "1.3.4"
RecursiveArrayTools = "3.27"
Reexport = "1.2.2"
Roots = "2.0.17"
SciMLBase = "2.11"
SciMLBase = "2.56"
SimpleUnPack = "1.1"
SparseArrays = "1"
StaticArrays = "1"
StaticArrays = "1.9.7"
SummationByPartsOperators = "0.5.63"
TimerOutputs = "0.5.7"
TrixiBase = "0.1.3"
julia = "1.9"
julia = "1.10"
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,35 +25,46 @@ A more detailed documentation can be found [online](https://JoshuaLampert.github
## Installation

If you have not yet installed Julia, then you first need to [download Julia](https://julialang.org/downloads/). Please [follow the instructions for your operating system](https://julialang.org/downloads/platform/).
DispersiveShallowWater.jl works with Julia v1.9 and newer. DispersiveShallowWater.jl is a registered Julia package. Therefore, you can install it by executing the following commands from the Julia REPL
DispersiveShallowWater.jl works with Julia v1.10 and newer. DispersiveShallowWater.jl is a registered Julia package. Therefore, you can install it by executing the following commands from the Julia REPL

```julia
julia> using Pkg

julia> Pkg.add(["DispersiveShallowWater", "OrdinaryDiffEq", "Plots"])
julia> Pkg.add(["DispersiveShallowWater", "OrdinaryDiffEqTsit5", "Plots"])
```
In addition, this installs the packages [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) used for time-integration and [Plots.jl](https://github.com/JuliaPlots/Plots.jl) to visualize the results.

In addition, this installs the packages OrdinaryDiffEqTsit5.jl from [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl)
used for time-integration and [Plots.jl](https://github.com/JuliaPlots/Plots.jl) to visualize the results. If you want to use
other time integration methods than `Tsit5`, you can install the respective subpackage or OrdinaryDiffEq.jl, which will install
every available solver.
If you want to use other SBP operators than the default operators that DispersiveShallowWater.jl uses, then you also need [SummationByPartsOperators.jl](https://github.com/ranocha/SummationByPartsOperators.jl),
which can be installed running

```julia
julia> Pkg.add("SummationByPartsOperators")
```

## Usage

In the Julia REPL, first load the package DispersiveShallowWater.jl

```julia
julia> using DispersiveShallowWater
```

You can run a basic simulation that solves the BBM-BBM equations by executing

```julia
julia> include(default_example());
```

The result can be visualized by using the package Plots.jl

```julia
julia> using Plots
julia> plot(semi => sol)
```

The command `plot` expects a `Pair` consisting of a `Semidiscretization` and an `ODESolution`. The visualization can also be customized, see the [documentation](https://JoshuaLampert.github.io/DispersiveShallowWater.jl/stable/overview#visualize_results)
for more details. Other examples can be found in the subdirectory [examples/](https://github.com/JoshuaLampert/DispersiveShallowWater.jl/tree/main/examples).
A list of all examples is returned by running `get_examples()`. You can pass the filename of one of the examples or your own simulation file to `include` in order to run it,
Expand All @@ -62,6 +73,7 @@ e.g., `include(joinpath(examples_dir(), "svaerd_kalisch_1d", "svaerd_kalisch_1d_
## Referencing

You can directly refer to DispersiveShallowWater.jl as

```bibtex
@misc{lampert2023dispersive,
title={{D}ispersive{S}hallow{W}ater.jl: {S}tructure-preserving numerical
Expand Down
6 changes: 4 additions & 2 deletions benchmark/Project.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[deps]
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqLowStorageRK = "b0944070-b475-4768-8dec-fb6eb410534d"
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
SummationByPartsOperators = "9f78cca6-572e-554e-b819-917d2f1cf240"

[compat]
BenchmarkTools = "1"
OrdinaryDiffEq = "6.49.1"
OrdinaryDiffEqLowStorageRK = "1"
OrdinaryDiffEqTsit5 = "1"
SummationByPartsOperators = "0.5.63"
4 changes: 2 additions & 2 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[deps]
Changelog = "5217a498-cd5d-4ec6-b8c2-9b85a09b6e3e"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
OrdinaryDiffEqTsit5 = "b1df2697-797e-41e3-8120-5422d3b24e4a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SummationByPartsOperators = "9f78cca6-572e-554e-b819-917d2f1cf240"
TrixiBase = "9a0f1c46-06d5-4909-a5a3-ce25d3fa3284"

[compat]
Changelog = "1"
Documenter = "1"
OrdinaryDiffEq = "6.49.1"
OrdinaryDiffEqTsit5 = "1"
Plots = "1.9"
SummationByPartsOperators = "0.5.41"
TrixiBase = "0.1.1"
2 changes: 1 addition & 1 deletion docs/src/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ cd DispersiveShallowWater
mkdir run
cd run
julia --project=. -e 'using Pkg; Pkg.develop(PackageSpec(path=".."))' # Install local DispersiveShallowWater.jl clone
julia --project=. -e 'using Pkg; Pkg.add(["OrdinaryDiffEq", "Plots", "SummationByPartsOperators"])' # Install additional packages
julia --project=. -e 'using Pkg; Pkg.add(["OrdinaryDiffEqTsit5", "Plots", "SummationByPartsOperators"])' # Install additional packages
```

If you use other packages for executing DispersiveShallowWater.jl, you can add them to the project in the `run`
Expand Down
18 changes: 15 additions & 3 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,35 +24,46 @@ Fully discrete entropy-conservative methods can be obtained by using the [relaxa
## Installation

If you have not yet installed Julia, then you first need to [download Julia](https://julialang.org/downloads/). Please [follow the instructions for your operating system](https://julialang.org/downloads/platform/).
DispersiveShallowWater.jl works with Julia v1.9 and newer. DispersiveShallowWater.jl is a registered Julia package. Therefore, you can install it by executing the following commands from the Julia REPL
DispersiveShallowWater.jl works with Julia v1.10 and newer. DispersiveShallowWater.jl is a registered Julia package. Therefore, you can install it by executing the following commands from the Julia REPL

```julia
julia> using Pkg

julia> Pkg.add(["DispersiveShallowWater", "OrdinaryDiffEq", "Plots"])
julia> Pkg.add(["DispersiveShallowWater", "OrdinaryDiffEqTsit5", "Plots"])
```
In addition, this installs the packages [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl) used for time-integration and [Plots.jl](https://github.com/JuliaPlots/Plots.jl) to visualize the results.

In addition, this installs the packages OrdinaryDiffEqTsit5.jl from [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl)
used for time-integration and [Plots.jl](https://github.com/JuliaPlots/Plots.jl) to visualize the results. If you want to use
other time integration methods than `Tsit5`, you can install the respective subpackage or OrdinaryDiffEq.jl, which will install
every available solver.
If you want to use other SBP operators than the default operators that DispersiveShallowWater.jl uses, then you also need [SummationByPartsOperators.jl](https://github.com/ranocha/SummationByPartsOperators.jl),
which can be installed running

```julia
julia> Pkg.add("SummationByPartsOperators")
```

## Usage

In the Julia REPL, first load the package DispersiveShallowWater.jl

```julia
julia> using DispersiveShallowWater
```

You can run a basic simulation that solves the BBM-BBM equations by executing

```julia
julia> include(default_example());
```

The result can be visualized by using the package Plots.jl

```julia
julia> using Plots
julia> plot(semi => sol)
```

The command `plot` expects a `Pair` consisting of a [`Semidiscretization`](@ref) and an `ODESolution`. The visualization can also be customized, see the [documentation](@ref visualize_results)
for more details. Other examples can be found in the subdirectory [examples/](https://github.com/JoshuaLampert/DispersiveShallowWater.jl/tree/main/examples).
A list of all examples is returned by running [`get_examples()`](@ref). You can pass the filename of one of the examples or your own simulation file to `include` in order to run it,
Expand All @@ -61,6 +72,7 @@ e.g., `include(joinpath(examples_dir(), "svaerd_kalisch_1d", "svaerd_kalisch_1d_
## Referencing

You can directly refer to DispersiveShallowWater.jl as

```bibtex
@misc{lampert2023dispersive,
title={{D}ispersive{S}hallow{W}ater.jl: {S}tructure-preserving numerical
Expand Down
8 changes: 4 additions & 4 deletions docs/src/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ In order to conduct a numerical simulation with DispersiveShallowWater.jl, we pe
First, we load the necessary libraries:

```@example overview
using DispersiveShallowWater, OrdinaryDiffEq
using DispersiveShallowWater, OrdinaryDiffEqTsit5
```

## Define physical setup
Expand Down Expand Up @@ -106,7 +106,9 @@ is a nonlinear invariant and should be constant over time as well. During the si

Finally, the `ode` can be `solve`d using the interface from [OrdinaryDiffEq.jl](https://github.com/SciML/OrdinaryDiffEq.jl). This means, we can specify a time-stepping
scheme we want to use the tolerances for the adaptive time-stepping and the time values, where the solution values should be saved. In this case, we use the adaptive
explicit Runge-Kutta method `Tsit5` by Tsitouras of order 5(4). Here, we save the solution at 100 equidistant points.
explicit Runge-Kutta method `Tsit5` by Tsitouras of order 5(4), which is implemented in the subpackage OrdinaryDiffEqTsit5.jl. If you want to use other time-stepping
schemes, you can install the respective subpackage or the whole package OrdinaryDiffEq.jl, which will install every available solver.
Here, we save the solution at 100 equidistant points.

```@example overview
tspan = (0.0, 25.0)
Expand Down Expand Up @@ -214,7 +216,6 @@ nothing # hide

![analysis callback relaxation](analysis_callback_relaxation.png)


## [Customize solver](@id customize_solver)

In the semidiscretization created above, we used the default SBP operators, which are periodic finite difference operators. Using different SBP operators for the
Expand Down Expand Up @@ -307,4 +308,3 @@ and [plot_examples.jl](https://github.com/JoshuaLampert/2023-master-thesis/blob/
Ranocha, Sayyari, Dalcin, Parsani, Ketcheson (2020):
Relaxation Runge–Kutta Methods: Fully-Discrete Explicit Entropy-Stable Schemes for the Compressible Euler and Navier–Stokes Equations
[DOI: 10.1137/19M1263480](https://doi.org/10.1137/19M1263480)

2 changes: 1 addition & 1 deletion examples/bbm_1d/bbm_1d_basic.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_1d/bbm_1d_fourier.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater
using SummationByPartsOperators: fourier_derivative_operator

Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_1d/bbm_1d_hamiltonian_relaxation.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_1d/bbm_1d_manufactured.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_1d/bbm_1d_relaxation.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_basic.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_basic_reflecting.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater
using SummationByPartsOperators: MattssonNordström2004, derivative_operator

Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_dg.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using SummationByPartsOperators: legendre_derivative_operator,
UniformPeriodicMesh1D,
couple_discontinuously
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_dingemans.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_fourier.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater
using SummationByPartsOperators: fourier_derivative_operator

Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_manufactured.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_relaxation.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_upwind_relaxation.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater
using SummationByPartsOperators: upwind_operators, periodic_derivative_operator
using SparseArrays: sparse
Expand Down
2 changes: 1 addition & 1 deletion examples/bbm_bbm_1d/bbm_bbm_1d_well_balanced.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater
using SummationByPartsOperators: periodic_derivative_operator
using SparseArrays: sparse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# equations in standard and hyperbolic form
# [arXiv: 2408.02665](https://arxiv.org/abs/2408.02665)

using OrdinaryDiffEq
using OrdinaryDiffEqLowStorageRK
using DispersiveShallowWater

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqLowStorageRK
using DispersiveShallowWater

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqLowStorageRK
using DispersiveShallowWater

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqLowStorageRK
using DispersiveShallowWater
using SummationByPartsOperators: fourier_derivative_operator

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqLowStorageRK
using DispersiveShallowWater

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# equations in standard and hyperbolic form
# [arXiv: 2408.02665](https://arxiv.org/abs/2408.02665)

using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater

###############################################################################
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using OrdinaryDiffEq
using OrdinaryDiffEqTsit5
using DispersiveShallowWater
using SummationByPartsOperators: upwind_operators, periodic_derivative_operator

Expand Down
Loading

0 comments on commit 83a753a

Please sign in to comment.