From 9777671a3a552251d5f59f74ce37e7183785de85 Mon Sep 17 00:00:00 2001 From: Daniel_Doehring Date: Wed, 18 Oct 2023 17:04:50 +0200 Subject: [PATCH 01/14] Add comments explaining why weak form is only for conserved terms --- src/solvers/dg.jl | 5 +++++ src/solvers/dgsem_structured/dg_2d.jl | 7 +++++++ src/solvers/dgsem_structured/dg_3d.jl | 7 +++++++ src/solvers/dgsem_tree/dg_1d.jl | 7 +++++++ src/solvers/dgsem_tree/dg_2d.jl | 7 +++++++ src/solvers/dgsem_tree/dg_3d.jl | 7 +++++++ 6 files changed, 40 insertions(+) diff --git a/src/solvers/dg.jl b/src/solvers/dg.jl index 36bbc6de361..2677d94e4b6 100644 --- a/src/solvers/dg.jl +++ b/src/solvers/dg.jl @@ -35,6 +35,11 @@ standard textbooks. Nodal Discontinuous Galerkin Methods: Algorithms, Analysis, and Applications [doi: 10.1007/978-0-387-72067-8](https://doi.org/10.1007/978-0-387-72067-8) + +`VolumeIntegralWeakForm()` is only implemented for conserved terms as +non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +see `VolumeIntegralFluxDifferencing(volume_flux)`. +This treatment is required to achieve e.g. entropy-stability and well-balancedness. """ struct VolumeIntegralWeakForm <: AbstractVolumeIntegral end diff --git a/src/solvers/dgsem_structured/dg_2d.jl b/src/solvers/dgsem_structured/dg_2d.jl index 3e8ce759b30..829e7761294 100644 --- a/src/solvers/dgsem_structured/dg_2d.jl +++ b/src/solvers/dgsem_structured/dg_2d.jl @@ -49,6 +49,13 @@ function rhs!(du, u, t, return nothing end +#= +`weak_form_kernel!` is only implemented for conserved terms as +non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +see `flux_differencing_kernel!`. +This treatment is required to achieve e.g. entropy-stability and well-balancedness. +See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 +=# @inline function weak_form_kernel!(du, u, element, mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, diff --git a/src/solvers/dgsem_structured/dg_3d.jl b/src/solvers/dgsem_structured/dg_3d.jl index 0e6bf8a2ac0..1ce9b178c7a 100644 --- a/src/solvers/dgsem_structured/dg_3d.jl +++ b/src/solvers/dgsem_structured/dg_3d.jl @@ -49,6 +49,13 @@ function rhs!(du, u, t, return nothing end +#= +`weak_form_kernel!` is only implemented for conserved terms as +non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +see `flux_differencing_kernel!`. +This treatment is required to achieve e.g. entropy-stability and well-balancedness. +See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 +=# @inline function weak_form_kernel!(du, u, element, mesh::Union{StructuredMesh{3}, P4estMesh{3}}, diff --git a/src/solvers/dgsem_tree/dg_1d.jl b/src/solvers/dgsem_tree/dg_1d.jl index b5bb076f3b7..92917ae7f74 100644 --- a/src/solvers/dgsem_tree/dg_1d.jl +++ b/src/solvers/dgsem_tree/dg_1d.jl @@ -144,6 +144,13 @@ function calc_volume_integral!(du, u, return nothing end +#= +`weak_form_kernel!` is only implemented for conserved terms as +non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +see `flux_differencing_kernel!`. +This treatment is required to achieve e.g. entropy-stability and well-balancedness. +See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 +=# @inline function weak_form_kernel!(du, u, element, mesh::Union{TreeMesh{1}, StructuredMesh{1}}, nonconservative_terms::False, equations, diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index c30d0a8e01a..2962c09a631 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -194,6 +194,13 @@ function calc_volume_integral!(du, u, return nothing end +#= +`weak_form_kernel!` is only implemented for conserved terms as +non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +see `flux_differencing_kernel!`. +This treatment is required to achieve e.g. entropy-stability and well-balancedness. +See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 +=# @inline function weak_form_kernel!(du, u, element, mesh::TreeMesh{2}, nonconservative_terms::False, equations, diff --git a/src/solvers/dgsem_tree/dg_3d.jl b/src/solvers/dgsem_tree/dg_3d.jl index acdab900cd1..7aec4ff5c5c 100644 --- a/src/solvers/dgsem_tree/dg_3d.jl +++ b/src/solvers/dgsem_tree/dg_3d.jl @@ -223,6 +223,13 @@ function calc_volume_integral!(du, u, return nothing end +#= +`weak_form_kernel!` is only implemented for conserved terms as +non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +see `flux_differencing_kernel!`. +This treatment is required to achieve e.g. entropy-stability and well-balancedness. +See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 +=# @inline function weak_form_kernel!(du, u, element, mesh::TreeMesh{3}, nonconservative_terms::False, equations, From 7caea6f367901826640641748a75bc16a70fb745 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:22:50 +0200 Subject: [PATCH 02/14] Update src/solvers/dg.jl Co-authored-by: Andrew Winters --- src/solvers/dg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dg.jl b/src/solvers/dg.jl index 2732a089c72..2e115c9963a 100644 --- a/src/solvers/dg.jl +++ b/src/solvers/dg.jl @@ -44,7 +44,7 @@ standard textbooks. `VolumeIntegralWeakForm()` is only implemented for conserved terms as non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, see `VolumeIntegralFluxDifferencing(volume_flux)`. -This treatment is required to achieve e.g. entropy-stability and well-balancedness. +This treatment is required to achieve, e.g., entropy-stability or well-balancedness. """ struct VolumeIntegralWeakForm <: AbstractVolumeIntegral end From bc5fe5a6be3ccca2f1598bcf448bfefcc02eae0d Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:02 +0200 Subject: [PATCH 03/14] Update src/solvers/dgsem_structured/dg_2d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_structured/dg_2d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_structured/dg_2d.jl b/src/solvers/dgsem_structured/dg_2d.jl index 829e7761294..290cc42f3df 100644 --- a/src/solvers/dgsem_structured/dg_2d.jl +++ b/src/solvers/dgsem_structured/dg_2d.jl @@ -51,7 +51,7 @@ end #= `weak_form_kernel!` is only implemented for conserved terms as -non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. This treatment is required to achieve e.g. entropy-stability and well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 From 364b686bd58131e437e24f2c0bd39baf4b408813 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:09 +0200 Subject: [PATCH 04/14] Update src/solvers/dg.jl Co-authored-by: Andrew Winters --- src/solvers/dg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dg.jl b/src/solvers/dg.jl index 2e115c9963a..de4ec486b79 100644 --- a/src/solvers/dg.jl +++ b/src/solvers/dg.jl @@ -42,7 +42,7 @@ standard textbooks. [doi: 10.1007/978-0-387-72067-8](https://doi.org/10.1007/978-0-387-72067-8) `VolumeIntegralWeakForm()` is only implemented for conserved terms as -non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `VolumeIntegralFluxDifferencing(volume_flux)`. This treatment is required to achieve, e.g., entropy-stability or well-balancedness. """ From c9126aebf6971c82ae4fd29266768c8d4cc036e1 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:15 +0200 Subject: [PATCH 05/14] Update src/solvers/dgsem_structured/dg_3d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_structured/dg_3d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_structured/dg_3d.jl b/src/solvers/dgsem_structured/dg_3d.jl index 1ce9b178c7a..83bb1d0081d 100644 --- a/src/solvers/dgsem_structured/dg_3d.jl +++ b/src/solvers/dgsem_structured/dg_3d.jl @@ -51,7 +51,7 @@ end #= `weak_form_kernel!` is only implemented for conserved terms as -non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. This treatment is required to achieve e.g. entropy-stability and well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 From 6ddfdcf60f06a3acc832fd280b0c550e12786435 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:21 +0200 Subject: [PATCH 06/14] Update src/solvers/dgsem_structured/dg_2d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_structured/dg_2d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_structured/dg_2d.jl b/src/solvers/dgsem_structured/dg_2d.jl index 290cc42f3df..25a0eea096f 100644 --- a/src/solvers/dgsem_structured/dg_2d.jl +++ b/src/solvers/dgsem_structured/dg_2d.jl @@ -53,7 +53,7 @@ end `weak_form_kernel!` is only implemented for conserved terms as non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. -This treatment is required to achieve e.g. entropy-stability and well-balancedness. +This treatment is required to achieve, e.g., entropy-stability or well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 =# @inline function weak_form_kernel!(du, u, From 1c531784ec6a0169f777dd36ee8ffca43bd8b130 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:29 +0200 Subject: [PATCH 07/14] Update src/solvers/dgsem_tree/dg_2d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_tree/dg_2d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index 2962c09a631..85603a85d76 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -196,7 +196,7 @@ end #= `weak_form_kernel!` is only implemented for conserved terms as -non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. This treatment is required to achieve e.g. entropy-stability and well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 From f1c17554be363b53bb62d4d46f19e80926bece79 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:35 +0200 Subject: [PATCH 08/14] Update src/solvers/dgsem_tree/dg_1d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_tree/dg_1d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_tree/dg_1d.jl b/src/solvers/dgsem_tree/dg_1d.jl index 92917ae7f74..e5a91fd3f8a 100644 --- a/src/solvers/dgsem_tree/dg_1d.jl +++ b/src/solvers/dgsem_tree/dg_1d.jl @@ -148,7 +148,7 @@ end `weak_form_kernel!` is only implemented for conserved terms as non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. -This treatment is required to achieve e.g. entropy-stability and well-balancedness. +This treatment is required to achieve, e.g., entropy-stability or well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 =# @inline function weak_form_kernel!(du, u, From 22f19843d4e83d30225b0725eb0330a6720d3a70 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:43 +0200 Subject: [PATCH 09/14] Update src/solvers/dgsem_tree/dg_3d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_tree/dg_3d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_tree/dg_3d.jl b/src/solvers/dgsem_tree/dg_3d.jl index 7aec4ff5c5c..505c2a1c218 100644 --- a/src/solvers/dgsem_tree/dg_3d.jl +++ b/src/solvers/dgsem_tree/dg_3d.jl @@ -225,7 +225,7 @@ end #= `weak_form_kernel!` is only implemented for conserved terms as -non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. This treatment is required to achieve e.g. entropy-stability and well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 From bb19f1cb4312dda438a8435a0c785c2c0912cbd9 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:49 +0200 Subject: [PATCH 10/14] Update src/solvers/dgsem_tree/dg_2d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_tree/dg_2d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_tree/dg_2d.jl b/src/solvers/dgsem_tree/dg_2d.jl index 85603a85d76..7ecf4c00032 100644 --- a/src/solvers/dgsem_tree/dg_2d.jl +++ b/src/solvers/dgsem_tree/dg_2d.jl @@ -198,7 +198,7 @@ end `weak_form_kernel!` is only implemented for conserved terms as non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. -This treatment is required to achieve e.g. entropy-stability and well-balancedness. +This treatment is required to achieve, e.g., entropy-stability or well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 =# @inline function weak_form_kernel!(du, u, From cf7deee79445f3a14f9a6113cdbd673c137e15bf Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:23:55 +0200 Subject: [PATCH 11/14] Update src/solvers/dgsem_tree/dg_3d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_tree/dg_3d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_tree/dg_3d.jl b/src/solvers/dgsem_tree/dg_3d.jl index 505c2a1c218..3364187e93c 100644 --- a/src/solvers/dgsem_tree/dg_3d.jl +++ b/src/solvers/dgsem_tree/dg_3d.jl @@ -227,7 +227,7 @@ end `weak_form_kernel!` is only implemented for conserved terms as non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. -This treatment is required to achieve e.g. entropy-stability and well-balancedness. +This treatment is required to achieve, e.g., entropy-stability or well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 =# @inline function weak_form_kernel!(du, u, From 07140f316194cccb001739b8dc232d8ba4cf38ca Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:24:04 +0200 Subject: [PATCH 12/14] Update src/solvers/dgsem_structured/dg_3d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_structured/dg_3d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_structured/dg_3d.jl b/src/solvers/dgsem_structured/dg_3d.jl index 83bb1d0081d..cdb085e9008 100644 --- a/src/solvers/dgsem_structured/dg_3d.jl +++ b/src/solvers/dgsem_structured/dg_3d.jl @@ -53,7 +53,7 @@ end `weak_form_kernel!` is only implemented for conserved terms as non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. -This treatment is required to achieve e.g. entropy-stability and well-balancedness. +This treatment is required to achieve, e.g., entropy-stability or well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 =# @inline function weak_form_kernel!(du, u, From e108243a04db87b8756a2287ad380d4b3917ab8d Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Thu, 19 Oct 2023 23:24:13 +0200 Subject: [PATCH 13/14] Update src/solvers/dgsem_tree/dg_1d.jl Co-authored-by: Andrew Winters --- src/solvers/dgsem_tree/dg_1d.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dgsem_tree/dg_1d.jl b/src/solvers/dgsem_tree/dg_1d.jl index e5a91fd3f8a..4a0747d1c09 100644 --- a/src/solvers/dgsem_tree/dg_1d.jl +++ b/src/solvers/dgsem_tree/dg_1d.jl @@ -146,7 +146,7 @@ end #= `weak_form_kernel!` is only implemented for conserved terms as -non-conserved terms are supposed to be always applied in conjunction with a flux-splitting scheme, +non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, see `flux_differencing_kernel!`. This treatment is required to achieve, e.g., entropy-stability or well-balancedness. See also https://github.com/trixi-framework/Trixi.jl/issues/1671#issuecomment-1765644064 From 82e06ccaa3dbd003ee36ae37a17c867209277ad8 Mon Sep 17 00:00:00 2001 From: Daniel Doehring Date: Fri, 20 Oct 2023 08:46:10 +0200 Subject: [PATCH 14/14] Update src/solvers/dg.jl Co-authored-by: Hendrik Ranocha --- src/solvers/dg.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/solvers/dg.jl b/src/solvers/dg.jl index de4ec486b79..91ad59b76b6 100644 --- a/src/solvers/dg.jl +++ b/src/solvers/dg.jl @@ -43,7 +43,7 @@ standard textbooks. `VolumeIntegralWeakForm()` is only implemented for conserved terms as non-conservative terms should always be discretized in conjunction with a flux-splitting scheme, -see `VolumeIntegralFluxDifferencing(volume_flux)`. +see [`VolumeIntegralFluxDifferencing`](@ref). This treatment is required to achieve, e.g., entropy-stability or well-balancedness. """ struct VolumeIntegralWeakForm <: AbstractVolumeIntegral end