Skip to content

Commit

Permalink
Add @inline to checks and goal functions; Update test required
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Oct 13, 2023
1 parent 463de3a commit e4d3a9d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/solvers/dgsem_tree/subcell_limiters_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -686,28 +686,28 @@ end
end

# Initial checks
function initial_check_entropy_spec(bound, goal, newton_abstol)
@inline function initial_check_entropy_spec(bound, goal, newton_abstol)
goal <= max(newton_abstol, abs(bound) * newton_abstol)
end

function initial_check_entropy_math(bound, goal, newton_abstol)
@inline function initial_check_entropy_math(bound, goal, newton_abstol)
goal >= -max(newton_abstol, abs(bound) * newton_abstol)
end

initial_check_nonnegative(bound, goal, newton_abstol) = goal <= 0
@inline initial_check_nonnegative(bound, goal, newton_abstol) = goal <= 0

# Goal and d(Goal)d(u) function
goal_function(variable, bound, u, equations) = bound - variable(u, equations)
function dgoal_function(variable, u, dt, antidiffusive_flux, equations)
@inline goal_function(variable, bound, u, equations) = bound - variable(u, equations)
@inline function dgoal_function(variable, u, dt, antidiffusive_flux, equations)
-dot(variable(u, equations, True()), dt * antidiffusive_flux)
end

# Final check
function final_check_standard(bound, goal, newton_abstol)
@inline function final_check_standard(bound, goal, newton_abstol)
abs(goal) < max(newton_abstol, abs(bound) * newton_abstol)
end

function final_check_nonnegative(bound, goal, newton_abstol)
@inline function final_check_nonnegative(bound, goal, newton_abstol)
(goal <= eps()) && (goal > -max(newton_abstol, abs(bound) * newton_abstol))
end

Expand Down

0 comments on commit e4d3a9d

Please sign in to comment.