Skip to content

Commit

Permalink
fix error message closes idaholab#29082
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnmunday committed Nov 15, 2024
1 parent 61ed706 commit 1a634d0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions framework/src/utils/FunctionParserUtils.C
Original file line number Diff line number Diff line change
Expand Up @@ -148,11 +148,11 @@ FunctionParserUtils<is_ad>::addFParserConstants(
unsigned int nconst = constant_expressions.size();
if (nconst != constant_names.size())
mooseError("The parameter vectors constant_names (size " +
std::to_string(constant_names.size()) + ") and constant_values (size " +
std::to_string(constant_names.size()) + ") and constant_expressions (size " +
std::to_string(nconst) + ") must have equal length.");

// previously evaluated constant_expressions may be used in following constant_expressions
std::vector<Real> constant_values(nconst);
std::vector<Real> constant_expressions(nconst);

for (unsigned int i = 0; i < nconst; ++i)
{
Expand All @@ -161,7 +161,7 @@ FunctionParserUtils<is_ad>::addFParserConstants(

// add previously evaluated constants
for (unsigned int j = 0; j < i; ++j)
if (!expression->AddConstant(constant_names[j], constant_values[j]))
if (!expression->AddConstant(constant_names[j], constant_expressions[j]))
mooseError("Invalid constant name in ParsedMaterialHelper");

// build the temporary constant expression function
Expand All @@ -171,9 +171,9 @@ FunctionParserUtils<is_ad>::addFParserConstants(
"\n in parsed function object.\n",
expression->ErrorMsg());

constant_values[i] = expression->Eval(NULL);
constant_expressions[i] = expression->Eval(NULL);

if (!parser->AddConstant(constant_names[i], constant_values[i]))
if (!parser->AddConstant(constant_names[i], constant_expressions[i]))
mooseError("Invalid constant name in parsed function object");
}
}
Expand Down

0 comments on commit 1a634d0

Please sign in to comment.