Skip to content

Commit

Permalink
Removed specialized divB routines for multi-ion MHD
Browse files Browse the repository at this point in the history
  • Loading branch information
amrueda committed Nov 26, 2024
1 parent 3dc164b commit a555e55
Showing 1 changed file with 0 additions and 38 deletions.
38 changes: 0 additions & 38 deletions src/callbacks_step/analysis_dg2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}},
Expand Down Expand Up @@ -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}},
Expand Down

0 comments on commit a555e55

Please sign in to comment.