[1D] Fixed oscillations in grid refinement when pruning is enabled

Points which are needed to satisfy the 'ratio' requirement are not removed when
pruning. Previously, it was possible for the solver to get stuck in a loop where
the same points were added and removed after successive grid refinements.
This commit is contained in:
Ray Speth 2012-12-06 17:31:31 +00:00
parent 351423bcda
commit d236358ec6

View file

@ -169,6 +169,12 @@ int Refiner::analyze(size_t n, const doublereal* z,
m_loc[j-1] = 1;
m_c["point "+int2str(j-1)] = 1;
}
if (j > 1 && z[j+1]-z[j] > m_ratio * dz[j-2]) {
m_keep[j] = 1;
}
if (j < n-2 && z[j+1]-z[j] > m_ratio * dz[j+1]) {
m_keep[j] = 1;
}
//if (m_loc.size() + n > m_npmax) goto done;
}