diff --git a/src/oneD/Sim1D.cpp b/src/oneD/Sim1D.cpp index 5be6de0c8f..d8dc453b2b 100644 --- a/src/oneD/Sim1D.cpp +++ b/src/oneD/Sim1D.cpp @@ -331,10 +331,6 @@ void Sim1D::solve(int loglevel, bool refine_grid) saveResidual("debug_sim1d.xml", "residual", "After regridding"); } - if (new_points < 0) { - writelog("Maximum number of grid points reached."); - new_points = 0; - } } else { debuglog("grid refinement disabled.\n", loglevel); new_points = 0; diff --git a/src/oneD/refine.cpp b/src/oneD/refine.cpp index f70fa7395e..c0288542ed 100644 --- a/src/oneD/refine.cpp +++ b/src/oneD/refine.cpp @@ -47,8 +47,7 @@ int Refiner::analyze(size_t n, const doublereal* z, const doublereal* x) { if (n >= m_npmax) { - writelog("max number of grid points reached ({}).\n", m_npmax); - return -2; + throw CanteraError("Refiner::analyze", "max number of grid points reached ({}).", m_npmax); } if (m_domain->nPoints() <= 1) { @@ -66,7 +65,7 @@ int Refiner::analyze(size_t n, const doublereal* z, // check consistency if (n != m_domain->nPoints()) { - throw CanteraError("analyze","inconsistent"); + throw CanteraError("Refiner::analyze", "inconsistent"); } // find locations where cell size ratio is too large.