Skip to content

Commit

Permalink
Merge branch 'main' into LinEuler1D
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielDoehring authored Mar 25, 2024
2 parents 7cff25b + 01032aa commit f91ab40
Show file tree
Hide file tree
Showing 28 changed files with 830 additions and 155 deletions.
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Contributing

Trixi.jl is an open-source project and we are very happy to accept contributions
from the community. Please feel free to open issues or submit patches (preferably
as pull requests) any time. For planned larger contributions, it is often
beneficial to get in contact with one of the principal developers first (see
from the community. Please feel free to
[open issues](https://github.com/trixi-framework/Trixi.jl/issues/new/choose)
or submit patches (preferably as
[pull requests](https://github.com/trixi-framework/Trixi.jl/pulls))
any time. For planned larger contributions, it is often beneficial to get
in contact with one of the principal developers first (see
[AUTHORS.md](AUTHORS.md)).

Trixi.jl and its contributions are licensed under the MIT license (see
Expand Down
13 changes: 10 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@ Trixi.jl follows the interpretation of [semantic versioning (semver)](https://ju
used in the Julia ecosystem. Notable changes will be documented in this file
for human readability.

## Changes in the v0.7 lifecycle

#### Added
- Implementation of `TimeSeriesCallback` for curvilinear meshes on `UnstructuredMesh2D` and extension
to 1D and 3D on `TreeMesh`.


## Changes when updating to v0.7 from v0.6.x

#### Added

#### Changed

- The default wave speed estimate used within `flux_hll` is now `min_max_speed_davis`
- The default wave speed estimate used within `flux_hll` is now `min_max_speed_davis`
instead of `min_max_speed_naive`.

#### Deprecated
Expand All @@ -26,7 +33,7 @@ for human readability.
#### Added
- AMR for hyperbolic-parabolic equations on 3D `P4estMesh`
- `flux_hllc` on non-cartesian meshes for `CompressibleEulerEquations{2,3}D`
- Different boundary conditions for quad/hex meshes in Abaqus format, even if not generated by HOHQMesh,
- Different boundary conditions for quad/hex meshes in Abaqus format, even if not generated by HOHQMesh,
can now be digested by Trixi in 2D and 3D.
- Subcell (positivity) limiting support for nonlinear variables in 2D for `TreeMesh`
- Added Lighthill-Whitham-Richards (LWR) traffic model
Expand All @@ -40,7 +47,7 @@ for human readability.
#### Changed

- The wave speed estimates for `flux_hll`, `FluxHLL()` are now consistent across equations.
In particular, the functions `min_max_speed_naive`, `min_max_speed_einfeldt` are now
In particular, the functions `min_max_speed_naive`, `min_max_speed_einfeldt` are now
conceptually identical across equations.
Users, who have been using `flux_hll` for MHD have now to use `flux_hlle` in order to use the
Einfeldt wave speed estimate.
Expand Down
4 changes: 1 addition & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Trixi"
uuid = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"
authors = ["Michael Schlottke-Lakemper <[email protected]>", "Gregor Gassner <[email protected]>", "Hendrik Ranocha <[email protected]>", "Andrew R. Winters <[email protected]>", "Jesse Chan <[email protected]>"]
version = "0.7.3-pre"
version = "0.7.5-pre"

[deps]
CodeTracking = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
Expand Down Expand Up @@ -31,7 +31,6 @@ RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
SciMLBase = "0bca4576-84f4-4d90-8ffe-ffa030f20462"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SimpleUnPack = "ce78b400-467f-4804-87d8-8f486da07d0a"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StartUpDG = "472ebc20-7c99-4d4b-9470-8fde4e9faa0f"
Expand Down Expand Up @@ -84,7 +83,6 @@ RecipesBase = "1.1"
Reexport = "1.0"
Requires = "1.1"
SciMLBase = "1.90, 2"
Setfield = "1"
SimpleUnPack = "1.1"
SparseArrays = "1"
StartUpDG = "0.17.7"
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
[![Aqua QA](https://raw.githubusercontent.com/JuliaTesting/Aqua.jl/master/badge.svg)](https://github.com/JuliaTesting/Aqua.jl)
[![License: MIT](https://img.shields.io/badge/License-MIT-success.svg)](https://opensource.org/licenses/MIT)
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.3996439.svg)](https://doi.org/10.5281/zenodo.3996439)
[![Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Trixi)](https://pkgs.genieframework.com?packages=Trixi)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8695/badge)](https://www.bestpractices.dev/projects/8695)
<!-- [![Downloads](https://shields.io/endpoint?url=https://pkgs.genieframework.com/api/v1/badge/Trixi)](https://pkgs.genieframework.com?packages=Trixi) -->
<!-- [![GitHub commits since tagged version](https://img.shields.io/github/commits-since/trixi-framework/Trixi.jl/v0.3.43.svg?style=social&logo=github)](https://github.com/trixi-framework/Trixi.jl) -->
<!-- [![PkgEval](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/T/Trixi.svg)](https://juliaci.github.io/NanosoldierReports/pkgeval_badges/report.html) -->

Expand Down
30 changes: 30 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Security Policy

The Trixi.jl development team takes security issues seriously. We appreciate
all efforts to responsibly disclose any security issues and will make every
effort to acknowledge contributions.


## Supported Versions

The current stable release following the interpretation of
[semantic versioning (SemVer)](https://julialang.github.io/Pkg.jl/dev/compatibility/#Version-specifier-format-1)
used in the Julia ecosystem is supported with security updates.


## Reporting a Vulnerability

To report a security issue, please use the GitHub Security Advisory
["Report a Vulnerability"](https://github.com/trixi-framework/Trixi.jl/security/advisories/new)
tab.

We will send a response indicating the next steps in handling your report.
After the initial reply to your report, we will keep you informed of the
progress towards a fix and full announcement, and may ask for additional
information or guidance.

Please report security bugs in third-party modules directly to the person
or team maintaining the module.

Public notifications of vulnerabilities will be shared in community channels
such as Slack.
2 changes: 2 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
src/code_of_conduct.md
src/contributing.md

2 changes: 1 addition & 1 deletion docs/literate/src/files/scalar_linear_advection_1d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ integral = sum(nodes.^3 .* weights)
# To approximate the solution, we need to get the polynomial coefficients $\{u_j^{Q_l}\}_{j=0}^N$
# for every element $Q_l$.

# After defining all nodes, we can implement the spatial coordinate $x$ and its initial value $u0$
# After defining all nodes, we can implement the spatial coordinate $x$ and its initial value $u0 = u(t_0)$
# for every node.
x = Matrix{Float64}(undef, length(nodes), n_elements)
for element in 1:n_elements
Expand Down
43 changes: 30 additions & 13 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,36 @@ DocMeta.setdocmeta!(Trixi2Vtk, :DocTestSetup, :(using Trixi2Vtk); recursive=true
# as necessary
# Based on: https://github.com/ranocha/SummationByPartsOperators.jl/blob/0206a74140d5c6eb9921ca5021cb7bf2da1a306d/docs/make.jl#L27-L41
open(joinpath(@__DIR__, "src", "code_of_conduct.md"), "w") do io
# Point to source license file
println(io, """
```@meta
EditURL = "https://github.com/trixi-framework/Trixi.jl/blob/main/CODE_OF_CONDUCT.md"
```
""")
# Write the modified contents
println(io, "# [Code of Conduct](@id code-of-conduct)")
println(io, "")
for line in eachline(joinpath(dirname(@__DIR__), "CODE_OF_CONDUCT.md"))
line = replace(line, "[AUTHORS.md](AUTHORS.md)" => "[Authors](@ref)")
println(io, "> ", line)
end
# Point to source license file
println(io,
"""
```@meta
EditURL = "https://github.com/trixi-framework/Trixi.jl/blob/main/CODE_OF_CONDUCT.md"
```
""")
# Write the modified contents
println(io, "# [Code of Conduct](@id code-of-conduct)")
println(io, "")
for line in eachline(joinpath(dirname(@__DIR__), "CODE_OF_CONDUCT.md"))
line = replace(line, "[AUTHORS.md](AUTHORS.md)" => "[Authors](@ref)")
println(io, "> ", line)
end
end

open(joinpath(@__DIR__, "src", "contributing.md"), "w") do io
# Point to source license file
println(io,
"""
```@meta
EditURL = "https://github.com/trixi-framework/Trixi.jl/blob/main/CONTRIBUTING.md"
```
""")
# Write the modified contents
for line in eachline(joinpath(dirname(@__DIR__), "CONTRIBUTING.md"))
line = replace(line, "[LICENSE.md](LICENSE.md)" => "[License](@ref)")
line = replace(line, "[AUTHORS.md](AUTHORS.md)" => "[Authors](@ref)")
println(io, line)
end
end

# Create tutorials for the following files:
Expand Down
54 changes: 0 additions & 54 deletions docs/src/contributing.md

This file was deleted.

3 changes: 3 additions & 0 deletions examples/tree_1d_dgsem/elixir_euler_source_terms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ save_solution = SaveSolutionCallback(interval = 100,

stepsize_callback = StepsizeCallback(cfl = 0.8)

time_series = TimeSeriesCallback(semi, [0.0, 0.33, 1.0], interval = 10)

callbacks = CallbackSet(summary_callback,
analysis_callback, alive_callback,
save_solution,
time_series,
stepsize_callback)

###############################################################################
Expand Down
5 changes: 5 additions & 0 deletions examples/tree_3d_dgsem/elixir_euler_source_terms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ save_solution = SaveSolutionCallback(interval = 100,

stepsize_callback = StepsizeCallback(cfl = 0.6)

time_series = TimeSeriesCallback(semi,
[(0.0, 0.0, 0.0), (0.33, 0.33, 0.33), (1.0, 1.0, 1.0)],
interval = 10)

callbacks = CallbackSet(summary_callback,
analysis_callback, alive_callback,
save_solution,
time_series,
stepsize_callback)

###############################################################################
Expand Down
115 changes: 115 additions & 0 deletions examples/unstructured_2d_dgsem/elixir_euler_time_series.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# An elixir that has an alternative convergence test that uses
# the `TimeSeriesCallback` on several gauge points. Many of the
# gauge points are selected as "stress tests" for the element
# identification, e.g., a gauge point that lies on an
# element corner of a curvilinear mesh

using OrdinaryDiffEq
using Trixi

###############################################################################
# semidiscretization of the compressible Euler equations

equations = CompressibleEulerEquations2D(1.4)

# Modify the manufactured solution test to use `L = sqrt(2)`
# in the initial condition and source terms
function initial_condition_convergence_shifted(x, t,
equations::CompressibleEulerEquations2D)
c = 2
A = 0.1
L = sqrt(2)
f = 1 / L
ω = 2 * pi * f
ini = c + A * sin* (x[1] + x[2] - t))

rho = ini
rho_v1 = ini
rho_v2 = ini
rho_e = ini^2

return SVector(rho, rho_v1, rho_v2, rho_e)
end

@inline function source_terms_convergence_shifted(u, x, t,
equations::CompressibleEulerEquations2D)
# Same settings as in `initial_condition`
c = 2
A = 0.1
L = sqrt(2)
f = 1 / L
ω = 2 * pi * f
γ = equations.gamma

x1, x2 = x
si, co = sincos* (x1 + x2 - t))
rho = c + A * si
rho_x = ω * A * co
# Note that d/dt rho = -d/dx rho = -d/dy rho.

tmp = (2 * rho - 1) *- 1)

du1 = rho_x
du2 = rho_x * (1 + tmp)
du3 = du2
du4 = 2 * rho_x * (rho + tmp)

return SVector(du1, du2, du3, du4)
end

initial_condition = initial_condition_convergence_shifted

source_term = source_terms_convergence_shifted

###############################################################################
# Get the DG approximation space

solver = DGSEM(polydeg = 6, surface_flux = flux_lax_friedrichs)

###############################################################################
# Get the curved quad mesh from a file (downloads the file if not available locally)

mesh_file = Trixi.download("https://gist.githubusercontent.com/andrewwinters5000/b434e724e3972a9c4ee48d58c80cdcdb/raw/55c916cd8c0294a2d4a836e960dac7247b7c8ccf/mesh_multiple_flips.mesh",
joinpath(@__DIR__, "mesh_multiple_flips.mesh"))

mesh = UnstructuredMesh2D(mesh_file, periodicity = true)

###############################################################################
# create the semi discretization object

semi = SemidiscretizationHyperbolic(mesh, equations, initial_condition, solver,
source_terms = source_term)

###############################################################################
# ODE solvers, callbacks etc.

tspan = (0.0, 1.0)
ode = semidiscretize(semi, tspan)

summary_callback = SummaryCallback()

analysis_interval = 1000
analysis_callback = AnalysisCallback(semi, interval = analysis_interval)

alive_callback = AliveCallback(analysis_interval = analysis_interval)

time_series = TimeSeriesCallback(semi,
[(0.75, 0.7), (1.23, 0.302), (0.8, 1.0),
(0.353553390593274, 0.353553390593274),
(0.505, 1.125), (1.37, 0.89), (0.349, 0.7153),
(0.883883476483184, 0.406586401289607),
(sqrt(2), sqrt(2))];
interval = 10)

callbacks = CallbackSet(summary_callback,
analysis_callback,
time_series,
alive_callback)

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

sol = solve(ode, RDPK3SpFSAL49(); abstol = 1.0e-6, reltol = 1.0e-6,
ode_default_options()..., callback = callbacks);

summary_callback() # print the timer summary
Loading

0 comments on commit f91ab40

Please sign in to comment.