From 7e5fe133c0937fc8fe99e07ab0167b9a3d130cca Mon Sep 17 00:00:00 2001
From: Andrew Heather <>
Date: Tue, 23 Jul 2019 12:26:06 +0100
Subject: [PATCH] BUG: adjointSolverManager - corrected indexing.  Fixes #1381

---
 .../adjoint/solvers/adjointSolverManager/adjointSolverManager.C | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolverManager/adjointSolverManager.C b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolverManager/adjointSolverManager.C
index 3685d0d881..4ad6b48819 100644
--- a/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolverManager/adjointSolverManager.C
+++ b/src/optimisation/adjointOptimisation/adjoint/solvers/adjointSolverManager/adjointSolverManager.C
@@ -260,7 +260,7 @@ Foam::scalar Foam::adjointSolverManager::objectiveValue()
     for (const label solveri : objectiveSolverIDs_)
     {
         objectiveManager& objManager =
-            adjointSolvers_[objectiveSolverIDs_[solveri]].getObjectiveManager();
+            adjointSolvers_[solveri].getObjectiveManager();
         objValue += objManager.print();
     }
 
-- 
GitLab