From 8823a9117ea8db232dc1f79d11cc0230fa6ad050 Mon Sep 17 00:00:00 2001 From: SimonCan Date: Tue, 18 Jun 2024 16:53:18 +0100 Subject: [PATCH 1/2] Added StructuredMeshView{2} to various fluxes. --- src/solvers/dgsem_structured/dg_2d.jl | 10 +++++----- src/solvers/dgsem_tree/dg_2d.jl | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/solvers/dgsem_structured/dg_2d.jl b/src/solvers/dgsem_structured/dg_2d.jl index 1eb244e06aa..f0bad1cd471 100644 --- a/src/solvers/dgsem_structured/dg_2d.jl +++ b/src/solvers/dgsem_structured/dg_2d.jl @@ -100,7 +100,7 @@ end @inline function flux_differencing_kernel!(du, u, element, - mesh::Union{StructuredMesh{2}, + mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::False, equations, @@ -157,7 +157,7 @@ end @inline function flux_differencing_kernel!(du, u, element, - mesh::Union{StructuredMesh{2}, + mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::True, equations, @@ -226,7 +226,7 @@ end # "A provably entropy stable subcell shock capturing approach for high order split form DG for the compressible Euler equations" # [arXiv: 2008.12044v2](https://arxiv.org/pdf/2008.12044) @inline function calcflux_fv!(fstar1_L, fstar1_R, fstar2_L, fstar2_R, u, - mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, + mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::False, equations, volume_flux_fv, dg::DGSEM, element, cache) @@ -296,7 +296,7 @@ end # Calculate the finite volume fluxes inside curvilinear elements (**with non-conservative terms**). @inline function calcflux_fv!(fstar1_L, fstar1_R, fstar2_L, fstar2_R, u::AbstractArray{<:Any, 4}, - mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, + mesh::Union{StructuredMesh{2}, StructuredMesh{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::True, equations, volume_flux_fv, dg::DGSEM, element, cache) @@ -475,7 +475,7 @@ end @inline function calc_interface_flux!(surface_flux_values, left_element, right_element, orientation, u, - mesh::StructuredMesh{2}, + mesh::Union{StructuredMesh{2}, StructuredMeshView{2}}, nonconservative_terms::True, equations, surface_integral, dg::DG, cache) # See comment on `calc_interface_flux!` with `nonconservative_terms::False` diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index 6b66c2d4bfa..706eb8243a4 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -36,7 +36,7 @@ end # The methods below are specialized on the volume integral type # and called from the basic `create_cache` method at the top. -function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, UnstructuredMesh2D, +function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, equations, volume_integral::VolumeIntegralFluxDifferencing, dg::DG, uEltype) @@ -233,7 +233,7 @@ end # mapping terms, stored in `cache.elements.contravariant_vectors`, is peeled apart # from the evaluation of the physical fluxes in each Cartesian direction function calc_volume_integral!(du, u, - mesh::Union{TreeMesh{2}, StructuredMesh{2}, + mesh::Union{TreeMesh{2}, StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms, equations, From f019845d92cfe696d9e2f6c8b74780303cb634e9 Mon Sep 17 00:00:00 2001 From: SimonCan Date: Wed, 19 Jun 2024 12:49:28 +0100 Subject: [PATCH 2/2] Applied autoformatter. --- src/solvers/dgsem_structured/dg_2d.jl | 15 ++++++++++----- src/solvers/dgsem_tree/dg_2d.jl | 6 ++++-- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/solvers/dgsem_structured/dg_2d.jl b/src/solvers/dgsem_structured/dg_2d.jl index f0bad1cd471..51b91eac6be 100644 --- a/src/solvers/dgsem_structured/dg_2d.jl +++ b/src/solvers/dgsem_structured/dg_2d.jl @@ -100,7 +100,8 @@ end @inline function flux_differencing_kernel!(du, u, element, - mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, + mesh::Union{StructuredMesh{2}, + StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::False, equations, @@ -157,7 +158,8 @@ end @inline function flux_differencing_kernel!(du, u, element, - mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, + mesh::Union{StructuredMesh{2}, + StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::True, equations, @@ -226,7 +228,8 @@ end # "A provably entropy stable subcell shock capturing approach for high order split form DG for the compressible Euler equations" # [arXiv: 2008.12044v2](https://arxiv.org/pdf/2008.12044) @inline function calcflux_fv!(fstar1_L, fstar1_R, fstar2_L, fstar2_R, u, - mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, + mesh::Union{StructuredMesh{2}, StructuredMeshView{2}, + UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::False, equations, volume_flux_fv, dg::DGSEM, element, cache) @@ -296,7 +299,8 @@ end # Calculate the finite volume fluxes inside curvilinear elements (**with non-conservative terms**). @inline function calcflux_fv!(fstar1_L, fstar1_R, fstar2_L, fstar2_R, u::AbstractArray{<:Any, 4}, - mesh::Union{StructuredMesh{2}, StructuredMesh{2}, UnstructuredMesh2D, + mesh::Union{StructuredMesh{2}, StructuredMesh{2}, + UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms::True, equations, volume_flux_fv, dg::DGSEM, element, cache) @@ -475,7 +479,8 @@ end @inline function calc_interface_flux!(surface_flux_values, left_element, right_element, orientation, u, - mesh::Union{StructuredMesh{2}, StructuredMeshView{2}}, + mesh::Union{StructuredMesh{2}, + StructuredMeshView{2}}, nonconservative_terms::True, equations, surface_integral, dg::DG, cache) # See comment on `calc_interface_flux!` with `nonconservative_terms::False` diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index 706eb8243a4..6a26b5e95be 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -36,7 +36,8 @@ end # The methods below are specialized on the volume integral type # and called from the basic `create_cache` method at the top. -function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, StructuredMeshView{2}, UnstructuredMesh2D, +function create_cache(mesh::Union{TreeMesh{2}, StructuredMesh{2}, StructuredMeshView{2}, + UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, equations, volume_integral::VolumeIntegralFluxDifferencing, dg::DG, uEltype) @@ -233,7 +234,8 @@ end # mapping terms, stored in `cache.elements.contravariant_vectors`, is peeled apart # from the evaluation of the physical fluxes in each Cartesian direction function calc_volume_integral!(du, u, - mesh::Union{TreeMesh{2}, StructuredMesh{2}, StructuredMeshView{2}, + mesh::Union{TreeMesh{2}, StructuredMesh{2}, + StructuredMeshView{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, nonconservative_terms, equations,