From 6b9fc98fc8e7d334ce078279d3133b22aeabbc44 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Tue, 5 Mar 2013 17:02:47 +0000 Subject: [PATCH] [1D] Pruning may not remove adjacent grid points --- src/oneD/refine.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/oneD/refine.cpp b/src/oneD/refine.cpp index 63800cb53..042b2dac0 100644 --- a/src/oneD/refine.cpp +++ b/src/oneD/refine.cpp @@ -151,6 +151,14 @@ int Refiner::analyze(size_t n, const doublereal* z, } } + // Don't allow pruning to remove multiple adjacent grid points + // in a single pass. + for (size_t j = 2; j < n-1; j++) { + if (m_keep[j] == -1 && m_keep[j-1] == -1) { + m_keep[j] = 1; + } + } + return int(m_loc.size()); }