Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ StrideArrays = "d1fa6d79-ef01-42a6-86c9-f7c551f8593b"
Trixi = "a7f1ee26-1774-49b1-8366-f1abc58fbfcb"

[compat]
ForwardDiff = "0.10.36"
ForwardDiff = "0.10.36, 1"
HDF5 = "0.16.10, 0.17"
LinearAlgebra = "1"
LoopVectorization = "0.12.118"
Expand All @@ -33,5 +33,5 @@ Static = "0.8, 1"
StaticArrayInterface = "1.5.1"
StaticArrays = "1"
StrideArrays = "0.1.28"
Trixi = "0.9.9, 0.10, 0.11, 0.12"
Trixi = "0.13"
julia = "1.9"
5 changes: 4 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ end
links = InterLinks("Trixi" => ("https://trixi-framework.github.io/TrixiDocumentation/stable/",
"https://trixi-framework.github.io/TrixiDocumentation/stable/objects.inv"))

# Search for any unresolvable `@ref` reference in external sources
fallbacks = ExternalFallbacks(; automatic = true)

# Define module-wide setups such that the respective modules are available in doctests
DocMeta.setdocmeta!(TrixiAtmo, :DocTestSetup, :(using TrixiAtmo);
recursive = true)
Expand Down Expand Up @@ -95,7 +98,7 @@ makedocs(;
"Contributing" => "contributing.md",
"Code of Conduct" => "code_of_conduct.md",
"License" => "license.md"],
plugins = [links],)
plugins = [links, fallbacks],)

deploydocs(;
repo = "github.com/trixi-framework/TrixiAtmo.jl",
Expand Down
6 changes: 3 additions & 3 deletions src/equations/covariant_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ end
end

# Maximum contravariant wave speed with respect to specific basis vector
@inline function Trixi.max_abs_speed_naive(u_ll, u_rr, aux_vars_ll, aux_vars_rr,
orientation::Integer,
equations::CovariantLinearAdvectionEquation2D)
@inline function Trixi.max_abs_speed(u_ll, u_rr, aux_vars_ll, aux_vars_rr,
orientation::Integer,
equations::CovariantLinearAdvectionEquation2D)
vcon_ll = velocity_contravariant(u_ll, equations) # Contravariant components on left side
vcon_rr = velocity_contravariant(u_rr, equations) # Contravariant components on right side
return max(abs(vcon_ll[orientation]), abs(vcon_rr[orientation]))
Expand Down
6 changes: 3 additions & 3 deletions src/equations/covariant_shallow_water.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ end
end

# Maximum wave speed along the normal direction in reference space
@inline function Trixi.max_abs_speed_naive(u_ll, u_rr, aux_vars_ll, aux_vars_rr,
orientation,
equations::AbstractCovariantShallowWaterEquations2D)
@inline function Trixi.max_abs_speed(u_ll, u_rr, aux_vars_ll, aux_vars_rr,
orientation,
equations::AbstractCovariantShallowWaterEquations2D)
# Geometric variables
Gcon_ll = metric_contravariant(aux_vars_ll, equations)
Gcon_rr = metric_contravariant(aux_vars_rr, equations)
Expand Down
22 changes: 22 additions & 0 deletions src/equations/shallow_water_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,28 @@ end
return max(abs(v_ll), abs(v_rr)) + max(c_ll, c_rr) * norm(normal_direction)
end

@inline function Trixi.max_abs_speed(u_ll, u_rr, normal_direction::AbstractVector,
equations::ShallowWaterEquations3D)
# Extract and compute the velocities in the normal direction
v1_ll, v2_ll, v3_ll = velocity(u_ll, equations)
v1_rr, v2_rr, v3_rr = velocity(u_rr, equations)
v_ll = v1_ll * normal_direction[1] + v2_ll * normal_direction[2] +
v3_ll * normal_direction[3]
v_rr = v1_rr * normal_direction[1] + v2_rr * normal_direction[2] +
v3_rr * normal_direction[3]

# Compute the wave celerity on the left and right
h_ll = waterheight(u_ll, equations)
h_rr = waterheight(u_rr, equations)

c_ll = sqrt(max(equations.gravity * h_ll, 0.0f0))
c_rr = sqrt(max(equations.gravity * h_rr, 0.0f0))

# The normal velocities are already scaled by the norm
norm_ = norm(normal_direction)
return max(abs(v_ll) + c_ll * norm_, abs(v_rr) + c_rr * norm_)
end

# Specialized `DissipationLocalLaxFriedrichs` to avoid spurious dissipation in the bottom topography
@inline function (dissipation::DissipationLocalLaxFriedrichs)(u_ll, u_rr,
orientation_or_normal_direction,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,28 @@ function Trixi.SemidiscretizationHyperbolic(mesh::P4estMesh{2},
# `RealT` is used as real type for node locations etc.
# while `uEltype` is used as element type of solutions etc.
RealT = real(solver), uEltype = RealT,
initial_cache = NamedTuple(),
metric_terms = MetricTermsCrossProduct(),
auxiliary_field = nothing)
cache = (;
Trixi.create_cache(mesh, equations, solver, RealT, metric_terms,
auxiliary_field, uEltype)..., initial_cache...)
auxiliary_field, uEltype)...)
_boundary_conditions = Trixi.digest_boundary_conditions(boundary_conditions, mesh,
solver,
cache)

