Skip to content

Commit

Permalink
Use get_node_vars for divB analysis rutines of TreeMesh{3}
Browse files Browse the repository at this point in the history
  • Loading branch information
amrueda committed Nov 25, 2024
1 parent 62ff764 commit f14f0a3
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/callbacks_step/analysis_dg3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,13 @@ function analyze(::Val{:l2_divb}, du, u, t,
dg, cache, derivative_matrix
divb = zero(eltype(u))
for l in eachnode(dg)
B_ljk = magnetic_field(u[:, l, j, k, element], equations)
B_ilk = magnetic_field(u[:, i, l, k, element], equations)
B_ijl = magnetic_field(u[:, i, j, l, element], equations)
u_ljk = get_node_vars(u, equations, dg, l, j, k, element)
u_ilk = get_node_vars(u, equations, dg, i, l, k, element)
u_ijl = get_node_vars(u, equations, dg, i, j, l, element)

B_ljk = magnetic_field(u_ljk, equations)
B_ilk = magnetic_field(u_ilk, equations)
B_ijl = magnetic_field(u_ijl, equations)

divb += (derivative_matrix[i, l] * B_ljk[1] +
derivative_matrix[j, l] * B_ilk[2] +
Expand Down Expand Up @@ -372,9 +376,13 @@ function analyze(::Val{:linf_divb}, du, u, t,
for k in eachnode(dg), j in eachnode(dg), i in eachnode(dg)
divb = zero(eltype(u))
for l in eachnode(dg)
B_ljk = magnetic_field(u[:, l, j, k, element], equations)
B_ilk = magnetic_field(u[:, i, l, k, element], equations)
B_ijl = magnetic_field(u[:, i, j, l, element], equations)
u_ljk = get_node_vars(u, equations, dg, l, j, k, element)
u_ilk = get_node_vars(u, equations, dg, i, l, k, element)
u_ijl = get_node_vars(u, equations, dg, i, j, l, element)

B_ljk = magnetic_field(u_ljk, equations)
B_ilk = magnetic_field(u_ilk, equations)
B_ijl = magnetic_field(u_ijl, equations)

divb += (derivative_matrix[i, l] * B_ljk[1] +
derivative_matrix[j, l] * B_ilk[2] +
Expand Down

0 comments on commit f14f0a3

Please sign in to comment.