boundaryField() -> boundaryFieldRef()

This commit is contained in:
Henry Weller
2016-04-24 22:07:37 +01:00
parent 6005258c10
commit 6a27f7af46
155 changed files with 1650 additions and 1466 deletions

View File

@ -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;
}
}
}

View File

@ -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;
}
}
}

View File

@ -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();

View File

@ -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)
{

View File

@ -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)
{

View File

@ -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";

View File

@ -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;

View File

@ -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);

View File

@ -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();

View File

@ -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;
}

View File

@ -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
);

View File

@ -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;

View File

@ -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())

View File

@ -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;
SLList<label>::iterator cellIter(slPatchCells[patchI].begin());
SLList<label>::iterator faceIter(slPatchCellFaces[patchI].begin());
SLList<label>::iterator cellIter(slPatchCells[patchi].begin());
SLList<label>::iterator faceIter(slPatchCellFaces[patchi].begin());
for
(
;
cellIter != slPatchCells[patchI].end()
&& faceIter != slPatchCellFaces[patchI].end();
cellIter != slPatchCells[patchi].end()
&& faceIter != slPatchCellFaces[patchi].end();
++cellIter, ++faceIter
)
{
@ -513,8 +513,8 @@ int main(int argc, char *argv[])
);
}
boundary[patchI] = patchFaces;
patchNames[patchI] = word("patch") + name(patchI + 1);
boundary[patchi] = patchFaces;
patchNames[patchi] = word("patch") + name(patchi + 1);
}
@ -522,10 +522,10 @@ int main(int argc, char *argv[])
// Lookup the face labels for all the boundary faces
//
labelListList boundaryFaceLabels(boundary.size());
forAll(boundary, patchI)
forAll(boundary, patchi)
{
const faceList& bFaces = boundary[patchI];
labelList& bFaceLabels = boundaryFaceLabels[patchI];
const faceList& bFaces = boundary[patchi];
labelList& bFaceLabels = boundaryFaceLabels[patchi];
bFaceLabels.setSize(bFaces.size());
forAll(bFaces, i)
{
@ -538,24 +538,24 @@ int main(int argc, char *argv[])
// faces go into faceZones and external faces go into patches.
List<faceList> patchFaces(slPatchCells.size());
labelList patchNFaces(slPatchCells.size(), 0);
forAll(boundary, patchI)
forAll(boundary, patchi)
{
const faceList& bFaces = boundary[patchI];
const labelList& bFaceLabels = boundaryFaceLabels[patchI];
const faceList& bFaces = boundary[patchi];
const labelList& bFaceLabels = boundaryFaceLabels[patchi];
patchFaces[patchI].setSize(bFaces.size());
patchFaces[patchi].setSize(bFaces.size());
forAll(bFaces, i)
{
if (!dummyMesh().isInternalFace(bFaceLabels[i]))
{
patchFaces[patchI][patchNFaces[patchI]++] = bFaces[i];
patchFaces[patchi][patchNFaces[patchi]++] = bFaces[i];
}
}
patchFaces[patchI].setSize(patchNFaces[patchI]);
patchFaces[patchi].setSize(patchNFaces[patchi]);
Info<< "Patch " << patchI << " named " << patchNames[patchI]
<< ": " << boundary[patchI].size() << " faces" << endl;
Info<< "Patch " << patchi << " named " << patchNames[patchi]
<< ": " << boundary[patchi].size() << " faces" << endl;
}
// We no longer need the dummyMesh
@ -583,14 +583,14 @@ int main(int argc, char *argv[])
);
// Add information to dictionary
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
if (!patchDicts.set(patchI))
if (!patchDicts.set(patchi))
{
patchDicts.set(patchI, new dictionary());
patchDicts.set(patchi, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", polyPatch::typeName, false);
patchDicts[patchi].add("type", polyPatch::typeName, false);
}
@ -619,27 +619,27 @@ int main(int argc, char *argv[])
DynamicList<cellZone*> cz;
// FaceZones
forAll(boundaryFaceLabels, patchI)
forAll(boundaryFaceLabels, patchi)
{
if (boundaryFaceLabels[patchI].size())
if (boundaryFaceLabels[patchi].size())
{
// Re-do the boundaryFaceLabels since the boundary face
// labels will be different on the pShapeMesh.
const faceList& bFaces = boundary[patchI];
labelList& bFaceLabels = boundaryFaceLabels[patchI];
const faceList& bFaces = boundary[patchi];
labelList& bFaceLabels = boundaryFaceLabels[patchi];
forAll(bFaceLabels, i)
{
bFaceLabels[i] = findFace(pShapeMesh, bFaces[i]);
}
Info<< "Creating faceZone " << patchNames[patchI]
Info<< "Creating faceZone " << patchNames[patchi]
<< " with " << bFaceLabels.size() << " faces" << endl;
fz.append
(
new faceZone
(
patchNames[patchI],
patchNames[patchi],
bFaceLabels,
boolList(bFaceLabels.size(), false),
fz.size(),

View File

@ -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
@ -103,14 +103,14 @@ int main(int argc, char *argv[])
{
label no, blkNo, patchLabel;
forAll(cfxPatchTypes, patchI)
forAll(cfxPatchTypes, patchi)
{
// Grab patch type and name
cfxFile >> cfxPatchTypes[patchI] >> cfxPatchNames[patchI] >> no;
cfxFile >> cfxPatchTypes[patchi] >> cfxPatchNames[patchi] >> no;
// Grab patch range
patchRanges[patchI].setSize(6);
labelList& curRange = patchRanges[patchI];
patchRanges[patchi].setSize(6);
labelList& curRange = patchRanges[patchi];
forAll(curRange, rI)
{
@ -122,9 +122,9 @@ int main(int argc, char *argv[])
// 0 = solid (3-D patch),
// 1 = high i, 2 = high j, 3 = high k
// 4 = low i, 5 = low j, 6 = low k
cfxFile >> patchDirections[patchI] >> blkNo >> patchLabel;
cfxFile >> patchDirections[patchi] >> blkNo >> patchLabel;
patchMasterBlocks[patchI] = blkNo - 1;
patchMasterBlocks[patchi] = blkNo - 1;
}
}
@ -178,9 +178,9 @@ int main(int argc, char *argv[])
faceListList rawPatches(npatch);
forAll(rawPatches, patchI)
forAll(rawPatches, patchi)
{
const word& patchType = cfxPatchTypes[patchI];
const word& patchType = cfxPatchTypes[patchi];
// reject volume patches
if
@ -189,17 +189,17 @@ int main(int argc, char *argv[])
|| patchType == "SOLCON" || patchType == "USER3D"
)
{
patchMasterBlocks[patchI] = -1;
rawPatches[patchI].setSize(0);
patchMasterBlocks[patchi] = -1;
rawPatches[patchi].setSize(0);
}
else
{
// read and create a 2-D patch
rawPatches[patchI] =
blocks[patchMasterBlocks[patchI]].patchFaces
rawPatches[patchi] =
blocks[patchMasterBlocks[patchi]].patchFaces
(
patchDirections[patchI],
patchRanges[patchI]
patchDirections[patchi],
patchRanges[patchi]
);
}
@ -580,30 +580,30 @@ int main(int argc, char *argv[])
label nCreatedPatches = 0;
forAll(rawPatches, patchI)
forAll(rawPatches, patchi)
{
if (rawPatches[patchI].size() && cfxPatchTypes[patchI] != "BLKBDY")
if (rawPatches[patchi].size() && cfxPatchTypes[patchi] != "BLKBDY")
{
// Check if this name has been already created
label existingPatch = -1;
for (label oldPatchI = 0; oldPatchI < nCreatedPatches; oldPatchI++)
{
if (patchNames[oldPatchI] == cfxPatchNames[patchI])
if (patchNames[oldPatchI] == cfxPatchNames[patchi])
{
existingPatch = oldPatchI;
break;
}
}
const faceList& curRawPatch = rawPatches[patchI];
label curBlock = patchMasterBlocks[patchI];
const faceList& curRawPatch = rawPatches[patchi];
label curBlock = patchMasterBlocks[patchi];
if (existingPatch >= 0)
{
Info<< "CFX patch " << patchI
<< ", of type " << cfxPatchTypes[patchI]
<< ", name " << cfxPatchNames[patchI]
Info<< "CFX patch " << patchi
<< ", of type " << cfxPatchTypes[patchi]
<< ", name " << cfxPatchNames[patchi]
<< " already exists as OpenFOAM patch " << existingPatch
<< ". Adding faces." << endl;
@ -653,48 +653,48 @@ int main(int argc, char *argv[])
}
}
Info<< "CFX patch " << patchI
<< ", of type " << cfxPatchTypes[patchI]
<< ", name " << cfxPatchNames[patchI]
Info<< "CFX patch " << patchi
<< ", of type " << cfxPatchTypes[patchi]
<< ", name " << cfxPatchNames[patchi]
<< " converted into OpenFOAM patch " << nCreatedPatches
<< " type ";
if (cfxPatchTypes[patchI] == "WALL")
if (cfxPatchTypes[patchi] == "WALL")
{
Info<< "wall." << endl;
patchTypes[nCreatedPatches] = wallPolyPatch::typeName;
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
nCreatedPatches++;
}
else if (cfxPatchTypes[patchI] == "SYMMET")
else if (cfxPatchTypes[patchi] == "SYMMET")
{
Info<< "symmetryPlane." << endl;
patchTypes[nCreatedPatches] = symmetryPolyPatch::typeName;
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
nCreatedPatches++;
}
else if
(
cfxPatchTypes[patchI] == "INLET"
|| cfxPatchTypes[patchI] == "OUTLET"
|| cfxPatchTypes[patchI] == "PRESS"
|| cfxPatchTypes[patchI] == "CNDBDY"
|| cfxPatchTypes[patchI] == "USER2D"
cfxPatchTypes[patchi] == "INLET"
|| cfxPatchTypes[patchi] == "OUTLET"
|| cfxPatchTypes[patchi] == "PRESS"
|| cfxPatchTypes[patchi] == "CNDBDY"
|| cfxPatchTypes[patchi] == "USER2D"
)
{
Info<< "generic." << endl;
patchTypes[nCreatedPatches] = polyPatch::typeName;
patchNames[nCreatedPatches] = cfxPatchNames[patchI];
patchNames[nCreatedPatches] = cfxPatchNames[patchi];
nCreatedPatches++;
}
else
{
FatalErrorInFunction
<< "Unrecognised CFX patch type "
<< cfxPatchTypes[patchI]
<< cfxPatchTypes[patchi]
<< abort(FatalError);
}
}
@ -719,14 +719,14 @@ int main(int argc, char *argv[])
);
// Add information to dictionary
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
if (!patchDicts.set(patchI))
if (!patchDicts.set(patchi))
{
patchDicts.set(patchI, new dictionary());
patchDicts.set(patchi, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", patchTypes[patchI], false);
patchDicts[patchi].add("type", patchTypes[patchi], false);
}
polyMesh pShapeMesh

View File

@ -1377,9 +1377,9 @@ int main(int argc, char *argv[])
label nBoundaries = 0;
forAll(patches, patchI)
forAll(patches, patchi)
{
const faceList& bFaces = patches[patchI];
const faceList& bFaces = patches[patchi];
label sz = bFaces.size();
labelList meshFaces(sz,-1);
@ -1402,7 +1402,7 @@ int main(int argc, char *argv[])
if
(
patchTypes[patchI] != "internal"
patchTypes[patchi] != "internal"
&& !pShapeMesh.isInternalFace(meshFaces[0])
)
{
@ -1418,7 +1418,7 @@ int main(int argc, char *argv[])
{
FatalErrorInFunction
<< "Face " << faceI << " on new patch "
<< patchNames[patchI]
<< patchNames[patchi]
<< " is not an external face of the mesh." << endl
<< exit(FatalError);
}
@ -1427,7 +1427,7 @@ int main(int argc, char *argv[])
{
FatalErrorInFunction
<< "Face " << faceI << " on new patch "
<< patchNames[patchI]
<< patchNames[patchi]
<< " has already been marked for repatching to"
<< " patch "
<< facePatchID[faceI - pShapeMesh.nInternalFaces()]
@ -1438,8 +1438,8 @@ int main(int argc, char *argv[])
//add to boundary patch
Info<< "Adding new patch " << patchNames[patchI]
<< " of type " << patchTypes[patchI]
Info<< "Adding new patch " << patchNames[patchi]
<< " of type " << patchTypes[patchi]
<< " as patch " << nBoundaries << endl;
// Add patch to new patch list
@ -1447,8 +1447,8 @@ int main(int argc, char *argv[])
(
polyPatch::New
(
patchTypes[patchI],
patchNames[patchI],
patchTypes[patchi],
patchNames[patchi],
sz,
cMeshFace,
nBoundaries,
@ -1460,7 +1460,7 @@ int main(int argc, char *argv[])
}
else
{
Info<< "Patch " << patchNames[patchI]
Info<< "Patch " << patchNames[patchi]
<< " is internal to the mesh "
<< " and is not being added to the boundary."
<< endl;
@ -1535,12 +1535,12 @@ int main(int argc, char *argv[])
// Re-do face matching to write sets
if (writeSets)
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const faceList& bFaces = patches[patchI];
const faceList& bFaces = patches[patchi];
label sz = bFaces.size();
faceSet pFaceSet(pShapeMesh, patchNames[patchI], sz);
faceSet pFaceSet(pShapeMesh, patchNames[patchi], sz);
forAll(bFaces, j)
{
@ -1548,7 +1548,7 @@ int main(int argc, char *argv[])
label cMeshFace = findFace(pShapeMesh, f);
pFaceSet.insert(cMeshFace);
}
Info<< "Writing patch " << patchNames[patchI]
Info<< "Writing patch " << patchNames[patchi]
<< " of size " << sz << " to faceSet" << endl;
pFaceSet.instance() = pShapeMesh.instance();

View File

@ -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
@ -157,31 +157,31 @@ void Foam::fluentFvMesh::writeFluentMesh() const
label nWrittenFaces = own.size();
// Writing boundary faces
forAll(boundary(), patchI)
forAll(boundary(), patchi)
{
const faceUList& patchFaces = boundaryMesh()[patchI];
const faceUList& patchFaces = boundaryMesh()[patchi];
const labelList& patchFaceCells =
boundaryMesh()[patchI].faceCells();
boundaryMesh()[patchi].faceCells();
// The face group will be offset by 10 from the patch label
// Write header
fluentMeshFile
<< "(13 (" << patchI + 10 << " " << nWrittenFaces + 1
<< "(13 (" << patchi + 10 << " " << nWrittenFaces + 1
<< " " << nWrittenFaces + patchFaces.size() << " ";
nWrittenFaces += patchFaces.size();
// Write patch type
if (isA<wallFvPatch>(boundary()[patchI]))
if (isA<wallFvPatch>(boundary()[patchi]))
{
fluentMeshFile << 3;
}
else if
(
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|| isA<symmetryFvPatch>(boundary()[patchI])
isA<symmetryPlaneFvPatch>(boundary()[patchi])
|| isA<symmetryFvPatch>(boundary()[patchi])
)
{
fluentMeshFile << 7;
@ -275,20 +275,20 @@ void Foam::fluentFvMesh::writeFluentMesh() const
fluentMeshFile << "(39 (2 interior interior-1)())" << std::endl;
// Writing boundary patch types
forAll(boundary(), patchI)
forAll(boundary(), patchi)
{
fluentMeshFile
<< "(39 (" << patchI + 10 << " ";
<< "(39 (" << patchi + 10 << " ";
// Write patch type
if (isA<wallFvPatch>(boundary()[patchI]))
if (isA<wallFvPatch>(boundary()[patchi]))
{
fluentMeshFile << "wall ";
}
else if
(
isA<symmetryPlaneFvPatch>(boundary()[patchI])
|| isA<symmetryFvPatch>(boundary()[patchI])
isA<symmetryPlaneFvPatch>(boundary()[patchi])
|| isA<symmetryFvPatch>(boundary()[patchi])
)
{
fluentMeshFile << "symmetry ";
@ -299,7 +299,7 @@ void Foam::fluentFvMesh::writeFluentMesh() const
}
fluentMeshFile
<< boundary()[patchI].name() << ")())" << std::endl;
<< boundary()[patchi].name() << ")())" << std::endl;
}
}

View File

@ -780,12 +780,12 @@ int main(int argc, char *argv[])
faceListList boundary(patchCells.size());
forAll(patchCells, patchI)
forAll(patchCells, patchi)
{
labelList& curCells = patchCells[patchI];
labelList& curFaces = patchCellFaces[patchI];
labelList& curCells = patchCells[patchi];
labelList& curFaces = patchCellFaces[patchi];
faceList& patchFaces = boundary[patchI];
faceList& patchFaces = boundary[patchi];
patchFaces.setSize(curCells.size());
forAll(curCells, faceI)
@ -831,14 +831,14 @@ int main(int argc, char *argv[])
);
// Add information to dictionary
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
if (!patchDicts.set(patchI))
if (!patchDicts.set(patchi))
{
patchDicts.set(patchI, new dictionary());
patchDicts.set(patchi, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", polyPatch::typeName, false);
patchDicts[patchi].add("type", polyPatch::typeName, false);
}
polyMesh pShapeMesh

View File

@ -505,28 +505,28 @@ void readCells
Map<label>::iterator regFnd = physToPatch.find(regPhys);
label patchI = -1;
label patchi = -1;
if (regFnd == physToPatch.end())
{
// New region. Allocate patch for it.
patchI = patchFaces.size();
patchi = patchFaces.size();
patchFaces.setSize(patchI + 1);
patchToPhys.setSize(patchI + 1);
patchFaces.setSize(patchi + 1);
patchToPhys.setSize(patchi + 1);
Info<< "Mapping region " << regPhys << " to Foam patch "
<< patchI << endl;
physToPatch.insert(regPhys, patchI);
patchToPhys[patchI] = regPhys;
<< patchi << endl;
physToPatch.insert(regPhys, patchi);
patchToPhys[patchi] = regPhys;
}
else
{
// Existing patch for region
patchI = regFnd();
patchi = regFnd();
}
// Add triangle to correct patchFaces.
patchFaces[patchI].append(triPoints);
patchFaces[patchi].append(triPoints);
}
else if (elmType == MSHQUAD)
{
@ -538,28 +538,28 @@ void readCells
Map<label>::iterator regFnd = physToPatch.find(regPhys);
label patchI = -1;
label patchi = -1;
if (regFnd == physToPatch.end())
{
// New region. Allocate patch for it.
patchI = patchFaces.size();
patchi = patchFaces.size();
patchFaces.setSize(patchI + 1);
patchToPhys.setSize(patchI + 1);
patchFaces.setSize(patchi + 1);
patchToPhys.setSize(patchi + 1);
Info<< "Mapping region " << regPhys << " to Foam patch "
<< patchI << endl;
physToPatch.insert(regPhys, patchI);
patchToPhys[patchI] = regPhys;
<< patchi << endl;
physToPatch.insert(regPhys, patchi);
patchToPhys[patchi] = regPhys;
}
else
{
// Existing patch for region
patchI = regFnd();
patchi = regFnd();
}
// Add quad to correct patchFaces.
patchFaces[patchI].append(quadPoints);
patchFaces[patchi].append(quadPoints);
}
else if (elmType == MSHTET)
{
@ -707,9 +707,9 @@ void readCells
cells.setSize(cellI);
forAll(patchFaces, patchI)
forAll(patchFaces, patchi)
{
patchFaces[patchI].shrink();
patchFaces[patchi].shrink();
}
@ -880,22 +880,22 @@ int main(int argc, char *argv[])
wordList boundaryPatchNames(boundaryFaces.size());
forAll(boundaryPatchNames, patchI)
forAll(boundaryPatchNames, patchi)
{
label physReg = patchToPhys[patchI];
label physReg = patchToPhys[patchi];
Map<word>::const_iterator iter = physicalNames.find(physReg);
if (iter != physicalNames.end())
{
boundaryPatchNames[patchI] = iter();
boundaryPatchNames[patchi] = iter();
}
else
{
boundaryPatchNames[patchI] = word("patch") + name(patchI);
boundaryPatchNames[patchi] = word("patch") + name(patchi);
}
Info<< "Patch " << patchI << " gets name "
<< boundaryPatchNames[patchI] << endl;
Info<< "Patch " << patchi << " gets name "
<< boundaryPatchNames[patchi] << endl;
}
Info<< endl;
@ -938,11 +938,11 @@ int main(int argc, char *argv[])
// Go through all the patchFaces and find corresponding face in pp.
forAll(patchFaces, patchI)
forAll(patchFaces, patchi)
{
const DynamicList<face>& pFaces = patchFaces[patchI];
const DynamicList<face>& pFaces = patchFaces[patchi];
Info<< "Finding faces of patch " << patchI << endl;
Info<< "Finding faces of patch " << patchi << endl;
forAll(pFaces, i)
{
@ -955,7 +955,7 @@ int main(int argc, char *argv[])
{
label meshFaceI = pp.start() + patchFaceI;
repatcher.changePatchID(meshFaceI, patchI);
repatcher.changePatchID(meshFaceI, patchi);
}
else
{
@ -965,7 +965,7 @@ int main(int argc, char *argv[])
if (meshFaceI != -1)
{
zoneFaces[patchI].append(meshFaceI);
zoneFaces[patchi].append(meshFaceI);
}
else
{
@ -1104,11 +1104,11 @@ int main(int argc, char *argv[])
{
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
label newPatchI = 0;
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
if (patchI != defaultPatchID)
if (patchi != defaultPatchID)
{
const polyPatch& patch = mesh.boundaryMesh()[patchI];
const polyPatch& patch = mesh.boundaryMesh()[patchi];
newPatchPtrList[newPatchI] = patch.clone
(

View File

@ -625,16 +625,16 @@ void readDOFS
// Returns -1 or group that all of the vertices of f are in,
label findPatch(const List<labelHashSet>& dofGroups, const face& f)
{
forAll(dofGroups, patchI)
forAll(dofGroups, patchi)
{
if (dofGroups[patchI].found(f[0]))
if (dofGroups[patchi].found(f[0]))
{
bool allInGroup = true;
// Check rest of face
for (label fp = 1; fp < f.size(); fp++)
{
if (!dofGroups[patchI].found(f[fp]))
if (!dofGroups[patchi].found(f[fp]))
{
allInGroup = false;
break;
@ -643,7 +643,7 @@ label findPatch(const List<labelHashSet>& dofGroups, const face& f)
if (allInGroup)
{
return patchI;
return patchi;
}
}
}
@ -937,22 +937,22 @@ int main(int argc, char *argv[])
<< " DOF sets to detect boundary faces."<< endl;
// Renumber vertex numbers on contraints
forAll(dofVertIndices, patchI)
forAll(dofVertIndices, patchi)
{
inplaceRenumber(unvToFoam, dofVertIndices[patchI]);
inplaceRenumber(unvToFoam, dofVertIndices[patchi]);
}
// Build labelHashSet of points per dofGroup/patch
List<labelHashSet> dofGroups(dofVertIndices.size());
forAll(dofVertIndices, patchI)
forAll(dofVertIndices, patchi)
{
const labelList& foamVerts = dofVertIndices[patchI];
const labelList& foamVerts = dofVertIndices[patchi];
forAll(foamVerts, i)
{
dofGroups[patchI].insert(foamVerts[i]);
dofGroups[patchi].insert(foamVerts[i]);
}
}
@ -966,11 +966,11 @@ int main(int argc, char *argv[])
forAll(shapeFaces, i)
{
label patchI = findPatch(dofGroups, shapeFaces[i]);
label patchi = findPatch(dofGroups, shapeFaces[i]);
if (patchI != -1)
if (patchi != -1)
{
dynPatchFaces[patchI].append(shapeFaces[i]);
dynPatchFaces[patchi].append(shapeFaces[i]);
}
}
}
@ -978,9 +978,9 @@ int main(int argc, char *argv[])
// Transfer
patchFaceVerts.setSize(dynPatchFaces.size());
forAll(dynPatchFaces, patchI)
forAll(dynPatchFaces, patchi)
{
patchFaceVerts[patchI].transfer(dynPatchFaces[patchI]);
patchFaceVerts[patchi].transfer(dynPatchFaces[patchi]);
}
}
else
@ -1005,12 +1005,12 @@ int main(int argc, char *argv[])
boundaryFaceToIndex.insert(boundaryFaceIndices[i], i);
}
forAll(patchFaceVerts, patchI)
forAll(patchFaceVerts, patchi)
{
Info << patchI << ": " << patchNames[patchI] << " is " << flush;
Info << patchi << ": " << patchNames[patchi] << " is " << flush;
faceList& patchFaces = patchFaceVerts[patchI];
const labelList& faceIndices = patchFaceIndices[patchI];
faceList& patchFaces = patchFaceVerts[patchi];
const labelList& faceIndices = patchFaceIndices[patchi];
patchFaces.setSize(faceIndices.size());
@ -1037,14 +1037,14 @@ int main(int argc, char *argv[])
if (cnt != patchFaces.size() || duplicateFaces)
{
isAPatch[patchI] = false;
isAPatch[patchi] = false;
if (verbose)
{
if (cnt != patchFaces.size())
{
WarningInFunction
<< "For patch " << patchI << " there were "
<< "For patch " << patchi << " there were "
<< patchFaces.size()-cnt
<< " faces not used because they seem"
<< " to be internal. "
@ -1055,7 +1055,7 @@ int main(int argc, char *argv[])
{
WarningInFunction
<< "Patch "
<< patchI << " has faces that are already "
<< patchi << " has faces that are already "
<< " in use on other boundary-patches,"
<< " Assuming faceZoneset." << endl;
}
@ -1075,13 +1075,13 @@ int main(int argc, char *argv[])
<< "The face index " << faceIndices[i]
<< " was not found amongst the cells."
<< " This kills the theory that "
<< patchNames[patchI] << " is a cell zone"
<< patchNames[patchi] << " is a cell zone"
<< endl
<< abort(FatalError);
}
theCells[i] = cellCorrespondence[faceIndices[i]];
}
cellZones.insert(patchNames[patchI], theCells);
cellZones.insert(patchNames[patchi], theCells);
}
else
{
@ -1091,7 +1091,7 @@ int main(int argc, char *argv[])
{
theFaces[i] = boundaryFaceToIndex[faceIndices[i]];
}
faceZones.insert(patchNames[patchI],theFaces);
faceZones.insert(patchNames[patchi],theFaces);
}
}
else
@ -1140,14 +1140,14 @@ int main(int argc, char *argv[])
DynamicList<word> usedPatchNames;
DynamicList<faceList> usedPatchFaceVerts;
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
if (isAPatch[patchI])
if (isAPatch[patchi])
{
Info<< " " << patchNames[patchI] << '\t'
<< patchFaceVerts[patchI].size() << nl;
usedPatchNames.append(patchNames[patchI]);
usedPatchFaceVerts.append(patchFaceVerts[patchI]);
Info<< " " << patchNames[patchi] << '\t'
<< patchFaceVerts[patchi].size() << nl;
usedPatchNames.append(patchNames[patchi]);
usedPatchFaceVerts.append(patchFaceVerts[patchi]);
}
}
usedPatchNames.shrink();

View File

@ -546,14 +546,14 @@ preservePatchTypes
defaultFacesType
);
// Add information to dictionary
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
if (!patchDicts.set(patchI))
if (!patchDicts.set(patchi))
{
patchDicts.set(patchI, new dictionary());
patchDicts.set(patchi, new dictionary());
}
// Add but not overwrite
patchDicts[patchI].add("type", patchTypes[patchI], false);
patchDicts[patchi].add("type", patchTypes[patchi], false);
}
// Build the mesh and write it out

View File

@ -167,18 +167,18 @@ int main(int argc, char *argv[])
forAll(boundaryFaces, faceI)
{
label patchI(readLabel(str));
label patchi(readLabel(str));
if (patchI < 0)
if (patchi < 0)
{
FatalErrorInFunction
<< "Invalid boundary region number " << patchI
<< "Invalid boundary region number " << patchi
<< " on line " << str.lineNumber()
<< exit(FatalError);
}
maxPatch = max(maxPatch, patchI);
maxPatch = max(maxPatch, patchi);
triFace tri(readLabel(str)-1, readLabel(str)-1, readLabel(str)-1);
@ -187,7 +187,7 @@ int main(int argc, char *argv[])
boundaryFaces[faceI][0] = tri[0];
boundaryFaces[faceI][1] = tri[1];
boundaryFaces[faceI][2] = tri[2];
boundaryPatch[faceI] = patchI;
boundaryPatch[faceI] = patchi;
vertsToBoundary.insert(tri, faceI);
}
@ -254,9 +254,9 @@ int main(int argc, char *argv[])
wordList patchNames(nPatches);
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
patchNames[patchI] = word("patch") + name(patchI);
patchNames[patchi] = word("patch") + name(patchi);
}
wordList patchTypes(nPatches, polyPatch::typeName);
@ -270,22 +270,22 @@ int main(int argc, char *argv[])
forAll(boundaryPatch, faceI)
{
label patchI = boundaryPatch[faceI];
label patchi = boundaryPatch[faceI];
allPatchFaces[patchI].append(boundaryFaces[faceI]);
allPatchFaces[patchi].append(boundaryFaces[faceI]);
}
Info<< "Patches:" << nl
<< "\tNeutral Boundary\tPatch name\tSize" << nl
<< "\t----------------\t----------\t----" << endl;
forAll(allPatchFaces, patchI)
forAll(allPatchFaces, patchi)
{
Info<< '\t' << patchI << "\t\t\t"
<< patchNames[patchI] << "\t\t"
<< allPatchFaces[patchI].size() << endl;
Info<< '\t' << patchi << "\t\t\t"
<< patchNames[patchi] << "\t\t"
<< allPatchFaces[patchi].size() << endl;
patchFaces[patchI].transfer(allPatchFaces[patchI]);
patchFaces[patchi].transfer(allPatchFaces[patchi]);
}
Info<< endl;

View File

@ -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
@ -70,9 +70,9 @@ bool Foam::sammMesh::sammEqualFace
void Foam::sammMesh::createBoundaryFaces()
{
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
faceList& patchFaces = boundary_[patchI];
faceList& patchFaces = boundary_[patchi];
const labelListList& PointCells = pointCells();

View File

@ -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
@ -41,11 +41,11 @@ void Foam::sammMesh::createPolyBoundary()
const labelListList& PointCells = pointCells();
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
const faceList& curShapePatch = boundary_[patchI];
const faceList& curShapePatch = boundary_[patchi];
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
forAll(curShapePatch, faceI)
{
@ -120,21 +120,21 @@ Foam::List<Foam::polyPatch* > Foam::sammMesh::polyBoundaryPatches
{
List<polyPatch* > p(boundary_.size());
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
const faceList& curShapePatch = boundary_[patchI];
const faceList& curShapePatch = boundary_[patchi];
p[patchI] = polyPatch::New
p[patchi] = polyPatch::New
(
patchTypes_[patchI],
patchNames_[patchI],
patchTypes_[patchi],
patchNames_[patchi],
curShapePatch.size(),
polyBoundaryPatchStartIndices_[patchI],
patchI,
polyBoundaryPatchStartIndices_[patchi],
patchi,
pMesh.boundaryMesh()
).ptr();
p[patchI]->physicalType() = patchPhysicalTypes_[patchI];
p[patchi]->physicalType() = patchPhysicalTypes_[patchi];
}
return p;

View File

@ -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
@ -243,13 +243,13 @@ void Foam::sammMesh::readBoundary()
defaultFacesType_
);
forAll(patchDicts, patchI)
forAll(patchDicts, patchi)
{
if (patchDicts.set(patchI))
if (patchDicts.set(patchi))
{
const dictionary& dict = patchDicts[patchI];
dict.readIfPresent("type", patchTypes_[patchI]);
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
const dictionary& dict = patchDicts[patchi];
dict.readIfPresent("type", patchTypes_[patchi]);
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchi]);
}
}
}

View File

@ -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
@ -97,13 +97,13 @@ void Foam::starMesh::markBoundaryFaces()
boundaryCellIDs_.setSize(boundary_.size());
boundaryCellFaceIDs_.setSize(boundary_.size());
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
const faceList& patchFaces = boundary_[patchI];
const faceList& patchFaces = boundary_[patchi];
// set size of patch lists
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
curBoundaryCellIDs.setSize(patchFaces.size());
curBoundaryCellFaceIDs.setSize(patchFaces.size());
@ -178,13 +178,13 @@ void Foam::starMesh::markBoundaryFaces()
void Foam::starMesh::collectBoundaryFaces()
{
Info<< "Collecting boundary faces" << endl;
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
faceList& patchFaces = boundary_[patchI];
faceList& patchFaces = boundary_[patchi];
// set size of patch lists
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchI];
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchI];
const labelList& curBoundaryCellIDs = boundaryCellIDs_[patchi];
const labelList& curBoundaryCellFaceIDs = boundaryCellFaceIDs_[patchi];
forAll(curBoundaryCellIDs, faceI)
{

View File

@ -41,11 +41,11 @@ void Foam::starMesh::createPolyBoundary()
const labelListList& PointCells = pointCells();
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
const faceList& curShapePatch = boundary_[patchI];
const faceList& curShapePatch = boundary_[patchi];
polyBoundaryPatchStartIndices_[patchI] = nCreatedFaces;
polyBoundaryPatchStartIndices_[patchi] = nCreatedFaces;
forAll(curShapePatch, faceI)
{
@ -295,15 +295,15 @@ Foam::starMesh::polyBoundaryPatches(const polyMesh& pMesh)
{
List<polyPatch*> p(boundary_.size());
forAll(boundary_, patchI)
forAll(boundary_, patchi)
{
p[patchI] = polyPatch::New
p[patchi] = polyPatch::New
(
patchTypes_[patchI],
patchNames_[patchI],
boundary_[patchI].size(),
polyBoundaryPatchStartIndices_[patchI],
patchI,
patchTypes_[patchi],
patchNames_[patchi],
boundary_[patchi].size(),
polyBoundaryPatchStartIndices_[patchi],
patchi,
pMesh.boundaryMesh()
).ptr();
}

View File

@ -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
@ -241,13 +241,13 @@ void Foam::starMesh::readBoundary()
defaultFacesType_
);
forAll(patchDicts, patchI)
forAll(patchDicts, patchi)
{
if (patchDicts.set(patchI))
if (patchDicts.set(patchi))
{
const dictionary& dict = patchDicts[patchI];
dict.readIfPresent("type", patchTypes_[patchI]);
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchI]);
const dictionary& dict = patchDicts[patchi];
dict.readIfPresent("type", patchTypes_[patchi]);
dict.readIfPresent("physicalType", patchPhysicalTypes_[patchi]);
}
}
}

View File

@ -431,27 +431,27 @@ int main(int argc, char *argv[])
// Get Foam patchID and update region->patch table.
label patchI = 0;
label patchi = 0;
Map<label>::iterator patchFind =
regionToPatch.find(region);
if (patchFind == regionToPatch.end())
{
patchI = nPatches;
patchi = nPatches;
Info<< "Mapping tetgen region " << region
<< " to Foam patch "
<< patchI << endl;
<< patchi << endl;
regionToPatch.insert(region, nPatches++);
}
else
{
patchI = patchFind();
patchi = patchFind();
}
boundaryPatch[faceI] = patchI;
boundaryPatch[faceI] = patchi;
// Skip remaining attributes
for (label i = 1; i < nFaceAttr; i++)
@ -486,9 +486,9 @@ int main(int argc, char *argv[])
faceListList patchFaces(nPatches);
wordList patchNames(nPatches);
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
patchNames[patchI] = word("patch") + name(patchI);
patchNames[patchi] = word("patch") + name(patchi);
}
wordList patchTypes(nPatches, polyPatch::typeName);
@ -502,19 +502,19 @@ int main(int argc, char *argv[])
forAll(boundaryPatch, faceI)
{
label patchI = boundaryPatch[faceI];
label patchi = boundaryPatch[faceI];
allPatchFaces[patchI].append(boundaryFaces[faceI]);
allPatchFaces[patchi].append(boundaryFaces[faceI]);
}
Info<< "Patch sizes:" << endl;
forAll(allPatchFaces, patchI)
forAll(allPatchFaces, patchi)
{
Info<< " " << patchNames[patchI] << " : "
<< allPatchFaces[patchI].size() << endl;
Info<< " " << patchNames[patchi] << " : "
<< allPatchFaces[patchi].size() << endl;
patchFaces[patchI].transfer(allPatchFaces[patchI]);
patchFaces[patchi].transfer(allPatchFaces[patchi]);
}
Info<< endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -222,9 +222,9 @@ void writePatchCentres
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
fileName faceFile
(
@ -251,9 +251,9 @@ void writePatchFaces
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
fileName faceFile
(
@ -294,9 +294,9 @@ void writePatchBoundaryEdges
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
fileName edgeFile
(

View File

@ -358,11 +358,11 @@ int main(int argc, char *argv[])
<< "Patches" << nl
<< "----------------" << nl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& p = patches[patchI];
const polyPatch& p = patches[patchi];
Info<< " " << "patch " << patchI
Info<< " " << "patch " << patchi
<< " (start: " << p.start()
<< " size: " << p.size()
<< ") name: " << p.name()

View File

@ -229,11 +229,11 @@ void changeFrontBackPatches
DynamicList<polyPatch*> newPatches(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp(patches[patchI]);
const polyPatch& pp(patches[patchi]);
if (patchI == frontPatchI || patchI == backPatchI)
if (patchi == frontPatchI || patchi == backPatchI)
{
newPatches.append
(
@ -397,10 +397,10 @@ int main(int argc, char *argv[])
{
label meshFaceI = meshFaces[i];
label patchI = patches.whichPatch(meshFaceI);
label patchi = patches.whichPatch(meshFaceI);
label own = mesh.faceOwner()[meshFaceI];
label nei = -1;
if (patchI == -1)
if (patchi == -1)
{
nei = mesh.faceNeighbour()[meshFaceI];
}
@ -420,7 +420,7 @@ int main(int argc, char *argv[])
own, // owner
nei, // neighbour
true, // face flip
patchI, // patch for face
patchi, // patch for face
zoneI, // zone for face
zoneFlip // face flip in zone
);
@ -521,11 +521,11 @@ int main(int argc, char *argv[])
if (nAdded > 0)
{
DynamicList<polyPatch*> newPatches(nPatches);
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
newPatches.append
(
mesh.boundaryMesh()[patchI].clone
mesh.boundaryMesh()[patchi].clone
(
mesh.boundaryMesh()
).ptr()
@ -533,14 +533,14 @@ int main(int argc, char *argv[])
}
for
(
label patchI = mesh.boundaryMesh().size();
patchI < nPatches;
patchI++
label patchi = mesh.boundaryMesh().size();
patchi < nPatches;
patchi++
)
{
label nbrProcI = patchToNbrProc[patchI];
label nbrProcI = patchToNbrProc[patchi];
Pout<< "Adding patch " << patchI
Pout<< "Adding patch " << patchi
<< " between " << Pstream::myProcNo()
<< " and " << nbrProcI
<< endl;
@ -551,7 +551,7 @@ int main(int argc, char *argv[])
(
0, // size
mesh.nFaces(), // start
patchI, // index
patchi, // index
mesh.boundaryMesh(),// polyBoundaryMesh
Pstream::myProcNo(),// myProcNo
nbrProcI // neighbProcNo

View File

@ -164,29 +164,29 @@ label addPatch
DynamicList<polyPatch*>& newPatches
)
{
label patchI = findPatchID(newPatches, patchName);
label patchi = findPatchID(newPatches, patchName);
if (patchI != -1)
if (patchi != -1)
{
if (isA<PatchType>(*newPatches[patchI]))
if (isA<PatchType>(*newPatches[patchi]))
{
// Already there
return patchI;
return patchi;
}
else
{
FatalErrorInFunction
<< "Already have patch " << patchName
<< " but of type " << newPatches[patchI]->type()
<< " but of type " << newPatches[patchi]->type()
<< exit(FatalError);
}
}
patchI = newPatches.size();
patchi = newPatches.size();
label startFaceI = 0;
if (patchI > 0)
if (patchi > 0)
{
const polyPatch& pp = *newPatches.last();
startFaceI = pp.start()+pp.size();
@ -201,12 +201,12 @@ label addPatch
patchName,
0, // size
startFaceI, // nFaces
patchI,
patchi,
patches
).ptr()
);
return patchI;
return patchi;
}
@ -219,29 +219,29 @@ label addPatch
DynamicList<polyPatch*>& newPatches
)
{
label patchI = findPatchID(newPatches, patchName);
label patchi = findPatchID(newPatches, patchName);
if (patchI != -1)
if (patchi != -1)
{
if (isA<PatchType>(*newPatches[patchI]))
if (isA<PatchType>(*newPatches[patchi]))
{
// Already there
return patchI;
return patchi;
}
else
{
FatalErrorInFunction
<< "Already have patch " << patchName
<< " but of type " << newPatches[patchI]->type()
<< " but of type " << newPatches[patchi]->type()
<< exit(FatalError);
}
}
patchI = newPatches.size();
patchi = newPatches.size();
label startFaceI = 0;
if (patchI > 0)
if (patchi > 0)
{
const polyPatch& pp = *newPatches.last();
startFaceI = pp.start()+pp.size();
@ -258,12 +258,12 @@ label addPatch
(
patchName,
patchDict,
patchI,
patchi,
patches
).ptr()
);
return patchI;
return patchi;
}
@ -287,60 +287,60 @@ void deleteEmptyPatches(fvMesh& mesh)
// Add all the non-empty, non-processor patches
forAll(masterNames, masterI)
{
label patchI = patches.findPatchID(masterNames[masterI]);
label patchi = patches.findPatchID(masterNames[masterI]);
if (patchI != -1)
if (patchi != -1)
{
if (isA<processorPolyPatch>(patches[patchI]))
if (isA<processorPolyPatch>(patches[patchi]))
{
// Similar named processor patch? Not 'possible'.
if (patches[patchI].size() == 0)
if (patches[patchi].size() == 0)
{
Pout<< "Deleting processor patch " << patchI
<< " name:" << patches[patchI].name()
Pout<< "Deleting processor patch " << patchi
<< " name:" << patches[patchi].name()
<< endl;
oldToNew[patchI] = --notUsedI;
oldToNew[patchi] = --notUsedI;
}
else
{
oldToNew[patchI] = usedI++;
oldToNew[patchi] = usedI++;
}
}
else
{
// Common patch.
if (returnReduce(patches[patchI].size(), sumOp<label>()) == 0)
if (returnReduce(patches[patchi].size(), sumOp<label>()) == 0)
{
Pout<< "Deleting patch " << patchI
<< " name:" << patches[patchI].name()
Pout<< "Deleting patch " << patchi
<< " name:" << patches[patchi].name()
<< endl;
oldToNew[patchI] = --notUsedI;
oldToNew[patchi] = --notUsedI;
}
else
{
oldToNew[patchI] = usedI++;
oldToNew[patchi] = usedI++;
}
}
}
}
// Add remaining patches at the end
forAll(patches, patchI)
forAll(patches, patchi)
{
if (oldToNew[patchI] == -1)
if (oldToNew[patchi] == -1)
{
// Unique to this processor. Note: could check that these are
// only processor patches.
if (patches[patchI].size() == 0)
if (patches[patchi].size() == 0)
{
Pout<< "Deleting processor patch " << patchI
<< " name:" << patches[patchI].name()
Pout<< "Deleting processor patch " << patchi
<< " name:" << patches[patchi].name()
<< endl;
oldToNew[patchI] = --notUsedI;
oldToNew[patchi] = --notUsedI;
}
else
{
oldToNew[patchI] = usedI++;
oldToNew[patchi] = usedI++;
}
}
}
@ -533,12 +533,12 @@ label findUncoveredPatchFace
forAll(eFaces, i)
{
label faceI = eFaces[i];
label patchI = pbm.whichPatch(faceI);
label patchi = pbm.whichPatch(faceI);
if
(
patchI != -1
&& !pbm[patchI].coupled()
patchi != -1
&& !pbm[patchi].coupled()
&& !extrudeFaceSet.found(faceI)
)
{
@ -569,12 +569,12 @@ label findUncoveredCyclicPatchFace
forAll(eFaces, i)
{
label faceI = eFaces[i];
label patchI = pbm.whichPatch(faceI);
label patchi = pbm.whichPatch(faceI);
if
(
patchI != -1
&& isA<cyclicPolyPatch>(pbm[patchI])
patchi != -1
&& isA<cyclicPolyPatch>(pbm[patchi])
&& !extrudeFaceSet.found(faceI)
)
{
@ -1181,20 +1181,20 @@ void setCouplingInfo
forAll(zoneToPatch, zoneI)
{
label patchI = zoneToPatch[zoneI];
label patchi = zoneToPatch[zoneI];
if (patchI != -1)
if (patchi != -1)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (isA<mappedWallPolyPatch>(pp))
{
newPatches[patchI] = new mappedWallPolyPatch
newPatches[patchi] = new mappedWallPolyPatch
(
pp.name(),
pp.size(),
pp.start(),
patchI,
patchi,
sampleRegion, // sampleRegion
mode, // sampleMode
pp.name(), // samplePatch
@ -1205,11 +1205,11 @@ void setCouplingInfo
}
}
forAll(newPatches, patchI)
forAll(newPatches, patchi)
{
if (!newPatches[patchI])
if (!newPatches[patchi])
{
newPatches[patchI] = patches[patchI].clone(patches).ptr();
newPatches[patchi] = patches[patchi].clone(patches).ptr();
}
}
@ -1956,14 +1956,14 @@ int main(int argc, char *argv[])
DynamicList<polyPatch*> regionPatches(patches.size());
// Copy all non-local patches since these are used on boundary edges of
// the extrusion
forAll(patches, patchI)
forAll(patches, patchi)
{
if (!isA<processorPolyPatch>(patches[patchI]))
if (!isA<processorPolyPatch>(patches[patchi]))
{
label newPatchI = regionPatches.size();
regionPatches.append
(
patches[patchI].clone
patches[patchi].clone
(
patches,
newPatchI,
@ -2008,9 +2008,9 @@ int main(int argc, char *argv[])
// Clone existing patches
DynamicList<polyPatch*> newPatches(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
newPatches.append(patches[patchI].clone(patches).ptr());
newPatches.append(patches[patchi].clone(patches).ptr());
}
// Add new patches
@ -2126,10 +2126,10 @@ int main(int argc, char *argv[])
// // Add all the newPatches to the mesh and fields
// // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// {
// forAll(newPatches, patchI)
// forAll(newPatches, patchi)
// {
// Pout<< "Adding patch " << patchI
// << " name:" << newPatches[patchI]->name()
// Pout<< "Adding patch " << patchi
// << " name:" << newPatches[patchi]->name()
// << endl;
// }
// //label nOldPatches = mesh.boundary().size();
@ -2139,12 +2139,12 @@ int main(int argc, char *argv[])
// //// Add calculated fvPatchFields for the added patches
// //for
// //(
// // label patchI = nOldPatches;
// // patchI < mesh.boundary().size();
// // patchI++
// // label patchi = nOldPatches;
// // patchi < mesh.boundary().size();
// // patchi++
// //)
// //{
// // Pout<< "ADDing calculated to patch " << patchI
// // Pout<< "ADDing calculated to patch " << patchi
// // << endl;
// // addCalculatedPatchFields(mesh);
// //}
@ -2408,10 +2408,10 @@ int main(int argc, char *argv[])
);
// Add the new patches
forAll(regionPatches, patchI)
forAll(regionPatches, patchi)
{
polyPatch* ppPtr = regionPatches[patchI];
regionPatches[patchI] = ppPtr->clone(regionMesh.boundaryMesh()).ptr();
polyPatch* ppPtr = regionPatches[patchi];
regionPatches[patchi] = ppPtr->clone(regionMesh.boundaryMesh()).ptr();
delete ppPtr;
}
regionMesh.clearOut();
@ -2474,20 +2474,20 @@ int main(int argc, char *argv[])
List<pointField> topOffsets(zoneNames.size());
List<pointField> bottomOffsets(zoneNames.size());
forAll(regionMesh.boundaryMesh(), patchI)
forAll(regionMesh.boundaryMesh(), patchi)
{
const polyPatch& pp = regionMesh.boundaryMesh()[patchI];
const polyPatch& pp = regionMesh.boundaryMesh()[patchi];
if (isA<mappedWallPolyPatch>(pp))
{
if (findIndex(interRegionTopPatch, patchI) != -1)
if (findIndex(interRegionTopPatch, patchi) != -1)
{
label zoneI = findIndex(interRegionTopPatch, patchI);
label zoneI = findIndex(interRegionTopPatch, patchi);
topOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
}
else if (findIndex(interRegionBottomPatch, patchI) != -1)
else if (findIndex(interRegionBottomPatch, patchi) != -1)
{
label zoneI = findIndex(interRegionBottomPatch, patchI);
label zoneI = findIndex(interRegionBottomPatch, patchi);
bottomOffsets[zoneI] = calcOffset(extrudePatch, extruder, pp);
}
}

View File

@ -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
@ -117,11 +117,11 @@ void Foam::extrude2DMesh::addFrontBackPatches()
// Add patch.
List<polyPatch*> newPatches(patches.size() + 2);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
newPatches[patchI] =
newPatches[patchi] =
pp.clone
(
patches,
@ -323,15 +323,15 @@ void Foam::extrude2DMesh::setRefinement
}
}
forAll(patches, patchI)
forAll(patches, patchi)
{
for (label layer=0; layer < nLayers; layer++)
{
label currentLayerOffset = layer*mesh_.nPoints();
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
label startFaceI = patches[patchI].start();
label endFaceI = startFaceI + patches[patchI].size();
label startFaceI = patches[patchi].start();
label endFaceI = startFaceI + patches[patchi].size();
for (label faceI = startFaceI; faceI < endFaceI; faceI++)
{
@ -361,7 +361,7 @@ void Foam::extrude2DMesh::setRefinement
-1, // masterEdgeID
nFaces++, // masterFaceID
false, // flipFaceFlux
patchI, // patchID
patchi, // patchID
zoneID, // zoneID
zoneFlip // zoneFlip
);

View File

@ -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
@ -152,11 +152,11 @@ void Foam::patchToPoly2DMesh::addPatchFacesToFaces()
label offset = patch_.nInternalEdges();
face f(2);
forAll(patchNames_, patchI)
forAll(patchNames_, patchi)
{
forAllConstIter(EdgeMap<label>, mapEdgesRegion_, eIter)
{
if (eIter() == patchI)
if (eIter() == patchi)
{
f[0] = meshPoints[eIter.key().start()];
f[1] = meshPoints[eIter.key().end()];
@ -333,10 +333,10 @@ void Foam::patchToPoly2DMesh::createMesh()
createPolyMeshComponents();
label startFace = patch_.nInternalEdges();
forAll(patchNames_, patchI)
forAll(patchNames_, patchi)
{
patchStarts_[patchI] = startFace;
startFace += patchSizes_[patchI];
patchStarts_[patchi] = startFace;
startFace += patchSizes_[patchi];
}
}

View File

@ -208,14 +208,14 @@ int main(int argc, char *argv[])
Info<< "Constructing patches." << endl;
List<polyPatch*> patches(poly2DMesh.patchNames().size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patches[patchI] = new polyPatch
patches[patchi] = new polyPatch
(
poly2DMesh.patchNames()[patchI],
poly2DMesh.patchSizes()[patchI],
poly2DMesh.patchStarts()[patchI],
patchI,
poly2DMesh.patchNames()[patchi],
poly2DMesh.patchSizes()[patchi],
poly2DMesh.patchStarts()[patchi],
patchi,
mesh().boundaryMesh(),
polyPatch::typeName
);

View File

@ -947,9 +947,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findOffsetPatchFaces
mesh.nCells()/1000
);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& patch = patches[patchI];
const polyPatch& patch = patches[patchi];
const faceList& localFaces = patch.localFaces();
const pointField& localPoints = patch.localPoints();
@ -1079,11 +1079,11 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::checkPolyMeshQuality
const polyBoundaryMesh& patches = pMesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const labelUList& owners = patches[patchI].faceCells();
const labelUList& owners = patches[patchi].faceCells();
forAll(owners, i)
{
@ -1535,16 +1535,16 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
const PtrList<dictionary>& patchInfo = geometryToConformTo_.patchInfo();
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
if (patchInfo.set(patchI))
if (patchInfo.set(patchi))
{
patchDicts.set(patchI, new dictionary(patchInfo[patchI]));
patchDicts.set(patchi, new dictionary(patchInfo[patchi]));
}
else
{
patchDicts.set(patchI, new dictionary());
patchDicts[patchI].set
patchDicts.set(patchi, new dictionary());
patchDicts[patchi].set
(
"type",
wallPolyPatch::typeName
@ -1734,14 +1734,14 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
const label nPatches = patchNames.size();
labelList procNeighbours(nPatches, label(-1));
forAll(procNeighbours, patchI)
forAll(procNeighbours, patchi)
{
if (patchDicts[patchI].found("neighbProcNo"))
if (patchDicts[patchi].found("neighbProcNo"))
{
procNeighbours[patchI] =
procNeighbours[patchi] =
(
patchDicts[patchI].found("neighbProcNo")
? readLabel(patchDicts[patchI].lookup("neighbProcNo"))
patchDicts[patchi].found("neighbProcNo")
? readLabel(patchDicts[patchi].lookup("neighbProcNo"))
: -1
);
}
@ -2347,9 +2347,9 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
// Return patchPointPairSlaves.setSize(nPatches);
patchPointPairSlaves.setSize(nPatches);
forAll(patchPPSlaves, patchI)
forAll(patchPPSlaves, patchi)
{
patchPointPairSlaves[patchI].transfer(patchPPSlaves[patchI]);
patchPointPairSlaves[patchi].transfer(patchPPSlaves[patchi]);
}
if (foamyHexMeshControls().objOutput())
@ -2458,13 +2458,13 @@ void Foam::conformalVoronoiMesh::sortProcPatches
return;
}
forAll(patchSortingIndices, patchI)
forAll(patchSortingIndices, patchi)
{
faceList& faces = patchFaces[patchI];
labelList& owner = patchOwners[patchI];
DynamicList<label>& slaves = patchPointPairSlaves[patchI];
faceList& faces = patchFaces[patchi];
labelList& owner = patchOwners[patchi];
DynamicList<label>& slaves = patchPointPairSlaves[patchi];
DynamicList<Pair<labelPair>>& sortingIndices
= patchSortingIndices[patchI];
= patchSortingIndices[patchi];
if (!sortingIndices.empty())
{
@ -2477,7 +2477,7 @@ void Foam::conformalVoronoiMesh::sortProcPatches
{
FatalErrorInFunction
<< "patch size and size of sorting indices is inconsistent "
<< " for patch " << patchI << nl
<< " for patch " << patchi << nl
<< " faces.size() " << faces.size() << nl
<< " owner.size() " << owner.size() << nl
<< " slaves.size() " << slaves.size() << nl

View File

@ -152,10 +152,10 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
dualPatchStarts.setSize(patchDicts.size());
forAll(dualPatchStarts, patchI)
forAll(dualPatchStarts, patchi)
{
dualPatchStarts[patchI] =
readLabel(patchDicts[patchI].lookup("startFace"));
dualPatchStarts[patchi] =
readLabel(patchDicts[patchi].lookup("startFace"));
}
}
@ -229,9 +229,9 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// vertexToDualAddressing[vertI] = cellI+1;
// }
//
// forAll(patchToDelaunayVertex, patchI)
// forAll(patchToDelaunayVertex, patchi)
// {
// const labelList& patchVertices = patchToDelaunayVertex[patchI];
// const labelList& patchVertices = patchToDelaunayVertex[patchi];
//
// forAll(patchVertices, i)
// {
@ -241,7 +241,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// {
// FatalErrorInFunction
// << "Delaunay vertex " << vertI
// << " from patch " << patchI
// << " from patch " << patchi
// << " local index " << i
// << " is already mapped to cell "
// << vertexToDualAddressing[vertI]-1
@ -250,7 +250,7 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
//
// // Vertex might be used by multiple faces. Which one to
// // use? For now last one wins.
// label dualFaceI = dualPatchStarts[patchI]+i;
// label dualFaceI = dualPatchStarts[patchi]+i;
// vertexToDualAddressing[vertI] = -dualFaceI-1;
// }
// }
@ -419,37 +419,37 @@ Foam::autoPtr<Foam::fvMesh> Foam::conformalVoronoiMesh::createDummyMesh
List<polyPatch*> patches(patchDicts.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
patchDicts.set(patchI)
patchDicts.set(patchi)
&& (
word(patchDicts[patchI].lookup("type"))
word(patchDicts[patchi].lookup("type"))
== processorPolyPatch::typeName
)
)
{
patches[patchI] = new processorPolyPatch
patches[patchi] = new processorPolyPatch
(
0, //patchSizes[p],
0, //patchStarts[p],
patchI,
patchi,
mesh.boundaryMesh(),
readLabel(patchDicts[patchI].lookup("myProcNo")),
readLabel(patchDicts[patchI].lookup("neighbProcNo")),
readLabel(patchDicts[patchi].lookup("myProcNo")),
readLabel(patchDicts[patchi].lookup("neighbProcNo")),
coupledPolyPatch::COINCIDENTFULLMATCH
);
}
else
{
patches[patchI] = polyPatch::New
patches[patchi] = polyPatch::New
(
patchDicts[patchI].lookup("type"),
patchNames[patchI],
patchDicts[patchi].lookup("type"),
patchNames[patchi],
0, //patchSizes[p],
0, //patchStarts[p],
patchI,
patchi,
mesh.boundaryMesh()
).ptr();
}
@ -473,22 +473,22 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
labelList(Pstream::nProcs(), -1)
);
forAll(patchDicts, patchI)
forAll(patchDicts, patchi)
{
if
(
patchDicts.set(patchI)
patchDicts.set(patchi)
&& (
word(patchDicts[patchI].lookup("type"))
word(patchDicts[patchi].lookup("type"))
== processorPolyPatch::typeName
)
)
{
const label procNeighb =
readLabel(patchDicts[patchI].lookup("neighbProcNo"));
readLabel(patchDicts[patchi].lookup("neighbProcNo"));
procPatchSizes[Pstream::myProcNo()][procNeighb]
= readLabel(patchDicts[patchI].lookup("nFaces"));
= readLabel(patchDicts[patchi].lookup("nFaces"));
}
}
@ -502,15 +502,15 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
{
const labelList& patchSizes = procPatchSizes[procI];
forAll(patchSizes, patchI)
forAll(patchSizes, patchi)
{
if (patchSizes[patchI] != procPatchSizes[patchI][procI])
if (patchSizes[patchi] != procPatchSizes[patchi][procI])
{
allMatch = false;
Info<< indent << "Patches " << procI << " and " << patchI
<< " have different sizes: " << patchSizes[patchI]
<< " and " << procPatchSizes[patchI][procI] << endl;
Info<< indent << "Patches " << procI << " and " << patchi
<< " have different sizes: " << patchSizes[patchi]
<< " and " << procPatchSizes[patchi][procI] << endl;
}
}
}
@ -621,9 +621,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
const fvMesh& sortMesh = sortMeshPtr();
// Change the transform type on processors to coincident full match.
// forAll(sortMesh.boundaryMesh(), patchI)
// forAll(sortMesh.boundaryMesh(), patchi)
// {
// const polyPatch& patch = sortMesh.boundaryMesh()[patchI];
// const polyPatch& patch = sortMesh.boundaryMesh()[patchi];
//
// if (isA<processorPolyPatch>(patch))
// {
@ -644,9 +644,9 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
PstreamBuffers pBufs(Pstream::nonBlocking);
// Send ordering
forAll(sortMesh.boundaryMesh(), patchI)
forAll(sortMesh.boundaryMesh(), patchi)
{
const polyPatch& pp = sortMesh.boundaryMesh()[patchI];
const polyPatch& pp = sortMesh.boundaryMesh()[patchi];
if (isA<processorPolyPatch>(pp))
{
@ -658,8 +658,8 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
SubList<face>
(
faces,
readLabel(patchDicts[patchI].lookup("nFaces")),
readLabel(patchDicts[patchI].lookup("startFace"))
readLabel(patchDicts[patchi].lookup("nFaces")),
readLabel(patchDicts[patchi].lookup("startFace"))
),
points
)
@ -674,16 +674,16 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
// Receive and calculate ordering
bool anyChanged = false;
forAll(sortMesh.boundaryMesh(), patchI)
forAll(sortMesh.boundaryMesh(), patchi)
{
const polyPatch& pp = sortMesh.boundaryMesh()[patchI];
const polyPatch& pp = sortMesh.boundaryMesh()[patchi];
if (isA<processorPolyPatch>(pp))
{
const label nPatchFaces =
readLabel(patchDicts[patchI].lookup("nFaces"));
readLabel(patchDicts[patchi].lookup("nFaces"));
const label patchStartFace =
readLabel(patchDicts[patchI].lookup("startFace"));
readLabel(patchDicts[patchi].lookup("startFace"));
labelList patchFaceMap(nPatchFaces, label(-1));
labelList patchFaceRotation(nPatchFaces, label(0));
@ -1355,9 +1355,9 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
labelHashSet protrudingBoundaryPoints;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& patch = patches[patchI];
const polyPatch& patch = patches[patchi];
forAll(patch.localPoints(), pLPI)
{

View File

@ -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
@ -51,9 +51,9 @@ void Foam::conformalVoronoiMesh::calcNeighbourCellCentres
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelUList& faceCells = pp.faceCells();
@ -82,14 +82,14 @@ void Foam::conformalVoronoiMesh::selectSeparatedCoupledFaces
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
// Check all coupled. Avoid using .coupled() so we also pick up AMI.
if (isA<coupledPolyPatch>(patches[patchI]))
if (isA<coupledPolyPatch>(patches[patchi]))
{
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
(
patches[patchI]
patches[patchi]
);
if (cpp.separated() || !cpp.parallel())
@ -323,9 +323,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelUList& faceCells = pp.faceCells();
@ -501,9 +501,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
// labelList neiCellSurface(mesh.nFaces()-mesh.nInternalFaces());
//
// forAll(patches, patchI)
// forAll(patches, patchi)
// {
// const polyPatch& pp = patches[patchI];
// const polyPatch& pp = patches[patchi];
//
// if (pp.coupled())
// {
@ -517,9 +517,9 @@ void Foam::conformalVoronoiMesh::calcFaceZones
// }
// syncTools::swapBoundaryFaceList(mesh, neiCellSurface);
//
// forAll(patches, patchI)
// forAll(patches, patchi)
// {
// const polyPatch& pp = patches[patchI];
// const polyPatch& pp = patches[patchi];
//
// if (pp.coupled())
// {

View File

@ -644,10 +644,10 @@ int main(int argc, char *argv[])
surfaces
);
// Patch fields
forAll(fvm.C().boundaryField(), patchI)
forAll(fvm.C().boundaryField(), patchi)
{
const pointField& cc = fvm.C().boundaryField()[patchI];
fvPatchScalarField& fld = cellDistance.boundaryField()[patchI];
const pointField& cc = fvm.C().boundaryField()[patchi];
fvPatchScalarField& fld = cellDistance.boundaryField()[patchi];
scalarField patchDistSqr
(
fld.patch().patchInternalField(distSqr)

View File

@ -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
@ -280,10 +280,10 @@ void Foam::CV2D::calcDual
extractPatches(patchNames, patchSizes, mapEdgesRegion, indirectPatchEdge);
forAll(patchNames, patchI)
forAll(patchNames, patchi)
{
Info<< "Patch " << patchNames[patchI]
<< " has size " << patchSizes[patchI] << endl;
Info<< "Patch " << patchNames[patchi]
<< " has size " << patchSizes[patchi] << endl;
}
// Create dual faces

View File

@ -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
@ -165,15 +165,15 @@ int main(int argc, char *argv[])
List<polyPatch*> patches(poly2DMesh.patchNames().size());
label countPatches = 0;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (poly2DMesh.patchSizes()[patchI] != 0)
if (poly2DMesh.patchSizes()[patchi] != 0)
{
patches[countPatches] = new polyPatch
(
poly2DMesh.patchNames()[patchI],
poly2DMesh.patchSizes()[patchI],
poly2DMesh.patchStarts()[patchI],
poly2DMesh.patchNames()[patchi],
poly2DMesh.patchSizes()[patchi],
poly2DMesh.patchStarts()[patchi],
countPatches,
pMesh.boundaryMesh(),
word::null

View File

@ -578,10 +578,10 @@ void Foam::shortEdgeFilter2D::writeInfo(Ostream& os)
<< " edgeAttachedToBoundaryFactor: " << edgeAttachedToBoundaryFactor_
<< endl;
forAll(patchNames_, patchI)
forAll(patchNames_, patchi)
{
os << " Patch " << patchNames_[patchI]
<< ", size " << patchSizes_[patchI] << endl;
os << " Patch " << patchNames_[patchi]
<< ", size " << patchSizes_[patchi] << endl;
}
os << " There are " << mapEdgesRegion_.size()

View File

@ -411,10 +411,10 @@ void extractSurface
labelList patchToCompactZone(bMesh.size(), -1);
forAllConstIter(HashTable<label>, compactZoneID, iter)
{
label patchI = bMesh.findPatchID(iter.key());
if (patchI != -1)
label patchi = bMesh.findPatchID(iter.key());
if (patchi != -1)
{
patchToCompactZone[patchI] = iter();
patchToCompactZone[patchi] = iter();
}
}
@ -1164,11 +1164,11 @@ int main(int argc, char *argv[])
{
label globalRegionI = surfaces.globalRegion(surfI, i);
label patchI;
label patchi;
if (surfacePatchInfo.set(globalRegionI))
{
patchI = meshRefiner.addMeshedPatch
patchi = meshRefiner.addMeshedPatch
(
regNames[i],
surfacePatchInfo[globalRegionI]
@ -1179,7 +1179,7 @@ int main(int argc, char *argv[])
dictionary patchInfo;
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch
patchi = meshRefiner.addMeshedPatch
(
regNames[i],
patchInfo
@ -1187,12 +1187,12 @@ int main(int argc, char *argv[])
}
Info<< setf(ios_base::left)
<< setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(6) << patchi
<< setw(20) << mesh.boundaryMesh()[patchi].type()
<< setw(30) << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI;
globalToSlavePatch[globalRegionI] = patchI;
globalToMasterPatch[globalRegionI] = patchi;
globalToSlavePatch[globalRegionI] = patchi;
}
}
else
@ -1204,11 +1204,11 @@ int main(int argc, char *argv[])
// Add master side patch
{
label patchI;
label patchi;
if (surfacePatchInfo.set(globalRegionI))
{
patchI = meshRefiner.addMeshedPatch
patchi = meshRefiner.addMeshedPatch
(
regNames[i],
surfacePatchInfo[globalRegionI]
@ -1219,7 +1219,7 @@ int main(int argc, char *argv[])
dictionary patchInfo;
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch
patchi = meshRefiner.addMeshedPatch
(
regNames[i],
patchInfo
@ -1227,20 +1227,20 @@ int main(int argc, char *argv[])
}
Info<< setf(ios_base::left)
<< setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(6) << patchi
<< setw(20) << mesh.boundaryMesh()[patchi].type()
<< setw(30) << regNames[i] << nl;
globalToMasterPatch[globalRegionI] = patchI;
globalToMasterPatch[globalRegionI] = patchi;
}
// Add slave side patch
{
const word slaveName = regNames[i] + "_slave";
label patchI;
label patchi;
if (surfacePatchInfo.set(globalRegionI))
{
patchI = meshRefiner.addMeshedPatch
patchi = meshRefiner.addMeshedPatch
(
slaveName,
surfacePatchInfo[globalRegionI]
@ -1251,7 +1251,7 @@ int main(int argc, char *argv[])
dictionary patchInfo;
patchInfo.set("type", wallPolyPatch::typeName);
patchI = meshRefiner.addMeshedPatch
patchi = meshRefiner.addMeshedPatch
(
slaveName,
patchInfo
@ -1259,11 +1259,11 @@ int main(int argc, char *argv[])
}
Info<< setf(ios_base::left)
<< setw(6) << patchI
<< setw(20) << mesh.boundaryMesh()[patchI].type()
<< setw(6) << patchi
<< setw(20) << mesh.boundaryMesh()[patchi].type()
<< setw(30) << slaveName << nl;
globalToSlavePatch[globalRegionI] = patchI;
globalToSlavePatch[globalRegionI] = patchi;
}
}
}
@ -1491,13 +1491,13 @@ int main(int argc, char *argv[])
}
else
{
forAll(bMesh, patchI)
forAll(bMesh, patchi)
{
const polyPatch& patch = bMesh[patchI];
const polyPatch& patch = bMesh[patchi];
if (!isA<processorPolyPatch>(patch))
{
includePatches.insert(patchI);
includePatches.insert(patchi);
}
}
}

View File

@ -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
@ -183,9 +183,9 @@ int main(int argc, char *argv[])
newPatchI = 0;
// Copy old patches
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
const polyPatch& patch = mesh.boundaryMesh()[patchI];
const polyPatch& patch = mesh.boundaryMesh()[patchi];
newPatchPtrList[newPatchI] =
patch.clone
@ -200,9 +200,9 @@ int main(int argc, char *argv[])
}
// Add new ones with empty size.
for (label patchI = newPatchI; patchI < patches.size(); patchI++)
for (label patchi = newPatchI; patchi < patches.size(); patchi++)
{
const boundaryPatch& bp = patches[patchI];
const boundaryPatch& bp = patches[patchi];
newPatchPtrList[newPatchI] = polyPatch::New
(

View File

@ -21,17 +21,17 @@ Foam::label Foam::findOppositeWedge
scalar wppCosAngle = wpp.cosAngle();
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
patchI != wpp.index()
&& patches[patchI].size()
&& isA<wedgePolyPatch>(patches[patchI])
patchi != wpp.index()
&& patches[patchi].size()
&& isA<wedgePolyPatch>(patches[patchi])
)
{
const wedgePolyPatch& pp =
refCast<const wedgePolyPatch>(patches[patchI]);
refCast<const wedgePolyPatch>(patches[patchi]);
// Calculate (cos of) angle to wpp (not pp!) centre normal
scalar ppCosAngle = wpp.centreNormal() & pp.n();
@ -43,7 +43,7 @@ Foam::label Foam::findOppositeWedge
&& mag(ppCosAngle - wppCosAngle) >= 1e-3
)
{
return patchI;
return patchi;
}
}
}
@ -67,12 +67,12 @@ bool Foam::checkWedges
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].size() && isA<wedgePolyPatch>(patches[patchI]))
if (patches[patchi].size() && isA<wedgePolyPatch>(patches[patchi]))
{
const wedgePolyPatch& pp =
refCast<const wedgePolyPatch>(patches[patchI]);
refCast<const wedgePolyPatch>(patches[patchi]);
scalar wedgeAngle = acos(pp.cosAngle());
@ -340,13 +340,13 @@ bool Foam::checkCoupledPoints
List<pointField> nbrPoints(fcs.size() - mesh.nInternalFaces());
// Exchange zero point
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& cpp = refCast<const coupledPolyPatch>
(
patches[patchI]
patches[patchi]
);
forAll(cpp, i)
@ -375,12 +375,12 @@ bool Foam::checkCoupledPoints
scalar avgMismatch = 0;
label nCoupledPoints = 0;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const coupledPolyPatch& cpp =
refCast<const coupledPolyPatch>(patches[patchI]);
refCast<const coupledPolyPatch>(patches[patchi]);
if (cpp.owner())
{

View File

@ -53,11 +53,11 @@ Foam::label Foam::checkTopology
// Check that empty patches cover all sides of the mesh
{
label nEmpty = 0;
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
if (isA<emptyPolyPatch>(mesh.boundaryMesh()[patchI]))
if (isA<emptyPolyPatch>(mesh.boundaryMesh()[patchi]))
{
nEmpty += mesh.boundaryMesh()[patchI].size();
nEmpty += mesh.boundaryMesh()[patchi].size();
}
}
reduce(nEmpty, sumOp<label>());
@ -229,11 +229,11 @@ Foam::label Foam::checkTopology
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
}
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
const labelUList& owners = patches[patchI].faceCells();
const labelUList& owners = patches[patchi].faceCells();
forAll(owners, i)
{
@ -387,9 +387,9 @@ Foam::label Foam::checkTopology
}
Info<< endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (!isA<processorPolyPatch>(pp))
{

View File

@ -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
@ -290,9 +290,9 @@ void createFaces
// For warning once per patch.
labelHashSet patchWarned;
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
label newPatchI = newMasterPatches[i];
@ -311,7 +311,7 @@ void createFaces
if (zoneFaceI != -1)
{
if (patchWarned.insert(patchI))
if (patchWarned.insert(patchi))
{
WarningInFunction
<< "Found boundary face (in patch "
@ -699,14 +699,14 @@ int main(int argc, char *argv[])
forAllConstIter(dictionary, patchSources, iter)
{
const word patchName(iter().dict()["name"]);
label patchI = pbm.findPatchID(patchName);
label patchi = pbm.findPatchID(patchName);
if (master)
{
newMasterPatches.append(patchI);
newMasterPatches.append(patchi);
}
else
{
newSlavePatches.append(patchI);
newSlavePatches.append(patchi);
}
master = !master;
}
@ -761,9 +761,9 @@ int main(int argc, char *argv[])
forAllConstIter(HashSet<word>, bafflePatches, iter)
{
label patchI = mesh.boundaryMesh().findPatchID(iter.key());
label patchi = mesh.boundaryMesh().findPatchID(iter.key());
const fvPatchMapper& pm = mapper.boundaryMap()[patchI];
const fvPatchMapper& pm = mapper.boundaryMap()[patchi];
if (pm.sizeBeforeMapping() == 0)
{
@ -775,7 +775,7 @@ int main(int argc, char *argv[])
<< "You might have to edit these fields." << endl;
}
fvMeshTools::zeroPatchFields(mesh, patchI);
fvMeshTools::zeroPatchFields(mesh, patchi);
}
}
}
@ -796,7 +796,7 @@ int main(int argc, char *argv[])
forAllConstIter(dictionary, patchSources, iter)
{
const word patchName(iter().dict()["name"]);
label patchI = pbm.findPatchID(patchName);
label patchi = pbm.findPatchID(patchName);
if (iter().dict().found("patchFields"))
{
@ -809,7 +809,7 @@ int main(int argc, char *argv[])
fvMeshTools::setPatchFields
(
mesh,
patchI,
patchi,
patchFieldsDict
);
}
@ -863,20 +863,20 @@ int main(int argc, char *argv[])
const word masterPatchName(groupName + "_master");
const word slavePatchName(groupName + "_slave");
label patchIMaster = pbm.findPatchID(masterPatchName);
label patchISlave = pbm.findPatchID(slavePatchName);
label patchiMaster = pbm.findPatchID(masterPatchName);
label patchiSlave = pbm.findPatchID(slavePatchName);
fvMeshTools::setPatchFields
(
mesh,
patchIMaster,
patchiMaster,
patchFieldsDict
);
fvMeshTools::setPatchFields
(
mesh,
patchISlave,
patchiSlave,
patchFieldsDict
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -115,9 +115,9 @@ void Foam::faceSelections::searchableSurfaceSelection::select
const polyBoundaryMesh& pbm = mesh_.boundaryMesh();
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
if (pp.coupled())
{
@ -155,9 +155,9 @@ void Foam::faceSelections::searchableSurfaceSelection::select
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
}
}
forAll(pbm, patchI)
forAll(pbm, patchi)
{
const polyPatch& pp = pbm[patchI];
const polyPatch& pp = pbm[patchi];
if (pp.coupled())
{

View File

@ -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
@ -107,9 +107,9 @@ void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
label nOldPatches = returnReduce(patches.size(), sumOp<label>());
// Copy old patches.
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
// Note: reduce possible since non-proc patches guaranteed in same order
if (!isA<processorPolyPatch>(pp))
@ -143,14 +143,14 @@ void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
{
Info<< "Removing zero-sized patch " << pp.name()
<< " type " << pp.type()
<< " at position " << patchI << endl;
<< " at position " << patchi << endl;
}
}
}
// Copy non-empty processor patches
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (isA<processorPolyPatch>(pp))
{
@ -170,7 +170,7 @@ void filterPatches(polyMesh& mesh, const HashSet<word>& addedPatchNames)
else
{
Info<< "Removing empty processor patch " << pp.name()
<< " at position " << patchI << endl;
<< " at position " << patchi << endl;
}
}
}
@ -199,16 +199,16 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
{
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
if
(
isA<cyclicPolyPatch>(patches[patchI])
&& refCast<const cyclicPolyPatch>(patches[patchI]).owner()
isA<cyclicPolyPatch>(patches[patchi])
&& refCast<const cyclicPolyPatch>(patches[patchi]).owner()
)
{
const cyclicPolyPatch& cycPatch =
refCast<const cyclicPolyPatch>(patches[patchI]);
refCast<const cyclicPolyPatch>(patches[patchi]);
// Dump patches
{
@ -319,9 +319,9 @@ void syncPoints
{
// Send
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
@ -356,9 +356,9 @@ void syncPoints
// Receive and set.
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
@ -407,9 +407,9 @@ void syncPoints
}
// Do the cyclics.
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
@ -558,9 +558,9 @@ int main(int argc, char *argv[])
label startFaceI = mesh.nInternalFaces();
// Copy old patches.
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (!isA<processorPolyPatch>(pp))
{
@ -569,7 +569,7 @@ int main(int argc, char *argv[])
pp.clone
(
patches,
patchI,
patchi,
pp.size(),
startFaceI
).ptr()
@ -619,9 +619,9 @@ int main(int argc, char *argv[])
}
// Copy old patches.
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (isA<processorPolyPatch>(pp))
{
@ -630,7 +630,7 @@ int main(int argc, char *argv[])
pp.clone
(
patches,
patchI,
patchi,
pp.size(),
startFaceI
).ptr()
@ -771,9 +771,9 @@ int main(int argc, char *argv[])
// For cyclic patches:
// - for separated ones use user specified offset vector
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
const polyPatch& pp = mesh.boundaryMesh()[patchI];
const polyPatch& pp = mesh.boundaryMesh()[patchi];
if (pp.size() && isA<coupledPolyPatch>(pp))
{

View File

@ -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
@ -50,14 +50,14 @@ Foam::label Foam::mergePolyMesh::patchIndex(const polyPatch& p)
bool nameFound = false;
forAll(patchNames_, patchI)
forAll(patchNames_, patchi)
{
if (patchNames_[patchI] == pName)
if (patchNames_[patchi] == pName)
{
if (word(patchDicts_[patchI]["type"]) == pType)
if (word(patchDicts_[patchi]["type"]) == pType)
{
// Found name and types match
return patchI;
return patchi;
}
else
{
@ -134,12 +134,12 @@ Foam::mergePolyMesh::mergePolyMesh(const IOobject& io)
// Insert the original patches into the list
wordList curPatchNames = boundaryMesh().names();
forAll(boundaryMesh(), patchI)
forAll(boundaryMesh(), patchi)
{
patchNames_.append(boundaryMesh()[patchI].name());
patchNames_.append(boundaryMesh()[patchi].name());
OStringStream os;
boundaryMesh()[patchI].write(os);
boundaryMesh()[patchi].write(os);
patchDicts_.append(dictionary(IStringStream(os.str())()));
}
@ -275,9 +275,9 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
// Gather the patch indices
labelList patchIndices(bm.size());
forAll(patchIndices, patchI)
forAll(patchIndices, patchi)
{
patchIndices[patchI] = patchIndex(bm[patchI]);
patchIndices[patchi] = patchIndex(bm[patchi]);
}
// Temporary: update number of allowable patches. This should be
@ -400,32 +400,32 @@ void Foam::mergePolyMesh::merge()
const polyBoundaryMesh& oldPatches = boundaryMesh();
// Note. Re-using counter in two for loops
label patchI = 0;
label patchi = 0;
for (patchI = 0; patchI < oldPatches.size(); patchI++)
for (patchi = 0; patchi < oldPatches.size(); patchi++)
{
newPatches[patchI] = oldPatches[patchI].clone(oldPatches).ptr();
newPatches[patchi] = oldPatches[patchi].clone(oldPatches).ptr();
}
Info<< "Adding new patches. " << endl;
label endOfLastPatch =
oldPatches[patchI - 1].start() + oldPatches[patchI - 1].size();
oldPatches[patchi - 1].start() + oldPatches[patchi - 1].size();
for (; patchI < patchNames_.size(); patchI++)
for (; patchi < patchNames_.size(); patchi++)
{
// Add a patch
dictionary dict(patchDicts_[patchI]);
dictionary dict(patchDicts_[patchi]);
dict.set("nFaces", 0);
dict.set("startFace", endOfLastPatch);
newPatches[patchI] =
newPatches[patchi] =
(
polyPatch::New
(
patchNames_[patchI],
patchNames_[patchi],
dict,
patchI,
patchi,
oldPatches
).ptr()
);

View File

@ -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
@ -171,16 +171,16 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
if (duplicates[bFaceI] != -1)
{
label faceI = mesh.nInternalFaces() + bFaceI;
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(faceI);
if (isA<processorPolyPatch>(patches[patchI]))
if (isA<processorPolyPatch>(patches[patchi]))
{
FatalErrorInFunction
<< "Duplicate face " << faceI
<< " is on a processorPolyPatch."
<< "This is not allowed." << nl
<< "Face:" << faceI
<< " is on patch:" << patches[patchI].name()
<< " is on patch:" << patches[patchi].name()
<< abort(FatalError);
}
}

View File

@ -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
@ -149,9 +149,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// as internal
boolListList insertedBouFace(oldPatches.size());
forAll(oldPatches, patchI)
forAll(oldPatches, patchi)
{
const polyPatch& curPatch = oldPatches[patchI];
const polyPatch& curPatch = oldPatches[patchi];
if (curPatch.coupled())
{
@ -162,7 +162,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
<< " createPatch afterwards." << endl;
}
boolList& curInsBouFace = insertedBouFace[patchI];
boolList& curInsBouFace = insertedBouFace[patchi];
curInsBouFace.setSize(curPatch.size());
curInsBouFace = false;
@ -249,11 +249,11 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
labelList newPatchStarts(boundary().size(), -1);
label nNewPatches = 0;
forAll(boundaryMesh(), patchI)
forAll(boundaryMesh(), patchi)
{
const label curPatchSize = boundaryMesh()[patchI].size();
const label curPatchStart = boundaryMesh()[patchI].start();
const boolList& curInserted = insertedBouFace[patchI];
const label curPatchSize = boundaryMesh()[patchi].size();
const label curPatchStart = boundaryMesh()[patchi].start();
const boolList& curInserted = insertedBouFace[patchi];
newPatchStarts[nNewPatches] = nNewFaces;
@ -303,7 +303,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// If patch exists, grab the name and type of the original patch
if (nNewFaces > newPatchStarts[nNewPatches])
{
newToOldPatch[nNewPatches] = patchI;
newToOldPatch[nNewPatches] = patchi;
newPatchSizes[nNewPatches] =
nNewFaces - newPatchStarts[nNewPatches];
@ -378,14 +378,14 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// Add the boundary patches
List<polyPatch*> p(newPatchSizes.size());
forAll(p, patchI)
forAll(p, patchi)
{
p[patchI] = boundaryMesh()[newToOldPatch[patchI]].clone
p[patchi] = boundaryMesh()[newToOldPatch[patchi]].clone
(
pMesh.boundaryMesh(),
patchI,
newPatchSizes[patchI],
newPatchStarts[patchI]
patchi,
newPatchSizes[patchi],
newPatchStarts[patchi]
).ptr();
}

View File

@ -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
@ -71,12 +71,12 @@ void writeWeights(const polyMesh& mesh)
const word tmName(mesh.time().timeName());
forAll(pbm, patchI)
forAll(pbm, patchi)
{
if (isA<cyclicAMIPolyPatch>(pbm[patchI]))
if (isA<cyclicAMIPolyPatch>(pbm[patchi]))
{
const cyclicAMIPolyPatch& cpp =
refCast<const cyclicAMIPolyPatch>(pbm[patchI]);
refCast<const cyclicAMIPolyPatch>(pbm[patchi]);
if (cpp.owner())
{

View File

@ -102,12 +102,12 @@ int main(int argc, char *argv[])
forAll(faceLabels, faceI)
{
const label meshFaceI = faceLabels[faceI];
const label patchI = bm.whichPatch(meshFaceI);
const label patchi = bm.whichPatch(meshFaceI);
if
(
patchI != -1
&& bm[patchI].coupled()
patchi != -1
&& bm[patchi].coupled()
&& !isMasterFace[meshFaceI]
)
{
@ -312,12 +312,12 @@ int main(int argc, char *argv[])
forAll(faceLabels, i)
{
const label meshFaceI = faceLabels[i];
const label patchI = bm.whichPatch(meshFaceI);
const label patchi = bm.whichPatch(meshFaceI);
if
(
patchI != -1
&& bm[patchI].coupled()
patchi != -1
&& bm[patchi].coupled()
&& !isMasterFace[meshFaceI]
)
{

View File

@ -319,7 +319,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
const label masterFaceI,
const label dualCellI,
const label patchI,
const label patchi,
const DynamicList<label>& verts,
polyTopoChange& meshMod
) const
@ -349,7 +349,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
masterEdgeI, // masterEdgeID
masterFaceI, // masterFaceID
false, // flipFaceFlux
patchI, // patchID
patchi, // patchID
zoneID, // zoneID
zoneFlip // zoneFlip
);
@ -640,7 +640,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
// (pointFaces()). Gets starting face and marks off visited faces in donePFaces.
void Foam::meshDualiser::createFacesAroundBoundaryPoint
(
const label patchI,
const label patchi,
const label patchPointI,
const label startFaceI,
polyTopoChange& meshMod,
@ -648,7 +648,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
) const
{
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelList& pFaces = pp.pointFaces()[patchPointI];
const labelList& own = mesh_.faceOwner();
@ -713,7 +713,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
if (faceI < pp.start() || faceI >= pp.start()+pp.size())
{
FatalErrorInFunction
<< "Walked from face on patch:" << patchI
<< "Walked from face on patch:" << patchi
<< " to face:" << faceI
<< " fc:" << mesh_.faceCentres()[faceI]
<< " on patch:" << patches.whichPatch(faceI)
@ -746,7 +746,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
-1, // masterEdgeI
faceI, // masterFaceI
dualCellI,
patchI,
patchi,
verts,
meshMod
);
@ -800,7 +800,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
-1, // masterEdgeI
faceI, // masterFaceI
findDualCell(own[faceI], pointI),
patchI,
patchi,
verts.shrink(),
meshMod
);
@ -845,7 +845,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
-1, // masterEdgeI
startFaceI, // masterFaceI
findDualCell(own[faceI], pointI),
patchI,
patchi,
verts.shrink(),
meshMod
);
@ -1390,9 +1390,9 @@ void Foam::meshDualiser::setRefinement
// These need to be closed.
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelListList& pointFaces = pp.pointFaces();
@ -1411,14 +1411,14 @@ void Foam::meshDualiser::setRefinement
//Pout<< "Walking around point:" << pointI
// << " coord:" << mesh_.points()[pointI]
// << " on patch:" << patchI
// << " on patch:" << patchi
// << " startFace:" << startFaceI
// << " at:" << mesh_.faceCentres()[startFaceI]
// << endl;
createFacesAroundBoundaryPoint
(
patchI,
patchi,
patchPointI,
startFaceI,
meshMod,

View File

@ -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
@ -105,9 +105,9 @@ void simpleMarkFeatures
// 1. Mark all edges between patches
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
const labelList& meshEdges = pp.meshEdges();
// All patch corner edges. These need to be feature points & edges!

View File

@ -446,12 +446,12 @@ autoPtr<mapPolyMesh> reorderMesh
labelList oldPatchNMeshPoints(patches.size());
labelListList patchPointMap(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patchSizes[patchI] = patches[patchI].size();
patchStarts[patchI] = patches[patchI].start();
oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
patchPointMap[patchI] = identity(patches[patchI].nPoints());
patchSizes[patchi] = patches[patchi].size();
patchStarts[patchi] = patches[patchi].start();
oldPatchNMeshPoints[patchi] = patches[patchi].nPoints();
patchPointMap[patchi] = identity(patches[patchi].nPoints());
}
mesh.resetPrimitives
@ -955,11 +955,11 @@ int main(int argc, char *argv[])
// Collect all boundary cells on coupled patches
label nBndCells = 0;
forAll(pbm, patchI)
forAll(pbm, patchi)
{
if (pbm[patchI].coupled())
if (pbm[patchi].coupled())
{
nBndCells += pbm[patchI].size();
nBndCells += pbm[patchi].size();
}
}
@ -968,11 +968,11 @@ int main(int argc, char *argv[])
labelList bndCells(nBndCells);
labelList bndCellMap(nBndCells);
nBndCells = 0;
forAll(pbm, patchI)
forAll(pbm, patchi)
{
if (pbm[patchI].coupled())
if (pbm[patchi].coupled())
{
const labelUList& faceCells = pbm[patchI].faceCells();
const labelUList& faceCells = pbm[patchi].faceCells();
forAll(faceCells, i)
{
label cellI = faceCells[i];

View File

@ -86,9 +86,9 @@ label findEdge(const primitiveMesh& mesh, const label v0, const label v1)
// Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{
const label patchI = bMesh.findPatchID(name);
const label patchi = bMesh.findPatchID(name);
if (patchI == -1)
if (patchi == -1)
{
FatalErrorInFunction
<< "Cannot find patch " << name << nl
@ -97,7 +97,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
<< exit(FatalError);
}
if (bMesh[patchI].size())
if (bMesh[patchi].size())
{
FatalErrorInFunction
<< "Patch " << name << " is present but non-zero size"

View File

@ -121,8 +121,8 @@ void renamePatches
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
forAll(patchesToRename, i)
{
label patchI = patchesToRename[i];
polyPatch& pp = polyPatches[patchI];
label patchi = patchesToRename[i];
polyPatch& pp = polyPatches[patchi];
if (isA<coupledPolyPatch>(pp))
{
@ -177,11 +177,11 @@ void subsetVolFields
// Hack: set value to 0 for introduced patches (since don't
// get initialised.
forAll(tSubFld().boundaryField(), patchI)
forAll(tSubFld().boundaryField(), patchi)
{
if (addedPatches.found(patchI))
if (addedPatches.found(patchi))
{
tSubFld.ref().boundaryField()[patchI] ==
tSubFld.ref().boundaryFieldRef()[patchi] ==
typename GeoField::value_type(Zero);
}
}
@ -229,11 +229,11 @@ void subsetSurfaceFields
// Hack: set value to 0 for introduced patches (since don't
// get initialised.
forAll(tSubFld().boundaryField(), patchI)
forAll(tSubFld().boundaryField(), patchi)
{
if (addedPatches.found(patchI))
if (addedPatches.found(patchi))
{
tSubFld.ref().boundaryField()[patchI] ==
tSubFld.ref().boundaryFieldRef()[patchi] ==
typename GeoField::value_type(Zero);
}
}
@ -875,16 +875,16 @@ void createAndWriteRegion
Info<< "Deleting empty patches" << endl;
// Assumes all non-proc boundaries are on all processors!
forAll(newPatches, patchI)
forAll(newPatches, patchi)
{
const polyPatch& pp = newPatches[patchI];
const polyPatch& pp = newPatches[patchi];
if (!isA<processorPolyPatch>(pp))
{
if (returnReduce(pp.size(), sumOp<label>()) > 0)
{
oldToNew[patchI] = newI;
if (!addedPatches.found(patchI))
oldToNew[patchi] = newI;
if (!addedPatches.found(patchi))
{
sharedPatches.append(newI);
}
@ -894,24 +894,24 @@ void createAndWriteRegion
}
// Same for processor patches (but need no reduction)
forAll(newPatches, patchI)
forAll(newPatches, patchi)
{
const polyPatch& pp = newPatches[patchI];
const polyPatch& pp = newPatches[patchi];
if (isA<processorPolyPatch>(pp) && pp.size())
{
oldToNew[patchI] = newI++;
oldToNew[patchi] = newI++;
}
}
const label nNewPatches = newI;
// Move all deleteable patches to the end
forAll(oldToNew, patchI)
forAll(oldToNew, patchi)
{
if (oldToNew[patchI] == -1)
if (oldToNew[patchi] == -1)
{
oldToNew[patchI] = newI++;
oldToNew[patchi] = newI++;
}
}

View File

@ -173,9 +173,9 @@ label addCellZone(const polyMesh& mesh, const word& name)
// Checks whether patch present
void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
{
const label patchI = bMesh.findPatchID(name);
const label patchi = bMesh.findPatchID(name);
if (patchI == -1)
if (patchi == -1)
{
FatalErrorInFunction
<< "Cannot find patch " << name << endl
@ -184,7 +184,7 @@ void checkPatch(const polyBoundaryMesh& bMesh, const word& name)
<< exit(FatalError);
}
if (bMesh[patchI].empty())
if (bMesh[patchi].empty())
{
FatalErrorInFunction
<< "Patch " << name << " is present but zero size"

View File

@ -129,20 +129,20 @@ int main(int argc, char *argv[])
{
// Print each patch separately
forAll(bm, patchI)
forAll(bm, patchi)
{
Info<< bm[patchI].type() << "\t: " << bm[patchI].name() << nl;
outputFieldList(vsf, patchI);
outputFieldList(vvf, patchI);
outputFieldList(vsptf, patchI);
outputFieldList(vsytf, patchI);
outputFieldList(vtf, patchI);
Info<< bm[patchi].type() << "\t: " << bm[patchi].name() << nl;
outputFieldList(vsf, patchi);
outputFieldList(vvf, patchi);
outputFieldList(vsptf, patchi);
outputFieldList(vsytf, patchi);
outputFieldList(vtf, patchi);
outputFieldList(psf, patchI);
outputFieldList(pvf, patchI);
outputFieldList(psptf, patchI);
outputFieldList(psytf, patchI);
outputFieldList(ptf, patchI);
outputFieldList(psf, patchi);
outputFieldList(pvf, patchi);
outputFieldList(psptf, patchi);
outputFieldList(psytf, patchi);
outputFieldList(ptf, patchi);
Info<< endl;
}
}
@ -155,32 +155,32 @@ int main(int argc, char *argv[])
DynamicList<HashTable<word>> fieldToTypes(bm.size());
// Per 'group' the patches
DynamicList<DynamicList<label>> groupToPatches(bm.size());
forAll(bm, patchI)
forAll(bm, patchi)
{
HashTable<word> fieldToType;
collectFieldList(vsf, patchI, fieldToType);
collectFieldList(vvf, patchI, fieldToType);
collectFieldList(vsptf, patchI, fieldToType);
collectFieldList(vsytf, patchI, fieldToType);
collectFieldList(vtf, patchI, fieldToType);
collectFieldList(vsf, patchi, fieldToType);
collectFieldList(vvf, patchi, fieldToType);
collectFieldList(vsptf, patchi, fieldToType);
collectFieldList(vsytf, patchi, fieldToType);
collectFieldList(vtf, patchi, fieldToType);
collectFieldList(psf, patchI, fieldToType);
collectFieldList(pvf, patchI, fieldToType);
collectFieldList(psptf, patchI, fieldToType);
collectFieldList(psytf, patchI, fieldToType);
collectFieldList(ptf, patchI, fieldToType);
collectFieldList(psf, patchi, fieldToType);
collectFieldList(pvf, patchi, fieldToType);
collectFieldList(psptf, patchi, fieldToType);
collectFieldList(psytf, patchi, fieldToType);
collectFieldList(ptf, patchi, fieldToType);
label groupI = findIndex(fieldToTypes, fieldToType);
if (groupI == -1)
{
DynamicList<label> group(1);
group.append(patchI);
group.append(patchi);
groupToPatches.append(group);
fieldToTypes.append(fieldToType);
}
else
{
groupToPatches[groupI].append(patchI);
groupToPatches[groupI].append(patchi);
}
}
@ -227,20 +227,20 @@ int main(int argc, char *argv[])
// No group.
forAll(patchIDs, i)
{
label patchI = patchIDs[i];
Info<< bm[patchI].type()
<< "\t: " << bm[patchI].name() << nl;
outputFieldList(vsf, patchI);
outputFieldList(vvf, patchI);
outputFieldList(vsptf, patchI);
outputFieldList(vsytf, patchI);
outputFieldList(vtf, patchI);
label patchi = patchIDs[i];
Info<< bm[patchi].type()
<< "\t: " << bm[patchi].name() << nl;
outputFieldList(vsf, patchi);
outputFieldList(vvf, patchi);
outputFieldList(vsptf, patchi);
outputFieldList(vsytf, patchi);
outputFieldList(vtf, patchi);
outputFieldList(psf, patchI);
outputFieldList(pvf, patchI);
outputFieldList(psptf, patchI);
outputFieldList(psytf, patchI);
outputFieldList(ptf, patchI);
outputFieldList(psf, patchi);
outputFieldList(pvf, patchi);
outputFieldList(psptf, patchi);
outputFieldList(psytf, patchi);
outputFieldList(ptf, patchi);
Info<< endl;
}
}

View File

@ -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
@ -53,7 +53,7 @@ template<class GeoField>
void Foam::outputFieldList
(
const PtrList<GeoField>& fieldList,
const label patchI
const label patchi
)
{
forAll(fieldList, fieldI)
@ -63,7 +63,7 @@ void Foam::outputFieldList
Info<< " " << pTraits<typename GeoField::value_type>::typeName
<< tab << tab
<< fieldList[fieldI].name() << tab << tab
<< fieldList[fieldI].boundaryField()[patchI].type() << nl;
<< fieldList[fieldI].boundaryField()[patchi].type() << nl;
}
}
}
@ -73,7 +73,7 @@ template<class GeoField>
void Foam::collectFieldList
(
const PtrList<GeoField>& fieldList,
const label patchI,
const label patchi,
HashTable<word>& fieldToType
)
{
@ -84,7 +84,7 @@ void Foam::collectFieldList
fieldToType.insert
(
fieldList[fieldI].name(),
fieldList[fieldI].boundaryField()[patchI].type()
fieldList[fieldI].boundaryField()[patchi].type()
);
}
}

View File

@ -55,16 +55,16 @@ void Foam::domainDecomposition::addInterProcFace
List<DynamicList<DynamicList<label>>>& interPatchFaces
) const
{
Map<label>::iterator patchIter = nbrToInterPatch[ownerProc].find(nbrProc);
Map<label>::iterator patchiter = nbrToInterPatch[ownerProc].find(nbrProc);
// Introduce turning index only for internal faces (are duplicated).
label ownerIndex = facei+1;
label nbrIndex = -(facei+1);
if (patchIter != nbrToInterPatch[ownerProc].end())
if (patchiter != nbrToInterPatch[ownerProc].end())
{
// Existing interproc patch. Add to both sides.
label toNbrProcPatchI = patchIter();
label toNbrProcPatchI = patchiter();
interPatchFaces[ownerProc][toNbrProcPatchI].append(ownerIndex);
if (isInternalFace(facei))
@ -402,11 +402,11 @@ void Foam::domainDecomposition::decomposeMesh()
//
// const labelList& curProcPatchStartIndex = procPatchStartIndex_[procI];
//
// forAll(curProcPatchStartIndex, patchI)
// forAll(curProcPatchStartIndex, patchi)
// {
// Info<< " patch:" << patchI
// << "\tstart:" << curProcPatchStartIndex[patchI]
// << "\tsize:" << procPatchSize_[procI][patchI]
// Info<< " patch:" << patchi
// << "\tstart:" << curProcPatchStartIndex[patchi]
// << "\tsize:" << procPatchSize_[procI][patchi]
// << endl;
// }
// }

View File

@ -117,9 +117,9 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
- masterMesh.nInternalFaces()
);
forAll(masterPatches, patchI)
forAll(masterPatches, patchi)
{
const polyPatch& pp = masterPatches[patchI];
const polyPatch& pp = masterPatches[patchi];
if
(
@ -151,9 +151,9 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
- meshToAdd.nInternalFaces()
);
forAll(addPatches, patchI)
forAll(addPatches, patchi)
{
const polyPatch& pp = addPatches[patchI];
const polyPatch& pp = addPatches[patchi];
if (isA<processorPolyPatch>(pp))
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -136,9 +136,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
List<polyPatch*> patches(patchEntries.size());
label nPatches = 0;
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const entry& e = patchEntries[patchI];
const entry& e = patchEntries[patchi];
const word type(e.dict().lookup("type"));
const word& name = e.keyword();
@ -152,7 +152,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
patchDict.set("nFaces", 0);
patchDict.set("startFace", 0);
patches[patchI] = polyPatch::New
patches[patchi] = polyPatch::New
(
name,
patchDict,
@ -223,9 +223,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const entry& e = patchEntries[patchI];
const entry& e = patchEntries[patchi];
const word type(e.dict().lookup("type"));
const word& name = e.keyword();
@ -234,7 +234,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
break;
}
if (patchI >= patches.size())
if (patchi >= patches.size())
{
FatalErrorInFunction
<< "Non-processor patches not synchronised."
@ -242,26 +242,26 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
<< "Processor " << Pstream::myProcNo()
<< " has only " << patches.size()
<< " patches, master has "
<< patchI
<< patchi
<< exit(FatalError);
}
if
(
type != patches[patchI].type()
|| name != patches[patchI].name()
type != patches[patchi].type()
|| name != patches[patchi].name()
)
{
FatalErrorInFunction
<< "Non-processor patches not synchronised."
<< endl
<< "Master patch " << patchI
<< "Master patch " << patchi
<< " name:" << type
<< " type:" << type << endl
<< "Processor " << Pstream::myProcNo()
<< " patch " << patchI
<< " has name:" << patches[patchI].name()
<< " type:" << patches[patchI].type()
<< " patch " << patchi
<< " has name:" << patches[patchi].name()
<< " type:" << patches[patchi].type()
<< exit(FatalError);
}
}

View File

@ -379,16 +379,16 @@ void compareFields
<< abort(FatalError);
}
}
forAll(a.boundaryField(), patchI)
forAll(a.boundaryField(), patchi)
{
// We have real mesh cellcentre and
// mapped original cell centre.
const fvPatchVectorField& aBoundary =
a.boundaryField()[patchI];
a.boundaryField()[patchi];
const fvPatchVectorField& bBoundary =
b.boundaryField()[patchI];
b.boundaryField()[patchi];
if (!bBoundary.coupled())
{
@ -399,7 +399,7 @@ void compareFields
WarningInFunction
<< "Did not map volVectorField correctly:"
<< endl
<< "patch:" << patchI << " patchFace:" << i
<< "patch:" << patchi << " patchFace:" << i
<< " cc:" << endl
<< " real :" << aBoundary[i] << endl
<< " mapped :" << bBoundary[i] << endl
@ -576,9 +576,9 @@ int main(int argc, char *argv[])
label nonProcI = -1;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (isA<processorPolyPatch>(patches[patchI]))
if (isA<processorPolyPatch>(patches[patchi]))
{
break;
}

View File

@ -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
@ -80,9 +80,9 @@ int main(int argc, char *argv[])
// Writing number of faces
label nFaces = mesh.nFaces();
forAll(mesh.boundary(), patchI)
forAll(mesh.boundary(), patchi)
{
nFaces += mesh.boundary()[patchI].size();
nFaces += mesh.boundary()[patchi].size();
}
fluentDataFile

View File

@ -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
@ -52,7 +52,7 @@ void writeFluentField
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< "1 " // Zone ID: (cells=1, internal faces=2,
// patch faces=patchI+10)
// patch faces=patchi+10)
<< "1 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< "1 " << phiInternal.size() // Start and end of list
@ -69,9 +69,9 @@ void writeFluentField
label nWrittenFaces = phiInternal.size();
// Writing boundary faces
forAll(phi.boundaryField(), patchI)
forAll(phi.boundaryField(), patchi)
{
if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchI]))
if (isType<emptyFvPatchScalarField>(phi.boundaryField()[patchi]))
{
// Form empty patch field repeat the internal field to
// allow for the node interpolation in Fluent
@ -79,13 +79,13 @@ void writeFluentField
// Get reference to internal cells
const labelList emptyFaceCells =
phi.boundaryField()[patchI].patch().patch().faceCells();
phi.boundaryField()[patchi].patch().patch().faceCells();
// Writing cells for empty patch
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< patchI + 10 << " " // Zone ID: patchI+10
<< patchi + 10 << " " // Zone ID: patchi+10
<< "1 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< nWrittenFaces + 1 << " "
@ -107,13 +107,13 @@ void writeFluentField
// Regular patch
label nWrittenFaces = phiInternal.size();
const scalarField& patchPhi = phi.boundaryField()[patchI];
const scalarField& patchPhi = phi.boundaryField()[patchi];
// Write header
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< patchI + 10 << " " // Zone ID: patchI+10
<< patchi + 10 << " " // Zone ID: patchi+10
<< "1 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()

View File

@ -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
@ -51,7 +51,7 @@ void writeFluentField
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< "1 " // Zone ID: (cells=1, internal faces=2,
// patch faces=patchI+10)
// patch faces=patchi+10)
<< "3 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< "1 " << phiInternal.size() // Start and end of list
@ -72,15 +72,15 @@ void writeFluentField
label nWrittenFaces = phiInternal.size();
// Writing boundary faces
forAll(phi.boundaryField(), patchI)
forAll(phi.boundaryField(), patchi)
{
const vectorField& patchPhi = phi.boundaryField()[patchI];
const vectorField& patchPhi = phi.boundaryField()[patchi];
// Write header
stream
<< "(300 ("
<< fluentFieldIdentifier << " " // Field identifier
<< patchI + 10 << " " // Zone ID: patchI+10
<< patchi + 10 << " " // Zone ID: patchi+10
<< "3 " // Number of components (scalar=1, vector=3)
<< "0 0 " // Unused
<< nWrittenFaces + 1 << " " << nWrittenFaces + patchPhi.size()

View File

@ -492,10 +492,10 @@ void ensightField
{
if (eMesh.faceToBeIncluded(faceI))
{
label patchI = mesh.boundaryMesh().whichPatch(faceI);
const polyPatch& pp = mesh.boundaryMesh()[patchI];
label patchi = mesh.boundaryMesh().whichPatch(faceI);
const polyPatch& pp = mesh.boundaryMesh()[patchi];
label patchFaceI = pp.whichFace(faceI);
Type value = sf.boundaryField()[patchI][patchFaceI];
Type value = sf.boundaryField()[patchi][patchFaceI];
values[j] = value;
++j;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -284,9 +284,9 @@ void Foam::ensightMesh::correct()
1
);
forAll(mesh_.boundaryMesh(), patchI)
forAll(mesh_.boundaryMesh(), patchi)
{
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
const polyPatch& pp = mesh_.boundaryMesh()[patchi];
if
(
isA<processorPolyPatch>(pp)

View File

@ -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
@ -129,9 +129,9 @@ labelList getSelectedPatches
Info<< "Combining patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
@ -139,18 +139,18 @@ labelList getSelectedPatches
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
)
{
Info<< " discarding empty/processor patch " << patchI
Info<< " discarding empty/processor patch " << patchi
<< " " << pp.name() << endl;
}
else if (findStrings(excludePatches, pp.name()))
{
Info<< " excluding patch " << patchI
Info<< " excluding patch " << patchi
<< " " << pp.name() << endl;
}
else
{
patchIDs.append(patchI);
Info<< " patch " << patchI << " " << pp.name() << endl;
patchIDs.append(patchi);
Info<< " patch " << patchi << " " << pp.name() << endl;
}
}
return patchIDs.shrink();

View File

@ -69,16 +69,16 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getPatchField
(
const bool nearCellValue,
const GeometricField<Type, fvPatchField, volMesh>& vfld,
const label patchI
const label patchi
) const
{
if (nearCellValue)
{
return vfld.boundaryField()[patchI].patchInternalField();
return vfld.boundaryField()[patchi].patchInternalField();
}
else
{
return vfld.boundaryField()[patchI];
return vfld.boundaryField()[patchi];
}
}
@ -99,16 +99,16 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getFaceField
{
label faceI = faceLabels[i];
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(faceI);
if (patchI == -1)
if (patchi == -1)
{
fld[i] = sfld[faceI];
}
else
{
label localFaceI = faceI - patches[patchI].start();
fld[i] = sfld.boundaryField()[patchI][localFaceI];
label localFaceI = faceI - patches[patchi].start();
fld[i] = sfld.boundaryField()[patchi][localFaceI];
}
}

View File

@ -110,12 +110,12 @@ void ReadAndMapFields
label bFaceI = faceI - mesh.nInternalFaces();
if (bFaceI >= 0)
{
label patchI = mesh.boundaryMesh().patchID()[bFaceI];
label localFaceI = mesh.boundaryMesh()[patchI].whichFace
label patchi = mesh.boundaryMesh().patchID()[bFaceI];
label localFaceI = mesh.boundaryMesh()[patchi].whichFace
(
faceI
);
fld[pointI] = readField.boundaryField()[patchI][localFaceI];
fld[pointI] = readField.boundaryField()[patchi][localFaceI];
}
//else
//{

View File

@ -198,9 +198,9 @@ labelList getSelectedPatches
Info<< "Combining patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
@ -208,18 +208,18 @@ labelList getSelectedPatches
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
)
{
Info<< " discarding empty/processor patch " << patchI
Info<< " discarding empty/processor patch " << patchi
<< " " << pp.name() << endl;
}
else if (findStrings(excludePatches, pp.name()))
{
Info<< " excluding patch " << patchI
Info<< " excluding patch " << patchi
<< " " << pp.name() << endl;
}
else
{
patchIDs.append(patchI);
Info<< " patch " << patchI << " " << pp.name() << endl;
patchIDs.append(patchi);
Info<< " patch " << patchi << " " << pp.name() << endl;
}
}
return patchIDs.shrink();
@ -890,9 +890,9 @@ int main(int argc, char *argv[])
}
else
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (!findStrings(excludePatches, pp.name()))
{
@ -925,7 +925,7 @@ int main(int argc, char *argv[])
binary,
nearCellValue,
patchFileName,
labelList(1, patchI)
labelList(1, patchi)
);
if (!isA<emptyPolyPatch>(pp))

View File

@ -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
@ -123,13 +123,13 @@ void Foam::patchWriter::writePatchIDs()
forAll(patchIDs_, i)
{
label patchI = patchIDs_[i];
label patchi = patchIDs_[i];
const polyPatch& pp = mesh.boundaryMesh()[patchI];
const polyPatch& pp = mesh.boundaryMesh()[patchi];
if (!isA<emptyPolyPatch>(pp))
{
writeFuns::insert(scalarField(pp.size(), patchI), fField);
writeFuns::insert(scalarField(pp.size(), patchi), fField);
}
}
writeFuns::write(os_, binary_, fField);

View File

@ -45,9 +45,9 @@ void Foam::patchWriter::write
forAll(patchIDs_, j)
{
label patchI = patchIDs_[j];
label patchi = patchIDs_[j];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
if (nearCellValue_)
{
@ -81,9 +81,9 @@ void Foam::patchWriter::write
forAll(patchIDs_, j)
{
label patchI = patchIDs_[j];
label patchi = patchIDs_[j];
const pointPatchField<Type>& pfld = fld.boundaryField()[patchI];
const pointPatchField<Type>& pfld = fld.boundaryField()[patchi];
writeFuns::insert(pfld.patchInternalField()(), fField);
}
@ -110,9 +110,9 @@ void Foam::patchWriter::write
forAll(patchIDs_, j)
{
label patchI = patchIDs_[j];
label patchi = patchIDs_[j];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchI];
const fvPatchField<Type>& pfld = fld.boundaryField()[patchi];
if (nearCellValue_)
{

View File

@ -43,16 +43,16 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
{
label faceI = pp_.addressing()[i];
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(faceI);
if (patchI == -1)
if (patchi == -1)
{
fld[i] = sfld[faceI];
}
else
{
label localFaceI = faceI - patches[patchI].start();
fld[i] = sfld.boundaryField()[patchI][localFaceI];
label localFaceI = faceI - patches[patchi].start();
fld[i] = sfld.boundaryField()[patchi][localFaceI];
}
}

View File

@ -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
@ -89,11 +89,11 @@ void writeSurfFields
writeFuns::insert(svf[faceI], fField);
}
forAll(svf.boundaryField(), patchI)
forAll(svf.boundaryField(), patchi)
{
const fvsPatchVectorField& pf = svf.boundaryField()[patchI];
const fvsPatchVectorField& pf = svf.boundaryField()[patchi];
const fvPatch& pp = mesh.boundary()[patchI];
const fvPatch& pp = mesh.boundary()[patchi];
if (isA<emptyFvsPatchVectorField>(pf))
{

View File

@ -630,10 +630,10 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// always remove old actors first
forAll(patchTextActorsPtrs_, patchI)
forAll(patchTextActorsPtrs_, patchi)
{
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
patchTextActorsPtrs_[patchI]->Delete();
renderer->RemoveViewProp(patchTextActorsPtrs_[patchi]);
patchTextActorsPtrs_[patchi]->Delete();
}
patchTextActorsPtrs_.clear();
@ -663,9 +663,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Loop through all patches to determine zones, and centre of each zone
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
// Only include the patch if it is selected
if (!selectedPatches.found(pp.name()))
@ -697,27 +697,27 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Do topological analysis of patch, find disconnected regions
patchZones pZones(pp, featEdge);
nZones[patchI] = pZones.nZones();
nZones[patchi] = pZones.nZones();
labelList zoneNFaces(pZones.nZones(), 0);
// Create storage for additional zone centres
forAll(zoneNFaces, zoneI)
{
zoneCentre[patchI].append(Zero);
zoneCentre[patchi].append(Zero);
}
// Do averaging per individual zone
forAll(pp, faceI)
{
label zoneI = pZones[faceI];
zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points());
zoneCentre[patchi][zoneI] += pp[faceI].centre(pp.points());
zoneNFaces[zoneI]++;
}
forAll(zoneCentre[patchI], zoneI)
forAll(zoneCentre[patchi], zoneI)
{
zoneCentre[patchI][zoneI] /= zoneNFaces[zoneI];
zoneCentre[patchi][zoneI] /= zoneNFaces[zoneI];
}
}
@ -728,9 +728,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
label displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
}
if (debug)
@ -750,18 +750,18 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
// Actor index
displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
label globalZoneI = 0;
// Only selected patches will have a non-zero number of zones
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
label nDisplayZones = min(MAXPATCHZONES, nZones[patchi]);
label increment = 1;
if (nZones[patchI] >= MAXPATCHZONES)
if (nZones[patchi] >= MAXPATCHZONES)
{
increment = nZones[patchI]/MAXPATCHZONES;
increment = nZones[patchi]/MAXPATCHZONES;
}
for (label i = 0; i < nDisplayZones; i++)
@ -769,7 +769,7 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
if (debug)
{
Info<< "patch name = " << pp.name() << nl
<< "anchor = " << zoneCentre[patchI][globalZoneI] << nl
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
<< "globalZoneI = " << globalZoneI << endl;
}
@ -792,9 +792,9 @@ void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
txt->GetPositionCoordinate()->SetValue
(
zoneCentre[patchI][globalZoneI].x(),
zoneCentre[patchI][globalZoneI].y(),
zoneCentre[patchI][globalZoneI].z()
zoneCentre[patchi][globalZoneI].x(),
zoneCentre[patchi][globalZoneI].y(),
zoneCentre[patchi][globalZoneI].z()
);
// Add text to each renderer

View File

@ -295,9 +295,9 @@ void Foam::vtkPV3Foam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.size())
{
@ -344,12 +344,12 @@ void Foam::vtkPV3Foam::updateInfoPatches
wordList names(patchEntries.size());
labelList sizes(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
sizes[patchI] = readLabel(patchDict.lookup("nFaces"));
names[patchI] = patchEntries[patchI].keyword();
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
names[patchi] = patchEntries[patchi].keyword();
}
@ -358,9 +358,9 @@ void Foam::vtkPV3Foam::updateInfoPatches
HashTable<labelList, word> groups(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
wordList groupNames;
patchDict.readIfPresent("inGroups", groupNames);
@ -373,11 +373,11 @@ void Foam::vtkPV3Foam::updateInfoPatches
);
if (iter != groups.end())
{
iter().append(patchI);
iter().append(patchi);
}
else
{
groups.insert(groupNames[groupI], labelList(1, patchI));
groups.insert(groupNames[groupI], labelList(1, patchi));
}
}
}
@ -432,14 +432,14 @@ void Foam::vtkPV3Foam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(names, patchI)
forAll(names, patchi)
{
// Valid patch if nFace > 0 - add patch to GUI list
if (sizes[patchI])
if (sizes[patchi])
{
arraySelection->AddArray
(
(names[patchI] + " - patch").c_str()
(names[patchi] + " - patch").c_str()
);
++nPatches;

View File

@ -634,10 +634,10 @@ void Foam::vtkPVFoam::renderPatchNames
// always remove old actors first
forAll(patchTextActorsPtrs_, patchI)
forAll(patchTextActorsPtrs_, patchi)
{
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
patchTextActorsPtrs_[patchI]->Delete();
renderer->RemoveViewProp(patchTextActorsPtrs_[patchi]);
patchTextActorsPtrs_[patchi]->Delete();
}
patchTextActorsPtrs_.clear();
@ -667,9 +667,9 @@ void Foam::vtkPVFoam::renderPatchNames
// Loop through all patches to determine zones, and centre of each zone
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
// Only include the patch if it is selected
if (!selectedPatches.found(pp.name()))
@ -701,27 +701,27 @@ void Foam::vtkPVFoam::renderPatchNames
// Do topological analysis of patch, find disconnected regions
patchZones pZones(pp, featEdge);
nZones[patchI] = pZones.nZones();
nZones[patchi] = pZones.nZones();
labelList zoneNFaces(pZones.nZones(), 0);
// Create storage for additional zone centres
forAll(zoneNFaces, zoneI)
{
zoneCentre[patchI].append(Zero);
zoneCentre[patchi].append(Zero);
}
// Do averaging per individual zone
forAll(pp, faceI)
{
label zoneI = pZones[faceI];
zoneCentre[patchI][zoneI] += pp[faceI].centre(pp.points());
zoneCentre[patchi][zoneI] += pp[faceI].centre(pp.points());
zoneNFaces[zoneI]++;
}
forAll(zoneCentre[patchI], zoneI)
forAll(zoneCentre[patchi], zoneI)
{
zoneCentre[patchI][zoneI] /= zoneNFaces[zoneI];
zoneCentre[patchi][zoneI] /= zoneNFaces[zoneI];
}
}
@ -732,9 +732,9 @@ void Foam::vtkPVFoam::renderPatchNames
label displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
}
if (debug)
@ -754,18 +754,18 @@ void Foam::vtkPVFoam::renderPatchNames
// Actor index
displayZoneI = 0;
forAll(pbMesh, patchI)
forAll(pbMesh, patchi)
{
const polyPatch& pp = pbMesh[patchI];
const polyPatch& pp = pbMesh[patchi];
label globalZoneI = 0;
// Only selected patches will have a non-zero number of zones
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
label nDisplayZones = min(MAXPATCHZONES, nZones[patchi]);
label increment = 1;
if (nZones[patchI] >= MAXPATCHZONES)
if (nZones[patchi] >= MAXPATCHZONES)
{
increment = nZones[patchI]/MAXPATCHZONES;
increment = nZones[patchi]/MAXPATCHZONES;
}
for (label i = 0; i < nDisplayZones; i++)
@ -773,7 +773,7 @@ void Foam::vtkPVFoam::renderPatchNames
if (debug)
{
Info<< "patch name = " << pp.name() << nl
<< "anchor = " << zoneCentre[patchI][globalZoneI] << nl
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
<< "globalZoneI = " << globalZoneI << endl;
}
@ -796,9 +796,9 @@ void Foam::vtkPVFoam::renderPatchNames
txt->GetPositionCoordinate()->SetValue
(
zoneCentre[patchI][globalZoneI].x(),
zoneCentre[patchI][globalZoneI].y(),
zoneCentre[patchI][globalZoneI].z()
zoneCentre[patchi][globalZoneI].x(),
zoneCentre[patchi][globalZoneI].y(),
zoneCentre[patchi][globalZoneI].z()
);
// Add text to each renderer

View File

@ -295,9 +295,9 @@ void Foam::vtkPVFoam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.size())
{
@ -344,12 +344,12 @@ void Foam::vtkPVFoam::updateInfoPatches
wordList names(patchEntries.size());
labelList sizes(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
sizes[patchI] = readLabel(patchDict.lookup("nFaces"));
names[patchI] = patchEntries[patchI].keyword();
sizes[patchi] = readLabel(patchDict.lookup("nFaces"));
names[patchi] = patchEntries[patchi].keyword();
}
@ -358,9 +358,9 @@ void Foam::vtkPVFoam::updateInfoPatches
HashTable<labelList, word> groups(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
const dictionary& patchDict = patchEntries[patchI].dict();
const dictionary& patchDict = patchEntries[patchi].dict();
wordList groupNames;
patchDict.readIfPresent("inGroups", groupNames);
@ -373,11 +373,11 @@ void Foam::vtkPVFoam::updateInfoPatches
);
if (iter != groups.end())
{
iter().append(patchI);
iter().append(patchi);
}
else
{
groups.insert(groupNames[groupI], labelList(1, patchI));
groups.insert(groupNames[groupI], labelList(1, patchi));
}
}
}
@ -432,14 +432,14 @@ void Foam::vtkPVFoam::updateInfoPatches
if (!reader_->GetShowGroupsOnly())
{
forAll(names, patchI)
forAll(names, patchi)
{
// Valid patch if nFace > 0 - add patch to GUI list
if (sizes[patchI])
if (sizes[patchi])
{
arraySelection->AddArray
(
(names[patchI] + " - patch").c_str()
(names[patchi] + " - patch").c_str()
);
++nPatches;

View File

@ -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
@ -243,9 +243,9 @@ Foam::channelIndex::channelIndex
forAll(patchNames, i)
{
const label patchI = patches.findPatchID(patchNames[i]);
const label patchi = patches.findPatchID(patchNames[i]);
if (patchI == -1)
if (patchi == -1)
{
FatalErrorInFunction
<< "Illegal patch " << patchNames[i]
@ -253,7 +253,7 @@ Foam::channelIndex::channelIndex
<< exit(FatalError);
}
nFaces += patches[patchI].size();
nFaces += patches[patchi].size();
}
labelList startFaces(nFaces);

View File

@ -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
@ -114,14 +114,19 @@ int main(int argc, char *argv[])
dimensionedScalar("V", mesh.V().dimensions(), 0.0),
calculatedFvPatchField<scalar>::typeName
);
V.dimensionedInternalField() = mesh.V();
forAll(V.boundaryField(), patchI)
volScalarField::GeometricBoundaryField& Vbf = V.boundaryFieldRef();
forAll(Vbf, patchi)
{
V.boundaryField()[patchI] =
V.boundaryField()[patchI].patch().magSf();
Vbf[patchi] = Vbf[patchi].patch().magSf();
}
Info<< "Writing cellVolumes and patch faceAreas to " << V.name()
<< " in " << runTime.timeName() << endl;
V.write();
}

View File

@ -39,7 +39,7 @@ void printAverage
const fvMesh& mesh,
const IOobject& fieldHeader,
const scalar area,
const label patchI,
const label patchi,
bool& done
)
{
@ -57,15 +57,15 @@ void printAverage
{
sumField = gSum
(
mesh.magSf().boundaryField()[patchI]
* field.boundaryField()[patchI]
mesh.magSf().boundaryField()[patchi]
* field.boundaryField()[patchi]
) / area;
}
Info<< " Average of " << fieldHeader.headerClassName()
<< " over patch "
<< mesh.boundary()[patchI].name()
<< '[' << patchI << ']' << " = "
<< mesh.boundary()[patchi].name()
<< '[' << patchi << ']' << " = "
<< sumField << endl;
done = true;
@ -106,21 +106,21 @@ int main(int argc, char *argv[])
{
mesh.readUpdate();
const label patchI = mesh.boundaryMesh().findPatchID(patchName);
if (patchI < 0)
const label patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchi < 0)
{
FatalError
<< "Unable to find patch " << patchName << nl
<< exit(FatalError);
}
scalar area = gSum(mesh.magSf().boundaryField()[patchI]);
scalar area = gSum(mesh.magSf().boundaryField()[patchi]);
bool done = false;
printAverage<volScalarField>(mesh, io, area, patchI, done);
printAverage<volVectorField>(mesh, io, area, patchI, done);
printAverage<volSphericalTensorField>(mesh, io, area, patchI, done);
printAverage<volSymmTensorField>(mesh, io, area, patchI, done);
printAverage<volTensorField>(mesh, io, area, patchI, done);
printAverage<volScalarField>(mesh, io, area, patchi, done);
printAverage<volVectorField>(mesh, io, area, patchi, done);
printAverage<volSphericalTensorField>(mesh, io, area, patchi, done);
printAverage<volSymmTensorField>(mesh, io, area, patchi, done);
printAverage<volTensorField>(mesh, io, area, patchi, done);
if (!done)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -38,7 +38,7 @@ void printIntegrate
(
const fvMesh& mesh,
const IOobject& fieldHeader,
const label patchI,
const label patchi,
bool& done
)
{
@ -51,21 +51,21 @@ void printIntegrate
Info<< " Integral of " << fieldHeader.name()
<< " over vector area of patch "
<< mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
<< mesh.boundary()[patchi].name() << '[' << patchi << ']' << " = "
<< gSum
(
mesh.Sf().boundaryField()[patchI]
*field.boundaryField()[patchI]
mesh.Sf().boundaryField()[patchi]
*field.boundaryField()[patchi]
)
<< nl;
Info<< " Integral of " << fieldHeader.name()
<< " over area magnitude of patch "
<< mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
<< mesh.boundary()[patchi].name() << '[' << patchi << ']' << " = "
<< gSum
(
mesh.magSf().boundaryField()[patchI]
*field.boundaryField()[patchI]
mesh.magSf().boundaryField()[patchi]
*field.boundaryField()[patchi]
)
<< nl;
@ -79,7 +79,7 @@ void printSum
(
const fvMesh& mesh,
const IOobject& fieldHeader,
const label patchI,
const label patchi,
bool& done
)
{
@ -91,11 +91,11 @@ void printSum
FieldType field(fieldHeader, mesh);
typename FieldType::value_type sumField = gSum
(
field.boundaryField()[patchI]
field.boundaryField()[patchi]
);
Info<< " Integral of " << fieldHeader.name() << " over patch "
<< mesh.boundary()[patchI].name() << '[' << patchI << ']' << " = "
<< mesh.boundary()[patchi].name() << '[' << patchi << ']' << " = "
<< sumField << nl;
done = true;
@ -136,8 +136,8 @@ int main(int argc, char *argv[])
{
mesh.readUpdate();
const label patchI = mesh.boundaryMesh().findPatchID(patchName);
if (patchI < 0)
const label patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchi < 0)
{
FatalError
<< "Unable to find patch " << patchName << nl
@ -146,11 +146,11 @@ int main(int argc, char *argv[])
// Give patch area
Info<< " Area vector of patch "
<< patchName << '[' << patchI << ']' << " = "
<< gSum(mesh.Sf().boundaryField()[patchI]) << endl;
<< patchName << '[' << patchi << ']' << " = "
<< gSum(mesh.Sf().boundaryField()[patchi]) << endl;
Info<< " Area magnitude of patch "
<< patchName << '[' << patchI << ']' << " = "
<< gSum(mesh.magSf().boundaryField()[patchI]) << endl;
<< patchName << '[' << patchi << ']' << " = "
<< gSum(mesh.magSf().boundaryField()[patchi]) << endl;
// Read field and calc integral
bool done = false;
@ -158,14 +158,14 @@ int main(int argc, char *argv[])
(
mesh,
fieldHeader,
patchI,
patchi,
done
);
printIntegrate<volVectorField>
(
mesh,
fieldHeader,
patchI,
patchi,
done
);
@ -174,21 +174,21 @@ int main(int argc, char *argv[])
//(
// mesh,
// fieldHeader,
// patchI,
// patchi,
// done
//);
//printIntegrate<volSymmTensorField>
//(
// mesh,
// fieldHeader,
// patchI,
// patchi,
// done
//);
//printIntegrate<volTensorField>
//(
// mesh,
// fieldHeader,
// patchI,
// patchi,
// done
//);
@ -196,35 +196,35 @@ int main(int argc, char *argv[])
(
mesh,
fieldHeader,
patchI,
patchi,
done
);
printSum<surfaceVectorField>
(
mesh,
fieldHeader,
patchI,
patchi,
done
);
printSum<volSphericalTensorField>
(
mesh,
fieldHeader,
patchI,
patchi,
done
);
printSum<volSymmTensorField>
(
mesh,
fieldHeader,
patchI,
patchi,
done
);
printSum<volTensorField>
(
mesh,
fieldHeader,
patchI,
patchi,
done
);

View File

@ -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
@ -192,12 +192,15 @@ int main(int argc, char *argv[])
0.0*sigma.component(symmTensor::YZ)
);
forAll(sigmaUn.boundaryField(), patchI)
volScalarField::GeometricBoundaryField& sigmaUnBf =
sigmaUn.boundaryFieldRef();
forAll(sigmaUn.boundaryField(), patchi)
{
sigmaUn.boundaryField()[patchI] =
sigmaUnBf[patchi] =
(
mesh.boundary()[patchI].nf()
& sigma.boundaryField()[patchI]
mesh.boundary()[patchi].nf()
& sigma.boundaryField()[patchi]
)().component(vector::X);
}

View File

@ -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
@ -147,17 +147,17 @@ int main(int argc, char *argv[])
{
found = false;
forAll(patches, patchI)
forAll(patches, patchi)
{
const primitivePatch& bouFaces = patches[patchI];
const primitivePatch& bouFaces = patches[patchi];
if (!isType<emptyPolyPatch>(patches[patchI]))
if (!isType<emptyPolyPatch>(patches[patchi]))
{
forAll(bouFaces, faceI)
{
if
(
magSqr(phi.boundaryField()[patchI][faceI])
magSqr(phi.boundaryField()[patchi][faceI])
< SMALL
)
{
@ -177,7 +177,7 @@ int main(int argc, char *argv[])
if (found)
{
Info<< "Zero face: patch: " << patchI
Info<< "Zero face: patch: " << patchi
<< " face: " << faceI << endl;
forAll(zeroPoints, pointI)
@ -471,7 +471,7 @@ int main(int argc, char *argv[])
// Normalise the stream-function by the 2D mesh thickness
streamFunction /= thickness;
streamFunction.boundaryField() = 0.0;
streamFunction.boundaryFieldRef() = 0.0;
streamFunction.write();
}
else

View File

@ -88,16 +88,18 @@ int main(int argc, char *argv[])
)
);
volVectorField::GeometricBoundaryField& wallGradUBf =
wallGradU.boundaryFieldRef();
const fvPatchList& patches = mesh.boundary();
forAll(wallGradU.boundaryField(), patchi)
forAll(wallGradUBf, patchi)
{
const fvPatch& currPatch = patches[patchi];
if (isA<wallFvPatch>(currPatch))
{
wallGradU.boundaryField()[patchi] =
-U.boundaryField()[patchi].snGrad();
wallGradUBf[patchi] = -U.boundaryField()[patchi].snGrad();
}
}

View File

@ -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
@ -104,9 +104,12 @@ int main(int argc, char *argv[])
dimensionedScalar("wallHeatFlux", heatFlux.dimensions(), 0.0)
);
forAll(wallHeatFlux.boundaryField(), patchi)
volScalarField::GeometricBoundaryField& wallHeatFluxBf =
wallHeatFlux.boundaryFieldRef();
forAll(wallHeatFluxBf, patchi)
{
wallHeatFlux.boundaryField()[patchi] = patchHeatFlux[patchi];
wallHeatFluxBf[patchi] = patchHeatFlux[patchi];
}
wallHeatFlux.write();
@ -132,9 +135,12 @@ int main(int argc, char *argv[])
)
);
forAll(totalWallHeatFlux.boundaryField(), patchi)
volScalarField::GeometricBoundaryField& totalWallHeatFluxBf =
totalWallHeatFlux.boundaryFieldRef();
forAll(totalWallHeatFluxBf, patchi)
{
totalWallHeatFlux.boundaryField()[patchi] =
totalWallHeatFluxBf[patchi] =
patchHeatFlux[patchi] - patchRadHeatFlux[patchi];
}

View File

@ -60,13 +60,16 @@ void calcIncompressible
const volSymmTensorField Reff(model->devReff());
forAll(wallShearStress.boundaryField(), patchI)
volVectorField::GeometricBoundaryField& wallShearStressBf =
wallShearStress.boundaryFieldRef();
forAll(wallShearStressBf, patchi)
{
wallShearStress.boundaryField()[patchI] =
wallShearStressBf[patchi] =
(
-mesh.Sf().boundaryField()[patchI]
/mesh.magSf().boundaryField()[patchI]
) & Reff.boundaryField()[patchI];
-mesh.Sf().boundaryField()[patchi]
/mesh.magSf().boundaryField()[patchi]
) & Reff.boundaryField()[patchi];
}
}
@ -109,13 +112,16 @@ void calcCompressible
const volSymmTensorField Reff(model->devRhoReff());
forAll(wallShearStress.boundaryField(), patchI)
volVectorField::GeometricBoundaryField& wallShearStressBf =
wallShearStress.boundaryFieldRef();
forAll(wallShearStressBf, patchi)
{
wallShearStress.boundaryField()[patchI] =
wallShearStressBf[patchi] =
(
-mesh.Sf().boundaryField()[patchI]
/mesh.magSf().boundaryField()[patchI]
) & Reff.boundaryField()[patchI];
-mesh.Sf().boundaryField()[patchi]
/mesh.magSf().boundaryField()[patchi]
) & Reff.boundaryField()[patchi];
}
}

View File

@ -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
@ -68,6 +68,9 @@ void calcYPlus
const volScalarField::GeometricBoundaryField nuBf =
turbulenceModel->nu()().boundaryField();
volScalarField::GeometricBoundaryField& yPlusBf =
yPlus.boundaryFieldRef();
const fvPatchList& patches = mesh.boundary();
forAll(patches, patchi)
@ -82,7 +85,7 @@ void calcYPlus
nutBf[patchi]
);
yPlus.boundaryField()[patchi] = nutPf.yPlus();
yPlusBf[patchi] = nutPf.yPlus();
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi
@ -93,7 +96,7 @@ void calcYPlus
}
else if (isA<wallFvPatch>(patch))
{
yPlus.boundaryField()[patchi] =
yPlusBf[patchi] =
d[patchi]
*sqrt
(

View File

@ -55,9 +55,9 @@ void processField
const typename fieldType::GeometricBoundaryField& bf =
vtf.boundaryField();
forAll(bf, patchI)
forAll(bf, patchi)
{
if (isA<externalCoupledMixedFvPatchField<Type>>(bf[patchI]))
if (isA<externalCoupledMixedFvPatchField<Type>>(bf[patchi]))
{
Info<< "Generating external coupled geometry for field "
<< fieldName << endl;
@ -65,7 +65,7 @@ void processField
const externalCoupledMixedFvPatchField<Type>& pf =
refCast<const externalCoupledMixedFvPatchField<Type>>
(
bf[patchI]
bf[patchi]
);
pf.writeGeometry();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,11 +84,11 @@ int main(int argc, char *argv[])
forAllConstIter(dictionary, agglomDict, iter)
{
labelList patchIds = boundary.findIndices(iter().keyword());
forAll(patchIds, i)
labelList patchids = boundary.findIndices(iter().keyword());
forAll(patchids, i)
{
label patchI = patchIds[i];
const polyPatch& pp = boundary[patchI];
label patchi = patchids[i];
const polyPatch& pp = boundary[patchi];
if (!pp.coupled())
{
Info << "\nAgglomerating patch : " << pp.name() << endl;
@ -98,12 +98,12 @@ int main(int argc, char *argv[])
agglomDict.subDict(pp.name())
);
agglomObject.agglomerate();
finalAgglom[patchI] =
finalAgglom[patchi] =
agglomObject.restrictTopBottomAddressing();
if (finalAgglom[patchI].size())
if (finalAgglom[patchi].size())
{
nCoarseFaces += max(finalAgglom[patchI] + 1);
nCoarseFaces += max(finalAgglom[patchi] + 1);
}
}
}
@ -111,40 +111,40 @@ int main(int argc, char *argv[])
// - All patches which are not agglomarated are identity for finalAgglom
forAll(boundary, patchId)
forAll(boundary, patchid)
{
if (finalAgglom[patchId].size() == 0)
if (finalAgglom[patchid].size() == 0)
{
finalAgglom[patchId] = identity(boundary[patchId].size());
finalAgglom[patchid] = identity(boundary[patchid].size());
}
}
// Sync agglomeration across coupled patches
labelList nbrAgglom(mesh.nFaces() - mesh.nInternalFaces(), -1);
forAll(boundary, patchId)
forAll(boundary, patchid)
{
const polyPatch& pp = boundary[patchId];
const polyPatch& pp = boundary[patchid];
if (pp.coupled())
{
finalAgglom[patchId] = identity(pp.size());
finalAgglom[patchid] = identity(pp.size());
forAll(pp, i)
{
nbrAgglom[pp.start() - mesh.nInternalFaces() + i] =
finalAgglom[patchId][i];
finalAgglom[patchid][i];
}
}
}
syncTools::swapBoundaryFaceList(mesh, nbrAgglom);
forAll(boundary, patchId)
forAll(boundary, patchid)
{
const polyPatch& pp = boundary[patchId];
const polyPatch& pp = boundary[patchid];
if (pp.coupled() && !refCast<const coupledPolyPatch>(pp).owner())
{
forAll(pp, i)
{
finalAgglom[patchId][i] =
finalAgglom[patchid][i] =
nbrAgglom[pp.start() - mesh.nInternalFaces() + i];
}
}
@ -169,14 +169,17 @@ int main(int argc, char *argv[])
dimensionedScalar("facesAgglomeration", dimless, 0)
);
volScalarField::GeometricBoundaryField& facesAgglomerationBf =
facesAgglomeration.boundaryFieldRef();
label coarsePatchIndex = 0;
forAll(boundary, patchId)
forAll(boundary, patchid)
{
const polyPatch& pp = boundary[patchId];
const polyPatch& pp = boundary[patchid];
if (pp.size() > 0)
{
fvPatchScalarField& bFacesAgglomeration =
facesAgglomeration.boundaryField()[patchId];
facesAgglomerationBf[patchid];
forAll(bFacesAgglomeration, j)
{
@ -184,11 +187,11 @@ int main(int argc, char *argv[])
index.toGlobal
(
Pstream::myProcNo(),
finalAgglom[patchId][j] + coarsePatchIndex
finalAgglom[patchid][j] + coarsePatchIndex
);
}
coarsePatchIndex += max(finalAgglom[patchId]) + 1;
coarsePatchIndex += max(finalAgglom[patchid]) + 1;
}
}

View File

@ -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
@ -87,15 +87,15 @@ void rewriteBoundary
// Replace any 'cyclic'
label nOldCyclics = 0;
forAll(patches, patchI)
forAll(patches, patchi)
{
const dictionary& patchDict = patches[patchI].dict();
const dictionary& patchDict = patches[patchi].dict();
if (word(patchDict["type"]) == cyclicPolyPatch::typeName)
{
if (!patchDict.found("neighbourPatch"))
{
Info<< "Patch " << patches[patchI].keyword()
Info<< "Patch " << patches[patchi].keyword()
<< " does not have 'neighbourPatch' entry; assuming it"
<< " is of the old type." << endl;
nOldCyclics++;
@ -120,21 +120,21 @@ void rewriteBoundary
// Add new entries
label addedPatchI = nOldPatches;
label newPatchI = 0;
forAll(oldPatches, patchI)
forAll(oldPatches, patchi)
{
const dictionary& patchDict = oldPatches[patchI].dict();
const dictionary& patchDict = oldPatches[patchi].dict();
if
(
word(patchDict["type"]) == cyclicPolyPatch::typeName
)
{
const word& name = oldPatches[patchI].keyword();
const word& name = oldPatches[patchi].keyword();
if (patchDict.found("neighbourPatch"))
{
patches.set(patchI, oldPatches.set(patchI, NULL));
oldToNew[patchI] = newPatchI++;
patches.set(patchi, oldPatches.set(patchi, NULL));
oldToNew[patchi] = newPatchI++;
// Check if patches come from automatic conversion
word oldName;
@ -178,15 +178,15 @@ void rewriteBoundary
nbrNames.insert(name, nbrName);
// Save current dictionary
const dictionary patchDict(patches[patchI].dict());
const dictionary patchDict(patches[patchi].dict());
// Change entry on this side
patches.set(patchI, oldPatches.set(patchI, NULL));
oldToNew[patchI] = newPatchI++;
dictionary& thisPatchDict = patches[patchI].dict();
patches.set(patchi, oldPatches.set(patchi, NULL));
oldToNew[patchi] = newPatchI++;
dictionary& thisPatchDict = patches[patchi].dict();
thisPatchDict.add("neighbourPatch", nbrName);
thisPatchDict.set("nFaces", nFaces/2);
patches[patchI].keyword() = thisName;
patches[patchi].keyword() = thisName;
// Add entry on other side
patches.set
@ -207,7 +207,7 @@ void rewriteBoundary
patches[addedPatchI].keyword() = nbrName;
Info<< "Replaced with patches" << nl
<< patches[patchI].keyword() << " with" << nl
<< patches[patchi].keyword() << " with" << nl
<< " nFaces : "
<< readLabel(thisPatchDict.lookup("nFaces"))
<< nl
@ -226,8 +226,8 @@ void rewriteBoundary
}
else
{
patches.set(patchI, oldPatches.set(patchI, NULL));
oldToNew[patchI] = newPatchI++;
patches.set(patchi, oldPatches.set(patchi, NULL));
oldToNew[patchi] = newPatchI++;
}
}

View File

@ -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
@ -133,11 +133,11 @@ wordList addProcessorPatches
const polyBoundaryMesh& pbm = meshTarget.boundaryMesh();
forAll(pbm, patchI)
forAll(pbm, patchi)
{
if (isA<processorPolyPatch>(pbm[patchI]))
if (isA<processorPolyPatch>(pbm[patchi]))
{
const word& patchName = pbm[patchI].name();
const word& patchName = pbm[patchi].name();
cuttingPatchTable.insert(patchName);
}
}

View File

@ -98,10 +98,12 @@ bool setCellFieldType
}
}
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& fieldBf = field.boundaryFieldRef();
forAll(field.boundaryField(), patchi)
{
field.boundaryField()[patchi] =
field.boundaryField()[patchi].patchInternalField();
fieldBf[patchi] = fieldBf[patchi].patchInternalField();
}
if (!field.write())
@ -274,6 +276,9 @@ bool setFaceFieldType
Pstream::listCombineGather(nChanged, plusEqOp<label>());
Pstream::listCombineScatter(nChanged);
typename GeometricField<Type, fvPatchField, volMesh>::
GeometricBoundaryField& fieldBf = field.boundaryFieldRef();
// Reassign.
forAll(field.boundaryField(), patchi)
{
@ -282,11 +287,11 @@ bool setFaceFieldType
Info<< " On patch "
<< field.boundaryField()[patchi].patch().name()
<< " set " << nChanged[patchi] << " values" << endl;
field.boundaryField()[patchi] == SubField<Type>
fieldBf[patchi] == SubField<Type>
(
allBoundaryValues,
field.boundaryField()[patchi].size(),
field.boundaryField()[patchi].patch().start()
fieldBf[patchi].size(),
fieldBf[patchi].patch().start()
- mesh.nInternalFaces()
);
}

View File

@ -24,9 +24,9 @@ dict.add
dict.add("mergeDistance", SMALL);
labelHashSet includePatches;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if
(
!pp.coupled()
@ -34,7 +34,7 @@ forAll(patches, patchI)
&& !isA<emptyPolyPatch>(pp)
)
{
includePatches.insert(patchI);
includePatches.insert(patchi);
}
}

Some files were not shown because too many files have changed in this diff Show More