Skip to content

Commit

Permalink
introduce a function barrier for boundary fluxes
Browse files Browse the repository at this point in the history
  • Loading branch information
ranocha committed May 12, 2021
1 parent 87868b1 commit cfec929
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/solvers/dg_unstructured_quad/dg_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,22 @@ function calc_boundary_flux!(cache, t, boundary_conditions,
boundary_condition = boundary_conditions[ name[boundary] ]

# calc boundary flux on the current boundary interface
for j in eachnode(dg)
calc_boundary_flux!(surface_flux_values, t, boundary_condition, mesh, equations, dg, cache,
j, side, element, boundary)
end
calc_boundary_flux!(surface_flux_values, t, boundary_condition, mesh, equations, dg, cache,
side, element, boundary)
end

return nothing
end

# use a function barrier for now to improve type stability
@noinline function calc_boundary_flux!(surface_flux_values, t, boundary_condition::BC,
mesh::UnstructuredQuadMesh, equations, dg::DG, cache,
side, element, boundary) where {BC}
for node in eachnode(dg)
calc_boundary_flux!(surface_flux_values, t, boundary_condition, mesh, equations, dg, cache,
node, side, element, boundary)
end
end

# inlined version of the boundary flux calculation along a physical interface where the
# boundary flux values are set according to a particular `boundary_condition` function
Expand Down

0 comments on commit cfec929

Please sign in to comment.