From 30b408c95fa868ba0858bfd4bff1d2aecd04341e Mon Sep 17 00:00:00 2001 From: Arne Morten Kvarving Date: Mon, 2 Jan 2023 08:46:32 +0100 Subject: [PATCH] NcpFlash: remove use of sstream --- opm/material/constraintsolvers/NcpFlash.hpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/opm/material/constraintsolvers/NcpFlash.hpp b/opm/material/constraintsolvers/NcpFlash.hpp index 817274c20..a4d56fdb1 100644 --- a/opm/material/constraintsolvers/NcpFlash.hpp +++ b/opm/material/constraintsolvers/NcpFlash.hpp @@ -42,7 +42,6 @@ #include #include -#include namespace Opm { @@ -233,11 +232,13 @@ public: } } - std::ostringstream oss; - oss << "NcpFlash solver failed:" - << " {c_alpha^kappa} = {" << globalMolarities << "}, " - << " T = " << fluidState.temperature(/*phaseIdx=*/0); - throw NumericalProblem(oss.str()); + std::string msg = "NcpFlash solver failed: " + "{c_alpha^kappa} = {"; + for (const auto& v : globalMolarities) + msg += " " + std::to_string(getValue(v)); + msg += " }, T = "; + msg += std::to_string(getValue(fluidState.temperature(/*phaseIdx=*/0))); + throw NumericalProblem(msg); } /*!