Skip to content

Commit

Permalink
address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
maxnezdyur committed Dec 19, 2024
1 parent d3c6cd3 commit 904462c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions modules/optimization/src/executioners/AdjointSolve.C
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,9 @@ AdjointSolve::checkIntegrity()
// If the user supplies any scaling factors for individual variables the
// adjoint system won't be consistent.
if (!absolute_fuzzy_equals(adj_var->scalingFactor(), 1.0))
mooseError("User supplied scaling factors for adjoint variables. Adjoint system is scaled "
"automatically by the forward system.");
mooseError(
"User cannot supply scaling factors for adjoint variables. Adjoint system is scaled "
"automatically by the forward system.");

// This is to prevent automatic scaling of the adjoint system. Scaling is
// taken from the forward system
Expand Down
3 changes: 3 additions & 0 deletions modules/optimization/test/tests/misc/scaling_test/tests
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
input = main.i
jsondiff = main_out.json
recover = false
max_threads = 1 # Optimize executioner does not support multiple threads
detail = "by manually providing scaling factors for the forward problem variables,"
[]
[automatic_scaling]
type = JSONDiff
input = main.i
jsondiff = main_out.json
recover = false
max_threads = 1 # Optimize executioner does not support multiple threads
cli_args = "MultiApps/forward/cli_args='Executioner/automatic_scaling=true'"
detail = "or by using the automatic scaling option."
[]
Expand All @@ -23,6 +25,7 @@
[scaling_factor_for_adjoint_variables]
type = 'RunException'
input = main.i
max_threads = 1 # Optimize executioner does not support multiple threads
cli_args = "MultiApps/forward/cli_args='Variables/T_real_adj/scaling=5'"
expect_err = 'User supplied scaling factors for adjoint variables. Adjoint system is scaled automatically by the forward system.'
requirement = "The system shall throw out an error when scalings are manually assigned to "
Expand Down

0 comments on commit 904462c

Please sign in to comment.