Skip to content

Use variable name have_nonconservative_terms everywhere #2400

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/semidiscretization/semidiscretization_coupled.jl
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ end
boundary_condition::BoundaryConditionCoupled,
mesh::Union{StructuredMesh,
StructuredMeshView},
nonconservative_terms::False,
have_nonconservative_terms::False,
equations,
surface_integral, dg::DG, cache,
direction, node_indices,
Expand Down Expand Up @@ -693,7 +693,7 @@ end
boundary_condition::BoundaryConditionCoupled,
mesh::Union{StructuredMesh,
StructuredMeshView},
nonconservative_terms::True,
have_nonconservative_terms::True,
equations,
surface_integral, dg::DG, cache,
direction, node_indices,
Expand Down
10 changes: 6 additions & 4 deletions src/solvers/dgmulti/flux_differencing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,8 @@ end
# Computes flux differencing contribution from each Cartesian direction over a single element.
# For dense operators, we do not use sum factorization.
@inline function local_flux_differencing!(fluxdiff_local, u_local, element_index,
has_nonconservative_terms::False, volume_flux,
have_nonconservative_terms::False,
volume_flux,
has_sparse_operators::False, mesh,
equations, dg, cache)
for dim in eachdim(mesh)
Expand All @@ -466,7 +467,7 @@ end
end

@inline function local_flux_differencing!(fluxdiff_local, u_local, element_index,
has_nonconservative_terms::True, volume_flux,
have_nonconservative_terms::True, volume_flux,
has_sparse_operators::False, mesh,
equations, dg, cache)
flux_conservative, flux_nonconservative = volume_flux
Expand All @@ -490,7 +491,8 @@ end
# When the operators are sparse, we use the sum-factorization approach to
# computing flux differencing.
@inline function local_flux_differencing!(fluxdiff_local, u_local, element_index,
has_nonconservative_terms::False, volume_flux,
have_nonconservative_terms::False,
volume_flux,
has_sparse_operators::True, mesh,
equations, dg, cache)
@unpack Qrst_skew = cache
Expand Down Expand Up @@ -520,7 +522,7 @@ end
end

