From 3db1d87334afbcb3e2f4ecfe0ece21391fd087f4 Mon Sep 17 00:00:00 2001 From: domfournier Date: Thu, 3 Jul 2025 16:05:26 -0700 Subject: [PATCH] Fix indexing for out of bound only (cherry picked from commit 1946eb583b0adf93ae4434bee8ecd4c304822d87) --- simpeg/directives/_vector_models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/simpeg/directives/_vector_models.py b/simpeg/directives/_vector_models.py index 603777954e..8d131e7f36 100644 --- a/simpeg/directives/_vector_models.py +++ b/simpeg/directives/_vector_models.py @@ -143,7 +143,9 @@ def endIter(self): if np.any(out_bound): scale = upper_bound / amplitude for ind in indices: - model[ind] *= scale + vec = model[ind] + vec[out_bound] *= scale[out_bound] + model[ind] = vec self.invProb.model = model self.opt.xc = model