diff --git a/src/callbacks_step/stepsize_dg2d.jl b/src/callbacks_step/stepsize_dg2d.jl index 5f4c30f..822ffef 100644 --- a/src/callbacks_step/stepsize_dg2d.jl +++ b/src/callbacks_step/stepsize_dg2d.jl @@ -1,8 +1,8 @@ # Specialization of max_dt function for 3D equations in 2D manifolds function Trixi.max_dt(u, t, - mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, P4estMesh{2}, - T8codeMesh{2}}, - constant_speed::False, equations::AbstractEquations{3}, dg::DG, cache) + mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, P4estMesh{2}, + T8codeMesh{2}}, + constant_speed::False, equations::AbstractEquations{3}, dg::DG, cache) # to avoid a division by zero if the speed vanishes everywhere, # e.g. for steady-state linear advection max_scaled_speed = nextfloat(zero(t)) @@ -16,11 +16,13 @@ function Trixi.max_dt(u, t, lambda1, lambda2, lambda3 = max_abs_speeds(u_node, equations) # Local speeds transformed to the reference element - Ja11, Ja12, Ja13 = Trixi.get_contravariant_vector(1, contravariant_vectors, i, j, - element) + Ja11, Ja12, Ja13 = Trixi.get_contravariant_vector(1, contravariant_vectors, i, + j, + element) lambda1_transformed = abs(Ja11 * lambda1 + Ja12 * lambda2 + Ja13 * lambda3) - Ja21, Ja22, Ja23 = Trixi.get_contravariant_vector(2, contravariant_vectors, i, j, - element) + Ja21, Ja22, Ja23 = Trixi.get_contravariant_vector(2, contravariant_vectors, i, + j, + element) lambda2_transformed = abs(Ja21 * lambda1 + Ja22 * lambda2 + Ja23 * lambda3) inv_jacobian = abs(inverse_jacobian[i, j, element]) @@ -33,4 +35,4 @@ function Trixi.max_dt(u, t, end return 2 / (nnodes(dg) * max_scaled_speed) -end \ No newline at end of file +end diff --git a/test/test_spherical_advection.jl b/test/test_spherical_advection.jl index 31f7a29..3dfab10 100644 --- a/test/test_spherical_advection.jl +++ b/test/test_spherical_advection.jl @@ -11,18 +11,18 @@ EXAMPLES_DIR = pkgdir(TrixiAtmo, "examples") @test_trixi_include(joinpath(EXAMPLES_DIR, "elixir_euler_spherical_advection_cartesian.jl"), l2=[ - 8.44505073e-03, - 8.23414117e-03, - 1.84210648e-03, + 8.44498914e-03, + 8.23407970e-03, + 1.84210216e-03, 0.00000000e+00, - 6.44302430e-02, + 6.44302432e-02, ], linf=[ - 9.48950488e-02, - 9.64811952e-02, - 1.37453400e-02, + 9.48946345e-02, + 9.64807833e-02, + 1.37450721e-02, 0.00000000e+00, - 4.09322999e-01, + 4.09322956e-01, ]) # Ensure that we do not have excessive memory allocations # (e.g., from type instabilities)