Skip to content

Commit

Permalink
Merge branch 'main' into subcell-limiting-entropies
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Mar 25, 2024
2 parents 27a93f4 + 01032aa commit 08e9f97
Show file tree
Hide file tree
Showing 20 changed files with 379 additions and 206 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
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ for human readability.
## Changes in the v0.7 lifecycle

#### Added
- Implementation of `TimeSeriesCallback` for curvilinear meshes on `UnstructuredMesh2D`.
- Subcell local one-sided limiting support for nonlinear variables in 2D for `TreeMesh`
- Implementation of `TimeSeriesCallback` for curvilinear meshes on `UnstructuredMesh2D` and extension
to 1D and 3D on `TreeMesh`.
- Subcell local one-sided limiting support for nonlinear variables in 2D for `TreeMesh`.


## Changes when updating to v0.7 from v0.6.x
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.4-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

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
13 changes: 6 additions & 7 deletions src/Trixi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ using LinearAlgebra: LinearAlgebra, Diagonal, diag, dot, mul!, norm, cross, norm
UniformScaling, det
using Printf: @printf, @sprintf, println
using SparseArrays: AbstractSparseMatrix, AbstractSparseMatrixCSC, sparse, droptol!,
rowvals, nzrange, nonzeros, spzeros
rowvals, nzrange, nonzeros

# import @reexport now to make it available for further imports/exports
using Reexport: @reexport
Expand All @@ -32,10 +32,10 @@ using Reexport: @reexport
using MPI: MPI

using SciMLBase: CallbackSet, DiscreteCallback,
ODEProblem, ODESolution, ODEFunction,
ODEProblem, ODESolution,
SplitODEProblem
import SciMLBase: get_du, get_tmp_cache, u_modified!,
AbstractODEIntegrator, init, step!, check_error,
init, step!, check_error,
get_proposed_dt, set_proposed_dt!,
terminate!, remake, add_tstop!, has_tstop, first_tstop

Expand All @@ -57,7 +57,6 @@ using Polyester: Polyester, @batch # You know, the cheapest threads you can find
using OffsetArrays: OffsetArray, OffsetVector
using P4est
using T8code
using Setfield: @set
using RecipesBase: RecipesBase
using Requires: @require
using Static: Static, One, True, False
Expand All @@ -66,7 +65,7 @@ using StaticArrays: StaticArrays, MVector, MArray, SMatrix, @SMatrix
using StrideArrays: PtrArray, StrideArray, StaticInt
@reexport using StructArrays: StructArrays, StructArray
using TimerOutputs: TimerOutputs, @notimeit, TimerOutput, print_timer, reset_timer!
using Triangulate: Triangulate, TriangulateIO, triangulate
using Triangulate: Triangulate, TriangulateIO
export TriangulateIO # for type parameter in DGMultiMesh
using TriplotBase: TriplotBase
using TriplotRecipes: DGTriPseudocolor
Expand All @@ -84,9 +83,9 @@ const _PREFERENCE_LOG = @load_preference("log", "log_Trixi_NaN")

# finite difference SBP operators
using SummationByPartsOperators: AbstractDerivativeOperator,
AbstractNonperiodicDerivativeOperator, DerivativeOperator,
AbstractNonperiodicDerivativeOperator,
AbstractPeriodicDerivativeOperator,
PeriodicDerivativeOperator, grid
grid
import SummationByPartsOperators: integrate, semidiscretize,
compute_coefficients, compute_coefficients!,
left_boundary_weight, right_boundary_weight
Expand Down
2 changes: 2 additions & 0 deletions src/auxiliary/auxiliary.jl
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@ macro threaded(expr)
# !!! danger "Heisenbug"
# Look at the comments for `wrap_array` when considering to change this macro.

# By using `Trixi.@batch` we allow users of Trixi.jl to use `@threaded` without having
# Polyester.jl in their namespace.
return esc(quote
Trixi.@batch $(expr)
end)
Expand Down
6 changes: 3 additions & 3 deletions src/callbacks_step/time_series.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ After the last time step, the results are stored in an HDF5 file `filename` in d
The real data type `RealT` and data type for solution variables `uEltype` default to the respective
types used in the solver and the cache.
Currently this callback is only implemented for [`TreeMesh`](@ref) in 2D
and [`UnstructuredMesh2D`](@ref).
Currently this callback is only implemented for [`TreeMesh`](@ref) and [`UnstructuredMesh2D`](@ref).
"""
mutable struct TimeSeriesCallback{RealT <: Real, uEltype <: Real, SolutionVariables,
VariableNames, Cache}
Expand Down Expand Up @@ -218,5 +217,6 @@ function (time_series_callback::TimeSeriesCallback)(integrator)
end

include("time_series_dg.jl")
include("time_series_dg2d.jl")
include("time_series_dg_tree.jl")
include("time_series_dg_unstructured.jl")
end # @muladd
37 changes: 37 additions & 0 deletions src/callbacks_step/time_series_dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,41 @@ function save_time_series_file(time_series_callback,
end
end
end

# Creates cache for time series callback
function create_cache_time_series(point_coordinates,
mesh::Union{TreeMesh, UnstructuredMesh2D},
dg, cache)
# Determine element ids for point coordinates
element_ids = get_elements_by_coordinates(point_coordinates, mesh, dg, cache)

# Calculate & store Lagrange interpolation polynomials
interpolating_polynomials = calc_interpolating_polynomials(point_coordinates,
element_ids, mesh,
dg, cache)

time_series_cache = (; element_ids, interpolating_polynomials)

return time_series_cache
end

function get_elements_by_coordinates(coordinates, mesh, dg, cache)
element_ids = Vector{Int}(undef, size(coordinates, 2))
get_elements_by_coordinates!(element_ids, coordinates, mesh, dg, cache)

return element_ids
end

function calc_interpolating_polynomials(coordinates, element_ids,
mesh::Union{TreeMesh, UnstructuredMesh2D},
dg, cache)
interpolating_polynomials = Array{real(dg), 3}(undef,
nnodes(dg), ndims(mesh),
length(element_ids))
calc_interpolating_polynomials!(interpolating_polynomials, coordinates, element_ids,
mesh, dg,
cache)

return interpolating_polynomials
end
end # @muladd
Loading

0 comments on commit 08e9f97

Please sign in to comment.