From 77cad08dfad2d0a450c5b9af34a13b55d71209a4 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Sat, 23 Apr 2016 23:37:53 +0100
Subject: [PATCH] boundaryField() -> boundaryFieldRef()

---
 .../Test-PatchEdgeFaceWave.C                  |  4 +--
 .../test/mappedPatch/Test-MappedPatch.C       |  2 +-
 .../motionSmoother/motionSmootherAlgo.C       |  4 +--
 .../skewCorrected/skewCorrectionVectors.C     |  2 +-
 .../surfaceInterpolation.C                    |  8 ++---
 .../inverseFaceDistanceDiffusivity.C          |  2 +-
 .../inversePointDistanceDiffusivity.C         |  2 +-
 .../snappyHexMeshDriver/snappyLayerDriver.C   |  6 ++--
 .../reactingOneDim/reactingOneDim.C           | 31 ++++++++++---------
 .../regionModel/regionModel1D/regionModel1D.C |  7 +++--
 10 files changed, 37 insertions(+), 31 deletions(-)

diff --git a/applications/test/PatchEdgeFaceWave/Test-PatchEdgeFaceWave.C b/applications/test/PatchEdgeFaceWave/Test-PatchEdgeFaceWave.C
index d1a2e8f202..f6bfa5dc9f 100644
--- a/applications/test/PatchEdgeFaceWave/Test-PatchEdgeFaceWave.C
+++ b/applications/test/PatchEdgeFaceWave/Test-PatchEdgeFaceWave.C
@@ -118,7 +118,7 @@ int main(int argc, char *argv[])
         {
             pf[faceI] = Foam::sqrt(allFaceInfo[faceI].distSqr());
         }
-        vsf.boundaryField()[patch.index()] = pf;
+        vsf.boundaryFieldRef()[patch.index()] = pf;
 
         Info<< "Writing patchDist volScalarField to " << runTime.value()
             << endl;
@@ -152,7 +152,7 @@ int main(int argc, char *argv[])
             mesh,
             dimensionedScalar("otherPatchDist", dimLength, 0.0)
         );
-        vsf.boundaryField()[patch.index()] = pwd;
+        vsf.boundaryFieldRef()[patch.index()] = pwd;
 
         Info<< "Writing otherPatchDist volScalarField to " << runTime.value()
             << endl;
diff --git a/applications/test/mappedPatch/Test-MappedPatch.C b/applications/test/mappedPatch/Test-MappedPatch.C
index d1a28a823a..ba3e06c8a5 100644
--- a/applications/test/mappedPatch/Test-MappedPatch.C
+++ b/applications/test/mappedPatch/Test-MappedPatch.C
@@ -87,7 +87,7 @@ int main(int argc, char *argv[])
     );
 
     cc.internalField() = mesh.C().internalField();
-    cc.boundaryField().updateCoeffs();
+    cc.boundaryFieldRef().updateCoeffs();
 
     forAll(cc.boundaryField(), patchI)
     {
diff --git a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C
index 2515a5cc8d..6cea332cb8 100644
--- a/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C
+++ b/src/dynamicMesh/motionSmoother/motionSmootherAlgo.C
@@ -428,7 +428,7 @@ void Foam::motionSmootherAlgo::setDisplacementPatchFields
     pointVectorField& displacement
 )
 {
-    typename pointVectorField::GeometricBoundaryField& displacementBf =
+    pointVectorField::GeometricBoundaryField& displacementBf =
         displacement.boundaryFieldRef();
 
     // Adapt the fixedValue bc's (i.e. copy internal point data to
@@ -584,7 +584,7 @@ void Foam::motionSmootherAlgo::correctBoundaryConditions
 
     const lduSchedule& patchSchedule = mesh_.globalData().patchSchedule();
 
-    typename pointVectorField::GeometricBoundaryField& displacementBf =
+    pointVectorField::GeometricBoundaryField& displacementBf =
         displacement.boundaryFieldRef();
 
     // 1. evaluate on adaptPatches
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C
index ad51c93b7c..cc3a7342ef 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/skewCorrected/skewCorrectionVectors.C
@@ -90,7 +90,7 @@ void Foam::skewCorrectionVectors::calcSkewCorrectionVectors()
             Cpf - ((Sf[facei] & Cpf)/(Sf[facei] & d))*d;
     }
 
-    typename surfaceVectorField::GeometricBoundaryField& skewCorrVecsBf =
+    surfaceVectorField::GeometricBoundaryField& skewCorrVecsBf =
         skewCorrectionVectors_.boundaryFieldRef();
 
     forAll(skewCorrVecsBf, patchi)
diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
index 0b7e3edc4b..582fc75841 100644
--- a/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
+++ b/src/finiteVolume/interpolation/surfaceInterpolation/surfaceInterpolation/surfaceInterpolation.C
@@ -183,7 +183,7 @@ void Foam::surfaceInterpolation::makeWeights() const
         w[facei] = SfdNei/(SfdOwn + SfdNei);
     }
 
