From d76704912bb6bb2ae4e72c6f9b7e3b73a877548b Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Sat, 13 Feb 2016 16:31:11 -0500 Subject: [PATCH] [1D] Fix transient mask after Jacobian update The transient mask should only be zeroed when doing a full evaluation of the residual function, since the partial evaluations done while evaluating the Jacobian will not fill in all elements of the mask. This error was causing Jacobian update in MultiNewton::solve to always effectively generate the steady-state Jacobian, even when in time-stepping mode. --- src/oneD/OneDim.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/oneD/OneDim.cpp b/src/oneD/OneDim.cpp index 8a3a0b5d3..ec19fd4a4 100644 --- a/src/oneD/OneDim.cpp +++ b/src/oneD/OneDim.cpp @@ -239,7 +239,9 @@ void OneDim::eval(size_t j, double* x, double* r, doublereal rdt, int count) m_interrupt->eval(m_nevals); } fill(r, r + m_size, 0.0); - fill(m_mask.begin(), m_mask.end(), 0); + if (j == npos) { + fill(m_mask.begin(), m_mask.end(), 0); + } if (rdt < 0.0) { rdt = m_rdt; }