From a555e558b77ad4a7c3e30ce46b5b32c59543b865 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Rueda-Ram=C3=ADrez?= Date: Tue, 26 Nov 2024 08:48:18 +0100 Subject: [PATCH] Removed specialized divB routines for multi-ion MHD --- src/callbacks_step/analysis_dg2d.jl | 38 ----------------------------- 1 file changed, 38 deletions(-) diff --git a/src/callbacks_step/analysis_dg2d.jl b/src/callbacks_step/analysis_dg2d.jl index e41debe8a36..e089133fa17 100644 --- a/src/callbacks_step/analysis_dg2d.jl +++ b/src/callbacks_step/analysis_dg2d.jl @@ -296,22 +296,6 @@ function analyze(::Val{:l2_divb}, du, u, t, end |> sqrt end -function analyze(::Val{:l2_divb}, du, u, t, - mesh::TreeMesh{2}, equations::IdealMhdMultiIonEquations2D, - dg::DG, cache) - integrate_via_indices(u, mesh, equations, dg, cache, cache, - dg.basis.derivative_matrix) do u, i, j, element, equations, - dg, cache, derivative_matrix - divb = zero(eltype(u)) - for k in eachnode(dg) - divb += (derivative_matrix[i, k] * u[1, k, j, element] + - derivative_matrix[j, k] * u[2, i, k, element]) - end - divb *= cache.elements.inverse_jacobian[element] - divb^2 - end |> sqrt -end - function analyze(::Val{:l2_divb}, du, u, t, mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}}, @@ -364,28 +348,6 @@ function analyze(::Val{:linf_divb}, du, u, t, return linf_divb end -function analyze(::Val{:linf_divb}, du, u, t, - mesh::TreeMesh{2}, equations::IdealMhdMultiIonEquations2D, - dg::DG, cache) - @unpack derivative_matrix, weights = dg.basis - - # integrate over all elements to get the divergence-free condition errors - linf_divb = zero(eltype(u)) - for element in eachelement(dg, cache) - for j in eachnode(dg), i in eachnode(dg) - divb = zero(eltype(u)) - for k in eachnode(dg) - divb += (derivative_matrix[i, k] * u[1, k, j, element] + - derivative_matrix[j, k] * u[2, i, k, element]) - end - divb *= cache.elements.inverse_jacobian[element] - linf_divb = max(linf_divb, abs(divb)) - end - end - - return linf_divb -end - function analyze(::Val{:linf_divb}, du, u, t, mesh::Union{StructuredMesh{2}, UnstructuredMesh2D, P4estMesh{2}, T8codeMesh{2}},