From 6244dc89577e9d34d54300cd9de4b1b1d7496249 Mon Sep 17 00:00:00 2001
From: mattijs <m.janssens@opencfd.co.uk>
Date: Fri, 9 May 2008 13:24:48 +0100
Subject: [PATCH] break sliced fields initialisation loop (constructor calls
 correctbc, calls evaluate on coupledFvPatchFields, uses weights which
 ultimately use mesh.C() which is being constructed.

---
 .../surfaceInterpolation/surfaceInterpolation.C        | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
index a235ab024c9..d6b54a00778 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
@@ -162,11 +162,15 @@ void surfaceInterpolation::makeWeights() const
 
 
     // Set local references to mesh data
-    const surfaceVectorField& Cf = mesh_.Cf();
-    const volVectorField& C = mesh_.C();
+    // (note that we should not use fvMesh sliced fields at this point yet
+    //  since this causes a loop when generating weighting factors in
+    //  coupledFvPatchField evaluation phase)
     const unallocLabelList& owner = mesh_.owner();
     const unallocLabelList& neighbour = mesh_.neighbour();
-    const surfaceVectorField& Sf = mesh_.Sf();
+
+    const vectorField& Cf = mesh_.faceCentres();
+    const vectorField& C = mesh_.cellCentres();
+    const vectorField& Sf = mesh_.faceAreas();
 
     // ... and reference to the internal field of the weighting factors
     scalarField& w = weightingFactors.internalField();
-- 
GitLab