Skip to content

Commit

Permalink
[1D] Exceeding the max number of grid points should be an error
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanwweber committed Nov 11, 2016
1 parent a82dd5a commit 0a363a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions src/oneD/Sim1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 2 additions & 3 deletions src/oneD/refine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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.
Expand Down

0 comments on commit 0a363a1

Please sign in to comment.