Skip to content
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

Fix P4estMesh CI issues #1593

Merged
merged 1 commit into from
Jul 29, 2023
Merged
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
54 changes: 0 additions & 54 deletions src/solvers/dgsem_p4est/dg_3d_parabolic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -563,60 +563,6 @@ function prolong2boundaries!(cache_parabolic, flux_viscous,
return nothing
end

# # Function barrier for type stability
# !!! TODO: Figure out why this cannot removed eventhough it exists in the dg_2d_parabolic.jl file
function calc_boundary_flux_gradients!(cache, t, boundary_conditions, mesh::P4estMesh,
equations, surface_integral, dg::DG)
(; boundary_condition_types, boundary_indices) = boundary_conditions

calc_boundary_flux_by_type!(cache, t, boundary_condition_types, boundary_indices,
Gradient(), mesh, equations, surface_integral, dg)
return nothing
end

function calc_boundary_flux_divergence!(cache, t, boundary_conditions, mesh::P4estMesh,
equations, surface_integral, dg::DG)
(; boundary_condition_types, boundary_indices) = boundary_conditions

calc_boundary_flux_by_type!(cache, t, boundary_condition_types, boundary_indices,
Divergence(), mesh, equations, surface_integral, dg)
return nothing
end

# Iterate over tuples of boundary condition types and associated indices
# in a type-stable way using "lispy tuple programming".
function calc_boundary_flux_by_type!(cache, t, BCs::NTuple{N, Any},
BC_indices::NTuple{N, Vector{Int}},
operator_type,
mesh::P4estMesh,
equations, surface_integral, dg::DG) where {N}
# Extract the boundary condition type and index vector
boundary_condition = first(BCs)
boundary_condition_indices = first(BC_indices)
# Extract the remaining types and indices to be processed later
remaining_boundary_conditions = Base.tail(BCs)
remaining_boundary_condition_indices = Base.tail(BC_indices)

# process the first boundary condition type
calc_boundary_flux!(cache, t, boundary_condition, boundary_condition_indices,
operator_type, mesh, equations, surface_integral, dg)

# recursively call this method with the unprocessed boundary types
calc_boundary_flux_by_type!(cache, t, remaining_boundary_conditions,
remaining_boundary_condition_indices,
operator_type,
mesh, equations, surface_integral, dg)

return nothing
end

# terminate the type-stable iteration over tuples
function calc_boundary_flux_by_type!(cache, t, BCs::Tuple{}, BC_indices::Tuple{},
operator_type, mesh::P4estMesh, equations,
surface_integral, dg::DG)
nothing
end

function calc_boundary_flux!(cache, t,
boundary_condition_parabolic, # works with Dict types
boundary_condition_indices,
Expand Down
Loading