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

quiet a Coverity complaint about tainted info.m_max_level #2834

Merged
merged 6 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Exec/gravity_tests/advecting_white_dwarf/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ amr.refinement_indicators = density
# Density refinement criterion
amr.refine.density.value_greater = 1.0e3
amr.refine.density.field_name = density
amr.refine.density.max_level = 20
amr.refine.density.max_level = 15

############################################################################################
# Physics to include
Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/Sedov/inputs.helm_scaling
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ amr.max_grid_size = 128

amr.refinement_indicators = dengrad_rel

amr.refine.dengrad_rel.max_level = 20
amr.refine.dengrad_rel.max_level = 15
amr.refine.dengrad_rel.relative_gradient = 0.25
amr.refine.dengrad_rel.field_name = density

amr.refine.dengrad_rel.max_level = 20
amr.refine.dengrad_rel.max_level = 15
amr.refine.dengrad_rel.relative_gradient = 0.25
amr.refine.dengrad_rel.field_name = Temp

Expand Down
4 changes: 2 additions & 2 deletions Exec/hydro_tests/Sedov/inputs.mini-Castro
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ amr.max_grid_size = 128

amr.refinement_indicators = dengrad_rel tempgrad_rel

amr.refine.dengrad_rel.max_level = 20
amr.refine.dengrad_rel.max_level = 15
amr.refine.dengrad_rel.relative_gradient = 0.25
amr.refine.dengrad_rel.field_name = density

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.25
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/hydro_tests/Sedov/inputs.mini-Castro.gpu_test
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ amr.max_grid_size = 32

amr.refinement_indicators = dengrad_rel

amr.refine.dengrad_rel.max_level = 20
amr.refine.dengrad_rel.max_level = 15
amr.refine.dengrad_rel.relative_gradient = 0.25
amr.refine.dengrad_rel.field_name = density

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M2.mg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M2.test
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M2.test.multid
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M5
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M5.mg
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M5.mg.test
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs.M5.mg.test.multid
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs_y.M5
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/radiation_tests/Rad2Tshock/inputs_z.M5
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ amr.grid_eff = 0.7 # what constitutes an efficient grid

amr.refinement_indicators = tempgrad_rel

amr.refine.tempgrad_rel.max_level = 20
amr.refine.tempgrad_rel.max_level = 15
amr.refine.tempgrad_rel.relative_gradient = 0.1
amr.refine.tempgrad_rel.field_name = Temp

Expand Down
2 changes: 1 addition & 1 deletion Exec/scf_tests/single_star/inputs_helm_nonrotating
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ amr.derive_plot_vars = ALL

amr.refinement_indicators = denerr

amr.refine.denerr.max_level = 20
amr.refine.denerr.max_level = 15
amr.refine.denerr.value_greater = 1.e6
amr.refine.denerr.field_name = density
2 changes: 1 addition & 1 deletion Exec/scf_tests/single_star/inputs_helm_nonrotating.test
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,6 @@ amr.derive_plot_vars = ALL

amr.refinement_indicators = denerr

amr.refine.denerr.max_level = 20
amr.refine.denerr.max_level = 15
amr.refine.denerr.value_greater = 1.e6
amr.refine.denerr.field_name = density
2 changes: 1 addition & 1 deletion Exec/scf_tests/single_star/inputs_helm_rotating
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ amr.derive_plot_vars = ALL

amr.refinement_indicators = denerr

amr.refine.denerr.max_level = 20
amr.refine.denerr.max_level = 15
amr.refine.denerr.value_greater = 1.e6
amr.refine.denerr.field_name = density

2 changes: 1 addition & 1 deletion Exec/science/Detonation/inputs-collision
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ amr.refine.dengrad_rel.max_level = 0
amr.refine.dengrad_rel.relative_gradient = 0.5
amr.refine.dengrad_rel.field_name = density

amr.refine.dxnucerr.max_level = 20
amr.refine.dxnucerr.max_level = 15
amr.refine.dxnucerr.value_greater = 1.e-16
amr.refine.dxnucerr.field_name = t_sound_t_enuc

Expand Down
2 changes: 1 addition & 1 deletion Exec/science/Detonation/inputs-collision.testsuite
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ amr.refine.dengrad_rel.max_level = 0
amr.refine.dengrad_rel.relative_gradient = 0.5
amr.refine.dengrad_rel.field_name = density

amr.refine.dxnucerr.max_level = 20
amr.refine.dxnucerr.max_level = 15
amr.refine.dxnucerr.value_greater = 1.e-16
amr.refine.dxnucerr.field_name = t_sound_t_enuc

Expand Down
2 changes: 1 addition & 1 deletion Exec/science/wdmerger/inputs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ amr.refinement_indicators = density temperature
# Density refinement criterion
amr.refine.density.value_greater = 1.0e0
amr.refine.density.field_name = density
amr.refine.density.max_level = 20
amr.refine.density.max_level = 15

# Temperature refinement criterion
amr.refine.temperature.value_greater = 5.0e8
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/wdmerger/tests/inputs_pakmor
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ amr.refine.density.max_level = 1
# Density2 refinement criterion
amr.refine.density2.value_greater = 1.0e5
amr.refine.density2.field_name = density
amr.refine.density2.max_level = 20
amr.refine.density2.max_level = 15

# Temperature refinement criterion
amr.refine.temperature.value_greater = 5.0e8
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/wdmerger/tests/inputs_scaling
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ amr.refine.density.max_level = 1
# Density2 refinement criterion
amr.refine.density2.value_greater = 1.0e5
amr.refine.density2.field_name = density
amr.refine.density2.max_level = 20
amr.refine.density2.max_level = 15

# Temperature refinement criterion
amr.refine.temperature.value_greater = 5.0e8
Expand Down
2 changes: 1 addition & 1 deletion Exec/science/wdmerger/tests/tde/inputs.test
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ amr.refinement_indicators = density
# Density refinement criterion
amr.refine.density.value_greater = 1.0e4
amr.refine.density.field_name = density
amr.refine.density.max_level = 20
amr.refine.density.max_level = 15

############################################################################################
# Physics to include
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ amr.refinement_indicators = density
# Density refinement criterion
amr.refine.density.value_greater = 1.0e2
amr.refine.density.field_name = density
amr.refine.density.max_level = 20
amr.refine.density.max_level = 15

# Avoid tagging near the domain boundary
castro.max_tagging_radius = 0.75e0
Expand Down
6 changes: 6 additions & 0 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
#include <problem_tagging.H>

#include <ambient.H>
#include <castro_limits.H>

using namespace amrex;

Expand Down Expand Up @@ -590,7 +591,12 @@ Castro::read_params ()
if (ppr.countval("max_level") > 0) {
int max_level;
ppr.get("max_level", max_level);
BL_ASSERT(max_level <= MAX_LEV);
info.SetMaxLevel(max_level);
} else {
// the default max_level of AMRErrorTagInfo is 1000, but make sure
// that it is reasonable for Castro
info.SetMaxLevel(MAX_LEV);
}
if (ppr.countval("volume_weighting") > 0) {
int volume_weighting;
Expand Down