From 04a55776f7191c97e768e6d0f4c66c8e01dfee3a Mon Sep 17 00:00:00 2001 From: mattijs Date: Fri, 20 Sep 2013 09:41:45 +0100 Subject: [PATCH] ENH:polyMeshTetDecomposition: extract reference before loop --- .../polyMeshTetDecomposition/polyMeshTetDecomposition.C | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C index df95c96818..7bd5bd0d4b 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C +++ b/src/OpenFOAM/meshes/polyMesh/polyMeshTetDecomposition/polyMeshTetDecomposition.C @@ -210,6 +210,7 @@ Foam::labelList Foam::polyMeshTetDecomposition::findFaceBasePts ) { const labelList& pOwner = mesh.faceOwner(); + const vectorField& pC = mesh.cellCentres(); // Find a suitable base point for each face, considering both // cells for interface faces or those on coupled patches @@ -228,7 +229,7 @@ Foam::labelList Foam::polyMeshTetDecomposition::findFaceBasePts for(label faceI = nInternalFaces; faceI < mesh.nFaces(); faceI++) { neighbourCellCentres[faceI - nInternalFaces] = - mesh.cellCentres()[pOwner[faceI]]; + pC[pOwner[faceI]]; } syncTools::swapBoundaryFacePositions(mesh, neighbourCellCentres);