Skip to content

Commit

Permalink
sqrtG -> J
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmontoya committed Jan 3, 2025
1 parent 0356b55 commit 192c84b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions src/callbacks_step/analysis_covariant.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function Trixi.integrate(func::Func, u,
end

# For the covariant form, we want to integrate using the exact area element
# √G = (det(AᵀA))^(1/2), which is stored in cache.auxiliary_variables, not the approximate
# J = (det(AᵀA))^(1/2), which is stored in cache.auxiliary_variables, not the approximate
# area element used in the Cartesian formulation, which stored in cache.elements
function Trixi.integrate_via_indices(func::Func, u,
mesh::Union{StructuredMesh{2},
Expand All @@ -42,10 +42,10 @@ function Trixi.integrate_via_indices(func::Func, u,
for element in eachelement(dg, cache)
for j in eachnode(dg), i in eachnode(dg)
aux_node = get_node_aux_vars(aux_node_vars, equations, dg, i, j, element)
sqrtG = area_element(aux_node, equations)
integral += weights[i] * weights[j] * sqrtG *
J = area_element(aux_node, equations)
integral += weights[i] * weights[j] * J *
func(u, i, j, element, equations, dg, args...)
total_volume += weights[i] * weights[j] * sqrtG
total_volume += weights[i] * weights[j] * J
end
end

Expand Down Expand Up @@ -108,14 +108,14 @@ function Trixi.calc_error_norms(func, u, t, analyzer, mesh::P4estMesh{2},
diff = func(u_exact, equations) - func(u_numerical, equations)

# For the L2 error, integrate with respect to area element stored in aux vars
sqrtG = area_element(aux_node, equations)
l2_error += diff .^ 2 * (weights[i] * weights[j] * sqrtG)
J = area_element(aux_node, equations)
l2_error += diff .^ 2 * (weights[i] * weights[j] * J)

# Compute Linf error as usual
linf_error = @. max(linf_error, abs(diff))

# Increment total volume according to the volume element stored in aux vars
total_volume += weights[i] * weights[j] * sqrtG
total_volume += weights[i] * weights[j] * J
end
end

Expand Down
8 changes: 4 additions & 4 deletions src/equations/covariant_advection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ end
@inline function Trixi.flux(u, aux_vars, orientation::Integer,
equations::CovariantLinearAdvectionEquation2D)
z = zero(eltype(u))
sqrtG = area_element(aux_vars, equations)
J = area_element(aux_vars, equations)
vcon = velocity(u, equations)
return SVector(sqrtG * u[1] * vcon[orientation], z, z)
return SVector(J * u[1] * vcon[orientation], z, z)
end

# Local Lax-Friedrichs dissipation which is not applied to the contravariant velocity
Expand All @@ -105,10 +105,10 @@ end
orientation_or_normal_direction,
equations::CovariantLinearAdvectionEquation2D)
z = zero(eltype(u_ll))
sqrtG = area_element(aux_vars_ll, equations)
J = area_element(aux_vars_ll, equations)
λ = dissipation.max_abs_speed(u_ll, u_rr, aux_vars_ll, aux_vars_rr,
orientation_or_normal_direction, equations)
return -0.5f0 * sqrtG * λ * SVector(u_rr[1] - u_ll[1], z, z)
return -0.5f0 * J * λ * SVector(u_rr[1] - u_ll[1], z, z)
end

# Maximum contravariant wave speed with respect to specific basis vector
Expand Down

0 comments on commit 192c84b

Please sign in to comment.