Skip to content

Commit

Permalink
Merge branch 'main' into Getting_started_with_Trixi
Browse files Browse the repository at this point in the history
  • Loading branch information
sloede authored Nov 9, 2023
2 parents 48b66c9 + 276dc3c commit c5cc3d9
Show file tree
Hide file tree
Showing 440 changed files with 27,782 additions and 22,178 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/FormatCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
# format(".")
run: |
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter"))'
julia -e 'using JuliaFormatter; format(["benchmark", "ext", "src", "utils"])'
julia -e 'using JuliaFormatter; format(["benchmark", "examples", "ext", "src", "test", "utils"])'
- name: Format check
run: |
julia -e '
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/SpellCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Check spelling
uses: crate-ci/[email protected].15
uses: crate-ci/[email protected].21
93 changes: 93 additions & 0 deletions .github/workflows/downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Note: this file is inspired by the downstream testing facilities in the SciML ecosystem
# x-ref: https://github.com/SciML/SciMLBase.jl/blob/ffe68aebedee5915190623cb08160d7ef1fbcce0/.github/workflows/Downstream.yml

name: Downstream
on:
push:
branches:
- main
paths-ignore:
- 'AUTHORS.md'
- 'CITATION.bib'
- 'CONTRIBUTING.md'
- 'LICENSE.md'
- 'NEWS.md'
- 'README.md'
- '.zenodo.json'
- '.github/workflows/benchmark.yml'
- '.github/workflows/CompatHelper.yml'
- '.github/workflows/TagBot.yml'
- 'benchmark/**'
# - 'docs/**'
- 'utils/**'
pull_request:
paths-ignore:
- 'AUTHORS.md'
- 'CITATION.bib'
- 'CONTRIBUTING.md'
- 'LICENSE.md'
- 'NEWS.md'
- 'README.md'
- '.zenodo.json'
- '.github/workflows/benchmark.yml'
- '.github/workflows/CompatHelper.yml'
- '.github/workflows/TagBot.yml'
- 'benchmark/**'
# - 'docs/**'
- 'utils/**'
workflow_dispatch:

