Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
c1b9eb0
fix (only) exports
tristanmontoya Mar 17, 2026
5869f33
use ordinarydiffeq subpackages in covariant tri tests
tristanmontoya Mar 18, 2026
8442f68
distinguish tri vs quad icosahedron tests
tristanmontoya Mar 18, 2026
e998c8e
fix tests
tristanmontoya Mar 18, 2026
3aa94ee
Merge branch 'main' into tm/fix_dgmulti_threading
tristanmontoya Mar 18, 2026
5d70e39
run formatter
tristanmontoya Mar 18, 2026
2b3554f
Merge remote-tracking branch 'origin/tm/fix_dgmulti_threading' into t…
tristanmontoya Mar 18, 2026
20af928
add back serial dgmulti tri euler for coverage
tristanmontoya Mar 18, 2026
f926ac3
revert
tristanmontoya Mar 18, 2026
6b09209
Merge branch 'main' into tm/fix_dgmulti_threading
tristanmontoya Mar 18, 2026
3313c83
isolated polyester issue, apparently this fixes it
tristanmontoya Mar 18, 2026
21fcbf3
Merge remote-tracking branch 'origin/tm/fix_dgmulti_threading' into t…
tristanmontoya Mar 18, 2026
90a534d
run formatter
tristanmontoya Mar 18, 2026
0634ce1
Merge remote-tracking branch 'origin/main' into tm/use_mesh_specializ…
tristanmontoya Mar 19, 2026
0ecf613
use mesh-specialized
tristanmontoya Mar 19, 2026
3cf5ee0
add solution_container and auxiliary_container
tristanmontoya Mar 19, 2026
db83854
adapt to Trixi v 0.16
benegee Mar 27, 2026
8459b02
Merge remote-tracking branch 'origin/bg/trixi-v016' into bg/trixi-v016
tristanmontoya Mar 28, 2026
7ee1ba2
update signatures to match Trixi.jl v0.16
tristanmontoya Mar 29, 2026
00bc02a
remove duplicated DGMulti stuff I added to keep downstream tests runn…
tristanmontoya Mar 29, 2026
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
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ Static = "0.8, 1"
StaticArrayInterface = "1.5.1"
StaticArrays = "1"
StrideArrays = "0.1.28"
Trixi = "0.15"
Trixi = "0.16"
julia = "1.10"
12 changes: 8 additions & 4 deletions examples/advection/cartesian/elixir_cubed_sphere.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,17 @@ end
# with central fluxes because of the curved geometry!
@inline function Trixi.weak_form_kernel!(du, u,
element,
mesh::Union{StructuredMesh{2},
UnstructuredMesh2D,
P4estMesh{2}, T8codeMesh{2}},
MeshT::Type{<:Union{StructuredMesh{2},
StructuredMeshView{2},
UnstructuredMesh2D,
P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
nonconservative_terms::Trixi.True,
equations::Trixi.AbstractEquations{3},
dg::DGSEM, cache, alpha = true)
Trixi.weak_form_kernel!(du, u, element, mesh, Trixi.False(), equations, dg, cache)
Trixi.weak_form_kernel!(du, u, element, MeshT, Trixi.False(), equations, dg, cache,
alpha)
end

# Create a 2D cubed sphere mesh the size of the Earth
Expand Down
12 changes: 8 additions & 4 deletions examples/advection/cartesian/elixir_quad_icosahedron.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,17 @@ end
# with central fluxes because of the curved geometry!
@inline function Trixi.weak_form_kernel!(du, u,
element,
mesh::Union{StructuredMesh{2},
UnstructuredMesh2D,
P4estMesh{2}, T8codeMesh{2}},
MeshT::Type{<:Union{StructuredMesh{2},
StructuredMeshView{2},
UnstructuredMesh2D,
P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
nonconservative_terms::Trixi.True,
equations::Trixi.AbstractEquations{3},
dg::DGSEM, cache, alpha = true)
Trixi.weak_form_kernel!(du, u, element, mesh, Trixi.False(), equations, dg, cache)
Trixi.weak_form_kernel!(du, u, element, MeshT, Trixi.False(), equations, dg, cache,
alpha)
end

# Create a 2D quad-based icosahedral mesh the size of the Earth
Expand Down
2 changes: 1 addition & 1 deletion src/TrixiAtmo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using Setfield
flux, flux_ec, flux_chandrashekar, flux_wintermeyer_etal,
flux_fjordholm_etal, flux_nonconservative_wintermeyer_etal,
flux_nonconservative_fjordholm_etal, FluxLMARS, flux_shima_etal,
flux_ranocha, flux_kennedy_gruber
flux_ranocha, flux_kennedy_gruber, trixi_backend

using Trixi: ln_mean, stolarsky_mean, inv_ln_mean

Expand Down
9 changes: 1 addition & 8 deletions src/solvers/dgmulti/dg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ function Trixi.create_cache(mesh::DGMultiMesh{NDIMS}, equations::AbstractCovaria
nvars = nvariables(equations)
naux = n_aux_node_vars(equations)

# We are duplicating the contents of solution_container in the top-level cache, but
# note that no actual data is being copied here, just references to the same arrays.
u_values = Trixi.allocate_nested_array(uEltype, nvars, size(md.xq), dg)
u_face_values = Trixi.allocate_nested_array(uEltype, nvars, size(md.xf), dg)
flux_face_values = Trixi.allocate_nested_array(uEltype, nvars, size(md.xf), dg)
Expand All @@ -25,7 +23,6 @@ function Trixi.create_cache(mesh::DGMultiMesh{NDIMS}, equations::AbstractCovaria
solution_container = (; u_values, u_face_values, flux_face_values,
local_values_threaded)

# To parallel the solution container, we create an auxiliary container.
aux_values = Trixi.allocate_nested_array(uEltype, naux, size(md.x), dg)
aux_quad_values = Trixi.allocate_nested_array(uEltype, naux, size(md.xq), dg)
aux_face_values = Trixi.allocate_nested_array(uEltype, naux, size(md.xf), dg)
Expand Down Expand Up @@ -57,12 +54,8 @@ function Trixi.create_cache(mesh::DGMultiMesh{NDIMS}, equations::AbstractCovaria
rotated_flux_threaded = [Trixi.allocate_nested_array(uEltype, nvars, (rd.Nq,), dg)
for _ in 1:Threads.maxthreadid()]

# For backwards compatibility with older DGMulti code, the solution is included in the
# top-level cache. TODO: remove once DGMulti refactor is complete and stable.
cache = (; md, weak_differentiation_matrices, lift_scalings, invJ, dxidxhatj,
solution_container, u_values, u_face_values, flux_face_values,
auxiliary_container, local_values_threaded, flux_threaded,
rotated_flux_threaded)
solution_container, auxiliary_container, flux_threaded, rotated_flux_threaded)
return cache
end

Expand Down
3 changes: 2 additions & 1 deletion src/solvers/dgmulti/dg_manifold_covariant.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ function Trixi.calc_volume_integral!(du, u,
end
end

function Trixi.calc_interface_flux!(cache, surface_integral::SurfaceIntegralWeakForm,
function Trixi.calc_interface_flux!(cache,
surface_integral::SurfaceIntegralWeakForm,
mesh::DGMultiMesh,
have_nonconservative_terms::False,
equations::AbstractCovariantEquations{NDIMS},
Expand Down
21 changes: 13 additions & 8 deletions src/solvers/dgsem_p4est/dg_2d_manifold_in_3d_cartesian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,27 @@ function Trixi.rhs!(du, u, t,
equations::AbstractEquations{3},
boundary_conditions, source_terms::Source,
dg::DG, cache) where {Source}
backend = trixi_backend(u)

# Reset du
Trixi.@trixi_timeit Trixi.timer() "reset ∂u/∂t" Trixi.set_zero!(du, dg, cache)

# Calculate volume integral
Trixi.@trixi_timeit Trixi.timer() "volume integral" begin
Trixi.calc_volume_integral!(du, u, mesh,
Trixi.calc_volume_integral!(backend, du, u, mesh,
Trixi.have_nonconservative_terms(equations),
equations,
dg.volume_integral, dg, cache)
end

# Prolong solution to interfaces
Trixi.@trixi_timeit Trixi.timer() "prolong2interfaces" begin
Trixi.prolong2interfaces!(cache, u, mesh, equations, dg)
Trixi.prolong2interfaces!(backend, cache, u, mesh, equations, dg)
end

# Calculate interface fluxes
Trixi.@trixi_timeit Trixi.timer() "interface flux" begin
Trixi.calc_interface_flux!(cache.elements.surface_flux_values, mesh,
Trixi.calc_interface_flux!(backend, cache.elements.surface_flux_values, mesh,
Trixi.have_nonconservative_terms(equations),
equations,
dg.surface_integral, dg, cache)
Expand Down Expand Up @@ -56,12 +57,13 @@ function Trixi.rhs!(du, u, t,

# Calculate surface integrals
Trixi.@trixi_timeit Trixi.timer() "surface integral" begin
Trixi.calc_surface_integral!(du, u, mesh, equations,
Trixi.calc_surface_integral!(backend, du, u, mesh, equations,
dg.surface_integral, dg, cache)
end

# Apply Jacobian from mapping to reference element
Trixi.@trixi_timeit Trixi.timer() "Jacobian" Trixi.apply_jacobian!(du, mesh,
Trixi.@trixi_timeit Trixi.timer() "Jacobian" Trixi.apply_jacobian!(backend, du,
mesh,
equations,
dg, cache)

Expand All @@ -76,9 +78,12 @@ end
# Weak-form kernel for 3D equations solved in 2D manifolds
@inline function Trixi.weak_form_kernel!(du, u,
element,
mesh::Union{StructuredMesh{2},
UnstructuredMesh2D,
P4estMesh{2}, T8codeMesh{2}},
::Type{<:Union{StructuredMesh{2},
StructuredMeshView{2},
UnstructuredMesh2D,
P4estMesh{2},
P4estMeshView{2},
T8codeMesh{2}}},
nonconservative_terms::False,
equations::AbstractEquations{3},
dg::DGSEM, cache, alpha = true)
Expand Down
27 changes: 16 additions & 11 deletions src/solvers/dgsem_p4est/dg_2d_manifold_in_3d_covariant.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,26 @@ function Trixi.rhs!(du, u, t,
equations::AbstractCovariantEquations{2},
boundary_conditions, source_terms::Source,
dg::DG, cache) where {Source}
backend = trixi_backend(u)

# Reset du
Trixi.@trixi_timeit Trixi.timer() "reset ∂u/∂t" Trixi.set_zero!(du, dg, cache)

# Calculate volume integral
Trixi.@trixi_timeit Trixi.timer() "volume integral" begin
Trixi.calc_volume_integral!(du, u, mesh,
Trixi.calc_volume_integral!(backend, du, u, mesh,
Trixi.have_nonconservative_terms(equations),
equations, dg.volume_integral, dg, cache)
end

# Prolong solution to interfaces
Trixi.@trixi_timeit Trixi.timer() "prolong2interfaces" begin
Trixi.prolong2interfaces!(cache, u, mesh, equations, dg)
Trixi.prolong2interfaces!(backend, cache, u, mesh, equations, dg)
end

# Calculate interface fluxes
Trixi.@trixi_timeit Trixi.timer() "interface flux" begin
Trixi.calc_interface_flux!(cache.elements.surface_flux_values, mesh,
Trixi.calc_interface_flux!(backend, cache.elements.surface_flux_values, mesh,
Trixi.have_nonconservative_terms(equations),
equations, dg.surface_integral, dg, cache)
end
Expand All @@ -48,12 +50,14 @@ function Trixi.rhs!(du, u, t,

# Calculate surface integrals
Trixi.@trixi_timeit Trixi.timer() "surface integral" begin
Trixi.calc_surface_integral!(du, u, mesh, equations, dg.surface_integral, dg,
Trixi.calc_surface_integral!(backend, du, u, mesh, equations,
dg.surface_integral, dg,
cache)
end

# Apply Jacobian from mapping to reference element
Trixi.@trixi_timeit Trixi.timer() "Jacobian" Trixi.apply_jacobian!(du, mesh,
Trixi.@trixi_timeit Trixi.timer() "Jacobian" Trixi.apply_jacobian!(backend, du,
mesh,
equations, dg,
cache)

Expand Down Expand Up @@ -92,7 +96,7 @@ end

# Weak form kernel which uses contravariant flux components, passing the geometric
# information contained in the auxiliary variables to the flux function
@inline function Trixi.weak_form_kernel!(du, u, element, mesh::P4estMesh{2},
@inline function Trixi.weak_form_kernel!(du, u, element, ::Type{<:P4estMesh{2}},
nonconservative_terms::False,
equations::AbstractCovariantEquations{2},
dg::DGSEM, cache, alpha = true)
Expand Down Expand Up @@ -126,7 +130,7 @@ end

# Flux differencing kernel which uses contravariant flux components, passing the geometric
# information contained in the auxiliary variables to the flux function
@inline function Trixi.flux_differencing_kernel!(du, u, element, mesh::P4estMesh{2},
@inline function Trixi.flux_differencing_kernel!(du, u, element, ::Type{<:P4estMesh{2}},
nonconservative_terms::False,
equations::AbstractCovariantEquations{2},
volume_flux, dg::DGSEM, cache,
Expand Down Expand Up @@ -180,7 +184,8 @@ end
# Non-conservative flux differencing kernel which uses contravariant flux components,
# passing the geometric information contained in the auxiliary variables to the flux
# function
@inline function Trixi.flux_differencing_kernel!(du, u, element, mesh::P4estMesh{2},
@inline function Trixi.flux_differencing_kernel!(du, u, element,
MeshT::Type{<:P4estMesh{2}},
nonconservative_terms::True,
equations::AbstractCovariantEquations{2},
volume_flux, dg::DGSEM, cache,
Expand All @@ -190,7 +195,7 @@ end
symmetric_flux, nonconservative_flux = volume_flux

# Apply the symmetric flux as usual
Trixi.flux_differencing_kernel!(du, u, element, mesh, False(), equations,
Trixi.flux_differencing_kernel!(du, u, element, MeshT, False(), equations,
symmetric_flux, dg, cache, alpha)

for j in eachnode(dg), i in eachnode(dg)
Expand Down Expand Up @@ -230,7 +235,7 @@ end
# Calculate the interface flux directly in the local coordinate system. This function
# differs from the standard approach in Trixi.jl in that one does not need to pass the
# normal vector to the pointwise flux calculation.
function Trixi.calc_interface_flux!(surface_flux_values,
function Trixi.calc_interface_flux!(backend::Nothing, surface_flux_values,
mesh::P4estMesh{2},
nonconservative_terms,
equations::AbstractCovariantEquations{2},
Expand Down Expand Up @@ -452,7 +457,7 @@ function Trixi.calc_sources!(du, u, t, source_terms::Nothing,
end

# Apply the exact Jacobian stored in auxiliary variables
function Trixi.apply_jacobian!(du, mesh::P4estMesh{2},
function Trixi.apply_jacobian!(backend::Nothing, du, 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 @@ NLsolve = "4.5.1"
OrdinaryDiffEqLowStorageRK = "1.2"
OrdinaryDiffEqSSPRK = "1.2"
Test = "1"
Trixi = "0.15"
Trixi = "0.16"
TrixiTest = "0.1.3, 0.2"
Loading