From cc0649bed1fea44d9c31731065a6e9d7df6d4dc7 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Tue, 1 May 2012 17:20:30 +0100
Subject: [PATCH] BUG: fvFieldReconstructorReconstructFields.C: indexing
 outside of internal faces

---
 .../reconstruct/fvFieldReconstructorReconstructFields.C     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C b/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C
index 58c74f4c4b5..5ff0f7bf2e0 100644
--- a/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C
+++ b/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C
@@ -379,12 +379,12 @@ Foam::fvFieldReconstructor::reconstructFvSurfaceField
         {
             const labelList& faceMap = faceProcAddressing_[procI];
 
-            // Addressing into original field
-            labelList curAddr(faceMap.size());
             // Correctly oriented copy of internal field
             Field<Type> procInternalField(procField.internalField());
+            // Addressing into original field
+            labelList curAddr(procInternalField.size());
 
-            forAll(faceMap, addrI)
+            forAll(procInternalField, addrI)
             {
                 curAddr[addrI] = mag(faceMap[addrI])-1;
                 if (faceMap[addrI] < 0)
-- 
GitLab