Trixi.check_periodicity_mesh_boundary_conditions(mesh, _boundary_conditions)

performance_counter = Trixi.PerformanceCounter()

SemidiscretizationHyperbolic{typeof(mesh), typeof(equations),
typeof(initial_condition),
typeof(_boundary_conditions), typeof(source_terms),
typeof(solver), typeof(cache)}(mesh, equations,
initial_condition,
_boundary_conditions,
source_terms, solver,
cache)
cache,
performance_counter)
end

# Constructor for SemidiscretizationHyperbolic for the covariant form. Requires
Expand All @@ -49,23 +53,27 @@ function Trixi.SemidiscretizationHyperbolic(mesh::P4estMesh{NDIMS, NDIMS_AMBIENT
# `RealT` is used as real type for node locations etc.
# while `uEltype` is used as element type of solutions etc.
RealT = real(solver), uEltype = RealT,
initial_cache = NamedTuple(),
metric_terms = MetricTermsCovariantSphere(),
auxiliary_field = nothing) where {NDIMS,
NDIMS_AMBIENT}
cache = (;
Trixi.create_cache(mesh, equations, solver, RealT, metric_terms,
auxiliary_field, uEltype)..., initial_cache...)
auxiliary_field, uEltype)...)
_boundary_conditions = Trixi.digest_boundary_conditions(boundary_conditions, mesh,
solver,
cache)

Trixi.check_periodicity_mesh_boundary_conditions(mesh, _boundary_conditions)

performance_counter = Trixi.PerformanceCounter()

SemidiscretizationHyperbolic{typeof(mesh), typeof(equations),
typeof(initial_condition),
typeof(_boundary_conditions), typeof(source_terms),
typeof(solver), typeof(cache)}(mesh, equations,
initial_condition,
_boundary_conditions,
source_terms, solver,
cache)
cache,
performance_counter)
end
2 changes: 1 addition & 1 deletion src/solvers/dgsem_p4est/dg_2d_manifold_in_3d_covariant.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function Trixi.rhs!(du, u, t,
end

# Compute coefficients for an initial condition that uses auxiliary variables
function Trixi.compute_coefficients!(u, func, t, mesh::P4estMesh{2},
function Trixi.compute_coefficients!(backend::Nothing, u, func, t, mesh::P4estMesh{2},
equations::AbstractCovariantEquations{2}, dg::DG,
cache)
(; aux_node_vars) = cache.auxiliary_variables
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ OrdinaryDiffEq = "6.91"
OrdinaryDiffEqLowStorageRK = "1.2"
OrdinaryDiffEqSSPRK = "1.2"
Test = "1"
Trixi = "0.9.9, 0.10, 0.11, 0.12"
Trixi = "0.13"
TrixiTest = "0.1"
Loading