-    typename surfaceScalarField::GeometricBoundaryField& wBf =
+    surfaceScalarField::GeometricBoundaryField& wBf =
         weights.boundaryFieldRef();
 
     forAll(mesh_.boundary(), patchi)
@@ -240,7 +240,7 @@ void Foam::surfaceInterpolation::makeDeltaCoeffs() const
         deltaCoeffs[facei] = 1.0/mag(C[neighbour[facei]] - C[owner[facei]]);
     }
 
-    typename surfaceScalarField::GeometricBoundaryField& deltaCoeffsBf =
+    surfaceScalarField::GeometricBoundaryField& deltaCoeffsBf =
         deltaCoeffs.boundaryFieldRef();
 
     forAll(deltaCoeffsBf, patchi)
@@ -305,7 +305,7 @@ void Foam::surfaceInterpolation::makeNonOrthDeltaCoeffs() const
         nonOrthDeltaCoeffs[facei] = 1.0/max(unitArea & delta, 0.05*mag(delta));
     }
 
-    typename surfaceScalarField::GeometricBoundaryField& nonOrthDeltaCoeffsBf =
+    surfaceScalarField::GeometricBoundaryField& nonOrthDeltaCoeffsBf =
         nonOrthDeltaCoeffs.boundaryFieldRef();
 
     forAll(nonOrthDeltaCoeffsBf, patchi)
@@ -363,7 +363,7 @@ void Foam::surfaceInterpolation::makeNonOrthCorrectionVectors() const
     // and calculated consistently with internal corrections for
     // coupled patches
 
-    typename surfaceVectorField::GeometricBoundaryField& corrVecsBf =
+    surfaceVectorField::GeometricBoundaryField& corrVecsBf =
         corrVecs.boundaryFieldRef();
 
     forAll(corrVecsBf, patchi)
diff --git a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C
index 95cd856f99..61ec8e11de 100644
--- a/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C
+++ b/src/fvMotionSolver/motionDiffusivity/inverseFaceDistance/inverseFaceDistanceDiffusivity.C
@@ -127,7 +127,7 @@ void Foam::inverseFaceDistanceDiffusivity::correct()
         faceDiffusivity_[faceI] = 1.0/sqrt(dist);
     }
 
-    typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
+    surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
         faceDiffusivity_.boundaryFieldRef();
 
     forAll(faceDiffusivityBf, patchI)
diff --git a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C
index 920fa5c22d..6468e49dce 100644
--- a/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C
+++ b/src/fvMotionSolver/motionDiffusivity/inversePointDistance/inversePointDistanceDiffusivity.C
@@ -153,7 +153,7 @@ void Foam::inversePointDistanceDiffusivity::correct()
     }
 
 
-    typename surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
+    surfaceScalarField::GeometricBoundaryField& faceDiffusivityBf =
         faceDiffusivity_.boundaryFieldRef();
 
     forAll(faceDiffusivityBf, patchI)
diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C
index 9d4c1d997e..2e07edce69 100644
--- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C
+++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyLayerDriver.C
@@ -2658,7 +2658,7 @@ bool Foam::snappyLayerDriver::writeLayerData
             );
             const polyBoundaryMesh& pbm = mesh.boundaryMesh();
 
-            typename volScalarField::GeometricBoundaryField& fldBf =
+            volScalarField::GeometricBoundaryField& fldBf =
                 fld.boundaryFieldRef();
 
             forAll(patchIDs, i)
@@ -2697,7 +2697,7 @@ bool Foam::snappyLayerDriver::writeLayerData
 
             const polyBoundaryMesh& pbm = mesh.boundaryMesh();
 
-            typename volScalarField::GeometricBoundaryField& fldBf =
+            volScalarField::GeometricBoundaryField& fldBf =
                 fld.boundaryFieldRef();
 
             forAll(patchIDs, i)
@@ -2732,7 +2732,7 @@ bool Foam::snappyLayerDriver::writeLayerData
 
             const polyBoundaryMesh& pbm = mesh.boundaryMesh();
 
-            typename volScalarField::GeometricBoundaryField& fldBf =
+            volScalarField::GeometricBoundaryField& fldBf =
                 fld.boundaryFieldRef();
 
             forAll(patchIDs, i)
diff --git a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C
index ec261e277e..4ff712e058 100644
--- a/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C
+++ b/src/regionModels/pyrolysisModels/reactingOneDim/reactingOneDim.C
@@ -103,15 +103,15 @@ void reactingOneDim::updateQr()
     // Retrieve field from coupled region using mapped boundary conditions
     Qr_.correctBoundaryConditions();
 
