Skip to content

Commit

Permalink
Replace construction of Symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Oct 20, 2023
1 parent aa44953 commit c509ef5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/callbacks_stage/subcell_bounds_check.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function init_callback(callback::BoundsCheckCallback, semi, limiter::SubcellLimi
print(f, "# iter, simu_time")
if positivity
for v in limiter.positivity_variables_cons
print(f, ", $(variables[v])_min")
print(f, ", " * string(variables[v]) * "_min")
end
end
println(f)
Expand Down Expand Up @@ -117,8 +117,8 @@ end
println(""^100)
if positivity
for v in limiter.positivity_variables_cons
println("$(variables[v]):\n- positivity: ",
idp_bounds_delta[Symbol("$(v)_min")][2])
println(string(variables[v]) * ":\n- positivity: ",
idp_bounds_delta[Symbol(string(v), "_min")][2])
end
end
println(""^100 * "\n")
Expand Down
4 changes: 2 additions & 2 deletions src/callbacks_stage/subcell_bounds_check_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

if positivity
for v in limiter.positivity_variables_cons
key = Symbol("$(v)_min")
key = Symbol(string(v), "_min")
deviation = idp_bounds_delta[key]
for element in eachelement(solver, cache), j in eachnode(solver),
i in eachnode(solver)
Expand All @@ -32,7 +32,7 @@
print(f, iter, ", ", time)
if positivity
for v in limiter.positivity_variables_cons
key = Symbol("$(v)_min")
key = Symbol(string(v), "_min")
print(f, ", ", idp_bounds_delta[key][1])
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/solvers/dgsem_tree/subcell_limiters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function SubcellLimiterIDP(equations::AbstractEquations, basis;
positivity_correction_factor = 0.1)
positivity = (length(positivity_variables_cons) > 0)

bound_keys = Tuple(Symbol("$(i)_min") for i in positivity_variables_cons)
bound_keys = Tuple(Symbol(string(v), "_min") for v in positivity_variables_cons)

cache = create_cache(SubcellLimiterIDP, equations, basis, bound_keys)

Expand Down
2 changes: 1 addition & 1 deletion src/solvers/dgsem_tree/subcell_limiters_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ end
(; positivity_correction_factor) = limiter

(; variable_bounds) = limiter.cache.subcell_limiter_coefficients
var_min = variable_bounds[Symbol("$(variable)_min")]
var_min = variable_bounds[Symbol(string(variable), "_min")]

@threaded for element in eachelement(dg, semi.cache)
inverse_jacobian = cache.elements.inverse_jacobian[element]
Expand Down

0 comments on commit c509ef5

Please sign in to comment.