Skip to content

Commit

Permalink
Error if bx norm postprocessor doesn't execute on linear
Browse files Browse the repository at this point in the history
  • Loading branch information
lindsayad committed Nov 10, 2024
1 parent 37b10cc commit 53798d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 11 additions & 0 deletions framework/src/problems/EigenProblem.C
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "OutputWarehouse.h"
#include "Function.h"
#include "MooseVariableScalar.h"
#include "UserObject.h"

// libMesh includes
#include "libmesh/system.h"
Expand Down Expand Up @@ -493,6 +494,16 @@ EigenProblem::checkProblemIntegrity()
{
FEProblemBase::checkProblemIntegrity();
_nl_eigen->checkIntegrity();
if (_bx_norm_name)
{
if (!isNonlinearEigenvalueSolver())
paramWarning("bx_norm", "This parameter is only used for nonlinear solve types");
else if (auto & pp = getUserObjectBase(_bx_norm_name.value());
!pp.getExecuteOnEnum().contains(EXEC_LINEAR))
pp.paramError("execute_on",
"If providing the Bx norm, this postprocessor must execute on linear e.g. "
"during residual evaluations");
}
}

void
Expand Down
11 changes: 10 additions & 1 deletion test/tests/problems/eigen_problem/jfnk_mo/tests
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,23 @@
slepc = true
slepc_version = '>=3.11.0'
detail = 'computed by a user provided postprocessor.'
prereq = 'ne_coupled_mo/l2_bx'
[]
[]
[missing_bx_norm_exec_linear]
type = RunException
issues = '#28993'
input = ne_coupled_mo.i
cli_args = "Problem/bx_norm=uint Postprocessors/uint/execute_on='initial nonlinear'"
requirement = 'The system shall error if the user wants the Bx norm provided by a postprocessor but the postprocessor is not executed during residual evaluations.'
expect_err = "If providing the Bx norm, this postprocessor must execute on linear"
[]

[ne_coupled_mo_full]
type = 'CSVDiff'
input = 'ne_coupled_mo.i'
csvdiff = 'ne_coupled_eigenvalues_0001.csv'
prereq = 'ne_coupled_mo'
prereq = 'ne_coupled_mo/custom_bx'
cli_args = 'Preconditioning/active='''
slepc = true
slepc_version = '>=3.11.0'
Expand Down

0 comments on commit 53798d8

Please sign in to comment.