+    volScalarField::GeometricBoundaryField& QrBf = Qr_.boundaryFieldRef();
+
     forAll(intCoupledPatchIDs_, i)
     {
-        const label patchI = intCoupledPatchIDs_[i];
-
-        scalarField& Qrp = Qr_.boundaryField()[patchI];
+        const label patchi = intCoupledPatchIDs_[i];
 
         // Qr is positive going in the solid
         // If the surface is emitting the radiative flux is set to zero
-        Qrp = max(Qrp, scalar(0.0));
+        QrBf[patchi] = max(QrBf[patchi], scalar(0.0));
     }
 
     const vectorField& cellC = regionMesh().cellCentres();
@@ -122,10 +122,10 @@ void reactingOneDim::updateQr()
     label localPyrolysisFaceI = 0;
     forAll(intCoupledPatchIDs_, i)
     {
-        const label patchI = intCoupledPatchIDs_[i];
+        const label patchi = intCoupledPatchIDs_[i];
 
-        const scalarField& Qrp = Qr_.boundaryField()[patchI];
-        const vectorField& Cf = regionMesh().Cf().boundaryField()[patchI];
+        const scalarField& Qrp = Qr_.boundaryField()[patchi];
+        const vectorField& Cf = regionMesh().Cf().boundaryField()[patchi];
 
         forAll(Qrp, faceI)
         {
@@ -164,12 +164,15 @@ void reactingOneDim::updatePhiGas()
         const DimensionedField<scalar, volMesh>& RRiGas =
             solidChemistry_->RRg(gasI);
 
+        surfaceScalarField::GeometricBoundaryField& phiGasBf =
+            phiGas_.boundaryFieldRef();
+
         label totalFaceId = 0;
         forAll(intCoupledPatchIDs_, i)
         {
-            const label patchI = intCoupledPatchIDs_[i];
+            const label patchi = intCoupledPatchIDs_[i];
 
-            scalarField& phiGasp = phiGas_.boundaryField()[patchI];
+            scalarField& phiGasp = phiGasBf[patchi];
             const scalarField& cellVol = regionMesh().V();
 
             forAll(phiGasp, faceI)
@@ -188,7 +191,7 @@ void reactingOneDim::updatePhiGas()
                 if (debug)
                 {
                     Info<< " Gas : " << gasTable[gasI]
-                        << " on patch : " << patchI
+                        << " on patch : " << patchi
                         << " mass produced at face(local) : "
                         <<  faceI
                         << " is : " << massInt
@@ -362,8 +365,8 @@ void reactingOneDim::calculateMassTransfer()
     totalGasMassFlux_ = 0;
     forAll(intCoupledPatchIDs_, i)
     {
-        const label patchI = intCoupledPatchIDs_[i];
-        totalGasMassFlux_ += gSum(phiGas_.boundaryField()[patchI]);
+        const label patchi = intCoupledPatchIDs_[i];
+        totalGasMassFlux_ += gSum(phiGas_.boundaryField()[patchi]);
     }
 
     if (infoOutput_)
@@ -587,12 +590,12 @@ reactingOneDim::~reactingOneDim()
 
 // * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
 
-scalar reactingOneDim::addMassSources(const label patchI, const label faceI)
+scalar reactingOneDim::addMassSources(const label patchi, const label faceI)
 {
     label index = 0;
     forAll(primaryPatchIDs_, i)
     {
-        if (primaryPatchIDs_[i] == patchI)
+        if (primaryPatchIDs_[i] == patchi)
         {
             index = i;
             break;
diff --git a/src/regionModels/regionModel/regionModel1D/regionModel1D.C b/src/regionModels/regionModel/regionModel1D/regionModel1D.C
index 62a6dba740..c53acb48c1 100644
--- a/src/regionModels/regionModel/regionModel1D/regionModel1D.C
+++ b/src/regionModels/regionModel/regionModel1D/regionModel1D.C
@@ -122,14 +122,17 @@ void Foam::regionModels::regionModel1D::initialise()
 
     surfaceScalarField& nMagSf = nMagSfPtr_();
 
+    surfaceScalarField::GeometricBoundaryField nMagSfBf =
+        nMagSf.boundaryFieldRef();
+
     localPyrolysisFaceI = 0;
+
     forAll(intCoupledPatchIDs_, i)
     {
         const label patchI = intCoupledPatchIDs_[i];
         const polyPatch& ppCoupled = rbm[patchI];
         const vectorField& pNormals = ppCoupled.faceNormals();
-        nMagSf.boundaryField()[patchI] =
-            regionMesh().Sf().boundaryField()[patchI] & pNormals;
+        nMagSfBf[patchI] = regionMesh().Sf().boundaryField()[patchI] & pNormals;
         forAll(pNormals, localFaceI)
         {
             const vector& n = pNormals[localFaceI];
-- 
GitLab