Commit 2d5ff316 authored by Henry Weller's avatar Henry Weller
Browse files

boundaryField() -> boundaryFieldRef()

parent 3758659a
......@@ -36,18 +36,17 @@ void Foam::BlendedInterfacialModel<ModelType>::correctFixedFluxBCs
GeometricField& field
) const
{
forAll(phase1_.phi()().boundaryField(), patchI)
forAll(phase1_.phi()().boundaryField(), patchi)
{
if
(
isA<fixedValueFvsPatchScalarField>
(
phase1_.phi()().boundaryField()[patchI]
phase1_.phi()().boundaryField()[patchi]
)
)
{
field.boundaryField()[patchI]
= Zero;
field.boundaryField()[patchi] = Zero;
}
}
}
......
......@@ -36,18 +36,17 @@ void Foam::BlendedInterfacialModel<modelType>::correctFixedFluxBCs
GeometricField& field
) const
{
forAll(pair_.phase1().phi().boundaryField(), patchI)
forAll(pair_.phase1().phi().boundaryField(), patchi)
{
if
(
isA<fixedValueFvsPatchScalarField>
(
pair_.phase1().phi().boundaryField()[patchI]
pair_.phase1().phi().boundaryField()[patchi]
)
)
{
field.boundaryField()[patchI]
= Zero;
field.boundaryField()[patchi] = Zero;
}
}
}
......
......@@ -208,8 +208,8 @@ int main(int argc, char *argv[])
#include "createMesh.H"
const word patchName = args[1];
label patchI = mesh.boundaryMesh().findPatchID(patchName);
const polyPatch& pp = mesh.boundaryMesh()[patchI];
label patchi = mesh.boundaryMesh().findPatchID(patchName);
const polyPatch& pp = mesh.boundaryMesh()[patchi];
const indirectPrimitivePatch& cpp = mesh.globalData().coupledPatch();
......
......@@ -156,9 +156,9 @@ int main(int argc, char *argv[])
}
// Insert my boundary values
label nCompact = fld.size();
forAll(fld.boundaryField(), patchI)
forAll(fld.boundaryField(), patchi)
{
const fvPatchField<vector>& pfld = fld.boundaryField()[patchI];
const fvPatchField<vector>& pfld = fld.boundaryField()[patchi];
forAll(pfld, i)
{
......
......@@ -60,11 +60,11 @@ int main(int argc, char *argv[])
calculatedFvPatchVectorField::typeName
);
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
if (isA<mappedPolyPatch>(mesh.boundaryMesh()[patchI]))
if (isA<mappedPolyPatch>(mesh.boundaryMesh()[patchi]))
{
patchFieldTypes[patchI] =
patchFieldTypes[patchi] =
mappedFixedValueFvPatchVectorField::typeName;
}
}
......@@ -89,23 +89,23 @@ int main(int argc, char *argv[])
cc.internalField() = mesh.C().internalField();
cc.boundaryFieldRef().updateCoeffs();
forAll(cc.boundaryField(), patchI)
forAll(cc.boundaryField(), patchi)
{
if
(
isA<mappedFixedValueFvPatchVectorField>
(
cc.boundaryField()[patchI]
cc.boundaryField()[patchi]
)
)
{
Pout<< "Detected a mapped patch:" << patchI << endl;
Pout<< "Detected a mapped patch:" << patchi << endl;
OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj");
OFstream str(mesh.boundaryMesh()[patchi].name() + ".obj");
Pout<< "Writing mapped values to " << str.name() << endl;
label vertI = 0;
const fvPatchVectorField& fvp = cc.boundaryField()[patchI];
const fvPatchVectorField& fvp = cc.boundaryField()[patchi];
forAll(fvp, i)
{
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -66,18 +66,18 @@ int main(int argc, char *argv[])
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
faceListList boundaryFaces(pbm.size());
forAll(pbm, patchI)
forAll(pbm, patchi)
{
boundaryFaces[patchI] = pbm[patchI];
boundaryFaces[patchi] = pbm[patchi];
}
wordList boundaryPatchNames(pbm.names());
PtrList<dictionary> boundaryDicts(pbm.size());
forAll(pbm, patchI)
forAll(pbm, patchi)
{
OStringStream os;
os << pbm[patchI];
os << pbm[patchi];
IStringStream is(os.str());
boundaryDicts.set(patchI, new dictionary(is));
boundaryDicts.set(patchi, new dictionary(is));
}
word defaultBoundaryPatchName = "defaultFaces";
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -59,8 +59,8 @@ int main(int argc, char *argv[])
const polyBoundaryMesh& pbm = mesh.boundaryMesh();
label patchI = pbm.findPatchID(patchName);
const polyPatch& patch = pbm[patchI];
label patchi = pbm.findPatchID(patchName);
const polyPatch& patch = pbm[patchi];
Info<< "Patch:" << patch.name() << endl;
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -52,9 +52,9 @@ labelList procNeighbours(const polyMesh& mesh)
label nNeighbours = 0;
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchi]))
{
nNeighbours++;
}
......@@ -64,11 +64,11 @@ labelList procNeighbours(const polyMesh& mesh)
nNeighbours = 0;
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchI]))
if (isA<processorPolyPatch>(mesh.boundaryMesh()[patchi]))
{
const polyPatch& patch = mesh.boundaryMesh()[patchI];
const polyPatch& patch = mesh.boundaryMesh()[patchi];
const processorPolyPatch& procPatch =
refCast<const processorPolyPatch>(patch);
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -70,11 +70,11 @@ int main(int argc, char *argv[])
const pointBoundaryMesh& pbm = pMesh.boundary();
Info<< "pointMesh boundary" << nl;
forAll(pbm, patchI)
forAll(pbm, patchi)
{
Info<< "patch=" << pbm[patchI].name()
<< ", type=" << pbm[patchI].type()
<< ", coupled=" << pbm[patchI].coupled()
Info<< "patch=" << pbm[patchi].name()
<< ", type=" << pbm[patchi].type()
<< ", coupled=" << pbm[patchi].coupled()
<< endl;
}
......@@ -83,10 +83,10 @@ int main(int argc, char *argv[])
pointScalarField pp(pInterp.interpolate(p));
Info<< pp.name() << " boundary" << endl;
forAll(pp.boundaryField(), patchI)
forAll(pp.boundaryField(), patchi)
{
Info<< pbm[patchI].name() << " coupled="
<< pp.boundaryField()[patchI].coupled()<< endl;
Info<< pbm[patchi].name() << " coupled="
<< pp.boundaryField()[patchi].coupled()<< endl;
}
pp.write();
......
......@@ -126,7 +126,7 @@ void subsetVolFields
(
const fvMeshSubset& subsetter,
const IOobjectList& objectsList,
const label patchI,
const label patchi,
const Type& exposedValue,
const word GeomVolType,
PtrList<GeometricField<Type, fvPatchField, volMesh>>& subFields
......@@ -152,15 +152,15 @@ void subsetVolFields
subFields.set(i, subsetter.interpolate(volField));
// Explicitly set exposed faces (in patchI) to exposedValue.
if (patchI >= 0)
// Explicitly set exposed faces (in patchi) to exposedValue.
if (patchi >= 0)
{
fvPatchField<Type>& fld =
subFields[i++].boundaryField()[patchI];
subFields[i++].boundaryFieldRef()[patchi];
label newStart = fld.patch().patch().start();
label oldPatchI = subsetter.patchMap()[patchI];
label oldPatchI = subsetter.patchMap()[patchi];
if (oldPatchI == -1)
{
......@@ -198,7 +198,7 @@ void subsetSurfaceFields
(
const fvMeshSubset& subsetter,
const IOobjectList& objectsList,
const label patchI,
const label patchi,
const Type& exposedValue,
const word GeomSurfType,
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& subFields
......@@ -225,15 +225,15 @@ void subsetSurfaceFields
subFields.set(i, subsetter.interpolate(volField));
// Explicitly set exposed faces (in patchI) to exposedValue.
if (patchI >= 0)
// Explicitly set exposed faces (in patchi) to exposedValue.
if (patchi >= 0)
{
fvsPatchField<Type>& fld =
subFields[i++].boundaryField()[patchI];
subFields[i++].boundaryFieldRef()[patchi];
label newStart = fld.patch().patch().start();
label oldPatchI = subsetter.patchMap()[patchI];
label oldPatchI = subsetter.patchMap()[patchi];
if (oldPatchI == -1)
{
......@@ -291,16 +291,19 @@ void initCreatedPatches
{
GeoField& field = const_cast<GeoField&>(*fieldIter());
forAll(field.boundaryField(), patchi)
typename GeoField::GeometricBoundaryField& fieldBf =
field.boundaryFieldRef();
forAll(fieldBf, patchi)
{
if (map.oldPatchSizes()[patchi] == 0)
{
// Not mapped.
field.boundaryField()[patchi] = initValue;
fieldBf[patchi] = initValue;
if (field.boundaryField()[patchi].fixesValue())
if (fieldBf[patchi].fixesValue())
{
field.boundaryField()[patchi] == initValue;
fieldBf[patchi] == initValue;
}
}
}
......@@ -526,9 +529,9 @@ void createBaffles
// Wrapper around find patch. Also makes sure same patch in parallel.
label findPatch(const polyBoundaryMesh& patches, const word& patchName)
{
label patchI = patches.findPatchID(patchName);
label patchi = patches.findPatchID(patchName);
if (patchI == -1)
if (patchi == -1)
{
FatalErrorInFunction
<< "Illegal patch " << patchName
......@@ -538,20 +541,20 @@ label findPatch(const polyBoundaryMesh& patches, const word& patchName)
// Check same patch for all procs
{
label newPatch = patchI;
label newPatch = patchi;
reduce(newPatch, minOp<label>());
if (newPatch != patchI)
if (newPatch != patchi)
{
FatalErrorInFunction
<< "Patch " << patchName
<< " should have the same patch index on all processors." << nl
<< "On my processor it has index " << patchI
<< "On my processor it has index " << patchi
<< " ; on some other processor it has index " << newPatch
<< exit(FatalError);
}
}
return patchI;
return patchi;
}
......@@ -641,7 +644,7 @@ int main(int argc, char *argv[])
{
faceSet fSet(mesh, setsAndPatches[setI][0]);
label patchI = findPatch
label patchi = findPatch
(
mesh.boundaryMesh(),
setsAndPatches[setI][1]
......@@ -658,7 +661,7 @@ int main(int argc, char *argv[])
<< " but also in patch " << wantedPatch[iter.key()]
<< exit(FatalError);
}
wantedPatch[iter.key()] = patchI;
wantedPatch[iter.key()] = patchi;
}
}
......@@ -683,7 +686,7 @@ int main(int argc, char *argv[])
);
faceSet fSet(mesh, coupledAndPatches[setI][0]);
label patchI = findPatch(patches, coupledAndPatches[setI][1]);
label patchi = findPatch(patches, coupledAndPatches[setI][1]);
forAllConstIter(faceSet, fSet, iter)
{
......@@ -696,7 +699,7 @@ int main(int argc, char *argv[])
<< " but also in patch " << coupledWantedPatch[iter.key()]
<< exit(FatalError);
}
coupledWantedPatch[iter.key()] = patchI;
coupledWantedPatch[iter.key()] = patchi;
cyclicWantedPatch_half0[iter.key()] = cyclicId;
cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
}
......
......@@ -193,24 +193,24 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt)
// Adds empty patch if not yet there. Returns patchID.
label addPatch(polyMesh& mesh, const word& patchName)
{
label patchI = mesh.boundaryMesh().findPatchID(patchName);
label patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchI == -1)
if (patchi == -1)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
List<polyPatch*> newPatches(patches.size() + 1);
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
patchI = 0;
patchi = 0;
newPatches[patchI] =
newPatches[patchi] =
new emptyPolyPatch
(
Foam::word(patchName),
0,
mesh.nInternalFaces(),
patchI,
patchi,
patches,
emptyPolyPatch::typeName
);
......@@ -232,15 +232,15 @@ label addPatch(polyMesh& mesh, const word& patchName)
mesh.removeBoundary();
mesh.addPatches(newPatches);
Info<< "Created patch oldInternalFaces at " << patchI << endl;
Info<< "Created patch oldInternalFaces at " << patchi << endl;
}
else
{
Info<< "Reusing patch oldInternalFaces at " << patchI << endl;
Info<< "Reusing patch oldInternalFaces at " << patchi << endl;
}
return patchI;
return patchi;
}
......@@ -482,7 +482,7 @@ void subsetMesh
(
polyMesh& mesh,
const label writeMesh,
const label patchI, // patchID for exposed faces
const label patchi, // patchID for exposed faces
const labelHashSet& cellsToRemove,
cellSet& cutCells,
labelIOList& refLevel
......@@ -503,7 +503,7 @@ void subsetMesh
(
cellLabels,
exposedFaces,
labelList(exposedFaces.size(), patchI),
labelList(exposedFaces.size(), patchi),
meshMod
);
......
......@@ -221,9 +221,9 @@ int main(int argc, char *argv[])
List<polyPatch*> p(patches.size());
forAll(p, patchI)
forAll(p, patchi)
{
p[patchI] = patches[patchI].clone(fMesh.boundaryMesh()).ptr();
p[patchi] = patches[patchi].clone(fMesh.boundaryMesh()).ptr();
}
fMesh.addFvPatches(p);
......@@ -294,15 +294,17 @@ int main(int argc, char *argv[])
}
}
volScalarField::GeometricBoundaryField& postRefLevelBf =
postRefLevel.boundaryFieldRef();
// For volScalarField: set boundary values to same as cell.
// Note: could also put
// zeroGradient b.c. on postRefLevel and do evaluate.
forAll(postRefLevel.boundaryField(), patchI)
forAll(postRefLevel.boundaryField(), patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
fvPatchScalarField& bField = postRefLevel.boundaryField()[patchI];
fvPatchScalarField& bField = postRefLevelBf[patchi];
Info<< "Setting field for patch "<< endl;
......
......@@ -931,38 +931,38 @@ int main(int argc, char *argv[])
label meshFaceI = foamPatchStarts[0];
forAll(newPatches, patchI)
forAll(newPatches, patchi)
{
const word& patchName = foamPatchNames[patchI];
const word& patchType = foamPatchTypes[patchI];
const word& patchName = foamPatchNames[patchi];
const word& patchType = foamPatchTypes[patchi];
Pout<< "Patch:" << patchName << " start at:" << meshFaceI
<< " size:" << foamPatchSizes[patchI]
<< " end at:" << meshFaceI+foamPatchSizes[patchI]
<< " size:" << foamPatchSizes[patchi]
<< " end at:" << meshFaceI+foamPatchSizes[patchi]
<< endl;
if (patchType == "wall")
{
newPatches[patchI] =
newPatches[patchi] =
new wallPolyPatch
(
patchName,
foamPatchSizes[patchI],
foamPatchSizes[patchi],
meshFaceI,
patchI,
patchi,
mesh.boundaryMesh(),
patchType
);
}
else if (patchType == "symmetryplane")
{
newPatches[patchI] =
newPatches[patchi] =
new symmetryPolyPatch
(
patchName,
foamPatchSizes[patchI],
foamPatchSizes[patchi],
meshFaceI,
patchI,
patchi,
mesh.boundaryMesh(),
patchType
);
......@@ -970,13 +970,13 @@ int main(int argc, char *argv[])
else if (patchType == "empty")
{
// Note: not ccm name, introduced by us above.
newPatches[patchI] =
newPatches[patchi] =
new emptyPolyPatch
(
patchName,
foamPatchSizes[patchI],
foamPatchSizes[patchi],
meshFaceI,
patchI,
patchi,
mesh.boundaryMesh(),
patchType
);
......@@ -985,19 +985,19 @@ int main(int argc, char *argv[])
{
// All other ccm types become straight polyPatch:
// 'inlet', 'outlet', ...
newPatches[patchI] =
newPatches[patchi] =
new polyPatch
(
patchName,
foamPatchSizes[patchI],
foamPatchSizes[patchi],
meshFaceI,
patchI,
patchi,
mesh.boundaryMesh(),
word::null
);
}
meshFaceI += foamPatchSizes[patchI];
meshFaceI += foamPatchSizes[patchi];
}
if (meshFaceI != foamOwner.size())
......
......@@ -485,18 +485,18 @@ int main(int argc, char *argv[])
faceListList boundary(slPatchCells.size());
wordList patchNames(slPatchCells.size());
forAll(slPatchCells, patchI)
forAll(slPatchCells, patchi)
{
SLList<face> patchFaces;