boundaryField() -> boundaryFieldRef()
This commit is contained in:
@ -126,7 +126,7 @@ void subsetVolFields
|
||||
(
|
||||
const fvMeshSubset& subsetter,
|
||||
const IOobjectList& objectsList,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const Type& exposedValue,
|
||||
const word GeomVolType,
|
||||
PtrList<GeometricField<Type, fvPatchField, volMesh>>& subFields
|
||||
@ -152,15 +152,15 @@ void subsetVolFields
|
||||
|
||||
subFields.set(i, subsetter.interpolate(volField));
|
||||
|
||||
// Explicitly set exposed faces (in patchI) to exposedValue.
|
||||
if (patchI >= 0)
|
||||
// Explicitly set exposed faces (in patchi) to exposedValue.
|
||||
if (patchi >= 0)
|
||||
{
|
||||
fvPatchField<Type>& fld =
|
||||
subFields[i++].boundaryField()[patchI];
|
||||
subFields[i++].boundaryFieldRef()[patchi];
|
||||
|
||||
label newStart = fld.patch().patch().start();
|
||||
|
||||
label oldPatchI = subsetter.patchMap()[patchI];
|
||||
label oldPatchI = subsetter.patchMap()[patchi];
|
||||
|
||||
if (oldPatchI == -1)
|
||||
{
|
||||
@ -198,7 +198,7 @@ void subsetSurfaceFields
|
||||
(
|
||||
const fvMeshSubset& subsetter,
|
||||
const IOobjectList& objectsList,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const Type& exposedValue,
|
||||
const word GeomSurfType,
|
||||
PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& subFields
|
||||
@ -225,15 +225,15 @@ void subsetSurfaceFields
|
||||
subFields.set(i, subsetter.interpolate(volField));
|
||||
|
||||
|
||||
// Explicitly set exposed faces (in patchI) to exposedValue.
|
||||
if (patchI >= 0)
|
||||
// Explicitly set exposed faces (in patchi) to exposedValue.
|
||||
if (patchi >= 0)
|
||||
{
|
||||
fvsPatchField<Type>& fld =
|
||||
subFields[i++].boundaryField()[patchI];
|
||||
subFields[i++].boundaryFieldRef()[patchi];
|
||||
|
||||
label newStart = fld.patch().patch().start();
|
||||
|
||||
label oldPatchI = subsetter.patchMap()[patchI];
|
||||
label oldPatchI = subsetter.patchMap()[patchi];
|
||||
|
||||
if (oldPatchI == -1)
|
||||
{
|
||||
@ -291,16 +291,19 @@ void initCreatedPatches
|
||||
{
|
||||
GeoField& field = const_cast<GeoField&>(*fieldIter());
|
||||
|
||||
forAll(field.boundaryField(), patchi)
|
||||
typename GeoField::GeometricBoundaryField& fieldBf =
|
||||
field.boundaryFieldRef();
|
||||
|
||||
forAll(fieldBf, patchi)
|
||||
{
|
||||
if (map.oldPatchSizes()[patchi] == 0)
|
||||
{
|
||||
// Not mapped.
|
||||
field.boundaryField()[patchi] = initValue;
|
||||
fieldBf[patchi] = initValue;
|
||||
|
||||
if (field.boundaryField()[patchi].fixesValue())
|
||||
if (fieldBf[patchi].fixesValue())
|
||||
{
|
||||
field.boundaryField()[patchi] == initValue;
|
||||
fieldBf[patchi] == initValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -526,9 +529,9 @@ void createBaffles
|
||||
// Wrapper around find patch. Also makes sure same patch in parallel.
|
||||
label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
{
|
||||
label patchI = patches.findPatchID(patchName);
|
||||
label patchi = patches.findPatchID(patchName);
|
||||
|
||||
if (patchI == -1)
|
||||
if (patchi == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Illegal patch " << patchName
|
||||
@ -538,20 +541,20 @@ label findPatch(const polyBoundaryMesh& patches, const word& patchName)
|
||||
|
||||
// Check same patch for all procs
|
||||
{
|
||||
label newPatch = patchI;
|
||||
label newPatch = patchi;
|
||||
reduce(newPatch, minOp<label>());
|
||||
|
||||
if (newPatch != patchI)
|
||||
if (newPatch != patchi)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Patch " << patchName
|
||||
<< " should have the same patch index on all processors." << nl
|
||||
<< "On my processor it has index " << patchI
|
||||
<< "On my processor it has index " << patchi
|
||||
<< " ; on some other processor it has index " << newPatch
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
|
||||
|
||||
@ -641,7 +644,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
faceSet fSet(mesh, setsAndPatches[setI][0]);
|
||||
|
||||
label patchI = findPatch
|
||||
label patchi = findPatch
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
setsAndPatches[setI][1]
|
||||
@ -658,7 +661,7 @@ int main(int argc, char *argv[])
|
||||
<< " but also in patch " << wantedPatch[iter.key()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
wantedPatch[iter.key()] = patchI;
|
||||
wantedPatch[iter.key()] = patchi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -683,7 +686,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
faceSet fSet(mesh, coupledAndPatches[setI][0]);
|
||||
label patchI = findPatch(patches, coupledAndPatches[setI][1]);
|
||||
label patchi = findPatch(patches, coupledAndPatches[setI][1]);
|
||||
|
||||
forAllConstIter(faceSet, fSet, iter)
|
||||
{
|
||||
@ -696,7 +699,7 @@ int main(int argc, char *argv[])
|
||||
<< " but also in patch " << coupledWantedPatch[iter.key()]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
coupledWantedPatch[iter.key()] = patchI;
|
||||
coupledWantedPatch[iter.key()] = patchi;
|
||||
cyclicWantedPatch_half0[iter.key()] = cyclicId;
|
||||
cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
|
||||
}
|
||||
|
||||
@ -193,24 +193,24 @@ scalar getEdgeStats(const primitiveMesh& mesh, const direction excludeCmpt)
|
||||
// Adds empty patch if not yet there. Returns patchID.
|
||||
label addPatch(polyMesh& mesh, const word& patchName)
|
||||
{
|
||||
label patchI = mesh.boundaryMesh().findPatchID(patchName);
|
||||
label patchi = mesh.boundaryMesh().findPatchID(patchName);
|
||||
|
||||
if (patchI == -1)
|
||||
if (patchi == -1)
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
List<polyPatch*> newPatches(patches.size() + 1);
|
||||
|
||||
// Add empty patch as 0th entry (Note: only since subsetMesh wants this)
|
||||
patchI = 0;
|
||||
patchi = 0;
|
||||
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new emptyPolyPatch
|
||||
(
|
||||
Foam::word(patchName),
|
||||
0,
|
||||
mesh.nInternalFaces(),
|
||||
patchI,
|
||||
patchi,
|
||||
patches,
|
||||
emptyPolyPatch::typeName
|
||||
);
|
||||
@ -232,15 +232,15 @@ label addPatch(polyMesh& mesh, const word& patchName)
|
||||
mesh.removeBoundary();
|
||||
mesh.addPatches(newPatches);
|
||||
|
||||
Info<< "Created patch oldInternalFaces at " << patchI << endl;
|
||||
Info<< "Created patch oldInternalFaces at " << patchi << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Reusing patch oldInternalFaces at " << patchI << endl;
|
||||
Info<< "Reusing patch oldInternalFaces at " << patchi << endl;
|
||||
}
|
||||
|
||||
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
|
||||
|
||||
@ -482,7 +482,7 @@ void subsetMesh
|
||||
(
|
||||
polyMesh& mesh,
|
||||
const label writeMesh,
|
||||
const label patchI, // patchID for exposed faces
|
||||
const label patchi, // patchID for exposed faces
|
||||
const labelHashSet& cellsToRemove,
|
||||
cellSet& cutCells,
|
||||
labelIOList& refLevel
|
||||
@ -503,7 +503,7 @@ void subsetMesh
|
||||
(
|
||||
cellLabels,
|
||||
exposedFaces,
|
||||
labelList(exposedFaces.size(), patchI),
|
||||
labelList(exposedFaces.size(), patchi),
|
||||
meshMod
|
||||
);
|
||||
|
||||
|
||||
@ -221,9 +221,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
List<polyPatch*> p(patches.size());
|
||||
|
||||
forAll(p, patchI)
|
||||
forAll(p, patchi)
|
||||
{
|
||||
p[patchI] = patches[patchI].clone(fMesh.boundaryMesh()).ptr();
|
||||
p[patchi] = patches[patchi].clone(fMesh.boundaryMesh()).ptr();
|
||||
}
|
||||
|
||||
fMesh.addFvPatches(p);
|
||||
@ -294,15 +294,17 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
volScalarField::GeometricBoundaryField& postRefLevelBf =
|
||||
postRefLevel.boundaryFieldRef();
|
||||
|
||||
// For volScalarField: set boundary values to same as cell.
|
||||
// Note: could also put
|
||||
// zeroGradient b.c. on postRefLevel and do evaluate.
|
||||
forAll(postRefLevel.boundaryField(), patchI)
|
||||
forAll(postRefLevel.boundaryField(), patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
fvPatchScalarField& bField = postRefLevel.boundaryField()[patchI];
|
||||
fvPatchScalarField& bField = postRefLevelBf[patchi];
|
||||
|
||||
Info<< "Setting field for patch "<< endl;
|
||||
|
||||
|
||||
@ -931,38 +931,38 @@ int main(int argc, char *argv[])
|
||||
|
||||
label meshFaceI = foamPatchStarts[0];
|
||||
|
||||
forAll(newPatches, patchI)
|
||||
forAll(newPatches, patchi)
|
||||
{
|
||||
const word& patchName = foamPatchNames[patchI];
|
||||
const word& patchType = foamPatchTypes[patchI];
|
||||
const word& patchName = foamPatchNames[patchi];
|
||||
const word& patchType = foamPatchTypes[patchi];
|
||||
|
||||
Pout<< "Patch:" << patchName << " start at:" << meshFaceI
|
||||
<< " size:" << foamPatchSizes[patchI]
|
||||
<< " end at:" << meshFaceI+foamPatchSizes[patchI]
|
||||
<< " size:" << foamPatchSizes[patchi]
|
||||
<< " end at:" << meshFaceI+foamPatchSizes[patchi]
|
||||
<< endl;
|
||||
|
||||
if (patchType == "wall")
|
||||
{
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new wallPolyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
}
|
||||
else if (patchType == "symmetryplane")
|
||||
{
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new symmetryPolyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
@ -970,13 +970,13 @@ int main(int argc, char *argv[])
|
||||
else if (patchType == "empty")
|
||||
{
|
||||
// Note: not ccm name, introduced by us above.
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new emptyPolyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
);
|
||||
@ -985,19 +985,19 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// All other ccm types become straight polyPatch:
|
||||
// 'inlet', 'outlet', ...
|
||||
newPatches[patchI] =
|
||||
newPatches[patchi] =
|
||||
new polyPatch
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchI],
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
patchI,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
word::null
|
||||
);
|
||||
}
|
||||
|
||||
meshFaceI += foamPatchSizes[patchI];
|
||||
meshFaceI += foamPatchSizes[patchi];
|
||||
}
|
||||
|
||||
if (meshFaceI != foamOwner.size())
|
||||
|
||||
@ -485,18 +485,18 @@ int main(int argc, char *argv[])
|
||||
faceListList boundary(slPatchCells.size());
|
||||
wordList patchNames(slPatchCells.size());
|
||||
|
||||
forAll(slPatchCells, patchI)
|
||||
forAll(slPatchCells, patchi)
|
||||
{
|
||||
SLList<face> patchFaces;
|
||||
|
||||
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(),
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
);
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
@ -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())
|
||||
// {
|
||||
|
||||
@ -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)
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
(
|
||||
|
||||
@ -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())
|
||||
{
|
||||
|
||||
@ -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))
|
||||
{
|
||||
|
||||
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@ -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())
|
||||
{
|
||||
|
||||
@ -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))
|
||||
{
|
||||
|
||||
@ -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()
|
||||
);
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
|
||||
@ -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())
|
||||
{
|
||||
|
||||
@ -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]
|
||||
)
|
||||
{
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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!
|
||||
|
||||
@ -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];
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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"
|
||||
|
||||
Reference in New Issue
Block a user