# Cancel redundant CI tests automatically
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
test:
if: "!contains(github.event.head_commit.message, 'skip ci')"
# We could also include the Julia version as in
# name: ${{ matrix.trixi_test }} - ${{ matrix.os }} - Julia ${{ matrix.version }} - ${{ matrix.arch }} - ${{ github.event_name }}
# to be more specific. However, that requires us updating the required CI tests whenever we update Julia.
name: ${{ matrix.package }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.9'
os:
- ubuntu-latest
arch:
- x64
package:
- TrixiShallowWater.jl
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- run: julia -e 'using InteractiveUtils; versioninfo(verbose=true)'
- uses: julia-actions/cache@v1
- uses: julia-actions/julia-buildpkg@v1
- name: Retrieve downstream package
# Note: we retrieve the current `main` branch of the downstream package to ensure
# that compatibility errors we make in Trixi.jl are detected already here
# See also https://github.com/trixi-framework/Trixi.jl/pull/1707#discussion_r1382938895
uses: actions/checkout@v4
with:
repository: trixi-framework/${{ matrix.package }}
path: downstream
- name: Load upstream package into downstream environment
shell: julia --color=yes --project=downstream {0}
run: |
using Pkg
Pkg.develop(PackageSpec(path="."))
Pkg.update()
- name: Run downstream tests (without coverage)
shell: julia --color=yes --project=downstream {0}
run: |
using Pkg
Pkg.test(coverage=false)
env:
TRIXI_TEST: upstream
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ for human readability.
- Capability to set truly discontinuous initial conditions in 1D.
- Wetting and drying feature and examples for 1D and 2D shallow water equations
- Implementation of the polytropic Euler equations in 2D
- Implementation of the quasi-1D shallow water equations
- Subcell positivity limiting support for conservative variables in 2D for `TreeMesh`
- AMR for hyperbolic-parabolic equations on 2D/3D `TreeMesh`

Expand Down
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ FillArrays = "0.13.2, 1"
ForwardDiff = "0.10.18"
HDF5 = "0.14, 0.15, 0.16, 0.17"
IfElse = "0.1"
LinearAlgebra = "1"
LinearMaps = "2.7, 3.0"
LoopVectorization = "0.12.118"
MPI = "0.20"
Expand All @@ -68,12 +69,14 @@ OffsetArrays = "1.3"
P4est = "0.4"
Polyester = "0.7.5"
PrecompileTools = "1.1"
Printf = "1"
RecipesBase = "1.1"
Reexport = "1.0"
Requires = "1.1"
SciMLBase = "1.90, 2"
Setfield = "0.8, 1"
SimpleUnPack = "1.1"
SparseArrays = "1"
StartUpDG = "0.17"
Static = "0.3, 0.4, 0.5, 0.6, 0.7, 0.8"
StaticArrayInterface = "1.4"
Expand Down
45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,31 +256,48 @@ or [create an issue](https://github.com/trixi-framework/Trixi.jl/issues/new).


## Acknowledgments
<p align="center">
<img align="middle" src="https://user-images.githubusercontent.com/3637659/233821022-84910be7-8649-4999-a0ff-22d5e20f0b90.jpg" width=auto/>
<p align="center" style="font-size:0;"><!--
BMBF --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/f59af636-3098-4be6-bf80-c6be3f17cbc6" height="120"><!--
DFG --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/e67b9ed3-7699-466a-bdaf-2ba070a29a8e" height="120"><!--
SRC --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/48f9da06-6f7a-4586-b23e-739bee3901c0" height="120"><!--
ERC --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/9371e7e4-3491-4433-ac5f-b3bfb215f5ca" height="120"><!--
NSF --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/5325103c-ae81-4747-b87c-c6e4a1b1d7a8" height="120"><!--
DUBS --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/bb021e6e-42e6-4fe1-a414-c847402e1937" height="120"><!--
NumFOCUS --><img align="middle" src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/8496ac9e-b586-475f-adb7-69bcfc415185" height="120"><!--
-->
</p>

This project has benefited from funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
under Germany's Excellence Strategy EXC 2044-390685587, Mathematics Münster:
Dynamics-Geometry-Structure.

This project has benefited from funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
through the research unit FOR 5409 "Structure-Preserving Numerical Methods for Bulk- and
Interface Coupling of Heterogeneous Models (SNuBIC)" (project number 463312734).
This project has benefited from funding by the [Deutsche
Forschungsgemeinschaft](https://www.dfg.de/) (DFG, German Research Foundation)
through the following grants:
* Excellence Strategy EXC 2044-390685587, Mathematics Münster: Dynamics-Geometry-Structure.
* Research unit FOR 5409 "Structure-Preserving Numerical Methods for Bulk- and
Interface Coupling of Heterogeneous Models (SNuBIC)" (project number 463312734).
* Individual grant no. 528753982.

This project has benefited from funding from the European Research Council through the
This project has benefited from funding from the [European Research Council](https://erc.europa.eu)
through the
ERC Starting Grant "An Exascale aware and Un-crashable Space-Time-Adaptive
Discontinuous Spectral Element Solver for Non-Linear Conservation Laws" (Extreme),
ERC grant agreement no. 714487.

This project has benefited from funding from Vetenskapsrådet (VR, Swedish Research Council), Sweden
This project has benefited from funding from [Vetenskapsrådet](https://www.vr.se)
(VR, Swedish Research Council), Sweden
through the VR Starting Grant "Shallow water flows including sediment transport and morphodynamics",
VR grant agreement 2020-03642 VR.

This project has benefited from funding from the United States National Science Foundation under awards
This project has benefited from funding from the United States
[National Science Foundation](https://www.nsf.gov/) (NSF) under awards
DMS-1719818 and DMS-1943186.

This project has benefited from funding from the German Federal Ministry of
Education and Research through the project grant "Adaptive earth system modeling
This project has benefited from funding from the German
[Federal Ministry of Education and Research](https://www.bmbf.de) (BMBF)
through the project grant "Adaptive earth system modeling
with significantly reduced computation time for exascale supercomputers
(ADAPTEX)" (funding id: 16ME0668K).

This project has benefited from funding by the
[Daimler und Benz Stiftung](https://www.daimler-benz-stiftung.de) (Daimler and Benz Foundation)
through grant no. 32-10/22.

Trixi.jl is supported by [NumFOCUS](https://numfocus.org/) as an Affiliated Project.
1 change: 1 addition & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,5 @@ Literate = "2.9"
Measurements = "2.5"
OrdinaryDiffEq = "6.49.1"
Plots = "1.9"
Test = "1"
Trixi2Vtk = "0.3"
4 changes: 2 additions & 2 deletions docs/literate/src/files/differentiable_programming.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ scatter(real.(λ), imag.(λ), label="central flux")
# As you can see here, the maximal real part is close to zero.

relative_maximum = maximum(real, λ) / maximum(abs, λ)
@test 3.0e-10 < relative_maximum < 8.0e-10 #src
@test 3.0e-10 < relative_maximum < 9.0e-10 #src

# Interestingly, if we add dissipation by switching to the `flux_lax_friedrichs`
# at the interfaces, the maximal real part of the eigenvalues increases.
Expand Down Expand Up @@ -87,7 +87,7 @@ scatter(real.(λ), imag.(λ), label="central flux")
# Here, the maximal real part is basically zero to machine accuracy.

relative_maximum = maximum(real, λ) / maximum(abs, λ)
@test 1.0e-17 < relative_maximum < 1.0e-15 #src
@test 1.0e-17 < relative_maximum < 2.0e-15 #src

# Moreover, the eigenvectors are not as ill-conditioned as in 2D.

Expand Down
55 changes: 42 additions & 13 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -344,29 +344,58 @@ or [create an issue](https://github.com/trixi-framework/Trixi.jl/issues/new).

## Acknowledgments

![funding-logo](https://user-images.githubusercontent.com/3637659/233821022-84910be7-8649-4999-a0ff-22d5e20f0b90.jpg)

This project has benefited from funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
under Germany's Excellence Strategy EXC 2044-390685587, Mathematics Münster:
Dynamics-Geometry-Structure.
```@raw html
<div style="width: 100%; text-align: center; font-size: 0;">
<div><!--
BMBF --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/f59af636-3098-4be6-bf80-c6be3f17cbc6" style="height: 120px; width: auto"><!--
DFG --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/e67b9ed3-7699-466a-bdaf-2ba070a29a8e" style="height: 120px; width: auto"><!--
SRC --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/48f9da06-6f7a-4586-b23e-739bee3901c0" style="height: 120px; width: auto"><!--
-->
</div>
<div><!--
ERC --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/9371e7e4-3491-4433-ac5f-b3bfb215f5ca" style="height: 120px; width: auto"><!--
NSF --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/5325103c-ae81-4747-b87c-c6e4a1b1d7a8" style="height: 120px; width: auto"><!--
DUBS --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/bb021e6e-42e6-4fe1-a414-c847402e1937" style="height: 120px; width: auto"><!--
-->
</div>
<div><!--
NumFOCUS --><img src="https://github.com/trixi-framework/Trixi.jl/assets/3637659/8496ac9e-b586-475f-adb7-69bcfc415185" style="height: 120px; width: auto"><!--
-->
</div>
</div>
```

This project has benefited from funding by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
through the research unit FOR 5409 "Structure-Preserving Numerical Methods for Bulk- and
Interface Coupling of Heterogeneous Models (SNuBIC)" (project number 463312734).
This project has benefited from funding by the [Deutsche
Forschungsgemeinschaft](https://www.dfg.de/) (DFG, German Research Foundation)
through the following grants:
* Excellence Strategy EXC 2044-390685587, Mathematics Münster: Dynamics-Geometry-Structure.
* Research unit FOR 5409 "Structure-Preserving Numerical Methods for Bulk- and
Interface Coupling of Heterogeneous Models (SNuBIC)" (project number 463312734).
* Individual grant no. 528753982.

This project has benefited from funding from the European Research Council through the
This project has benefited from funding from the [European Research Council](https://erc.europa.eu)
through the
ERC Starting Grant "An Exascale aware and Un-crashable Space-Time-Adaptive
Discontinuous Spectral Element Solver for Non-Linear Conservation Laws" (Extreme),
ERC grant agreement no. 714487.

This project has benefited from funding from Vetenskapsrådet (VR, Swedish Research Council), Sweden
This project has benefited from funding from [Vetenskapsrådet](https://www.vr.se)
(VR, Swedish Research Council), Sweden
through the VR Starting Grant "Shallow water flows including sediment transport and morphodynamics",
VR grant agreement 2020-03642 VR.

This project has benefited from funding from the United States National Science Foundation under awards
This project has benefited from funding from the United States
[National Science Foundation](https://www.nsf.gov/) (NSF) under awards
DMS-1719818 and DMS-1943186.

This project has benefited from funding from the German Federal Ministry of
Education and Research through the project grant "Adaptive earth system modeling
This project has benefited from funding from the German
[Federal Ministry of Education and Research](https://www.bmbf.de) (BMBF)
through the project grant "Adaptive earth system modeling
with significantly reduced computation time for exascale supercomputers
(ADAPTEX)" (funding id: 16ME0668K).

This project has benefited from funding by the
[Daimler und Benz Stiftung](https://www.daimler-benz-stiftung.de) (Daimler and Benz Foundation)
through grant no. 32-10/22.

Trixi.jl is supported by [NumFOCUS](https://numfocus.org/) as an Affiliated Project.
18 changes: 9 additions & 9 deletions docs/src/styleguide.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ conventions, we apply and enforce automated source code formatting
* Maximum line length (strictly): **92**.
* Functions that mutate their *input* are named with a trailing `!`.
* Functions order their parameters [similar to Julia Base](https://docs.julialang.org/en/v1/manual/style-guide/#Write-functions-with-argument-ordering-similar-to-Julia-Base-1).
* The main modified argument comes first. For example, if the right-hand side `du` is modified,
it should come first. If only the `cache` is modified, e.g., in `prolong2interfaces!`
* The main modified argument comes first. For example, if the right-hand side `du` is modified,
it should come first. If only the `cache` is modified, e.g., in `prolong2interfaces!`
and its siblings, put the `cache` first.
* Otherwise, use the order `mesh, equations, solver, cache`.
* If something needs to be specified in more detail for dispatch, put the additional argument before the general one
* If something needs to be specified in more detail for dispatch, put the additional argument before the general one
that is specified in more detail. For example, we use `have_nonconservative_terms(equations), equations`
and `dg.mortar, dg`.
* Prefer `for i in ...` to `for i = ...` for better semantic clarity and greater flexibility.
Expand Down Expand Up @@ -55,7 +55,7 @@ julia -e 'using Pkg; Pkg.add("JuliaFormatter")'
```
You can then recursively format the core Julia files in the Trixi.jl repo by executing
```shell
julia -e 'using JuliaFormatter; format(["benchmark", "ext", "src", "utils"])'
julia -e 'using JuliaFormatter; format(["benchmark", "examples", "ext", "src", "test", "utils"])'
```
from inside the Trixi.jl repository. For convenience, there is also a script you can
directly run from your terminal shell, which will automatically install JuliaFormatter in a
Expand All @@ -67,12 +67,12 @@ You can get more information about using the convenience script by running it wi
`--help`/`-h` flag.

### Checking formatting before committing
It can be convenient to check the formatting of source code automatically before each commit.
It can be convenient to check the formatting of source code automatically before each commit.
We use git-hooks for it and provide a `pre-commit` script in the `utils` folder. The script uses
[JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) just like formatting script that
runs over the whole Trixi.jl directory.
You can copy the `pre-commit`-script into `.git/hooks/pre-commit` and it will check your formatting
[JuliaFormatter.jl](https://github.com/domluna/JuliaFormatter.jl) just like formatting script that
runs over the whole Trixi.jl directory.
You can copy the `pre-commit`-script into `.git/hooks/pre-commit` and it will check your formatting
before each commit. If errors are found the commit is aborted and you can add the corrections via
```shell
```shell
git add -p
```
13 changes: 6 additions & 7 deletions examples/dgmulti_1d/elixir_advection_gauss_sbp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ dg = DGMulti(polydeg = 3,

cells_per_dimension = (8,)
mesh = DGMultiMesh(dg, cells_per_dimension,
coordinates_min=(-1.0,), coordinates_max=(1.0,),
periodicity=true)
coordinates_min = (-1.0,), coordinates_max = (1.0,),
periodicity = true)

###############################################################################
# setup the test problem (no source term needed for linear advection)
Expand All @@ -49,20 +49,19 @@ ode = semidiscretize(semi, tspan)
summary_callback = SummaryCallback()

# analyse the solution in regular intervals and prints the results
analysis_callback = AnalysisCallback(semi, interval=100, uEltype=real(dg))
analysis_callback = AnalysisCallback(semi, interval = 100, uEltype = real(dg))

# handles the re-calculation of the maximum Δt after each time step
stepsize_callback = StepsizeCallback(cfl=0.75)
stepsize_callback = StepsizeCallback(cfl = 0.75)

# collect all callbacks such that they can be passed to the ODE solver
callbacks = CallbackSet(summary_callback, analysis_callback, stepsize_callback)

###############################################################################
# run the simulation

sol = solve(ode, CarpenterKennedy2N54(williamson_condition=false),
dt=1.0, save_everystep=false, callback=callbacks);
sol = solve(ode, CarpenterKennedy2N54(williamson_condition = false),
dt = 1.0, save_everystep = false, callback = callbacks);

# Print the timer summary
summary_callback()

Loading

0 comments on commit c5cc3d9

Please sign in to comment.