Skip to content
Snippets Groups Projects
Verified Commit 93697149 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

JSON output: remove duplicate “rhs” field when RHS of equation is non-zero constant

(cherry picked from commit 3d21821d)
parent 1cc3e3c8
No related branches found
No related tags found
No related merge requests found
Pipeline #7222 passed
......@@ -1829,21 +1829,7 @@ ModelTree::writeJsonModelEquations(ostream &output, bool residuals) const
output << R"(, "rhs": ")";
rhs->writeJsonOutput(output, {}, {});
output << R"(")";
try
{
// Test if the right hand side of the equation is empty.
if (rhs->eval({}) != 0)
{
output << R"(, "rhs": ")";
rhs->writeJsonOutput(output, {}, {});
output << R"(")";
}
}
catch (ExprNode::EvalException &e)
{
}
output << "}";
output << R"("})";
}
else
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment