Skip to content

Commit

Permalink
Reset mcl_bounds_delta_local simplier
Browse files Browse the repository at this point in the history
  • Loading branch information
bennibolm committed Feb 5, 2024
1 parent 94a71cb commit fb643f1
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/callbacks_stage/subcell_bounds_check_2d.jl
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,8 @@ end
# \bar{phi}^{min} <= \bar{phi}^{Lim} / \bar{rho}^{Lim} <= \bar{phi}^{max}
# - pressure (p):
# \bar{rho}^{Lim} \bar{rho * E}^{Lim} >= |\bar{rho * v}^{Lim}|^2 / 2
var_limited = zero(eltype(mcl_bounds_delta_local_threaded[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_local_threaded[Threads.threadid()]))
var_limited = zero(eltype(mcl_bounds_delta_global))
error_pressure = zero(eltype(mcl_bounds_delta_global))
# -x
rho_limited = bar_states1[1, i, j, element] -
antidiffusive_flux1_L[1, i, j, element] /
Expand All @@ -287,7 +287,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
# +x
rho_limited = bar_states1[1, i + 1, j, element] +
Expand All @@ -312,7 +312,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
# -y
rho_limited = bar_states2[1, i, j, element] -
Expand All @@ -337,7 +337,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
# +y
rho_limited = bar_states2[1, i, j + 1, element] +
Expand All @@ -362,7 +362,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
end
end
Expand Down Expand Up @@ -394,8 +394,8 @@ end
# \bar{rho*phi}^{min} <= \bar{rho*phi}^{Lim} <= \bar{rho*phi}^{max}
# - pressure (p):
# \bar{rho}^{Lim} \bar{rho * E}^{Lim} >= |\bar{rho * v}^{Lim}|^2 / 2
var_limited = zero(eltype(mcl_bounds_delta_local_threaded[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_local_threaded[Threads.threadid()]))
var_limited = zero(eltype(mcl_bounds_delta_global))
error_pressure = zero(eltype(mcl_bounds_delta_global))
# -x
for v in 2:n_vars
var_limited = bar_states1[v, i, j, element] -
Expand All @@ -419,7 +419,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
# +x
for v in 2:n_vars
Expand All @@ -444,7 +444,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
# -y
for v in 2:n_vars
Expand All @@ -469,7 +469,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
# +y
for v in 2:n_vars
Expand All @@ -494,7 +494,7 @@ end
mcl_bounds_delta_local[1, n_vars + 1] = max(mcl_bounds_delta_local[1,
n_vars + 1],
error_pressure)
error_pressure = zero(eltype(mcl_bounds_delta_local[Threads.threadid()]))
error_pressure = zero(eltype(mcl_bounds_delta_global))
end
end
end
Expand Down Expand Up @@ -682,11 +682,11 @@ end
for i in 1:Threads.nthreads()
mcl_bounds_delta_local = mcl_bounds_delta_local_threaded[i]
for v in eachvariable(equations)
mcl_bounds_delta_local[1, v] = zero(eltype(mcl_bounds_delta_local))
mcl_bounds_delta_local[2, v] = zero(eltype(mcl_bounds_delta_local))
mcl_bounds_delta_local[1, v] = zero(eltype(mcl_bounds_delta_global))
mcl_bounds_delta_local[2, v] = zero(eltype(mcl_bounds_delta_global))
end
if limiter.positivity_limiter_pressure
mcl_bounds_delta_local[1, n_vars + 1] = zero(eltype(mcl_bounds_delta_local))
mcl_bounds_delta_local[1, n_vars + 1] = zero(eltype(mcl_bounds_delta_global))
end
end

Expand Down

0 comments on commit fb643f1

Please sign in to comment.