@inline function local_flux_differencing!(fluxdiff_local, u_local, element_index,
has_nonconservative_terms::True, volume_flux,
have_nonconservative_terms::True, volume_flux,
has_sparse_operators::True, mesh,
equations, dg, cache)
@unpack Qrst_skew = cache
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/dgmulti/sbp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function calc_volume_integral!(du, u, mesh::DGMultiMesh,
# `= ∑_j (1 / M[i,i] * Q[i,j]) * volume_flux(u[i], u[j])`
# `= ∑_j D[i,j] * volume_flux(u[i], u[j])`
# TODO: DGMulti.
# This would have to be changed if `has_nonconservative_terms = False()`
# This would have to be changed if `have_nonconservative_terms = False()`
# because then `volume_flux` is non-symmetric.
A = dg.basis.Drst[dim]

Expand Down Expand Up @@ -243,7 +243,7 @@ function calc_volume_integral!(du, u, mesh::DGMultiMesh,

A = dg.basis.Drst[dim]

# since has_nonconservative_terms::False,
# since have_nonconservative_terms::False,
# the volume flux is symmetric.
flux_is_symmetric = True()
hadamard_sum!(du, A, flux_is_symmetric, volume_flux,
Expand Down
20 changes: 10 additions & 10 deletions src/solvers/dgsem_p4est/dg_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ end
function calc_interface_flux!(surface_flux_values,
mesh::Union{P4estMesh{2}, P4estMeshView{2},
T8codeMesh{2}},
nonconservative_terms,
have_nonconservative_terms,
equations, surface_integral, dg::DG, cache)
@unpack neighbor_ids, node_indices = cache.interfaces
@unpack contravariant_vectors = cache.elements
Expand Down Expand Up @@ -168,7 +168,7 @@ function calc_interface_flux!(surface_flux_values,
i_primary, j_primary,
primary_element)

calc_interface_flux!(surface_flux_values, mesh, nonconservative_terms,
calc_interface_flux!(surface_flux_values, mesh, have_nonconservative_terms,
equations,
surface_integral, dg, cache,
interface, normal_direction,
Expand All @@ -190,7 +190,7 @@ end
@inline function calc_interface_flux!(surface_flux_values,
mesh::Union{P4estMesh{2}, P4estMeshView{2},
T8codeMesh{2}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
interface_index, normal_direction,
primary_node_index, primary_direction_index,
Expand All @@ -214,7 +214,7 @@ end
# Inlined version of the interface flux computation for equations with conservative and nonconservative terms
@inline function calc_interface_flux!(surface_flux_values,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
nonconservative_terms::True, equations,
have_nonconservative_terms::True, equations,
surface_integral, dg::DG, cache,
interface_index, normal_direction,
primary_node_index, primary_direction_index,
Expand Down Expand Up @@ -314,7 +314,7 @@ end
# inlined version of the boundary flux calculation along a physical interface
@inline function calc_boundary_flux!(surface_flux_values, t, boundary_condition,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
i_index, j_index,
node_index, direction_index, element_index,
Expand Down Expand Up @@ -345,7 +345,7 @@ end
# inlined version of the boundary flux with nonconservative terms calculation along a physical interface
@inline function calc_boundary_flux!(surface_flux_values, t, boundary_condition,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
nonconservative_terms::True, equations,
have_nonconservative_terms::True, equations,
surface_integral, dg::DG, cache,
i_index, j_index,
node_index, direction_index, element_index,
Expand Down Expand Up @@ -450,7 +450,7 @@ end

function calc_mortar_flux!(surface_flux_values,
mesh::Union{P4estMesh{2}, P4estMeshView{2}, T8codeMesh{2}},
nonconservative_terms, equations,
have_nonconservative_terms, equations,
mortar_l2::LobattoLegendreMortarL2,
surface_integral, dg::DG, cache)
@unpack neighbor_ids, node_indices = cache.mortars
Expand Down Expand Up @@ -489,7 +489,7 @@ function calc_mortar_flux!(surface_flux_values,
i_small, j_small, element)

calc_mortar_flux!(fstar_primary, fstar_secondary,
mesh, nonconservative_terms, equations,
mesh, have_nonconservative_terms, equations,
surface_integral, dg, cache,
mortar, position, normal_direction,
node)
Expand Down Expand Up @@ -520,7 +520,7 @@ end
# Inlined version of the mortar flux computation on small elements for conservation laws
@inline function calc_mortar_flux!(fstar_primary, fstar_secondary,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
mortar_index, position_index, normal_direction,
node_index)
Expand All @@ -541,7 +541,7 @@ end
# nonconservative terms
@inline function calc_mortar_flux!(fstar_primary, fstar_secondary,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
nonconservative_terms::True, equations,
have_nonconservative_terms::True, equations,
surface_integral, dg::DG, cache,
mortar_index, position_index, normal_direction,
node_index)
Expand Down
4 changes: 2 additions & 2 deletions src/solvers/dgsem_p4est/dg_2d_parabolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,7 @@ end

# This version is used for parabolic gradient computations
@inline function calc_interface_flux!(surface_flux_values, mesh::P4estMesh{2},
nonconservative_terms::False,
have_nonconservative_terms::False,
equations::AbstractEquationsParabolic,
surface_integral, dg::DG, cache,
interface_index, normal_direction,
Expand Down Expand Up @@ -809,7 +809,7 @@ end
# non-conservative terms are present.
@inline function calc_mortar_flux!(fstar_primary, fstar_secondary,
mesh::Union{P4estMesh{2}, T8codeMesh{2}},
nonconservative_terms::False,
have_nonconservative_terms::False,
equations::AbstractEquationsParabolic,
surface_integral, dg::DG, cache,
mortar_index, position_index, normal_direction,
Expand Down
14 changes: 8 additions & 6 deletions src/solvers/dgsem_p4est/dg_2d_parallel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ end
function calc_mpi_interface_flux!(surface_flux_values,
mesh::Union{ParallelP4estMesh{2},
ParallelT8codeMesh{2}},
nonconservative_terms,
have_nonconservative_terms,
equations, surface_integral, dg::DG, cache)
@unpack local_neighbor_ids, node_indices, local_sides = cache.mpi_interfaces
@unpack contravariant_vectors = cache.elements
Expand Down Expand Up @@ -87,7 +87,8 @@ function calc_mpi_interface_flux!(surface_flux_values,
contravariant_vectors,
i_element, j_element, local_element)

calc_mpi_interface_flux!(surface_flux_values, mesh, nonconservative_terms,
calc_mpi_interface_flux!(surface_flux_values, mesh,
have_nonconservative_terms,
equations,
surface_integral, dg, cache,
interface, normal_direction,
Expand All @@ -110,7 +111,7 @@ end
@inline function calc_mpi_interface_flux!(surface_flux_values,
mesh::Union{ParallelP4estMesh{2},
ParallelT8codeMesh{2}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
interface_index, normal_direction,
interface_node_index, local_side,
Expand Down Expand Up @@ -202,7 +203,7 @@ end

function calc_mpi_mortar_flux!(surface_flux_values,
mesh::Union{ParallelP4estMesh{2}, ParallelT8codeMesh{2}},
nonconservative_terms, equations,
have_nonconservative_terms, equations,
mortar_l2::LobattoLegendreMortarL2,
surface_integral, dg::DG, cache)
@unpack local_neighbor_ids, local_neighbor_positions, node_indices = cache.mpi_mortars
Expand Down Expand Up @@ -231,7 +232,8 @@ function calc_mpi_mortar_flux!(surface_flux_values,
normal_direction = get_normal_direction(cache.mpi_mortars, node,
position, mortar)

calc_mpi_mortar_flux!(fstar, mesh, nonconservative_terms, equations,
calc_mpi_mortar_flux!(fstar, mesh, have_nonconservative_terms,
equations,
surface_integral, dg, cache,
mortar, position, normal_direction, node)

Expand All @@ -256,7 +258,7 @@ end
@inline function calc_mpi_mortar_flux!(fstar,
mesh::Union{ParallelP4estMesh{2},
ParallelT8codeMesh{2}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
mortar_index, position_index, normal_direction,
node_index)
Expand Down
17 changes: 9 additions & 8 deletions src/solvers/dgsem_p4est/dg_3d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ end

function calc_interface_flux!(surface_flux_values,
mesh::Union{P4estMesh{3}, T8codeMesh{3}},
nonconservative_terms,
have_nonconservative_terms,
equations, surface_integral, dg::DG, cache)
@unpack neighbor_ids, node_indices = cache.interfaces
@unpack contravariant_vectors = cache.elements
Expand Down Expand Up @@ -218,7 +218,8 @@ function calc_interface_flux!(surface_flux_values,
i_primary, j_primary, k_primary,
primary_element)

calc_interface_flux!(surface_flux_values, mesh, nonconservative_terms,
calc_interface_flux!(surface_flux_values, mesh,
have_nonconservative_terms,
equations,
surface_integral, dg, cache,
interface, normal_direction,
Expand Down Expand Up @@ -250,7 +251,7 @@ end
# Inlined function for interface flux computation for conservative flux terms
@inline function calc_interface_flux!(surface_flux_values,
mesh::Union{P4estMesh{3}, T8codeMesh{3}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
interface_index, normal_direction,
primary_i_node_index, primary_j_node_index,
Expand All @@ -277,7 +278,7 @@ end
# Inlined function for interface flux computation for flux + nonconservative terms
@inline function calc_interface_flux!(surface_flux_values,
mesh::Union{P4estMesh{3}, T8codeMesh{3}},
nonconservative_terms::True, equations,
have_nonconservative_terms::True, equations,
surface_integral, dg::DG, cache,
interface_index, normal_direction,
primary_i_node_index, primary_j_node_index,
Expand Down Expand Up @@ -521,7 +522,7 @@ end

function calc_mortar_flux!(surface_flux_values,
mesh::Union{P4estMesh{3}, T8codeMesh{3}},
nonconservative_terms, equations,
have_nonconservative_terms, equations,
mortar_l2::LobattoLegendreMortarL2,
surface_integral, dg::DG, cache)
@unpack neighbor_ids, node_indices = cache.mortars
Expand Down Expand Up @@ -562,7 +563,7 @@ function calc_mortar_flux!(surface_flux_values,
element)

calc_mortar_flux!(fstar_primary, fstar_secondary, mesh,
nonconservative_terms, equations,
have_nonconservative_terms, equations,
surface_integral, dg, cache,
mortar, position, normal_direction,
i, j)
Expand Down Expand Up @@ -598,7 +599,7 @@ end
# Inlined version of the mortar flux computation on small elements for conservation fluxes
@inline function calc_mortar_flux!(fstar_primary, fstar_secondary,
mesh::Union{P4estMesh{3}, T8codeMesh{3}},
nonconservative_terms::False, equations,
have_nonconservative_terms::False, equations,
surface_integral, dg::DG, cache,
mortar_index, position_index, normal_direction,
i_node_index, j_node_index)
Expand All @@ -621,7 +622,7 @@ end
# with nonconservative terms
@inline function calc_mortar_flux!(fstar_primary, fstar_secondary,
mesh::Union{P4estMesh{3}, T8codeMesh{3}},
nonconservative_terms::True, equations,
have_nonconservative_terms::True, equations,
surface_integral, dg::DG, cache,
mortar_index, position_index, normal_direction,
i_node_index, j_node_index)
Expand Down
Loading
Loading