mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Standardized cell, patch and face loop index names
This commit is contained in:
@ -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
|
||||
@ -98,12 +98,12 @@ Foam::PtrList<Foam::dictionary> Foam::blockMesh::patchDicts() const
|
||||
|
||||
PtrList<dictionary> patchDicts(patchTopologies.size());
|
||||
|
||||
forAll(patchTopologies, patchI)
|
||||
forAll(patchTopologies, patchi)
|
||||
{
|
||||
OStringStream os;
|
||||
patchTopologies[patchI].write(os);
|
||||
patchTopologies[patchi].write(os);
|
||||
IStringStream is(os.str());
|
||||
patchDicts.set(patchI, new dictionary(is));
|
||||
patchDicts.set(patchi, new dictionary(is));
|
||||
}
|
||||
return patchDicts;
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -190,9 +190,9 @@ bool Foam::blockMesh::patchLabelsOK
|
||||
{
|
||||
bool ok = true;
|
||||
|
||||
forAll(patchFaces, faceI)
|
||||
forAll(patchFaces, facei)
|
||||
{
|
||||
const labelList& f = patchFaces[faceI];
|
||||
const labelList& f = patchFaces[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -204,7 +204,7 @@ bool Foam::blockMesh::patchLabelsOK
|
||||
<< "out-of-range point label " << f[fp]
|
||||
<< " (min = 0"
|
||||
<< ") on patch " << patchLabel
|
||||
<< ", face " << faceI << endl;
|
||||
<< ", face " << facei << endl;
|
||||
}
|
||||
else if (f[fp] >= points.size())
|
||||
{
|
||||
@ -214,7 +214,7 @@ bool Foam::blockMesh::patchLabelsOK
|
||||
<< "out-of-range point label " << f[fp]
|
||||
<< " (max = " << points.size() - 1
|
||||
<< ") on patch " << patchLabel
|
||||
<< ", face " << faceI << endl;
|
||||
<< ", face " << facei << 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
|
||||
@ -272,9 +272,9 @@ void Foam::blockMesh::createPatches() const
|
||||
patches_.clear();
|
||||
patches_.setSize(topoPatches.size());
|
||||
|
||||
forAll(topoPatches, patchI)
|
||||
forAll(topoPatches, patchi)
|
||||
{
|
||||
patches_[patchI] = createPatchFaces(topoPatches[patchI]);
|
||||
patches_[patchi] = createPatchFaces(topoPatches[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
|
||||
@ -202,9 +202,9 @@ bool Foam::blockMesh::readBoundary
|
||||
tmpBlocksPatches.setSize(patchesInfo.size());
|
||||
patchDicts.setSize(patchesInfo.size());
|
||||
|
||||
forAll(tmpBlocksPatches, patchI)
|
||||
forAll(tmpBlocksPatches, patchi)
|
||||
{
|
||||
const entry& patchInfo = patchesInfo[patchI];
|
||||
const entry& patchInfo = patchesInfo[patchi];
|
||||
|
||||
if (!patchInfo.isDict())
|
||||
{
|
||||
@ -213,17 +213,17 @@ bool Foam::blockMesh::readBoundary
|
||||
<< " valid dictionary." << exit(FatalIOError);
|
||||
}
|
||||
|
||||
patchNames[patchI] = patchInfo.keyword();
|
||||
patchNames[patchi] = patchInfo.keyword();
|
||||
// Construct dictionary
|
||||
patchDicts.set(patchI, new dictionary(patchInfo.dict()));
|
||||
patchDicts.set(patchi, new dictionary(patchInfo.dict()));
|
||||
// Read block faces
|
||||
patchDicts[patchI].lookup("faces") >> tmpBlocksPatches[patchI];
|
||||
patchDicts[patchi].lookup("faces") >> tmpBlocksPatches[patchi];
|
||||
|
||||
topologyOK = topologyOK && patchLabelsOK
|
||||
(
|
||||
patchI,
|
||||
patchi,
|
||||
blockPointField_,
|
||||
tmpBlocksPatches[patchI]
|
||||
tmpBlocksPatches[patchi]
|
||||
);
|
||||
}
|
||||
|
||||
@ -488,36 +488,36 @@ Foam::polyMesh* Foam::blockMesh::createTopology
|
||||
|
||||
|
||||
// Add cyclic info (might not be present from older file)
|
||||
forAll(patchDicts, patchI)
|
||||
forAll(patchDicts, patchi)
|
||||
{
|
||||
if (!patchDicts.set(patchI))
|
||||
if (!patchDicts.set(patchi))
|
||||
{
|
||||
patchDicts.set(patchI, new dictionary());
|
||||
patchDicts.set(patchi, new dictionary());
|
||||
}
|
||||
|
||||
dictionary& dict = patchDicts[patchI];
|
||||
dictionary& dict = patchDicts[patchi];
|
||||
|
||||
// Add but not override type
|
||||
if (!dict.found("type"))
|
||||
{
|
||||
dict.add("type", patchTypes[patchI], false);
|
||||
dict.add("type", patchTypes[patchi], false);
|
||||
}
|
||||
else if (word(dict.lookup("type")) != patchTypes[patchI])
|
||||
else if (word(dict.lookup("type")) != patchTypes[patchi])
|
||||
{
|
||||
IOWarningInFunction
|
||||
(
|
||||
meshDescription
|
||||
) << "For patch " << patchNames[patchI]
|
||||
<< " overriding type '" << patchTypes[patchI]
|
||||
) << "For patch " << patchNames[patchi]
|
||||
<< " overriding type '" << patchTypes[patchi]
|
||||
<< "' with '" << word(dict.lookup("type"))
|
||||
<< "' (read from boundary file)"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Override neighbourpatch name
|
||||
if (nbrPatchNames[patchI] != word::null)
|
||||
if (nbrPatchNames[patchi] != word::null)
|
||||
{
|
||||
dict.set("neighbourPatch", nbrPatchNames[patchI]);
|
||||
dict.set("neighbourPatch", nbrPatchNames[patchi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -58,10 +58,10 @@ Foam::labelList Foam::medialAxisMeshMover::getFixedValueBCs
|
||||
)
|
||||
{
|
||||
DynamicList<label> adaptPatchIDs;
|
||||
forAll(fld.boundaryField(), patchI)
|
||||
forAll(fld.boundaryField(), patchi)
|
||||
{
|
||||
const pointPatchField<vector>& patchFld =
|
||||
fld.boundaryField()[patchI];
|
||||
fld.boundaryField()[patchi];
|
||||
|
||||
if (isA<valuePointPatchField<vector>>(patchFld))
|
||||
{
|
||||
@ -72,7 +72,7 @@ Foam::labelList Foam::medialAxisMeshMover::getFixedValueBCs
|
||||
}
|
||||
else
|
||||
{
|
||||
adaptPatchIDs.append(patchI);
|
||||
adaptPatchIDs.append(patchi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -631,17 +631,17 @@ void Foam::medialAxisMeshMover::update(const dictionary& coeffDict)
|
||||
labelHashSet adaptPatches(adaptPatchIDs_);
|
||||
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
const pointPatchVectorField& pvf =
|
||||
pointDisplacement().boundaryField()[patchI];
|
||||
pointDisplacement().boundaryField()[patchi];
|
||||
|
||||
if
|
||||
(
|
||||
!pp.coupled()
|
||||
&& !isA<emptyPolyPatch>(pp)
|
||||
&& !adaptPatches.found(patchI)
|
||||
&& !adaptPatches.found(patchi)
|
||||
)
|
||||
{
|
||||
const labelList& meshPoints = pp.meshPoints();
|
||||
@ -1093,15 +1093,15 @@ handleFeatureAngleLayerTerminations
|
||||
|
||||
boolList extrudedFaces(pp.size(), true);
|
||||
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (extrudeStatus[f[fp]] == snappyLayerDriver::NOEXTRUDE)
|
||||
{
|
||||
extrudedFaces[faceI] = false;
|
||||
extrudedFaces[facei] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1130,9 +1130,9 @@ handleFeatureAngleLayerTerminations
|
||||
edgeFaceExtrude[edgeI].setSize(eFaces.size());
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label faceI = eFaces[i];
|
||||
edgeFaceNormals[edgeI][i] = faceNormals[faceI];
|
||||
edgeFaceExtrude[edgeI][i] = extrudedFaces[faceI];
|
||||
label facei = eFaces[i];
|
||||
edgeFaceNormals[edgeI][i] = faceNormals[facei];
|
||||
edgeFaceExtrude[edgeI][i] = extrudedFaces[facei];
|
||||
}
|
||||
}
|
||||
|
||||
@ -1282,23 +1282,23 @@ void Foam::medialAxisMeshMover::findIsolatedRegions
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
labelList islandPoint(pp.size(), -1);
|
||||
forAll(pp, faceI)
|
||||
forAll(pp, facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (extrudeStatus[f[fp]] != snappyLayerDriver::NOEXTRUDE)
|
||||
{
|
||||
if (islandPoint[faceI] == -1)
|
||||
if (islandPoint[facei] == -1)
|
||||
{
|
||||
// First point to extrude
|
||||
islandPoint[faceI] = f[fp];
|
||||
islandPoint[facei] = f[fp];
|
||||
}
|
||||
else if (islandPoint[faceI] != -2)
|
||||
else if (islandPoint[facei] != -2)
|
||||
{
|
||||
// Second or more point to extrude
|
||||
islandPoint[faceI] = -2;
|
||||
islandPoint[facei] = -2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1318,8 +1318,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
if (islandPoint[faceI] != patchPointI)
|
||||
label facei = pFaces[i];
|
||||
if (islandPoint[facei] != patchPointI)
|
||||
{
|
||||
keptPoints[patchPointI] = true;
|
||||
break;
|
||||
@ -1335,14 +1335,14 @@ void Foam::medialAxisMeshMover::findIsolatedRegions
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
boolList extrudedFaces(pp.size(), true);
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (extrudeStatus[f[fp]] == snappyLayerDriver::NOEXTRUDE)
|
||||
{
|
||||
extrudedFaces[faceI] = false;
|
||||
extrudedFaces[facei] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1356,8 +1356,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
if (extrudedFaces[faceI])
|
||||
label facei = pFaces[i];
|
||||
if (extrudedFaces[facei])
|
||||
{
|
||||
keptPoints[patchPointI] = true;
|
||||
break;
|
||||
@ -1441,9 +1441,9 @@ void Foam::medialAxisMeshMover::findIsolatedRegions
|
||||
|
||||
// stop layer growth on isolated faces
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
forAll(pp, faceI)
|
||||
forAll(pp, facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
bool failed = false;
|
||||
forAll(f, fp)
|
||||
{
|
||||
|
||||
@ -141,9 +141,9 @@ void Foam::meshRefinement::calcNeighbourData
|
||||
|
||||
labelHashSet addedPatchIDSet(meshedPatches());
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
const vectorField::subField faceCentres = pp.faceCentres();
|
||||
@ -160,7 +160,7 @@ void Foam::meshRefinement::calcNeighbourData
|
||||
bFaceI++;
|
||||
}
|
||||
}
|
||||
else if (addedPatchIDSet.found(patchI))
|
||||
else if (addedPatchIDSet.found(patchi))
|
||||
{
|
||||
// Face was introduced from cell-cell intersection. Try to
|
||||
// reconstruct other side cell(centre). Three possibilities:
|
||||
@ -218,9 +218,9 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces)
|
||||
|
||||
{
|
||||
label nMasterFaces = 0;
|
||||
forAll(isMasterFace, faceI)
|
||||
forAll(isMasterFace, facei)
|
||||
{
|
||||
if (isMasterFace.get(faceI) == 1)
|
||||
if (isMasterFace.get(facei) == 1)
|
||||
{
|
||||
nMasterFaces++;
|
||||
}
|
||||
@ -255,17 +255,17 @@ void Foam::meshRefinement::updateIntersections(const labelList& changedFaces)
|
||||
|
||||
forAll(changedFaces, i)
|
||||
{
|
||||
label faceI = changedFaces[i];
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label facei = changedFaces[i];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
end[i] = cellCentres[mesh_.faceNeighbour()[faceI]];
|
||||
end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
|
||||
}
|
||||
else
|
||||
{
|
||||
end[i] = neiCc[faceI-mesh_.nInternalFaces()];
|
||||
end[i] = neiCc[facei-mesh_.nInternalFaces()];
|
||||
}
|
||||
}
|
||||
|
||||
@ -460,17 +460,17 @@ void Foam::meshRefinement::checkData()
|
||||
pointField start(mesh_.nFaces());
|
||||
pointField end(mesh_.nFaces());
|
||||
|
||||
forAll(start, faceI)
|
||||
forAll(start, facei)
|
||||
{
|
||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
||||
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
end[faceI] = mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]];
|
||||
end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
|
||||
}
|
||||
else
|
||||
{
|
||||
end[faceI] = neiCc[faceI-mesh_.nInternalFaces()];
|
||||
end[facei] = neiCc[facei-mesh_.nInternalFaces()];
|
||||
}
|
||||
}
|
||||
|
||||
@ -508,37 +508,37 @@ void Foam::meshRefinement::checkData()
|
||||
syncTools::swapBoundaryFaceList(mesh_, neiHit);
|
||||
|
||||
// Check
|
||||
forAll(surfaceHit, faceI)
|
||||
forAll(surfaceHit, facei)
|
||||
{
|
||||
if (surfaceIndex_[faceI] != surfaceHit[faceI])
|
||||
if (surfaceIndex_[facei] != surfaceHit[facei])
|
||||
{
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Internal face:" << faceI
|
||||
<< " fc:" << mesh_.faceCentres()[faceI]
|
||||
<< " cached surfaceIndex_:" << surfaceIndex_[faceI]
|
||||
<< " current:" << surfaceHit[faceI]
|
||||
<< "Internal face:" << facei
|
||||
<< " fc:" << mesh_.faceCentres()[facei]
|
||||
<< " cached surfaceIndex_:" << surfaceIndex_[facei]
|
||||
<< " current:" << surfaceHit[facei]
|
||||
<< " ownCc:"
|
||||
<< mesh_.cellCentres()[mesh_.faceOwner()[faceI]]
|
||||
<< mesh_.cellCentres()[mesh_.faceOwner()[facei]]
|
||||
<< " neiCc:"
|
||||
<< mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]]
|
||||
<< mesh_.cellCentres()[mesh_.faceNeighbour()[facei]]
|
||||
<< endl;
|
||||
}
|
||||
else if
|
||||
(
|
||||
surfaceIndex_[faceI]
|
||||
!= neiHit[faceI-mesh_.nInternalFaces()]
|
||||
surfaceIndex_[facei]
|
||||
!= neiHit[facei-mesh_.nInternalFaces()]
|
||||
)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Boundary face:" << faceI
|
||||
<< " fc:" << mesh_.faceCentres()[faceI]
|
||||
<< " cached surfaceIndex_:" << surfaceIndex_[faceI]
|
||||
<< " current:" << surfaceHit[faceI]
|
||||
<< "Boundary face:" << facei
|
||||
<< " fc:" << mesh_.faceCentres()[facei]
|
||||
<< " cached surfaceIndex_:" << surfaceIndex_[facei]
|
||||
<< " current:" << surfaceHit[facei]
|
||||
<< " ownCc:"
|
||||
<< mesh_.cellCentres()[mesh_.faceOwner()[faceI]]
|
||||
<< " end:" << end[faceI]
|
||||
<< mesh_.cellCentres()[mesh_.faceOwner()[facei]]
|
||||
<< " end:" << end[facei]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
@ -681,8 +681,8 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitFaces
|
||||
|
||||
forAll(splitFaces, i)
|
||||
{
|
||||
label faceI = splitFaces[i];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
label facei = splitFaces[i];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
|
||||
// Split as start and end index in face
|
||||
@ -716,28 +716,28 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitFaces
|
||||
|
||||
|
||||
// Determine face properties
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label nei = -1;
|
||||
label patchI = -1;
|
||||
if (faceI >= mesh_.nInternalFaces())
|
||||
label patchi = -1;
|
||||
if (facei >= mesh_.nInternalFaces())
|
||||
{
|
||||
patchI = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
patchi = mesh_.boundaryMesh().whichPatch(facei);
|
||||
}
|
||||
else
|
||||
{
|
||||
nei = mesh_.faceNeighbour()[faceI];
|
||||
nei = mesh_.faceNeighbour()[facei];
|
||||
}
|
||||
|
||||
label zoneI = mesh_.faceZones().whichZone(faceI);
|
||||
label zoneI = mesh_.faceZones().whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
if (zoneI != -1)
|
||||
{
|
||||
const faceZone& fz = mesh_.faceZones()[zoneI];
|
||||
zoneFlip = fz.flipMap()[fz.whichFace(faceI)];
|
||||
zoneFlip = fz.flipMap()[fz.whichFace(facei)];
|
||||
}
|
||||
|
||||
|
||||
Pout<< "face:" << faceI << " verts:" << f
|
||||
Pout<< "face:" << facei << " verts:" << f
|
||||
<< " split into f0:" << f0
|
||||
<< " f1:" << f1 << endl;
|
||||
|
||||
@ -745,11 +745,11 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
meshMod.modifyFace
|
||||
(
|
||||
f0, // modified face
|
||||
faceI, // label of face
|
||||
facei, // label of face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchI, // patch for face
|
||||
patchi, // patch for face
|
||||
zoneI, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
);
|
||||
@ -760,9 +760,9 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
nei, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
faceI, // master face
|
||||
facei, // master face
|
||||
false, // face flip
|
||||
patchI, // patch for face
|
||||
patchi, // patch for face
|
||||
zoneI, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
);
|
||||
@ -797,13 +797,13 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
// Add added faces (every splitFaces becomes two faces)
|
||||
label sz = newSplitFaces.size();
|
||||
newSplitFaces.setSize(2*sz);
|
||||
forAll(map().faceMap(), faceI)
|
||||
forAll(map().faceMap(), facei)
|
||||
{
|
||||
label oldFaceI = map().faceMap()[faceI];
|
||||
if (oldToNew[oldFaceI] != faceI)
|
||||
label oldFaceI = map().faceMap()[facei];
|
||||
if (oldToNew[oldFaceI] != facei)
|
||||
{
|
||||
// Added face
|
||||
newSplitFaces[sz++] = faceI;
|
||||
newSplitFaces[sz++] = facei;
|
||||
}
|
||||
}
|
||||
|
||||
@ -825,27 +825,27 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
//{
|
||||
// const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
//
|
||||
// forAll(patches, patchI)
|
||||
// forAll(patches, patchi)
|
||||
// {
|
||||
// const polyPatch& pp = patches[patchI];
|
||||
// const polyPatch& pp = patches[patchi];
|
||||
//
|
||||
// if (isA<processorPolyPatch>(pp))
|
||||
// {
|
||||
// forAll(pp, i)
|
||||
// {
|
||||
// label faceI = pp.start()+i;
|
||||
// label facei = pp.start()+i;
|
||||
//
|
||||
// if (!blockedFace[faceI])
|
||||
// if (!blockedFace[facei])
|
||||
// {
|
||||
// // Only if there is a connection to the neighbour
|
||||
// // will there be a multi-domain region; if not through
|
||||
// // this face then through another.
|
||||
//
|
||||
// label cellI = mesh_.faceOwner()[faceI];
|
||||
// label globalCellI = globalCells.toGlobal(cellI);
|
||||
// label celli = mesh_.faceOwner()[facei];
|
||||
// label globalCellI = globalCells.toGlobal(celli);
|
||||
//
|
||||
// Map<label>::iterator iter =
|
||||
// regionToMaster.find(globalRegion[cellI]);
|
||||
// regionToMaster.find(globalRegion[celli]);
|
||||
//
|
||||
// if (iter != regionToMaster.end())
|
||||
// {
|
||||
@ -856,7 +856,7 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
// {
|
||||
// regionToMaster.insert
|
||||
// (
|
||||
// globalRegion[cellI],
|
||||
// globalRegion[celli],
|
||||
// globalCellI
|
||||
// );
|
||||
// }
|
||||
@ -887,24 +887,24 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
// DynamicList<point> localCc(globalRegion.size()/2);
|
||||
// DynamicList<scalar> localWts(globalRegion.size()/2);
|
||||
//
|
||||
// forAll(globalRegion, cellI)
|
||||
// forAll(globalRegion, celli)
|
||||
// {
|
||||
// Map<label>::const_iterator fndMaster =
|
||||
// coupledRegionToMaster.find(globalRegion[cellI]);
|
||||
// coupledRegionToMaster.find(globalRegion[celli]);
|
||||
//
|
||||
// if (fndMaster != coupledRegionToMaster.end())
|
||||
// {
|
||||
// // Multi-processor region.
|
||||
// if (globalCells.toGlobal(cellI) == fndMaster())
|
||||
// if (globalCells.toGlobal(celli) == fndMaster())
|
||||
// {
|
||||
// // I am master. Allocate region for me.
|
||||
// globalToLocalRegion.insert
|
||||
// (
|
||||
// globalRegion[cellI],
|
||||
// globalRegion[celli],
|
||||
// localCc.size()
|
||||
// );
|
||||
// localCc.append(mesh_.cellCentres()[cellI]);
|
||||
// localWts.append(cellWeights[cellI]);
|
||||
// localCc.append(mesh_.cellCentres()[celli]);
|
||||
// localWts.append(cellWeights[celli]);
|
||||
// }
|
||||
// }
|
||||
// else
|
||||
@ -914,13 +914,13 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
// (
|
||||
// globalToLocalRegion.insert
|
||||
// (
|
||||
// globalRegion[cellI],
|
||||
// globalRegion[celli],
|
||||
// localCc.size()
|
||||
// )
|
||||
// )
|
||||
// {
|
||||
// localCc.append(mesh_.cellCentres()[cellI]);
|
||||
// localWts.append(cellWeights[cellI]);
|
||||
// localCc.append(mesh_.cellCentres()[celli]);
|
||||
// localWts.append(cellWeights[celli]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -1038,10 +1038,10 @@ Pout<< "face:" << faceI << " verts:" << f
|
||||
//
|
||||
// // Add all local connectivity to regionRegions; add all non-local
|
||||
// // to the transferlists.
|
||||
// for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
// for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
// {
|
||||
// label ownRegion = globalRegion[mesh_.faceOwner()[faceI]];
|
||||
// label neiRegion = globalRegion[mesh_.faceNeighbour()[faceI]];
|
||||
// label ownRegion = globalRegion[mesh_.faceOwner()[facei]];
|
||||
// label neiRegion = globalRegion[mesh_.faceNeighbour()[facei]];
|
||||
//
|
||||
// if (ownRegion != neiRegion)
|
||||
// {
|
||||
@ -1213,9 +1213,9 @@ Foam::label Foam::meshRefinement::countHits() const
|
||||
|
||||
label nHits = 0;
|
||||
|
||||
forAll(surfaceIndex_, faceI)
|
||||
forAll(surfaceIndex_, facei)
|
||||
{
|
||||
if (surfaceIndex_[faceI] >= 0 && isMasterFace.get(faceI) == 1)
|
||||
if (surfaceIndex_[facei] >= 0 && isMasterFace.get(facei) == 1)
|
||||
{
|
||||
nHits++;
|
||||
}
|
||||
@ -1346,21 +1346,21 @@ Foam::label Foam::meshRefinement::countHits() const
|
||||
// // Determine destination for all cells
|
||||
// labelList distribution(mesh_.nCells());
|
||||
//
|
||||
// forAll(globalRegion, cellI)
|
||||
// forAll(globalRegion, celli)
|
||||
// {
|
||||
// Map<label>::const_iterator fndRegion =
|
||||
// regionToDist.find(globalRegion[cellI]);
|
||||
// regionToDist.find(globalRegion[celli]);
|
||||
//
|
||||
// if (fndRegion != regionToDist.end())
|
||||
// {
|
||||
// distribution[cellI] = fndRegion();
|
||||
// distribution[celli] = fndRegion();
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// // region is local to the processor.
|
||||
// label localRegionI = globalToLocalRegion[globalRegion[cellI]];
|
||||
// label localRegionI = globalToLocalRegion[globalRegion[celli]];
|
||||
//
|
||||
// distribution[cellI] = regionDistribution[localRegionI];
|
||||
// distribution[celli] = regionDistribution[localRegionI];
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@ -1444,16 +1444,16 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
|
||||
|
||||
forAll(fZone, i)
|
||||
{
|
||||
label faceI = fZone[i];
|
||||
if (blockedFace[faceI])
|
||||
label facei = fZone[i];
|
||||
if (blockedFace[facei])
|
||||
{
|
||||
if
|
||||
(
|
||||
mesh_.isInternalFace(faceI)
|
||||
|| pbm[pbm.whichPatch(faceI)].coupled()
|
||||
mesh_.isInternalFace(facei)
|
||||
|| pbm[pbm.whichPatch(facei)].coupled()
|
||||
)
|
||||
{
|
||||
blockedFace[faceI] = false;
|
||||
blockedFace[facei] = false;
|
||||
nUnblocked++;
|
||||
}
|
||||
}
|
||||
@ -1487,13 +1487,13 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
|
||||
selectSeparatedCoupledFaces(separatedCoupledFace);
|
||||
|
||||
label nSeparated = 0;
|
||||
forAll(separatedCoupledFace, faceI)
|
||||
forAll(separatedCoupledFace, facei)
|
||||
{
|
||||
if (separatedCoupledFace[faceI])
|
||||
if (separatedCoupledFace[facei])
|
||||
{
|
||||
if (blockedFace[faceI])
|
||||
if (blockedFace[facei])
|
||||
{
|
||||
blockedFace[faceI] = false;
|
||||
blockedFace[facei] = false;
|
||||
nSeparated++;
|
||||
}
|
||||
}
|
||||
@ -1536,11 +1536,11 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::meshRefinement::balance
|
||||
|
||||
couples.setSize(nBnd);
|
||||
label nCpl = 0;
|
||||
forAll(coupledFace, faceI)
|
||||
forAll(coupledFace, facei)
|
||||
{
|
||||
if (coupledFace[faceI] != -1 && faceI < coupledFace[faceI])
|
||||
if (coupledFace[facei] != -1 && facei < coupledFace[facei])
|
||||
{
|
||||
couples[nCpl++] = labelPair(faceI, coupledFace[faceI]);
|
||||
couples[nCpl++] = labelPair(facei, coupledFace[facei]);
|
||||
}
|
||||
}
|
||||
couples.setSize(nCpl);
|
||||
@ -1653,9 +1653,9 @@ Foam::labelList Foam::meshRefinement::intersectedFaces() const
|
||||
{
|
||||
label nBoundaryFaces = 0;
|
||||
|
||||
forAll(surfaceIndex_, faceI)
|
||||
forAll(surfaceIndex_, facei)
|
||||
{
|
||||
if (surfaceIndex_[faceI] != -1)
|
||||
if (surfaceIndex_[facei] != -1)
|
||||
{
|
||||
nBoundaryFaces++;
|
||||
}
|
||||
@ -1664,11 +1664,11 @@ Foam::labelList Foam::meshRefinement::intersectedFaces() const
|
||||
labelList surfaceFaces(nBoundaryFaces);
|
||||
nBoundaryFaces = 0;
|
||||
|
||||
forAll(surfaceIndex_, faceI)
|
||||
forAll(surfaceIndex_, facei)
|
||||
{
|
||||
if (surfaceIndex_[faceI] != -1)
|
||||
if (surfaceIndex_[facei] != -1)
|
||||
{
|
||||
surfaceFaces[nBoundaryFaces++] = faceI;
|
||||
surfaceFaces[nBoundaryFaces++] = facei;
|
||||
}
|
||||
}
|
||||
return surfaceFaces;
|
||||
@ -1684,11 +1684,11 @@ Foam::labelList Foam::meshRefinement::intersectedPoints() const
|
||||
PackedBoolList isBoundaryPoint(mesh_.nPoints());
|
||||
label nBoundaryPoints = 0;
|
||||
|
||||
forAll(surfaceIndex_, faceI)
|
||||
forAll(surfaceIndex_, facei)
|
||||
{
|
||||
if (surfaceIndex_[faceI] != -1)
|
||||
if (surfaceIndex_[facei] != -1)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const face& f = faces[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -1704,17 +1704,17 @@ Foam::labelList Foam::meshRefinement::intersectedPoints() const
|
||||
//labelList adaptPatchIDs(meshedPatches());
|
||||
//forAll(adaptPatchIDs, i)
|
||||
//{
|
||||
// label patchI = adaptPatchIDs[i];
|
||||
// label patchi = adaptPatchIDs[i];
|
||||
//
|
||||
// if (patchI != -1)
|
||||
// if (patchi != -1)
|
||||
// {
|
||||
// const polyPatch& pp = mesh_.boundaryMesh()[patchI];
|
||||
// const polyPatch& pp = mesh_.boundaryMesh()[patchi];
|
||||
//
|
||||
// label faceI = pp.start();
|
||||
// label facei = pp.start();
|
||||
//
|
||||
// forAll(pp, i)
|
||||
// {
|
||||
// const face& f = faces[faceI];
|
||||
// const face& f = faces[facei];
|
||||
//
|
||||
// forAll(f, fp)
|
||||
// {
|
||||
@ -1722,7 +1722,7 @@ Foam::labelList Foam::meshRefinement::intersectedPoints() const
|
||||
// nBoundaryPoints++;
|
||||
// }
|
||||
// }
|
||||
// faceI++;
|
||||
// facei++;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@ -1812,15 +1812,15 @@ Foam::tmp<Foam::pointVectorField> Foam::meshRefinement::makeDisplacementField
|
||||
fixedValuePointPatchVectorField::typeName;
|
||||
}
|
||||
|
||||
forAll(pointPatches, patchI)
|
||||
forAll(pointPatches, patchi)
|
||||
{
|
||||
if (isA<processorPointPatch>(pointPatches[patchI]))
|
||||
if (isA<processorPointPatch>(pointPatches[patchi]))
|
||||
{
|
||||
patchFieldTypes[patchI] = calculatedPointPatchVectorField::typeName;
|
||||
patchFieldTypes[patchi] = calculatedPointPatchVectorField::typeName;
|
||||
}
|
||||
else if (isA<cyclicPointPatch>(pointPatches[patchI]))
|
||||
else if (isA<cyclicPointPatch>(pointPatches[patchi]))
|
||||
{
|
||||
patchFieldTypes[patchI] = cyclicSlipPointPatchVectorField::typeName;
|
||||
patchFieldTypes[patchi] = cyclicSlipPointPatchVectorField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2005,13 +2005,13 @@ Foam::label Foam::meshRefinement::appendPatch
|
||||
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
||||
fvBoundaryMesh& fvPatches = const_cast<fvBoundaryMesh&>(mesh.boundary());
|
||||
|
||||
label patchI = polyPatches.size();
|
||||
label patchi = polyPatches.size();
|
||||
|
||||
// Add polyPatch at the end
|
||||
polyPatches.setSize(patchI+1);
|
||||
polyPatches.setSize(patchi+1);
|
||||
polyPatches.set
|
||||
(
|
||||
patchI,
|
||||
patchi,
|
||||
polyPatch::New
|
||||
(
|
||||
patchName,
|
||||
@ -2020,13 +2020,13 @@ Foam::label Foam::meshRefinement::appendPatch
|
||||
polyPatches
|
||||
)
|
||||
);
|
||||
fvPatches.setSize(patchI+1);
|
||||
fvPatches.setSize(patchi+1);
|
||||
fvPatches.set
|
||||
(
|
||||
patchI,
|
||||
patchi,
|
||||
fvPatch::New
|
||||
(
|
||||
polyPatches[patchI], // point to newly added polyPatch
|
||||
polyPatches[patchi], // point to newly added polyPatch
|
||||
mesh.boundary()
|
||||
)
|
||||
);
|
||||
@ -2084,7 +2084,7 @@ Foam::label Foam::meshRefinement::appendPatch
|
||||
mesh,
|
||||
calculatedFvPatchField<tensor>::typeName
|
||||
);
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
|
||||
|
||||
@ -2100,24 +2100,24 @@ Foam::label Foam::meshRefinement::addPatch
|
||||
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
|
||||
fvBoundaryMesh& fvPatches = const_cast<fvBoundaryMesh&>(mesh.boundary());
|
||||
|
||||
const label patchI = polyPatches.findPatchID(patchName);
|
||||
if (patchI != -1)
|
||||
const label patchi = polyPatches.findPatchID(patchName);
|
||||
if (patchi != -1)
|
||||
{
|
||||
// Already there
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
|
||||
|
||||
label insertPatchI = polyPatches.size();
|
||||
label startFaceI = mesh.nFaces();
|
||||
|
||||
forAll(polyPatches, patchI)
|
||||
forAll(polyPatches, patchi)
|
||||
{
|
||||
const polyPatch& pp = polyPatches[patchI];
|
||||
const polyPatch& pp = polyPatches[patchi];
|
||||
|
||||
if (isA<processorPolyPatch>(pp))
|
||||
{
|
||||
insertPatchI = patchI;
|
||||
insertPatchI = patchi;
|
||||
startFaceI = pp.start();
|
||||
break;
|
||||
}
|
||||
@ -2183,7 +2183,7 @@ Foam::label Foam::meshRefinement::addMeshedPatch
|
||||
else
|
||||
{
|
||||
// Add patch
|
||||
label patchI = addPatch(mesh_, name, patchInfo);
|
||||
label patchi = addPatch(mesh_, name, patchInfo);
|
||||
|
||||
// dictionary patchDict(patchInfo);
|
||||
// patchDict.set("nFaces", 0);
|
||||
@ -2198,7 +2198,7 @@ Foam::label Foam::meshRefinement::addMeshedPatch
|
||||
// mesh_.boundaryMesh()
|
||||
// )
|
||||
// );
|
||||
// label patchI = fvMeshTools::addPatch
|
||||
// label patchi = fvMeshTools::addPatch
|
||||
// (
|
||||
// mesh_,
|
||||
// ppPtr(),
|
||||
@ -2210,7 +2210,7 @@ Foam::label Foam::meshRefinement::addMeshedPatch
|
||||
// Store
|
||||
meshedPatches_.append(name);
|
||||
|
||||
return patchI;
|
||||
return patchi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2222,18 +2222,18 @@ Foam::labelList Foam::meshRefinement::meshedPatches() const
|
||||
DynamicList<label> patchIDs(meshedPatches_.size());
|
||||
forAll(meshedPatches_, i)
|
||||
{
|
||||
label patchI = patches.findPatchID(meshedPatches_[i]);
|
||||
label patchi = patches.findPatchID(meshedPatches_[i]);
|
||||
|
||||
if (patchI == -1)
|
||||
if (patchi == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem : did not find patch " << meshedPatches_[i]
|
||||
<< endl << "Valid patches are " << patches.names()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
if (!polyPatch::constraintType(patches[patchI].type()))
|
||||
if (!polyPatch::constraintType(patches[patchi].type()))
|
||||
{
|
||||
patchIDs.append(patchI);
|
||||
patchIDs.append(patchi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2245,14 +2245,14 @@ void Foam::meshRefinement::selectSeparatedCoupledFaces(boolList& selected) const
|
||||
{
|
||||
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())
|
||||
@ -2276,20 +2276,20 @@ Foam::label Foam::meshRefinement::findRegion
|
||||
)
|
||||
{
|
||||
label regionI = -1;
|
||||
label cellI = mesh.findCell(p);
|
||||
if (cellI != -1)
|
||||
label celli = mesh.findCell(p);
|
||||
if (celli != -1)
|
||||
{
|
||||
regionI = cellToRegion[cellI];
|
||||
regionI = cellToRegion[celli];
|
||||
}
|
||||
reduce(regionI, maxOp<label>());
|
||||
|
||||
if (regionI == -1)
|
||||
{
|
||||
// See if we can perturb a bit
|
||||
cellI = mesh.findCell(p+perturbVec);
|
||||
if (cellI != -1)
|
||||
celli = mesh.findCell(p+perturbVec);
|
||||
if (celli != -1)
|
||||
{
|
||||
regionI = cellToRegion[cellI];
|
||||
regionI = cellToRegion[celli];
|
||||
}
|
||||
reduce(regionI, maxOp<label>());
|
||||
}
|
||||
@ -2337,11 +2337,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::splitMeshRegions
|
||||
|
||||
// Get cells to remove
|
||||
DynamicList<label> cellsToRemove(mesh_.nCells());
|
||||
forAll(cellRegion, cellI)
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
if (cellRegion[cellI] != regionI)
|
||||
if (cellRegion[celli] != regionI)
|
||||
{
|
||||
cellsToRemove.append(cellI);
|
||||
cellsToRemove.append(celli);
|
||||
}
|
||||
}
|
||||
cellsToRemove.shrink();
|
||||
@ -2522,13 +2522,13 @@ void Foam::meshRefinement::updateMesh
|
||||
// keep master only
|
||||
labelList newFaceData(map.faceMap().size(), -1);
|
||||
|
||||
forAll(newFaceData, faceI)
|
||||
forAll(newFaceData, facei)
|
||||
{
|
||||
label oldFaceI = map.faceMap()[faceI];
|
||||
label oldFaceI = map.faceMap()[facei];
|
||||
|
||||
if (oldFaceI >= 0 && map.reverseFaceMap()[oldFaceI] == faceI)
|
||||
if (oldFaceI >= 0 && map.reverseFaceMap()[oldFaceI] == facei)
|
||||
{
|
||||
newFaceData[faceI] = data[oldFaceI];
|
||||
newFaceData[facei] = data[oldFaceI];
|
||||
}
|
||||
}
|
||||
data.transfer(newFaceData);
|
||||
@ -2542,15 +2542,15 @@ void Foam::meshRefinement::updateMesh
|
||||
// These get marked with -1 in reverseFaceMap
|
||||
labelList reverseFaceMap(map.reverseFaceMap());
|
||||
|
||||
forAll(map.faceMap(), faceI)
|
||||
forAll(map.faceMap(), facei)
|
||||
{
|
||||
label oldFaceI = map.faceMap()[faceI];
|
||||
label oldFaceI = map.faceMap()[facei];
|
||||
|
||||
if (oldFaceI >= 0)
|
||||
{
|
||||
if (reverseFaceMap[oldFaceI] != faceI)
|
||||
if (reverseFaceMap[oldFaceI] != facei)
|
||||
{
|
||||
// faceI is slave face. Mark old face.
|
||||
// facei is slave face. Mark old face.
|
||||
reverseFaceMap[oldFaceI] = -1;
|
||||
}
|
||||
}
|
||||
@ -2558,15 +2558,15 @@ void Foam::meshRefinement::updateMesh
|
||||
|
||||
// 2. Map only faces with intact reverseFaceMap
|
||||
labelList newFaceData(map.faceMap().size(), -1);
|
||||
forAll(newFaceData, faceI)
|
||||
forAll(newFaceData, facei)
|
||||
{
|
||||
label oldFaceI = map.faceMap()[faceI];
|
||||
label oldFaceI = map.faceMap()[facei];
|
||||
|
||||
if (oldFaceI >= 0)
|
||||
{
|
||||
if (reverseFaceMap[oldFaceI] == faceI)
|
||||
if (reverseFaceMap[oldFaceI] == facei)
|
||||
{
|
||||
newFaceData[faceI] = data[oldFaceI];
|
||||
newFaceData[facei] = data[oldFaceI];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2738,9 +2738,9 @@ const
|
||||
|
||||
labelList nCells(gMax(cellLevel)+1, 0);
|
||||
|
||||
forAll(cellLevel, cellI)
|
||||
forAll(cellLevel, celli)
|
||||
{
|
||||
nCells[cellLevel[cellI]]++;
|
||||
nCells[cellLevel[celli]]++;
|
||||
}
|
||||
|
||||
Pstream::listCombineGather(nCells, plusEqOp<label>());
|
||||
@ -2791,9 +2791,9 @@ void Foam::meshRefinement::dumpRefinementLevel() const
|
||||
|
||||
const labelList& cellLevel = meshCutter_.cellLevel();
|
||||
|
||||
forAll(volRefLevel, cellI)
|
||||
forAll(volRefLevel, celli)
|
||||
{
|
||||
volRefLevel[cellI] = cellLevel[cellI];
|
||||
volRefLevel[celli] = cellLevel[celli];
|
||||
}
|
||||
|
||||
volRefLevel.write();
|
||||
@ -2858,16 +2858,16 @@ void Foam::meshRefinement::dumpIntersections(const fileName& prefix) const
|
||||
|
||||
forAll(intersectionFaces, i)
|
||||
{
|
||||
label faceI = intersectionFaces[i];
|
||||
start[i] = cellCentres[mesh_.faceOwner()[faceI]];
|
||||
label facei = intersectionFaces[i];
|
||||
start[i] = cellCentres[mesh_.faceOwner()[facei]];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
end[i] = cellCentres[mesh_.faceNeighbour()[faceI]];
|
||||
end[i] = cellCentres[mesh_.faceNeighbour()[facei]];
|
||||
}
|
||||
else
|
||||
{
|
||||
end[i] = neiCc[faceI-mesh_.nInternalFaces()];
|
||||
end[i] = neiCc[facei-mesh_.nInternalFaces()];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -337,7 +337,7 @@ private:
|
||||
const vector& surfaceLocation,
|
||||
const vector& surfaceNormal,
|
||||
|
||||
const label cellI,
|
||||
const label celli,
|
||||
|
||||
label& cellMaxLevel,
|
||||
vector& cellMaxLocation,
|
||||
@ -384,7 +384,7 @@ private:
|
||||
// Returns label of added face.
|
||||
label createBaffle
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label ownPatch,
|
||||
const label neiPatch,
|
||||
polyTopoChange& meshMod
|
||||
@ -396,7 +396,7 @@ private:
|
||||
// markFacesOnProblemCells
|
||||
void markBoundaryFace
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
boolList& isBoundaryFace,
|
||||
boolList& isBoundaryEdge,
|
||||
boolList& isBoundaryPoint
|
||||
@ -423,14 +423,14 @@ private:
|
||||
const pointField& neiCc,
|
||||
const scalar minFaceArea,
|
||||
const scalar maxNonOrtho,
|
||||
const label faceI
|
||||
const label facei
|
||||
) const;
|
||||
|
||||
bool isCollapsedCell
|
||||
(
|
||||
const pointField&,
|
||||
const scalar volFraction,
|
||||
const label cellI
|
||||
const label celli
|
||||
) const;
|
||||
|
||||
//- Returns list with for every internal face -1 or the patch
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -52,9 +52,9 @@ License
|
||||
//
|
||||
// forAll(patchIDs, i)
|
||||
// {
|
||||
// label patchI = patchIDs[i];
|
||||
// label patchi = patchIDs[i];
|
||||
//
|
||||
// const polyPatch& patch = patches[patchI];
|
||||
// const polyPatch& patch = patches[patchi];
|
||||
//
|
||||
// if (!patch.coupled())
|
||||
// {
|
||||
@ -122,10 +122,10 @@ License
|
||||
// {
|
||||
// label oldMasterI = mergeSets[setI][0];
|
||||
//
|
||||
// label faceI = map().reverseFaceMap()[oldMasterI];
|
||||
// label facei = map().reverseFaceMap()[oldMasterI];
|
||||
//
|
||||
// // faceI is always uncoupled boundary face
|
||||
// const cell& cFaces = mesh_.cells()[mesh_.faceOwner()[faceI]];
|
||||
// // facei is always uncoupled boundary face
|
||||
// const cell& cFaces = mesh_.cells()[mesh_.faceOwner()[facei]];
|
||||
//
|
||||
// forAll(cFaces, i)
|
||||
// {
|
||||
@ -169,15 +169,15 @@ License
|
||||
// {
|
||||
// const faceList& faces = mesh_.faces();
|
||||
//
|
||||
// forAll(faces, faceI)
|
||||
// forAll(faces, facei)
|
||||
// {
|
||||
// const face& f = faces[faceI];
|
||||
// const face& f = faces[facei];
|
||||
//
|
||||
// forAll(f, fp)
|
||||
// {
|
||||
// if (pointCanBeDeleted[f[fp]])
|
||||
// {
|
||||
// retestOldFaces.insert(faceI);
|
||||
// retestOldFaces.insert(facei);
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
@ -218,18 +218,18 @@ License
|
||||
//
|
||||
// forAllConstIter(labelHashSet, retestOldFaces, iter)
|
||||
// {
|
||||
// label faceI = map().reverseFaceMap()[iter.key()];
|
||||
// label facei = map().reverseFaceMap()[iter.key()];
|
||||
//
|
||||
// const cell& ownFaces = cells[mesh_.faceOwner()[faceI]];
|
||||
// const cell& ownFaces = cells[mesh_.faceOwner()[facei]];
|
||||
//
|
||||
// forAll(ownFaces, i)
|
||||
// {
|
||||
// retestFaces.insert(ownFaces[i]);
|
||||
// }
|
||||
//
|
||||
// if (mesh_.isInternalFace(faceI))
|
||||
// if (mesh_.isInternalFace(facei))
|
||||
// {
|
||||
// const cell& neiFaces = cells[mesh_.faceNeighbour()[faceI]];
|
||||
// const cell& neiFaces = cells[mesh_.faceNeighbour()[facei]];
|
||||
//
|
||||
// forAll(neiFaces, i)
|
||||
// {
|
||||
@ -264,9 +264,9 @@ Foam::label Foam::meshRefinement::mergePatchFacesUndo
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
label patchi = patchIDs[i];
|
||||
|
||||
const polyPatch& patch = patches[patchI];
|
||||
const polyPatch& patch = patches[patchi];
|
||||
|
||||
if (!patch.coupled())
|
||||
{
|
||||
@ -661,10 +661,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRemovePoints
|
||||
labelHashSet retestFaces(pointRemover.savedFaceLabels().size());
|
||||
forAll(pointRemover.savedFaceLabels(), i)
|
||||
{
|
||||
label faceI = pointRemover.savedFaceLabels()[i];
|
||||
if (faceI >= 0)
|
||||
label facei = pointRemover.savedFaceLabels()[i];
|
||||
if (facei >= 0)
|
||||
{
|
||||
retestFaces.insert(faceI);
|
||||
retestFaces.insert(facei);
|
||||
}
|
||||
}
|
||||
updateMesh(map, growFaceCellFace(retestFaces));
|
||||
@ -732,10 +732,10 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::meshRefinement::doRestorePoints
|
||||
labelHashSet retestFaces(2*facesToRestore.size());
|
||||
forAll(facesToRestore, i)
|
||||
{
|
||||
label faceI = map().reverseFaceMap()[facesToRestore[i]];
|
||||
if (faceI >= 0)
|
||||
label facei = map().reverseFaceMap()[facesToRestore[i]];
|
||||
if (facei >= 0)
|
||||
{
|
||||
retestFaces.insert(faceI);
|
||||
retestFaces.insert(facei);
|
||||
}
|
||||
}
|
||||
updateMesh(map, growFaceCellFace(retestFaces));
|
||||
@ -765,11 +765,11 @@ Foam::labelList Foam::meshRefinement::collectFaces
|
||||
|
||||
forAll(candidateFaces, i)
|
||||
{
|
||||
label faceI = candidateFaces[i];
|
||||
label facei = candidateFaces[i];
|
||||
|
||||
if (set.found(faceI))
|
||||
if (set.found(facei))
|
||||
{
|
||||
selected[faceI] = true;
|
||||
selected[facei] = true;
|
||||
}
|
||||
}
|
||||
syncTools::syncFaceList
|
||||
@ -795,9 +795,9 @@ Foam::labelList Foam::meshRefinement::growFaceCellFace
|
||||
|
||||
forAllConstIter(faceSet, set, iter)
|
||||
{
|
||||
label faceI = iter.key();
|
||||
label facei = iter.key();
|
||||
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
const cell& ownFaces = mesh_.cells()[own];
|
||||
forAll(ownFaces, ownFaceI)
|
||||
@ -805,9 +805,9 @@ Foam::labelList Foam::meshRefinement::growFaceCellFace
|
||||
selected[ownFaces[ownFaceI]] = true;
|
||||
}
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nbr = mesh_.faceNeighbour()[faceI];
|
||||
label nbr = mesh_.faceNeighbour()[facei];
|
||||
|
||||
const cell& nbrFaces = mesh_.cells()[nbr];
|
||||
forAll(nbrFaces, nbrFaceI)
|
||||
|
||||
@ -47,22 +47,22 @@ License
|
||||
|
||||
void Foam::meshRefinement::markBoundaryFace
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
boolList& isBoundaryFace,
|
||||
boolList& isBoundaryEdge,
|
||||
boolList& isBoundaryPoint
|
||||
) const
|
||||
{
|
||||
isBoundaryFace[faceI] = true;
|
||||
isBoundaryFace[facei] = true;
|
||||
|
||||
const labelList& fEdges = mesh_.faceEdges(faceI);
|
||||
const labelList& fEdges = mesh_.faceEdges(facei);
|
||||
|
||||
forAll(fEdges, fp)
|
||||
{
|
||||
isBoundaryEdge[fEdges[fp]] = true;
|
||||
}
|
||||
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -241,9 +241,9 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
|
||||
|
||||
forAll(candidateFaces, i)
|
||||
{
|
||||
label faceI = candidateFaces[i];
|
||||
label facei = candidateFaces[i];
|
||||
|
||||
vector n = mesh_.faceAreas()[faceI];
|
||||
vector n = mesh_.faceAreas()[facei];
|
||||
n /= mag(n);
|
||||
|
||||
label region = surfaces_.globalRegion
|
||||
@ -258,10 +258,10 @@ Foam::Map<Foam::label> Foam::meshRefinement::findEdgeConnectedProblemCells
|
||||
{
|
||||
if (mag(n & nearestNormal[i]) < Foam::sin(angle))
|
||||
{
|
||||
perpFaces.insert(faceI);
|
||||
perpFaces.insert(facei);
|
||||
candidateCells.insert
|
||||
(
|
||||
mesh_.faceOwner()[faceI],
|
||||
mesh_.faceOwner()[facei],
|
||||
globalToPatch[region]
|
||||
);
|
||||
}
|
||||
@ -289,14 +289,14 @@ bool Foam::meshRefinement::isCollapsedFace
|
||||
const pointField& neiCc,
|
||||
const scalar minFaceArea,
|
||||
const scalar maxNonOrtho,
|
||||
const label faceI
|
||||
const label facei
|
||||
) const
|
||||
{
|
||||
// Severe nonorthogonality threshold
|
||||
const scalar severeNonorthogonalityThreshold =
|
||||
::cos(degToRad(maxNonOrtho));
|
||||
|
||||
vector s = mesh_.faces()[faceI].normal(points);
|
||||
vector s = mesh_.faces()[facei].normal(points);
|
||||
scalar magS = mag(s);
|
||||
|
||||
// Check face area
|
||||
@ -306,11 +306,11 @@ bool Foam::meshRefinement::isCollapsedFace
|
||||
}
|
||||
|
||||
// Check orthogonality
|
||||
const point& ownCc = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
||||
const point& ownCc = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
vector d = mesh_.cellCentres()[nei] - ownCc;
|
||||
|
||||
scalar dDotS = (d & s)/(mag(d)*magS + VSMALL);
|
||||
@ -326,11 +326,11 @@ bool Foam::meshRefinement::isCollapsedFace
|
||||
}
|
||||
else
|
||||
{
|
||||
label patchI = mesh_.boundaryMesh().whichPatch(faceI);
|
||||
label patchi = mesh_.boundaryMesh().whichPatch(facei);
|
||||
|
||||
if (mesh_.boundaryMesh()[patchI].coupled())
|
||||
if (mesh_.boundaryMesh()[patchi].coupled())
|
||||
{
|
||||
vector d = neiCc[faceI-mesh_.nInternalFaces()] - ownCc;
|
||||
vector d = neiCc[facei-mesh_.nInternalFaces()] - ownCc;
|
||||
|
||||
scalar dDotS = (d & s)/(mag(d)*magS + VSMALL);
|
||||
|
||||
@ -358,12 +358,12 @@ bool Foam::meshRefinement::isCollapsedCell
|
||||
(
|
||||
const pointField& points,
|
||||
const scalar volFraction,
|
||||
const label cellI
|
||||
const label celli
|
||||
) const
|
||||
{
|
||||
scalar vol = mesh_.cells()[cellI].mag(points, mesh_.faces());
|
||||
scalar vol = mesh_.cells()[celli].mag(points, mesh_.faces());
|
||||
|
||||
if (vol/mesh_.cellVolumes()[cellI] < volFraction)
|
||||
if (vol/mesh_.cellVolumes()[celli] < volFraction)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -406,13 +406,13 @@ Foam::labelList Foam::meshRefinement::nearestPatch
|
||||
nFaces = 0;
|
||||
forAll(adaptPatchIDs, i)
|
||||
{
|
||||
label patchI = adaptPatchIDs[i];
|
||||
const polyPatch& pp = patches[patchI];
|
||||
label patchi = adaptPatchIDs[i];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
patchFaces[nFaces] = pp.start()+i;
|
||||
patchData[nFaces] = topoDistanceData(patchI, 0);
|
||||
patchData[nFaces] = topoDistanceData(patchi, 0);
|
||||
nFaces++;
|
||||
}
|
||||
}
|
||||
@ -431,15 +431,15 @@ Foam::labelList Foam::meshRefinement::nearestPatch
|
||||
// And extract
|
||||
|
||||
bool haveWarned = false;
|
||||
forAll(faceData, faceI)
|
||||
forAll(faceData, facei)
|
||||
{
|
||||
if (!faceData[faceI].valid(deltaCalc.data()))
|
||||
if (!faceData[facei].valid(deltaCalc.data()))
|
||||
{
|
||||
if (!haveWarned)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Did not visit some faces, e.g. face " << faceI
|
||||
<< " at " << mesh_.faceCentres()[faceI] << endl
|
||||
<< "Did not visit some faces, e.g. face " << facei
|
||||
<< " at " << mesh_.faceCentres()[facei] << endl
|
||||
<< "Assigning these cells to patch "
|
||||
<< adaptPatchIDs[0]
|
||||
<< endl;
|
||||
@ -448,7 +448,7 @@ Foam::labelList Foam::meshRefinement::nearestPatch
|
||||
}
|
||||
else
|
||||
{
|
||||
nearestAdaptPatch[faceI] = faceData[faceI].data();
|
||||
nearestAdaptPatch[facei] = faceData[facei].data();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -495,19 +495,19 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
{
|
||||
const polyPatch& pp = patches[adaptPatchIDs[i]];
|
||||
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
|
||||
forAll(pp, j)
|
||||
{
|
||||
markBoundaryFace
|
||||
(
|
||||
faceI,
|
||||
facei,
|
||||
isBoundaryFace,
|
||||
isBoundaryEdge,
|
||||
isBoundaryPoint
|
||||
);
|
||||
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -557,17 +557,17 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
label faceI = cFaces[i];
|
||||
label facei = cFaces[i];
|
||||
|
||||
if (facePatch[faceI] == -1 && mesh_.isInternalFace(faceI))
|
||||
if (facePatch[facei] == -1 && mesh_.isInternalFace(facei))
|
||||
{
|
||||
facePatch[faceI] = nearestAdaptPatch[faceI];
|
||||
facePatch[facei] = nearestAdaptPatch[facei];
|
||||
nBaffleFaces++;
|
||||
|
||||
// Mark face as a 'boundary'
|
||||
markBoundaryFace
|
||||
(
|
||||
faceI,
|
||||
facei,
|
||||
isBoundaryFace,
|
||||
isBoundaryEdge,
|
||||
isBoundaryPoint
|
||||
@ -719,9 +719,9 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
DynamicList<label> dynFEdges;
|
||||
DynamicList<label> dynCPoints;
|
||||
|
||||
forAll(cellLevel, cellI)
|
||||
forAll(cellLevel, celli)
|
||||
{
|
||||
const labelList& cPoints = mesh_.cellPoints(cellI, dynCPoints);
|
||||
const labelList& cPoints = mesh_.cellPoints(celli, dynCPoints);
|
||||
|
||||
// Get number of anchor points (pointLevel <= cellLevel)
|
||||
|
||||
@ -733,7 +733,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
{
|
||||
label pointI = cPoints[i];
|
||||
|
||||
if (pointLevel[pointI] <= cellLevel[cellI])
|
||||
if (pointLevel[pointI] <= cellLevel[celli])
|
||||
{
|
||||
// Anchor point
|
||||
if (isBoundaryPoint[pointI])
|
||||
@ -754,7 +754,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
|
||||
if (nBoundaryAnchors == 8)
|
||||
{
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
// Count boundary faces.
|
||||
label nBfaces = 0;
|
||||
@ -777,16 +777,16 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
if
|
||||
(
|
||||
checkCollapse
|
||||
&& !isCollapsedCell(newPoints, volFraction, cellI)
|
||||
&& !isCollapsedCell(newPoints, volFraction, celli)
|
||||
)
|
||||
{
|
||||
nPrevented++;
|
||||
//Pout<< "Preventing baffling/removal of 8 anchor point"
|
||||
// << " cell "
|
||||
// << cellI << " at " << mesh_.cellCentres()[cellI]
|
||||
// << celli << " at " << mesh_.cellCentres()[celli]
|
||||
// << " since new volume "
|
||||
// << mesh_.cells()[cellI].mag(newPoints, mesh_.faces())
|
||||
// << " old volume " << mesh_.cellVolumes()[cellI]
|
||||
// << mesh_.cells()[celli].mag(newPoints, mesh_.faces())
|
||||
// << " old volume " << mesh_.cellVolumes()[celli]
|
||||
// << endl;
|
||||
}
|
||||
else
|
||||
@ -794,21 +794,21 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
// Block all faces of cell
|
||||
forAll(cFaces, cf)
|
||||
{
|
||||
label faceI = cFaces[cf];
|
||||
label facei = cFaces[cf];
|
||||
|
||||
if
|
||||
(
|
||||
facePatch[faceI] == -1
|
||||
&& mesh_.isInternalFace(faceI)
|
||||
facePatch[facei] == -1
|
||||
&& mesh_.isInternalFace(facei)
|
||||
)
|
||||
{
|
||||
facePatch[faceI] = nearestAdaptPatch[faceI];
|
||||
facePatch[facei] = nearestAdaptPatch[facei];
|
||||
nBaffleFaces++;
|
||||
|
||||
// Mark face as a 'boundary'
|
||||
markBoundaryFace
|
||||
(
|
||||
faceI,
|
||||
facei,
|
||||
isBoundaryFace,
|
||||
isBoundaryEdge,
|
||||
isBoundaryPoint
|
||||
@ -821,7 +821,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
else if (nBoundaryAnchors == 7)
|
||||
{
|
||||
// Mark the cell. Store the (single!) non-boundary anchor point.
|
||||
hasSevenBoundaryAnchorPoints.set(cellI, 1u);
|
||||
hasSevenBoundaryAnchorPoints.set(celli, 1u);
|
||||
nonBoundaryAnchors.insert(nonBoundaryAnchor);
|
||||
}
|
||||
}
|
||||
@ -855,47 +855,47 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
// Point in danger of being what? Remove all 7-cells.
|
||||
forAll(pCells, i)
|
||||
{
|
||||
label cellI = pCells[i];
|
||||
label celli = pCells[i];
|
||||
|
||||
if (hasSevenBoundaryAnchorPoints.get(cellI) == 1u)
|
||||
if (hasSevenBoundaryAnchorPoints.get(celli) == 1u)
|
||||
{
|
||||
if
|
||||
(
|
||||
checkCollapse
|
||||
&& !isCollapsedCell(newPoints, volFraction, cellI)
|
||||
&& !isCollapsedCell(newPoints, volFraction, celli)
|
||||
)
|
||||
{
|
||||
nPrevented++;
|
||||
//Pout<< "Preventing baffling of 7 anchor cell "
|
||||
// << cellI
|
||||
// << " at " << mesh_.cellCentres()[cellI]
|
||||
// << celli
|
||||
// << " at " << mesh_.cellCentres()[celli]
|
||||
// << " since new volume "
|
||||
// << mesh_.cells()[cellI].mag
|
||||
// << mesh_.cells()[celli].mag
|
||||
// (newPoints, mesh_.faces())
|
||||
// << " old volume " << mesh_.cellVolumes()[cellI]
|
||||
// << " old volume " << mesh_.cellVolumes()[celli]
|
||||
// << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
const cell& cFaces = mesh_.cells()[cellI];
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
forAll(cFaces, cf)
|
||||
{
|
||||
label faceI = cFaces[cf];
|
||||
label facei = cFaces[cf];
|
||||
|
||||
if
|
||||
(
|
||||
facePatch[faceI] == -1
|
||||
&& mesh_.isInternalFace(faceI)
|
||||
facePatch[facei] == -1
|
||||
&& mesh_.isInternalFace(facei)
|
||||
)
|
||||
{
|
||||
facePatch[faceI] = nearestAdaptPatch[faceI];
|
||||
facePatch[facei] = nearestAdaptPatch[facei];
|
||||
nBaffleFaces++;
|
||||
|
||||
// Mark face as a 'boundary'
|
||||
markBoundaryFace
|
||||
(
|
||||
faceI,
|
||||
facei,
|
||||
isBoundaryFace,
|
||||
isBoundaryEdge,
|
||||
isBoundaryPoint
|
||||
@ -937,11 +937,11 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
|
||||
|
||||
// Find faces with all edges on the boundary and make them baffles
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
if (facePatch[faceI] == -1)
|
||||
if (facePatch[facei] == -1)
|
||||
{
|
||||
const labelList& fEdges = mesh_.faceEdges(faceI, dynFEdges);
|
||||
const labelList& fEdges = mesh_.faceEdges(facei, dynFEdges);
|
||||
label nFaceBoundaryEdges = 0;
|
||||
|
||||
forAll(fEdges, fe)
|
||||
@ -963,20 +963,20 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
neiCc,
|
||||
minArea,
|
||||
maxNonOrtho,
|
||||
faceI
|
||||
facei
|
||||
)
|
||||
)
|
||||
{
|
||||
nPrevented++;
|
||||
//Pout<< "Preventing baffling (to avoid collapse) of face "
|
||||
// << faceI
|
||||
// << facei
|
||||
// << " with all boundary edges "
|
||||
// << " at " << mesh_.faceCentres()[faceI]
|
||||
// << " at " << mesh_.faceCentres()[facei]
|
||||
// << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
facePatch[faceI] = nearestAdaptPatch[faceI];
|
||||
facePatch[facei] = nearestAdaptPatch[facei];
|
||||
nBaffleFaces++;
|
||||
|
||||
// Do NOT update boundary data since this would grow blocked
|
||||
@ -986,19 +986,19 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
}
|
||||
}
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
if (pp.coupled())
|
||||
{
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
if (facePatch[faceI] == -1)
|
||||
if (facePatch[facei] == -1)
|
||||
{
|
||||
const labelList& fEdges = mesh_.faceEdges(faceI, dynFEdges);
|
||||
const labelList& fEdges = mesh_.faceEdges(facei, dynFEdges);
|
||||
label nFaceBoundaryEdges = 0;
|
||||
|
||||
forAll(fEdges, fe)
|
||||
@ -1020,21 +1020,21 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
neiCc,
|
||||
minArea,
|
||||
maxNonOrtho,
|
||||
faceI
|
||||
facei
|
||||
)
|
||||
)
|
||||
{
|
||||
nPrevented++;
|
||||
//Pout<< "Preventing baffling of coupled face "
|
||||
// << faceI
|
||||
// << facei
|
||||
// << " with all boundary edges "
|
||||
// << " at " << mesh_.faceCentres()[faceI]
|
||||
// << " at " << mesh_.faceCentres()[facei]
|
||||
// << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
facePatch[faceI] = nearestAdaptPatch[faceI];
|
||||
if (isMasterFace[faceI])
|
||||
facePatch[facei] = nearestAdaptPatch[facei];
|
||||
if (isMasterFace[facei])
|
||||
{
|
||||
nBaffleFaces++;
|
||||
}
|
||||
@ -1045,7 +1045,7 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
|
||||
}
|
||||
}
|
||||
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1297,15 +1297,15 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCellsGeometric
|
||||
|
||||
forAllConstIter(faceSet, wrongFaces, iter)
|
||||
{
|
||||
label patchI = mesh_.boundaryMesh().whichPatch(iter.key());
|
||||
label patchi = mesh_.boundaryMesh().whichPatch(iter.key());
|
||||
|
||||
if (patchI == -1 || mesh_.boundaryMesh()[patchI].coupled())
|
||||
if (patchi == -1 || mesh_.boundaryMesh()[patchi].coupled())
|
||||
{
|
||||
facePatch[iter.key()] = nearestAdaptPatch[iter.key()];
|
||||
nBaffleFaces++;
|
||||
|
||||
//Pout<< " " << iter.key()
|
||||
// //<< " on patch " << mesh_.boundaryMesh()[patchI].name()
|
||||
// //<< " on patch " << mesh_.boundaryMesh()[patchi].name()
|
||||
// << " is destined for patch " << facePatch[iter.key()]
|
||||
// << endl;
|
||||
}
|
||||
|
||||
@ -154,10 +154,10 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
|
||||
|
||||
// 1. Internal faces
|
||||
|
||||
for (label faceI = 0; faceI < nInternalFaces; faceI++)
|
||||
for (label facei = 0; facei < nInternalFaces; facei++)
|
||||
{
|
||||
label oldOwn = map.cellMap()[faceOwner[faceI]];
|
||||
label oldNei = map.cellMap()[faceNeighbour[faceI]];
|
||||
label oldOwn = map.cellMap()[faceOwner[facei]];
|
||||
label oldNei = map.cellMap()[faceNeighbour[facei]];
|
||||
|
||||
if
|
||||
(
|
||||
@ -171,7 +171,7 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
|
||||
}
|
||||
else
|
||||
{
|
||||
refinedInternalFace.set(faceI, 1u);
|
||||
refinedInternalFace.set(facei, 1u);
|
||||
}
|
||||
}
|
||||
|
||||
@ -180,15 +180,15 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
|
||||
|
||||
boolList refinedBoundaryFace(mesh.nFaces()-nInternalFaces, false);
|
||||
|
||||
forAll(mesh.boundaryMesh(), patchI)
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||
|
||||
label faceI = pp.start();
|
||||
label facei = pp.start();
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
label oldOwn = map.cellMap()[faceOwner[faceI]];
|
||||
label oldOwn = map.cellMap()[faceOwner[facei]];
|
||||
|
||||
if (oldOwn >= 0 && oldRefineCell.get(oldOwn) == 0u)
|
||||
{
|
||||
@ -196,9 +196,9 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
|
||||
}
|
||||
else
|
||||
{
|
||||
refinedBoundaryFace[faceI-nInternalFaces] = true;
|
||||
refinedBoundaryFace[facei-nInternalFaces] = true;
|
||||
}
|
||||
faceI++;
|
||||
facei++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -216,16 +216,16 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
|
||||
// - refinedBoundaryFace
|
||||
boolList changedFace(mesh.nFaces(), false);
|
||||
|
||||
forAll(refinedInternalFace, faceI)
|
||||
forAll(refinedInternalFace, facei)
|
||||
{
|
||||
if (refinedInternalFace.get(faceI) == 1u)
|
||||
if (refinedInternalFace.get(facei) == 1u)
|
||||
{
|
||||
const cell& ownFaces = cells[faceOwner[faceI]];
|
||||
const cell& ownFaces = cells[faceOwner[facei]];
|
||||
forAll(ownFaces, ownI)
|
||||
{
|
||||
changedFace[ownFaces[ownI]] = true;
|
||||
}
|
||||
const cell& neiFaces = cells[faceNeighbour[faceI]];
|
||||
const cell& neiFaces = cells[faceNeighbour[facei]];
|
||||
forAll(neiFaces, neiI)
|
||||
{
|
||||
changedFace[neiFaces[neiI]] = true;
|
||||
@ -261,9 +261,9 @@ Foam::labelList Foam::meshRefinement::getChangedFaces
|
||||
// Count changed master faces.
|
||||
nMasterChanged = 0;
|
||||
|
||||
forAll(changedFace, faceI)
|
||||
forAll(changedFace, facei)
|
||||
{
|
||||
if (changedFace[faceI] && isMasterFace[faceI])
|
||||
if (changedFace[facei] && isMasterFace[facei])
|
||||
{
|
||||
nMasterChanged++;
|
||||
}
|
||||
@ -350,7 +350,7 @@ void Foam::meshRefinement::markFeatureCellLevel
|
||||
{
|
||||
const point& keepPoint = keepPoints[i];
|
||||
|
||||
label cellI = -1;
|
||||
label celli = -1;
|
||||
label tetFaceI = -1;
|
||||
label tetPtI = -1;
|
||||
|
||||
@ -360,10 +360,10 @@ void Foam::meshRefinement::markFeatureCellLevel
|
||||
(void)mesh_.cellTree();
|
||||
if (mesh_.nCells())
|
||||
{
|
||||
mesh_.findCellFacePt(keepPoint, cellI, tetFaceI, tetPtI);
|
||||
mesh_.findCellFacePt(keepPoint, celli, tetFaceI, tetPtI);
|
||||
}
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
// I am the processor that holds the keepPoint
|
||||
|
||||
@ -404,7 +404,7 @@ void Foam::meshRefinement::markFeatureCellLevel
|
||||
(
|
||||
mesh_,
|
||||
keepPoint,
|
||||
cellI,
|
||||
celli,
|
||||
tetFaceI,
|
||||
tetPtI,
|
||||
featureMesh.points()[pointI], // endpos
|
||||
@ -449,7 +449,7 @@ void Foam::meshRefinement::markFeatureCellLevel
|
||||
(
|
||||
mesh_,
|
||||
keepPoint,
|
||||
cellI,
|
||||
celli,
|
||||
tetFaceI,
|
||||
tetPtI,
|
||||
featureMesh.points()[pointI], // endpos
|
||||
@ -637,13 +637,13 @@ void Foam::meshRefinement::markFeatureCellLevel
|
||||
|
||||
//if (debug&meshRefinement::FEATURESEEDS)
|
||||
//{
|
||||
// forAll(maxFeatureLevel, cellI)
|
||||
// forAll(maxFeatureLevel, celli)
|
||||
// {
|
||||
// if (maxFeatureLevel[cellI] != -1)
|
||||
// if (maxFeatureLevel[celli] != -1)
|
||||
// {
|
||||
// Pout<< "Feature went through cell:" << cellI
|
||||
// << " coord:" << mesh_.cellCentres()[cellI]
|
||||
// << " leve:" << maxFeatureLevel[cellI]
|
||||
// Pout<< "Feature went through cell:" << celli
|
||||
// << " coord:" << mesh_.cellCentres()[celli]
|
||||
// << " leve:" << maxFeatureLevel[celli]
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
@ -672,9 +672,9 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
|
||||
|
||||
label oldNRefine = nRefine;
|
||||
|
||||
forAll(maxFeatureLevel, cellI)
|
||||
forAll(maxFeatureLevel, celli)
|
||||
{
|
||||
if (maxFeatureLevel[cellI] > cellLevel[cellI])
|
||||
if (maxFeatureLevel[celli] > cellLevel[celli])
|
||||
{
|
||||
// Mark
|
||||
if
|
||||
@ -683,7 +683,7 @@ Foam::label Foam::meshRefinement::markFeatureRefinement
|
||||
(
|
||||
0, // surface (n/a)
|
||||
nAllowRefine,
|
||||
refineCell[cellI],
|
||||
refineCell[celli],
|
||||
nRefine
|
||||
)
|
||||
)
|
||||
@ -732,12 +732,12 @@ Foam::label Foam::meshRefinement::markInternalDistanceToFeatureRefinement
|
||||
labelList testLevels(cellLevel.size()-nRefine);
|
||||
label testI = 0;
|
||||
|
||||
forAll(cellLevel, cellI)
|
||||
forAll(cellLevel, celli)
|
||||
{
|
||||
if (refineCell[cellI] == -1)
|
||||
if (refineCell[celli] == -1)
|
||||
{
|
||||
testCc[testI] = cellCentres[cellI];
|
||||
testLevels[testI] = cellLevel[cellI];
|
||||
testCc[testI] = cellCentres[celli];
|
||||
testLevels[testI] = cellLevel[celli];
|
||||
testI++;
|
||||
}
|
||||
}
|
||||
@ -749,9 +749,9 @@ Foam::label Foam::meshRefinement::markInternalDistanceToFeatureRefinement
|
||||
// Mark for refinement. Note that we didn't store the original cellID so
|
||||
// now just reloop in same order.
|
||||
testI = 0;
|
||||
forAll(cellLevel, cellI)
|
||||
forAll(cellLevel, celli)
|
||||
{
|
||||
if (refineCell[cellI] == -1)
|
||||
if (refineCell[celli] == -1)
|
||||
{
|
||||
if (maxLevel[testI] > testLevels[testI])
|
||||
{
|
||||
@ -759,7 +759,7 @@ Foam::label Foam::meshRefinement::markInternalDistanceToFeatureRefinement
|
||||
(
|
||||
maxLevel[testI], // mark with any positive value
|
||||
nAllowRefine,
|
||||
refineCell[cellI],
|
||||
refineCell[celli],
|
||||
nRefine
|
||||
);
|
||||
|
||||
@ -810,12 +810,12 @@ Foam::label Foam::meshRefinement::markInternalRefinement
|
||||
labelList testLevels(cellLevel.size()-nRefine);
|
||||
label testI = 0;
|
||||
|
||||
forAll(cellLevel, cellI)
|
||||
forAll(cellLevel, celli)
|
||||
{
|
||||
if (refineCell[cellI] == -1)
|
||||
if (refineCell[celli] == -1)
|
||||
{
|
||||
testCc[testI] = cellCentres[cellI];
|
||||
testLevels[testI] = cellLevel[cellI];
|
||||
testCc[testI] = cellCentres[celli];
|
||||
testLevels[testI] = cellLevel[celli];
|
||||
testI++;
|
||||
}
|
||||
}
|
||||
@ -827,9 +827,9 @@ Foam::label Foam::meshRefinement::markInternalRefinement
|
||||
// Mark for refinement. Note that we didn't store the original cellID so
|
||||
// now just reloop in same order.
|
||||
testI = 0;
|
||||
forAll(cellLevel, cellI)
|
||||
forAll(cellLevel, celli)
|
||||
{
|
||||
if (refineCell[cellI] == -1)
|
||||
if (refineCell[celli] == -1)
|
||||
{
|
||||
if (maxLevel[testI] > testLevels[testI])
|
||||
{
|
||||
@ -837,7 +837,7 @@ Foam::label Foam::meshRefinement::markInternalRefinement
|
||||
(
|
||||
maxLevel[testI], // mark with any positive value
|
||||
nAllowRefine,
|
||||
refineCell[cellI],
|
||||
refineCell[celli],
|
||||
nRefine
|
||||
);
|
||||
|
||||
@ -880,26 +880,26 @@ Foam::labelList Foam::meshRefinement::getRefineCandidateFaces
|
||||
|
||||
label nTest = 0;
|
||||
|
||||
forAll(surfaceIndex_, faceI)
|
||||
forAll(surfaceIndex_, facei)
|
||||
{
|
||||
if (surfaceIndex_[faceI] != -1)
|
||||
if (surfaceIndex_[facei] != -1)
|
||||
{
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
if (refineCell[own] == -1 || refineCell[nei] == -1)
|
||||
{
|
||||
testFaces[nTest++] = faceI;
|
||||
testFaces[nTest++] = facei;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (refineCell[own] == -1)
|
||||
{
|
||||
testFaces[nTest++] = faceI;
|
||||
testFaces[nTest++] = facei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -943,13 +943,13 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
|
||||
|
||||
forAll(testFaces, i)
|
||||
{
|
||||
label faceI = testFaces[i];
|
||||
label facei = testFaces[i];
|
||||
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
end[i] = cellCentres[nei];
|
||||
@ -957,7 +957,7 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
label bFaceI = faceI - mesh_.nInternalFaces();
|
||||
label bFaceI = facei - mesh_.nInternalFaces();
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
end[i] = neiCc[bFaceI];
|
||||
@ -994,7 +994,7 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
|
||||
|
||||
forAll(testFaces, i)
|
||||
{
|
||||
label faceI = testFaces[i];
|
||||
label facei = testFaces[i];
|
||||
|
||||
label surfI = surfaceHit[i];
|
||||
|
||||
@ -1006,7 +1006,7 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
|
||||
// do the check with the surfaceMinLevel whilst intersecting the
|
||||
// surfaces?
|
||||
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
if (surfaceMinLevel[i] > cellLevel[own])
|
||||
{
|
||||
@ -1026,9 +1026,9 @@ Foam::label Foam::meshRefinement::markSurfaceRefinement
|
||||
}
|
||||
}
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
if (surfaceMinLevel[i] > cellLevel[nei])
|
||||
{
|
||||
// Neighbour needs refining
|
||||
@ -1131,13 +1131,13 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
|
||||
forAll(testFaces, i)
|
||||
{
|
||||
label faceI = testFaces[i];
|
||||
label facei = testFaces[i];
|
||||
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
end[i] = cellCentres[nei];
|
||||
@ -1145,12 +1145,12 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
label bFaceI = faceI - mesh_.nInternalFaces();
|
||||
label bFaceI = facei - mesh_.nInternalFaces();
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
end[i] = neiCc[bFaceI];
|
||||
|
||||
if (!isMasterFace[faceI])
|
||||
if (!isMasterFace[facei])
|
||||
{
|
||||
Swap(start[i], end[i]);
|
||||
}
|
||||
@ -1215,8 +1215,8 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
// Convert face-wise data to cell.
|
||||
forAll(testFaces, i)
|
||||
{
|
||||
label faceI = testFaces[i];
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label facei = testFaces[i];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
const vectorList& fNormals = surfaceNormal[i];
|
||||
const labelList& fLevels = surfaceLevel[i];
|
||||
@ -1229,9 +1229,9 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
cellSurfNormals[own].append(fNormals[hitI]);
|
||||
}
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
if (fLevels[hitI] > cellLevel[nei])
|
||||
{
|
||||
cellSurfLevels[nei].append(fLevels[hitI]);
|
||||
@ -1249,9 +1249,9 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
{
|
||||
label nSet = 0;
|
||||
label nNormals = 9;
|
||||
forAll(cellSurfNormals, cellI)
|
||||
forAll(cellSurfNormals, celli)
|
||||
{
|
||||
const vectorList& normals = cellSurfNormals[cellI];
|
||||
const vectorList& normals = cellSurfNormals[celli];
|
||||
if (normals.size())
|
||||
{
|
||||
nSet++;
|
||||
@ -1277,13 +1277,13 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
|
||||
for
|
||||
(
|
||||
label cellI = 0;
|
||||
!reachedLimit && cellI < cellSurfNormals.size();
|
||||
cellI++
|
||||
label celli = 0;
|
||||
!reachedLimit && celli < cellSurfNormals.size();
|
||||
celli++
|
||||
)
|
||||
{
|
||||
const vectorList& normals = cellSurfNormals[cellI];
|
||||
const labelList& levels = cellSurfLevels[cellI];
|
||||
const vectorList& normals = cellSurfNormals[celli];
|
||||
const labelList& levels = cellSurfLevels[celli];
|
||||
|
||||
// n^2 comparison of all normals in a cell
|
||||
for (label i = 0; !reachedLimit && i < normals.size(); i++)
|
||||
@ -1294,7 +1294,7 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
{
|
||||
label maxLevel = max(levels[i], levels[j]);
|
||||
|
||||
if (cellLevel[cellI] < maxLevel)
|
||||
if (cellLevel[celli] < maxLevel)
|
||||
{
|
||||
if
|
||||
(
|
||||
@ -1302,7 +1302,7 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
(
|
||||
maxLevel,
|
||||
nAllowRefine,
|
||||
refineCell[cellI],
|
||||
refineCell[celli],
|
||||
nRefine
|
||||
)
|
||||
)
|
||||
@ -1332,13 +1332,13 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
// Internal faces
|
||||
for
|
||||
(
|
||||
label faceI = 0;
|
||||
!reachedLimit && faceI < mesh_.nInternalFaces();
|
||||
faceI++
|
||||
label facei = 0;
|
||||
!reachedLimit && facei < mesh_.nInternalFaces();
|
||||
facei++
|
||||
)
|
||||
{
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
const vectorList& ownNormals = cellSurfNormals[own];
|
||||
const labelList& ownLevels = cellSurfLevels[own];
|
||||
@ -1430,13 +1430,13 @@ Foam::label Foam::meshRefinement::markSurfaceCurvatureRefinement
|
||||
// Boundary faces
|
||||
for
|
||||
(
|
||||
label faceI = mesh_.nInternalFaces();
|
||||
!reachedLimit && faceI < mesh_.nFaces();
|
||||
faceI++
|
||||
label facei = mesh_.nInternalFaces();
|
||||
!reachedLimit && facei < mesh_.nFaces();
|
||||
facei++
|
||||
)
|
||||
{
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label bFaceI = faceI - mesh_.nInternalFaces();
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label bFaceI = facei - mesh_.nInternalFaces();
|
||||
|
||||
const vectorList& ownNormals = cellSurfNormals[own];
|
||||
const labelList& ownLevels = cellSurfLevels[own];
|
||||
@ -1632,7 +1632,7 @@ bool Foam::meshRefinement::checkProximity
|
||||
const vector& surfaceLocation, // current intersection location
|
||||
const vector& surfaceNormal, // current intersection normal
|
||||
|
||||
const label cellI,
|
||||
const label celli,
|
||||
|
||||
label& cellMaxLevel, // cached max surface level for this cell
|
||||
vector& cellMaxLocation, // cached surface normal for this cell
|
||||
@ -1645,7 +1645,7 @@ bool Foam::meshRefinement::checkProximity
|
||||
const labelList& cellLevel = meshCutter_.cellLevel();
|
||||
|
||||
// Test if surface applicable
|
||||
if (surfaceLevel > cellLevel[cellI])
|
||||
if (surfaceLevel > cellLevel[celli])
|
||||
{
|
||||
if (cellMaxLevel == -1)
|
||||
{
|
||||
@ -1694,7 +1694,7 @@ bool Foam::meshRefinement::checkProximity
|
||||
(
|
||||
surfaceLevel, // mark with any non-neg number.
|
||||
nAllowRefine,
|
||||
refineCell[cellI],
|
||||
refineCell[celli],
|
||||
nRefine
|
||||
);
|
||||
}
|
||||
@ -1740,13 +1740,13 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
|
||||
forAll(testFaces, i)
|
||||
{
|
||||
label faceI = testFaces[i];
|
||||
label facei = testFaces[i];
|
||||
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
end[i] = cellCentres[nei];
|
||||
@ -1754,7 +1754,7 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
label bFaceI = faceI - mesh_.nInternalFaces();
|
||||
label bFaceI = facei - mesh_.nInternalFaces();
|
||||
|
||||
start[i] = cellCentres[own];
|
||||
end[i] = neiCc[bFaceI];
|
||||
@ -1821,8 +1821,8 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
|
||||
forAll(testFaces, i)
|
||||
{
|
||||
label faceI = testFaces[i];
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label facei = testFaces[i];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
const labelList& fLevels = surfaceLevel[i];
|
||||
const vectorList& fPoints = surfaceLocation[i];
|
||||
@ -1849,9 +1849,9 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
);
|
||||
}
|
||||
|
||||
if (mesh_.isInternalFace(faceI))
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
forAll(fLevels, hitI)
|
||||
{
|
||||
@ -1884,10 +1884,10 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
pointField neiBndMaxLocation(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||
vectorField neiBndMaxNormal(mesh_.nFaces()-mesh_.nInternalFaces());
|
||||
|
||||
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
label bFaceI = faceI-mesh_.nInternalFaces();
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label bFaceI = facei-mesh_.nInternalFaces();
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
|
||||
neiBndMaxLevel[bFaceI] = cellMaxLevel[own];
|
||||
neiBndMaxLocation[bFaceI] = cellMaxLocation[own];
|
||||
@ -1900,10 +1900,10 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
// Loop over all faces. Could only be checkFaces.. except if they're coupled
|
||||
|
||||
// Internal faces
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
if (cellMaxLevel[own] != -1 && cellMaxLevel[nei] != -1)
|
||||
{
|
||||
@ -1970,10 +1970,10 @@ Foam::label Foam::meshRefinement::markProximityRefinement
|
||||
}
|
||||
}
|
||||
// Boundary faces
|
||||
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label bFaceI = faceI - mesh_.nInternalFaces();
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label bFaceI = facei - mesh_.nInternalFaces();
|
||||
|
||||
if (cellLevel[own] < cellMaxLevel[own] && neiBndMaxLevel[bFaceI] != -1)
|
||||
{
|
||||
@ -2223,11 +2223,11 @@ Foam::labelList Foam::meshRefinement::refineCandidates
|
||||
cellsToRefine.setSize(nRefine);
|
||||
nRefine = 0;
|
||||
|
||||
forAll(refineCell, cellI)
|
||||
forAll(refineCell, celli)
|
||||
{
|
||||
if (refineCell[cellI] != -1)
|
||||
if (refineCell[celli] != -1)
|
||||
{
|
||||
cellsToRefine[nRefine++] = cellI;
|
||||
cellsToRefine[nRefine++] = celli;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -119,9 +119,9 @@ void Foam::meshRefinement::testSyncBoundaryFaceList
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
label bFaceI = pp.start() - mesh_.nInternalFaces();
|
||||
|
||||
@ -132,13 +132,13 @@ void Foam::meshRefinement::testSyncBoundaryFaceList
|
||||
|
||||
if (mag(data - syncData) > tol)
|
||||
{
|
||||
label faceI = pp.start()+i;
|
||||
label facei = pp.start()+i;
|
||||
|
||||
FatalErrorInFunction
|
||||
<< msg
|
||||
<< "patchFace:" << i
|
||||
<< " face:" << faceI
|
||||
<< " fc:" << mesh_.faceCentres()[faceI]
|
||||
<< " face:" << facei
|
||||
<< " fc:" << mesh_.faceCentres()[facei]
|
||||
<< " patch:" << pp.name()
|
||||
<< " faceData:" << data
|
||||
<< " syncedFaceData:" << syncData
|
||||
|
||||
@ -103,7 +103,7 @@ public:
|
||||
const polyMesh& mesh,
|
||||
const indirectPrimitivePatch& patch,
|
||||
const label edgeI,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const patchFaceOrientation& faceInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -127,7 +127,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const indirectPrimitivePatch& patch,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const patchFaceOrientation& edgeInfo,
|
||||
const scalar tol,
|
||||
|
||||
@ -90,7 +90,7 @@ inline bool Foam::patchFaceOrientation::updateEdge
|
||||
const polyMesh& mesh,
|
||||
const indirectPrimitivePatch& patch,
|
||||
const label edgeI,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const patchFaceOrientation& faceInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -101,7 +101,7 @@ inline bool Foam::patchFaceOrientation::updateEdge
|
||||
return false;
|
||||
}
|
||||
|
||||
const face& f = patch.localFaces()[faceI];
|
||||
const face& f = patch.localFaces()[facei];
|
||||
const edge& e = patch.edges()[edgeI];
|
||||
|
||||
//Pout<< "Updating edge:" << edgeI << " verts:" << e << nl
|
||||
@ -156,7 +156,7 @@ inline bool Foam::patchFaceOrientation::updateFace
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const indirectPrimitivePatch& patch,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const patchFaceOrientation& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -169,11 +169,11 @@ inline bool Foam::patchFaceOrientation::updateFace
|
||||
}
|
||||
|
||||
// Transfer flip to face
|
||||
const face& f = patch.localFaces()[faceI];
|
||||
const face& f = patch.localFaces()[facei];
|
||||
const edge& e = patch.edges()[edgeI];
|
||||
|
||||
|
||||
//Pout<< "Updating face:" << faceI << nl
|
||||
//Pout<< "Updating face:" << facei << nl
|
||||
// << " verts:" << f << nl
|
||||
// << " with edge:" << edgeI << nl
|
||||
// << " start:" << patch.localPoints()[e[0]] << nl
|
||||
|
||||
@ -272,11 +272,11 @@ Foam::layerParameters::layerParameters
|
||||
{
|
||||
const dictionary& layerDict = iter().dict();
|
||||
|
||||
forAllConstIter(labelHashSet, patchIDs, patchIter)
|
||||
forAllConstIter(labelHashSet, patchIDs, patchiter)
|
||||
{
|
||||
label patchI = patchIter.key();
|
||||
label patchi = patchiter.key();
|
||||
|
||||
numLayers_[patchI] =
|
||||
numLayers_[patchi] =
|
||||
readLabel(layerDict.lookup("nSurfaceLayers"));
|
||||
|
||||
switch (layerSpec_)
|
||||
@ -285,12 +285,12 @@ Foam::layerParameters::layerParameters
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"firstLayerThickness",
|
||||
firstLayerThickness_[patchI]
|
||||
firstLayerThickness_[patchi]
|
||||
);
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"thickness",
|
||||
thickness_[patchI]
|
||||
thickness_[patchi]
|
||||
);
|
||||
break;
|
||||
|
||||
@ -298,12 +298,12 @@ Foam::layerParameters::layerParameters
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"firstLayerThickness",
|
||||
firstLayerThickness_[patchI]
|
||||
firstLayerThickness_[patchi]
|
||||
);
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"expansionRatio",
|
||||
expansionRatio_[patchI]
|
||||
expansionRatio_[patchi]
|
||||
);
|
||||
break;
|
||||
|
||||
@ -311,12 +311,12 @@ Foam::layerParameters::layerParameters
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"finalLayerThickness",
|
||||
finalLayerThickness_[patchI]
|
||||
finalLayerThickness_[patchi]
|
||||
);
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"thickness",
|
||||
thickness_[patchI]
|
||||
thickness_[patchi]
|
||||
);
|
||||
break;
|
||||
|
||||
@ -324,12 +324,12 @@ Foam::layerParameters::layerParameters
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"finalLayerThickness",
|
||||
finalLayerThickness_[patchI]
|
||||
finalLayerThickness_[patchi]
|
||||
);
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"expansionRatio",
|
||||
expansionRatio_[patchI]
|
||||
expansionRatio_[patchi]
|
||||
);
|
||||
break;
|
||||
|
||||
@ -337,12 +337,12 @@ Foam::layerParameters::layerParameters
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"thickness",
|
||||
thickness_[patchI]
|
||||
thickness_[patchi]
|
||||
);
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"expansionRatio",
|
||||
expansionRatio_[patchI]
|
||||
expansionRatio_[patchi]
|
||||
);
|
||||
break;
|
||||
|
||||
@ -357,7 +357,7 @@ Foam::layerParameters::layerParameters
|
||||
layerDict.readIfPresent
|
||||
(
|
||||
"minThickness",
|
||||
minThickness_[patchI]
|
||||
minThickness_[patchi]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -114,16 +114,16 @@ Foam::tmp<Foam::scalarField> Foam::snappyLayerDriver::avgPointData
|
||||
tmp<scalarField> tfaceFld(new scalarField(pp.size(), 0.0));
|
||||
scalarField& faceFld = tfaceFld.ref();
|
||||
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
if (f.size())
|
||||
{
|
||||
forAll(f, fp)
|
||||
{
|
||||
faceFld[faceI] += pointFld[f[fp]];
|
||||
faceFld[facei] += pointFld[f[fp]];
|
||||
}
|
||||
faceFld[faceI] /= f.size();
|
||||
faceFld[facei] /= f.size();
|
||||
}
|
||||
}
|
||||
return tfaceFld;
|
||||
@ -168,9 +168,9 @@ void Foam::snappyLayerDriver::checkMeshManifold() const
|
||||
// Get all outside faces
|
||||
labelList outsideFaces(mesh.nFaces() - mesh.nInternalFaces());
|
||||
|
||||
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
|
||||
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
outsideFaces[faceI - mesh.nInternalFaces()] = faceI;
|
||||
outsideFaces[facei - mesh.nInternalFaces()] = facei;
|
||||
}
|
||||
|
||||
pointSet nonManifoldPoints
|
||||
@ -529,13 +529,13 @@ void Foam::snappyLayerDriver::handleWarpedFaces
|
||||
|
||||
if (f.size() > 3)
|
||||
{
|
||||
label faceI = pp.addressing()[i];
|
||||
label facei = pp.addressing()[i];
|
||||
|
||||
label ownLevel = cellLevel[mesh.faceOwner()[faceI]];
|
||||
label ownLevel = cellLevel[mesh.faceOwner()[facei]];
|
||||
scalar edgeLen = edge0Len/(1<<ownLevel);
|
||||
|
||||
// Normal distance to face centre plane
|
||||
const point& fc = mesh.faceCentres()[faceI];
|
||||
const point& fc = mesh.faceCentres()[facei];
|
||||
const vector& fn = pp.faceNormals()[i];
|
||||
|
||||
scalarField vProj(f.size());
|
||||
@ -604,13 +604,13 @@ void Foam::snappyLayerDriver::handleWarpedFaces
|
||||
//
|
||||
// forAll(pFaces, i)
|
||||
// {
|
||||
// label cellI = mesh.faceOwner()[pp.addressing()[pFaces[i]]];
|
||||
// label celli = mesh.faceOwner()[pp.addressing()[pFaces[i]]];
|
||||
//
|
||||
// if (!pointCells.insert(cellI))
|
||||
// if (!pointCells.insert(celli))
|
||||
// {
|
||||
// // Second or more occurrence of cell so cell has two or more
|
||||
// // pp faces connected to this point.
|
||||
// multiPatchCells.insert(cellI);
|
||||
// multiPatchCells.insert(celli);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -648,10 +648,10 @@ void Foam::snappyLayerDriver::handleWarpedFaces
|
||||
//
|
||||
// forAll(pFaces, i)
|
||||
// {
|
||||
// label cellI =
|
||||
// label celli =
|
||||
// mesh.faceOwner()[pp.addressing()[pFaces[i]]];
|
||||
//
|
||||
// if (multiPatchCells.found(cellI))
|
||||
// if (multiPatchCells.found(celli))
|
||||
// {
|
||||
// if
|
||||
// (
|
||||
@ -702,11 +702,11 @@ void Foam::snappyLayerDriver::setNumLayers
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
label patchi = patchIDs[i];
|
||||
|
||||
const labelList& meshPoints = mesh.boundaryMesh()[patchI].meshPoints();
|
||||
const labelList& meshPoints = mesh.boundaryMesh()[patchi].meshPoints();
|
||||
|
||||
label wantedLayers = patchToNLayers[patchI];
|
||||
label wantedLayers = patchToNLayers[patchi];
|
||||
|
||||
forAll(meshPoints, patchPointI)
|
||||
{
|
||||
@ -777,9 +777,9 @@ void Foam::snappyLayerDriver::setNumLayers
|
||||
|
||||
// Calculate number of cells to create
|
||||
nAddedCells = 0;
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
// Get max of extrusion per point
|
||||
label nCells = 0;
|
||||
@ -818,35 +818,35 @@ Foam::snappyLayerDriver::makeLayerDisplacementField
|
||||
slipPointPatchVectorField::typeName
|
||||
);
|
||||
wordList actualPatchTypes(patchFieldTypes.size());
|
||||
forAll(pointPatches, patchI)
|
||||
forAll(pointPatches, patchi)
|
||||
{
|
||||
actualPatchTypes[patchI] = pointPatches[patchI].type();
|
||||
actualPatchTypes[patchi] = pointPatches[patchi].type();
|
||||
}
|
||||
|
||||
forAll(numLayers, patchI)
|
||||
forAll(numLayers, patchi)
|
||||
{
|
||||
// 0 layers: do not allow slip so fixedValue 0
|
||||
// >0 layers: fixedValue which gets adapted
|
||||
if (numLayers[patchI] == 0)
|
||||
if (numLayers[patchi] == 0)
|
||||
{
|
||||
patchFieldTypes[patchI] =
|
||||
patchFieldTypes[patchi] =
|
||||
zeroFixedValuePointPatchVectorField::typeName;
|
||||
}
|
||||
else if (numLayers[patchI] > 0)
|
||||
else if (numLayers[patchi] > 0)
|
||||
{
|
||||
patchFieldTypes[patchI] = fixedValuePointPatchVectorField::typeName;
|
||||
patchFieldTypes[patchi] = fixedValuePointPatchVectorField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
forAll(pointPatches, patchI)
|
||||
forAll(pointPatches, patchi)
|
||||
{
|
||||
if (isA<processorPointPatch>(pointPatches[patchI]))
|
||||
if (isA<processorPointPatch>(pointPatches[patchi]))
|
||||
{
|
||||
patchFieldTypes[patchI] = calculatedPointPatchVectorField::typeName;
|
||||
patchFieldTypes[patchi] = calculatedPointPatchVectorField::typeName;
|
||||
}
|
||||
else if (isA<cyclicPointPatch>(pointPatches[patchI]))
|
||||
else if (isA<cyclicPointPatch>(pointPatches[patchi]))
|
||||
{
|
||||
patchFieldTypes[patchI] = cyclicSlipPointPatchVectorField::typeName;
|
||||
patchFieldTypes[patchi] = cyclicSlipPointPatchVectorField::typeName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -893,9 +893,9 @@ void Foam::snappyLayerDriver::growNoExtrusion
|
||||
|
||||
label nGrown = 0;
|
||||
|
||||
forAll(localFaces, faceI)
|
||||
forAll(localFaces, facei)
|
||||
{
|
||||
const face& f = localFaces[faceI];
|
||||
const face& f = localFaces[facei];
|
||||
|
||||
bool hasSqueeze = false;
|
||||
forAll(f, fp)
|
||||
@ -1015,9 +1015,9 @@ void Foam::snappyLayerDriver::determineSidePatches
|
||||
// so prepare to renumber sidePatchID
|
||||
Map<label> wantedToAddedPatch;
|
||||
|
||||
for (label patchI = nOldPatches; patchI < nPatches; patchI++)
|
||||
for (label patchi = nOldPatches; patchi < nPatches; patchi++)
|
||||
{
|
||||
label nbrProcI = patchToNbrProc[patchI];
|
||||
label nbrProcI = patchToNbrProc[patchi];
|
||||
word name
|
||||
(
|
||||
processorPolyPatch::newName(Pstream::myProcNo(), nbrProcI)
|
||||
@ -1037,14 +1037,14 @@ void Foam::snappyLayerDriver::determineSidePatches
|
||||
name,
|
||||
patchDict
|
||||
);
|
||||
wantedToAddedPatch.insert(patchI, procPatchI);
|
||||
wantedToAddedPatch.insert(patchi, procPatchI);
|
||||
}
|
||||
|
||||
// Renumber sidePatchID
|
||||
forAll(sidePatchID, i)
|
||||
{
|
||||
label patchI = sidePatchID[i];
|
||||
Map<label>::const_iterator fnd = wantedToAddedPatch.find(patchI);
|
||||
label patchi = sidePatchID[i];
|
||||
Map<label>::const_iterator fnd = wantedToAddedPatch.find(patchi);
|
||||
if (fnd != wantedToAddedPatch.end())
|
||||
{
|
||||
sidePatchID[i] = fnd();
|
||||
@ -1089,9 +1089,9 @@ void Foam::snappyLayerDriver::calculateLayerThickness
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
label patchi = patchIDs[i];
|
||||
|
||||
const labelList& meshPoints = patches[patchI].meshPoints();
|
||||
const labelList& meshPoints = patches[patchi].meshPoints();
|
||||
|
||||
forAll(meshPoints, patchPointI)
|
||||
{
|
||||
@ -1100,27 +1100,27 @@ void Foam::snappyLayerDriver::calculateLayerThickness
|
||||
firstLayerThickness[ppPointI] = min
|
||||
(
|
||||
firstLayerThickness[ppPointI],
|
||||
layerParams.firstLayerThickness()[patchI]
|
||||
layerParams.firstLayerThickness()[patchi]
|
||||
);
|
||||
finalLayerThickness[ppPointI] = min
|
||||
(
|
||||
finalLayerThickness[ppPointI],
|
||||
layerParams.finalLayerThickness()[patchI]
|
||||
layerParams.finalLayerThickness()[patchi]
|
||||
);
|
||||
totalThickness[ppPointI] = min
|
||||
(
|
||||
totalThickness[ppPointI],
|
||||
layerParams.thickness()[patchI]
|
||||
layerParams.thickness()[patchi]
|
||||
);
|
||||
expRatio[ppPointI] = min
|
||||
(
|
||||
expRatio[ppPointI],
|
||||
layerParams.expansionRatio()[patchI]
|
||||
layerParams.expansionRatio()[patchi]
|
||||
);
|
||||
minThickness[ppPointI] = min
|
||||
(
|
||||
minThickness[ppPointI],
|
||||
layerParams.minThickness()[patchI]
|
||||
layerParams.minThickness()[patchi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1268,8 +1268,8 @@ void Foam::snappyLayerDriver::calculateLayerThickness
|
||||
label maxPatchNameLen = 0;
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
word patchName = patches[patchI].name();
|
||||
label patchi = patchIDs[i];
|
||||
word patchName = patches[patchi].name();
|
||||
maxPatchNameLen = max(maxPatchNameLen, label(patchName.size()));
|
||||
}
|
||||
|
||||
@ -1286,9 +1286,9 @@ void Foam::snappyLayerDriver::calculateLayerThickness
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
label patchi = patchIDs[i];
|
||||
|
||||
const labelList& meshPoints = patches[patchI].meshPoints();
|
||||
const labelList& meshPoints = patches[patchi].meshPoints();
|
||||
|
||||
scalar sumThickness = 0;
|
||||
scalar sumNearWallThickness = 0;
|
||||
@ -1331,10 +1331,10 @@ void Foam::snappyLayerDriver::calculateLayerThickness
|
||||
}
|
||||
|
||||
Info<< setf(ios_base::left) << setw(maxPatchNameLen)
|
||||
<< patches[patchI].name() << setprecision(3)
|
||||
<< patches[patchi].name() << setprecision(3)
|
||||
<< " " << setw(8)
|
||||
<< returnReduce(patches[patchI].size(), sumOp<scalar>())
|
||||
<< " " << setw(6) << layerParams.numLayers()[patchI]
|
||||
<< returnReduce(patches[patchi].size(), sumOp<scalar>())
|
||||
<< " " << setw(6) << layerParams.numLayers()[patchi]
|
||||
<< " " << setw(8) << avgNearWallThickness
|
||||
<< " " << setw(8) << avgThickness
|
||||
<< endl;
|
||||
@ -1636,14 +1636,14 @@ void Foam::snappyLayerDriver::getVertexString
|
||||
(
|
||||
const indirectPrimitivePatch& pp,
|
||||
const labelListList& globalEdgeFaces,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const label myGlobFaceI,
|
||||
const label nbrGlobFaceI,
|
||||
DynamicList<label>& vertices
|
||||
) const
|
||||
{
|
||||
const labelList& fEdges = pp.faceEdges()[faceI];
|
||||
const labelList& fEdges = pp.faceEdges()[facei];
|
||||
label fp = findIndex(fEdges, edgeI);
|
||||
|
||||
if (fp == -1)
|
||||
@ -1694,7 +1694,7 @@ void Foam::snappyLayerDriver::getVertexString
|
||||
endFp = nextFp;
|
||||
}
|
||||
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
vertices.clear();
|
||||
fp = startFp;
|
||||
while (fp != endFp)
|
||||
@ -1731,17 +1731,17 @@ Foam::label Foam::snappyLayerDriver::truncateDisplacement
|
||||
|
||||
forAllConstIter(faceSet, illegalPatchFaces, iter)
|
||||
{
|
||||
label faceI = iter.key();
|
||||
label facei = iter.key();
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Faceset " << illegalPatchFaces.name()
|
||||
<< " contains internal face " << faceI << nl
|
||||
<< " contains internal face " << facei << nl
|
||||
<< "It should only contain patch faces" << abort(FatalError);
|
||||
}
|
||||
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
|
||||
forAll(f, fp)
|
||||
@ -2144,12 +2144,12 @@ void Foam::snappyLayerDriver::setupLayerInfoTruncation
|
||||
{
|
||||
forAll(pointFaces[patchPointI], pointFaceI)
|
||||
{
|
||||
label faceI = pointFaces[patchPointI][pointFaceI];
|
||||
label facei = pointFaces[patchPointI][pointFaceI];
|
||||
|
||||
if
|
||||
(
|
||||
nPatchFaceLayers[faceI] != -1
|
||||
&& maxLevel[faceI] > 0
|
||||
nPatchFaceLayers[facei] != -1
|
||||
&& maxLevel[facei] > 0
|
||||
)
|
||||
{
|
||||
foundNeighbour[patchPointI] = true;
|
||||
@ -2173,15 +2173,15 @@ void Foam::snappyLayerDriver::setupLayerInfoTruncation
|
||||
{
|
||||
forAll(pointFaces[patchPointI], pointFaceI)
|
||||
{
|
||||
label faceI = pointFaces[patchPointI][pointFaceI];
|
||||
label facei = pointFaces[patchPointI][pointFaceI];
|
||||
if
|
||||
(
|
||||
nPatchFaceLayers[faceI] == -1
|
||||
&& maxLevel[faceI] > 0
|
||||
&& ilevel < maxLevel[faceI]
|
||||
nPatchFaceLayers[facei] == -1
|
||||
&& maxLevel[facei] > 0
|
||||
&& ilevel < maxLevel[facei]
|
||||
)
|
||||
{
|
||||
tempCounter[faceI] = ilevel;
|
||||
tempCounter[facei] = ilevel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2492,8 +2492,8 @@ void Foam::snappyLayerDriver::printLayerData
|
||||
label maxPatchNameLen = 0;
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
word patchName = pbm[patchI].name();
|
||||
label patchi = patchIDs[i];
|
||||
word patchName = pbm[patchi].name();
|
||||
maxPatchNameLen = max(maxPatchNameLen, label(patchName.size()));
|
||||
}
|
||||
|
||||
@ -2508,8 +2508,8 @@ void Foam::snappyLayerDriver::printLayerData
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
const polyPatch& pp = pbm[patchI];
|
||||
label patchi = patchIDs[i];
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
|
||||
label sumSize = pp.size();
|
||||
|
||||
@ -2522,11 +2522,11 @@ void Foam::snappyLayerDriver::printLayerData
|
||||
}
|
||||
|
||||
// Thickness
|
||||
scalarField::subField patchWanted = pbm[patchI].patchSlice
|
||||
scalarField::subField patchWanted = pbm[patchi].patchSlice
|
||||
(
|
||||
faceWantedThickness
|
||||
);
|
||||
scalarField::subField patchReal = pbm[patchI].patchSlice
|
||||
scalarField::subField patchReal = pbm[patchi].patchSlice
|
||||
(
|
||||
faceRealThickness
|
||||
);
|
||||
@ -2559,7 +2559,7 @@ void Foam::snappyLayerDriver::printLayerData
|
||||
}
|
||||
|
||||
Info<< setf(ios_base::left) << setw(maxPatchNameLen)
|
||||
<< pbm[patchI].name() << setprecision(3)
|
||||
<< pbm[patchi].name() << setprecision(3)
|
||||
<< " " << setw(8) << sumSize
|
||||
<< " " << setw(8) << avgLayers
|
||||
<< " " << setw(8) << avgReal
|
||||
@ -2585,19 +2585,19 @@ bool Foam::snappyLayerDriver::writeLayerData
|
||||
{
|
||||
{
|
||||
label nAdded = 0;
|
||||
forAll(cellNLayers, cellI)
|
||||
forAll(cellNLayers, celli)
|
||||
{
|
||||
if (cellNLayers[cellI] > 0)
|
||||
if (cellNLayers[celli] > 0)
|
||||
{
|
||||
nAdded++;
|
||||
}
|
||||
}
|
||||
cellSet addedCellSet(mesh, "addedCells", nAdded);
|
||||
forAll(cellNLayers, cellI)
|
||||
forAll(cellNLayers, celli)
|
||||
{
|
||||
if (cellNLayers[cellI] > 0)
|
||||
if (cellNLayers[celli] > 0)
|
||||
{
|
||||
addedCellSet.insert(cellI);
|
||||
addedCellSet.insert(celli);
|
||||
}
|
||||
}
|
||||
addedCellSet.instance() = meshRefiner_.timeName();
|
||||
@ -2610,20 +2610,20 @@ bool Foam::snappyLayerDriver::writeLayerData
|
||||
}
|
||||
{
|
||||
label nAdded = 0;
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
if (faceRealThickness[faceI] > 0)
|
||||
if (faceRealThickness[facei] > 0)
|
||||
{
|
||||
nAdded++;
|
||||
}
|
||||
}
|
||||
|
||||
faceSet layerFacesSet(mesh, "layerFaces", nAdded);
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
if (faceRealThickness[faceI] > 0)
|
||||
if (faceRealThickness[facei] > 0)
|
||||
{
|
||||
layerFacesSet.insert(faceI);
|
||||
layerFacesSet.insert(facei);
|
||||
}
|
||||
}
|
||||
layerFacesSet.instance() = meshRefiner_.timeName();
|
||||
@ -2663,15 +2663,15 @@ bool Foam::snappyLayerDriver::writeLayerData
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
const polyPatch& pp = pbm[patchI];
|
||||
label patchi = patchIDs[i];
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
const labelList& faceCells = pp.faceCells();
|
||||
scalarField pfld(faceCells.size());
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
pfld[i] = cellNLayers[faceCells[i]];
|
||||
}
|
||||
fldBf[patchI] == pfld;
|
||||
fldBf[patchi] == pfld;
|
||||
}
|
||||
Info<< indent << fld.name() << " : actual number of layers"
|
||||
<< endl;
|
||||
@ -2702,8 +2702,8 @@ bool Foam::snappyLayerDriver::writeLayerData
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
fldBf[patchI] == pbm[patchI].patchSlice
|
||||
label patchi = patchIDs[i];
|
||||
fldBf[patchi] == pbm[patchi].patchSlice
|
||||
(
|
||||
faceRealThickness
|
||||
);
|
||||
@ -2737,13 +2737,13 @@ bool Foam::snappyLayerDriver::writeLayerData
|
||||
|
||||
forAll(patchIDs, i)
|
||||
{
|
||||
label patchI = patchIDs[i];
|
||||
label patchi = patchIDs[i];
|
||||
|
||||
scalarField::subField patchWanted = pbm[patchI].patchSlice
|
||||
scalarField::subField patchWanted = pbm[patchi].patchSlice
|
||||
(
|
||||
faceWantedThickness
|
||||
);
|
||||
scalarField::subField patchReal = pbm[patchI].patchSlice
|
||||
scalarField::subField patchReal = pbm[patchi].patchSlice
|
||||
(
|
||||
faceRealThickness
|
||||
);
|
||||
@ -2758,7 +2758,7 @@ bool Foam::snappyLayerDriver::writeLayerData
|
||||
}
|
||||
}
|
||||
|
||||
fldBf[patchI] == pfld;
|
||||
fldBf[patchi] == pfld;
|
||||
}
|
||||
Info<< indent << fld.name()
|
||||
<< " : overall layer thickness (fraction"
|
||||
@ -3391,9 +3391,9 @@ void Foam::snappyLayerDriver::addLayers
|
||||
|
||||
// Count number of added cells
|
||||
label nAddedCells = 0;
|
||||
forAll(cellNLayers, cellI)
|
||||
forAll(cellNLayers, celli)
|
||||
{
|
||||
if (cellNLayers[cellI] > 0)
|
||||
if (cellNLayers[celli] > 0)
|
||||
{
|
||||
nAddedCells++;
|
||||
}
|
||||
@ -3407,11 +3407,11 @@ void Foam::snappyLayerDriver::addLayers
|
||||
newMesh.write();
|
||||
|
||||
cellSet addedCellSet(newMesh, "addedCells", nAddedCells);
|
||||
forAll(cellNLayers, cellI)
|
||||
forAll(cellNLayers, celli)
|
||||
{
|
||||
if (cellNLayers[cellI] > 0)
|
||||
if (cellNLayers[celli] > 0)
|
||||
{
|
||||
addedCellSet.insert(cellI);
|
||||
addedCellSet.insert(celli);
|
||||
}
|
||||
}
|
||||
addedCellSet.instance() = meshRefiner_.timeName();
|
||||
@ -3421,11 +3421,11 @@ void Foam::snappyLayerDriver::addLayers
|
||||
addedCellSet.write();
|
||||
|
||||
faceSet layerFacesSet(newMesh, "layerFaces", newMesh.nFaces()/100);
|
||||
for (label faceI = 0; faceI < newMesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < newMesh.nInternalFaces(); facei++)
|
||||
{
|
||||
if (faceRealThickness[faceI] > 0)
|
||||
if (faceRealThickness[facei] > 0)
|
||||
{
|
||||
layerFacesSet.insert(faceI);
|
||||
layerFacesSet.insert(facei);
|
||||
}
|
||||
}
|
||||
layerFacesSet.instance() = meshRefiner_.timeName();
|
||||
@ -3624,16 +3624,16 @@ void Foam::snappyLayerDriver::doLayers
|
||||
// Patches that need to get a layer
|
||||
DynamicList<label> patchIDs(numLayers.size());
|
||||
label nFacesWithLayers = 0;
|
||||
forAll(numLayers, patchI)
|
||||
forAll(numLayers, patchi)
|
||||
{
|
||||
if (numLayers[patchI] > 0)
|
||||
if (numLayers[patchi] > 0)
|
||||
{
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||
|
||||
if (!pp.coupled())
|
||||
{
|
||||
patchIDs.append(patchI);
|
||||
nFacesWithLayers += mesh.boundaryMesh()[patchI].size();
|
||||
patchIDs.append(patchi);
|
||||
nFacesWithLayers += mesh.boundaryMesh()[patchi].size();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -3678,14 +3678,14 @@ void Foam::snappyLayerDriver::doLayers
|
||||
<< endl;
|
||||
|
||||
scalarField cellWeights(mesh.nCells(), 1);
|
||||
forAll(numLayers, patchI)
|
||||
forAll(numLayers, patchi)
|
||||
{
|
||||
if (numLayers[patchI] > 0)
|
||||
if (numLayers[patchi] > 0)
|
||||
{
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchI];
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||
forAll(pp.faceCells(), i)
|
||||
{
|
||||
cellWeights[pp.faceCells()[i]] += numLayers[patchI];
|
||||
cellWeights[pp.faceCells()[i]] += numLayers[patchi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ private:
|
||||
(
|
||||
const indirectPrimitivePatch& pp,
|
||||
const labelListList& globalEdgeFaces,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const label myGlobFaceI,
|
||||
const label nbrGlobFaceI,
|
||||
|
||||
@ -508,15 +508,15 @@ void Foam::snappyLayerDriver::handleFeatureAngleLayerTerminations
|
||||
|
||||
boolList extrudedFaces(pp.size(), true);
|
||||
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (extrudeStatus[f[fp]] == NOEXTRUDE)
|
||||
{
|
||||
extrudedFaces[faceI] = false;
|
||||
extrudedFaces[facei] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -546,9 +546,9 @@ void Foam::snappyLayerDriver::handleFeatureAngleLayerTerminations
|
||||
edgeFaceExtrude[edgeI].setSize(eFaces.size());
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label faceI = eFaces[i];
|
||||
edgeFaceNormals[edgeI][i] = faceNormals[faceI];
|
||||
edgeFaceExtrude[edgeI][i] = extrudedFaces[faceI];
|
||||
label facei = eFaces[i];
|
||||
edgeFaceNormals[edgeI][i] = faceNormals[facei];
|
||||
edgeFaceExtrude[edgeI][i] = extrudedFaces[facei];
|
||||
}
|
||||
}
|
||||
|
||||
@ -692,14 +692,14 @@ void Foam::snappyLayerDriver::findIsolatedRegions
|
||||
// faces are not grown
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
boolList extrudedFaces(pp.size(), true);
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (extrudeStatus[f[fp]] == NOEXTRUDE)
|
||||
{
|
||||
extrudedFaces[faceI] = false;
|
||||
extrudedFaces[facei] = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -714,8 +714,8 @@ void Foam::snappyLayerDriver::findIsolatedRegions
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
if (extrudedFaces[faceI])
|
||||
label facei = pFaces[i];
|
||||
if (extrudedFaces[facei])
|
||||
{
|
||||
keptPoints[patchPointI] = true;
|
||||
break;
|
||||
@ -801,9 +801,9 @@ void Foam::snappyLayerDriver::findIsolatedRegions
|
||||
|
||||
// stop layer growth on isolated faces
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
forAll(pp, faceI)
|
||||
forAll(pp, facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
bool failed = false;
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -1114,17 +1114,17 @@ void Foam::snappyLayerDriver::medialAxisSmoothingInfo
|
||||
labelHashSet adaptPatches(meshMover.adaptPatchIDs());
|
||||
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
const pointPatchVectorField& pvf =
|
||||
meshMover.displacement().boundaryField()[patchI];
|
||||
meshMover.displacement().boundaryField()[patchi];
|
||||
|
||||
if
|
||||
(
|
||||
!pp.coupled()
|
||||
&& !isA<emptyPolyPatch>(pp)
|
||||
&& !adaptPatches.found(patchI)
|
||||
&& !adaptPatches.found(patchi)
|
||||
)
|
||||
{
|
||||
const labelList& meshPoints = pp.meshPoints();
|
||||
|
||||
@ -378,10 +378,10 @@ Foam::label Foam::snappyRefineDriver::gapOnlyRefine
|
||||
boolList newIsCandidateCell(isCandidateCell);
|
||||
|
||||
// Internal faces
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label own = mesh.faceOwner()[faceI];
|
||||
label nei = mesh.faceNeighbour()[faceI];
|
||||
label own = mesh.faceOwner()[facei];
|
||||
label nei = mesh.faceNeighbour()[facei];
|
||||
|
||||
if (isCandidateCell[own] != isCandidateCell[nei])
|
||||
{
|
||||
@ -402,13 +402,13 @@ Foam::label Foam::snappyRefineDriver::gapOnlyRefine
|
||||
// Boundary faces
|
||||
for
|
||||
(
|
||||
label faceI = mesh.nInternalFaces();
|
||||
faceI < mesh.nFaces();
|
||||
faceI++
|
||||
label facei = mesh.nInternalFaces();
|
||||
facei < mesh.nFaces();
|
||||
facei++
|
||||
)
|
||||
{
|
||||
label own = mesh.faceOwner()[faceI];
|
||||
label bFaceI = faceI-mesh.nInternalFaces();
|
||||
label own = mesh.faceOwner()[facei];
|
||||
label bFaceI = facei-mesh.nInternalFaces();
|
||||
|
||||
if (isCandidateCell[own] != neiIsCandidateCell[bFaceI])
|
||||
{
|
||||
@ -420,20 +420,20 @@ Foam::label Foam::snappyRefineDriver::gapOnlyRefine
|
||||
}
|
||||
|
||||
label n = 0;
|
||||
forAll(isCandidateCell, cellI)
|
||||
forAll(isCandidateCell, celli)
|
||||
{
|
||||
if (isCandidateCell[cellI])
|
||||
if (isCandidateCell[celli])
|
||||
{
|
||||
n++;
|
||||
}
|
||||
}
|
||||
candidateCells.setSize(n);
|
||||
n = 0;
|
||||
forAll(isCandidateCell, cellI)
|
||||
forAll(isCandidateCell, celli)
|
||||
{
|
||||
if (isCandidateCell[cellI])
|
||||
if (isCandidateCell[celli])
|
||||
{
|
||||
candidateCells[n++] = cellI;
|
||||
candidateCells[n++] = celli;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -553,9 +553,9 @@ Foam::label Foam::snappyRefineDriver::danglingCellRefine
|
||||
{
|
||||
cellSet candidateCellSet(mesh, "candidateCells", cells.size()/1000);
|
||||
|
||||
forAll(cells, cellI)
|
||||
forAll(cells, celli)
|
||||
{
|
||||
const cell& cFaces = cells[cellI];
|
||||
const cell& cFaces = cells[celli];
|
||||
|
||||
label nIntFaces = 0;
|
||||
forAll(cFaces, i)
|
||||
@ -567,8 +567,8 @@ Foam::label Foam::snappyRefineDriver::danglingCellRefine
|
||||
}
|
||||
else
|
||||
{
|
||||
label patchI = pbm.patchID()[bFaceI];
|
||||
if (pbm[patchI].coupled())
|
||||
label patchi = pbm.patchID()[bFaceI];
|
||||
if (pbm[patchi].coupled())
|
||||
{
|
||||
nIntFaces++;
|
||||
}
|
||||
@ -577,7 +577,7 @@ Foam::label Foam::snappyRefineDriver::danglingCellRefine
|
||||
|
||||
if (nIntFaces == nFaces)
|
||||
{
|
||||
candidateCellSet.insert(cellI);
|
||||
candidateCellSet.insert(celli);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -198,11 +198,11 @@ Foam::pointField Foam::snappySnapDriver::smoothPatchDisplacement
|
||||
|
||||
forAll(pFaces, pfI)
|
||||
{
|
||||
label faceI = pFaces[pfI];
|
||||
label facei = pFaces[pfI];
|
||||
|
||||
if (isMasterFace.get(pp.addressing()[faceI]))
|
||||
if (isMasterFace.get(pp.addressing()[facei]))
|
||||
{
|
||||
avgBoundary[patchPointI] += pp[faceI].centre(points);
|
||||
avgBoundary[patchPointI] += pp[facei].centre(points);
|
||||
nBoundary[patchPointI]++;
|
||||
}
|
||||
}
|
||||
@ -243,10 +243,10 @@ Foam::pointField Foam::snappySnapDriver::smoothPatchDisplacement
|
||||
// Note: no use of pointFaces
|
||||
const faceList& faces = mesh.faces();
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const point& fc = mesh.faceCentres()[faceI];
|
||||
const face& f = faces[facei];
|
||||
const point& fc = mesh.faceCentres()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -258,16 +258,16 @@ Foam::pointField Foam::snappySnapDriver::smoothPatchDisplacement
|
||||
// Count coupled faces as internal ones (but only once)
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
if
|
||||
(
|
||||
patches[patchI].coupled()
|
||||
&& refCast<const coupledPolyPatch>(patches[patchI]).owner()
|
||||
patches[patchi].coupled()
|
||||
&& refCast<const coupledPolyPatch>(patches[patchi]).owner()
|
||||
)
|
||||
{
|
||||
const coupledPolyPatch& pp =
|
||||
refCast<const coupledPolyPatch>(patches[patchI]);
|
||||
refCast<const coupledPolyPatch>(patches[patchi]);
|
||||
|
||||
const vectorField::subField faceCentres = pp.faceCentres();
|
||||
|
||||
@ -327,21 +327,21 @@ Foam::pointField Foam::snappySnapDriver::smoothPatchDisplacement
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
labelList anyCell(mesh.nPoints(), -1);
|
||||
forAll(mesh.faceNeighbour(), faceI)
|
||||
forAll(mesh.faceNeighbour(), facei)
|
||||
{
|
||||
label own = mesh.faceOwner()[faceI];
|
||||
const face& f = mesh.faces()[faceI];
|
||||
label own = mesh.faceOwner()[facei];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
anyCell[f[fp]] = own;
|
||||
}
|
||||
}
|
||||
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
|
||||
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
label own = mesh.faceOwner()[faceI];
|
||||
label own = mesh.faceOwner()[facei];
|
||||
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -740,9 +740,9 @@ void Foam::snappySnapDriver::preSmoothPatch
|
||||
{
|
||||
Info<< "Smoothing iteration " << smoothIter << endl;
|
||||
checkFaces.setSize(mesh.nFaces());
|
||||
forAll(checkFaces, faceI)
|
||||
forAll(checkFaces, facei)
|
||||
{
|
||||
checkFaces[faceI] = faceI;
|
||||
checkFaces[facei] = facei;
|
||||
}
|
||||
|
||||
pointField patchDisp(smoothPatchDisplacement(meshMover, baffles));
|
||||
@ -883,8 +883,8 @@ Foam::tmp<Foam::pointField> Foam::snappySnapDriver::avgCellCentres
|
||||
|
||||
forAll(pFaces, pfI)
|
||||
{
|
||||
label faceI = pFaces[pfI];
|
||||
label meshFaceI = pp.addressing()[faceI];
|
||||
label facei = pFaces[pfI];
|
||||
label meshFaceI = pp.addressing()[facei];
|
||||
|
||||
label own = mesh.faceOwner()[meshFaceI];
|
||||
avgBoundary[pointI] += mesh.cellCentres()[own];
|
||||
@ -1874,14 +1874,14 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurface
|
||||
////
|
||||
//// forAll(meshMover.adaptPatchIDs(), i)
|
||||
//// {
|
||||
//// label patchI = meshMover.adaptPatchIDs()[i];
|
||||
//// const labelList& meshPoints = pbm[patchI].meshPoints();
|
||||
//// label patchi = meshMover.adaptPatchIDs()[i];
|
||||
//// const labelList& meshPoints = pbm[patchi].meshPoints();
|
||||
////
|
||||
//// forAll(meshPoints, meshPointI)
|
||||
//// {
|
||||
//// label meshPointI = meshPoints[meshPointI];
|
||||
//// minPatch[meshPointI] = min(minPatch[meshPointI], patchI);
|
||||
//// maxPatch[meshPointI] = max(maxPatch[meshPointI], patchI);
|
||||
//// minPatch[meshPointI] = min(minPatch[meshPointI], patchi);
|
||||
//// maxPatch[meshPointI] = max(maxPatch[meshPointI], patchi);
|
||||
//// }
|
||||
//// }
|
||||
////
|
||||
@ -2232,11 +2232,11 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
PackedBoolList isZonedFace(mesh.nFaces());
|
||||
{
|
||||
// 1. Preserve faces in preserveFaces list
|
||||
forAll(preserveFaces, faceI)
|
||||
forAll(preserveFaces, facei)
|
||||
{
|
||||
if (preserveFaces[faceI] != -1)
|
||||
if (preserveFaces[facei] != -1)
|
||||
{
|
||||
isZonedFace.set(faceI, 1);
|
||||
isZonedFace.set(facei, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2279,15 +2279,15 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
|
||||
const faceList& localFaces = pp.localFaces();
|
||||
|
||||
forAll(localFaces, faceI)
|
||||
forAll(localFaces, facei)
|
||||
{
|
||||
const face& f = localFaces[faceI];
|
||||
const face& f = localFaces[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
faceSnapDist[faceI] = max
|
||||
faceSnapDist[facei] = max
|
||||
(
|
||||
faceSnapDist[faceI],
|
||||
faceSnapDist[facei],
|
||||
snapDist[f[fp]]
|
||||
);
|
||||
}
|
||||
@ -2311,9 +2311,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
// Get patch
|
||||
forAll(pp, i)
|
||||
{
|
||||
label faceI = pp.addressing()[i];
|
||||
label facei = pp.addressing()[i];
|
||||
|
||||
if (hitSurface[i] != -1 && !isZonedFace.get(faceI))
|
||||
if (hitSurface[i] != -1 && !isZonedFace.get(facei))
|
||||
{
|
||||
closestPatch[i] = globalToMasterPatch_
|
||||
[
|
||||
@ -2336,26 +2336,26 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::snappySnapDriver::repatchToSurface
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patches, patchI)
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
const polyPatch& pp = patches[patchI];
|
||||
const polyPatch& pp = patches[patchi];
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
ownPatch[pp.start()+i] = patchI;
|
||||
neiPatch[pp.start()+i] = patchI;
|
||||
ownPatch[pp.start()+i] = patchi;
|
||||
neiPatch[pp.start()+i] = patchi;
|
||||
}
|
||||
}
|
||||
|
||||
label nChanged = 0;
|
||||
forAll(closestPatch, i)
|
||||
{
|
||||
label faceI = pp.addressing()[i];
|
||||
label facei = pp.addressing()[i];
|
||||
|
||||
if (closestPatch[i] != -1 && closestPatch[i] != ownPatch[faceI])
|
||||
if (closestPatch[i] != -1 && closestPatch[i] != ownPatch[facei])
|
||||
{
|
||||
ownPatch[faceI] = closestPatch[i];
|
||||
neiPatch[faceI] = closestPatch[i];
|
||||
ownPatch[facei] = closestPatch[i];
|
||||
neiPatch[facei] = closestPatch[i];
|
||||
nChanged++;
|
||||
}
|
||||
}
|
||||
@ -2393,9 +2393,9 @@ void Foam::snappySnapDriver::detectWarpedFaces
|
||||
face f0(4);
|
||||
face f1(4);
|
||||
|
||||
forAll(localFaces, faceI)
|
||||
forAll(localFaces, facei)
|
||||
{
|
||||
const face& f = localFaces[faceI];
|
||||
const face& f = localFaces[facei];
|
||||
|
||||
if (f.size() >= 4)
|
||||
{
|
||||
@ -2454,7 +2454,7 @@ void Foam::snappySnapDriver::detectWarpedFaces
|
||||
|
||||
if (minCos < featureCos)
|
||||
{
|
||||
splitFaces.append(bFaces[faceI]);
|
||||
splitFaces.append(bFaces[facei]);
|
||||
splits.append(minDiag);
|
||||
}
|
||||
}
|
||||
@ -2575,8 +2575,8 @@ void Foam::snappySnapDriver::doSnap
|
||||
const faceZone& fZone = fZones[zoneI];
|
||||
forAll(fZone, i)
|
||||
{
|
||||
label faceI = fZone[i];
|
||||
filterFace[faceI] = zoneI;
|
||||
label facei = fZone[i];
|
||||
filterFace[facei] = zoneI;
|
||||
nFilterFaces++;
|
||||
}
|
||||
|
||||
@ -2584,12 +2584,12 @@ void Foam::snappySnapDriver::doSnap
|
||||
{
|
||||
forAll(fZone, i)
|
||||
{
|
||||
label faceI = fZone[i];
|
||||
label facei = fZone[i];
|
||||
|
||||
// Allow combining patch faces across this face
|
||||
duplicateFace[faceI] = -1;
|
||||
duplicateFace[facei] = -1;
|
||||
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const face& f = mesh.faces()[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
if (!duplicatePoint[f[fp]])
|
||||
@ -2877,7 +2877,7 @@ void Foam::snappySnapDriver::doSnap
|
||||
// DynamicList<label> splitFaces(bFaces.size());
|
||||
// DynamicList<labelPair> splits(bFaces.size());
|
||||
//
|
||||
// forAll(bFaces, faceI)
|
||||
// forAll(bFaces, facei)
|
||||
// {
|
||||
// const labelPair split
|
||||
// (
|
||||
@ -2886,13 +2886,13 @@ void Foam::snappySnapDriver::doSnap
|
||||
// ppPtr(),
|
||||
// patchAttraction,
|
||||
// patchConstraints,
|
||||
// faceI
|
||||
// facei
|
||||
// )
|
||||
// );
|
||||
//
|
||||
// if (split != labelPair(-1, -1))
|
||||
// {
|
||||
// splitFaces.append(bFaces[faceI]);
|
||||
// splitFaces.append(bFaces[facei]);
|
||||
// splits.append(split);
|
||||
// }
|
||||
// }
|
||||
@ -3176,11 +3176,11 @@ void Foam::snappySnapDriver::doSnap
|
||||
|
||||
if (mapPtr.valid())
|
||||
{
|
||||
forAll(duplicateFace, faceI)
|
||||
forAll(duplicateFace, facei)
|
||||
{
|
||||
if (duplicateFace[faceI] != -1)
|
||||
if (duplicateFace[facei] != -1)
|
||||
{
|
||||
duplicateFace[faceI] = mapPtr().reverseFaceMap()[faceI];
|
||||
duplicateFace[facei] = mapPtr().reverseFaceMap()[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,7 +242,7 @@ class snappySnapDriver
|
||||
const indirectPrimitivePatch& pp,
|
||||
const vectorField& patchAttraction,
|
||||
const List<pointConstraint>& patchConstraints,
|
||||
const label faceI
|
||||
const label facei
|
||||
) const;
|
||||
|
||||
//- Avoid attraction across face diagonal since would
|
||||
|
||||
@ -319,10 +319,10 @@ void Foam::snappySnapDriver::calcNearestFace
|
||||
{
|
||||
if (hitInfo[hitI].hit())
|
||||
{
|
||||
label faceI = ppFaces[hitI];
|
||||
faceDisp[faceI] = hitInfo[hitI].hitPoint() - fc[hitI];
|
||||
faceSurfaceNormal[faceI] = hitNormal[hitI];
|
||||
faceSurfaceGlobalRegion[faceI] = surfaces.globalRegion
|
||||
label facei = ppFaces[hitI];
|
||||
faceDisp[facei] = hitInfo[hitI].hitPoint() - fc[hitI];
|
||||
faceSurfaceNormal[facei] = hitNormal[hitI];
|
||||
faceSurfaceGlobalRegion[facei] = surfaces.globalRegion
|
||||
(
|
||||
hitSurface[hitI],
|
||||
hitRegion[hitI]
|
||||
@ -383,10 +383,10 @@ void Foam::snappySnapDriver::calcNearestFace
|
||||
{
|
||||
if (hitInfo[hitI].hit())
|
||||
{
|
||||
label faceI = ppFaces[hitI];
|
||||
faceDisp[faceI] = hitInfo[hitI].hitPoint() - fc[hitI];
|
||||
faceSurfaceNormal[faceI] = hitNormal[hitI];
|
||||
faceSurfaceGlobalRegion[faceI] = surfaces.globalRegion
|
||||
label facei = ppFaces[hitI];
|
||||
faceDisp[facei] = hitInfo[hitI].hitPoint() - fc[hitI];
|
||||
faceSurfaceNormal[facei] = hitNormal[hitI];
|
||||
faceSurfaceGlobalRegion[facei] = surfaces.globalRegion
|
||||
(
|
||||
hitSurface[hitI],
|
||||
hitRegion[hitI]
|
||||
@ -408,12 +408,12 @@ void Foam::snappySnapDriver::calcNearestFace
|
||||
faceRotation.setSize(pp.size());
|
||||
faceRotation = Zero;
|
||||
|
||||
forAll(faceRotation, faceI)
|
||||
forAll(faceRotation, facei)
|
||||
{
|
||||
// Note: extend to >180 degrees checking
|
||||
faceRotation[faceI] =
|
||||
pp.faceNormals()[faceI]
|
||||
^ faceSurfaceNormal[faceI];
|
||||
faceRotation[facei] =
|
||||
pp.faceNormals()[facei]
|
||||
^ faceSurfaceNormal[facei];
|
||||
}
|
||||
|
||||
if (debug&meshRefinement::ATTRACTION)
|
||||
@ -474,8 +474,8 @@ void Foam::snappySnapDriver::calcNearestFacePointProperties
|
||||
label nFaces = 0;
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
if (isMasterFace[faceI] && faceSurfaceGlobalRegion[faceI] != -1)
|
||||
label facei = pFaces[i];
|
||||
if (isMasterFace[facei] && faceSurfaceGlobalRegion[facei] != -1)
|
||||
{
|
||||
nFaces++;
|
||||
}
|
||||
@ -494,14 +494,14 @@ void Foam::snappySnapDriver::calcNearestFacePointProperties
|
||||
nFaces = 0;
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
label faceI = pFaces[i];
|
||||
label globalRegionI = faceSurfaceGlobalRegion[faceI];
|
||||
label facei = pFaces[i];
|
||||
label globalRegionI = faceSurfaceGlobalRegion[facei];
|
||||
|
||||
if (isMasterFace[faceI] && globalRegionI != -1)
|
||||
if (isMasterFace[facei] && globalRegionI != -1)
|
||||
{
|
||||
pNormals[nFaces] = faceSurfaceNormal[faceI];
|
||||
pDisp[nFaces] = faceDisp[faceI];
|
||||
pFc[nFaces] = pp.faceCentres()[faceI];
|
||||
pNormals[nFaces] = faceSurfaceNormal[facei];
|
||||
pDisp[nFaces] = faceDisp[facei];
|
||||
pFc[nFaces] = pp.faceCentres()[facei];
|
||||
pFid[nFaces] = globalToMasterPatch_[globalRegionI];
|
||||
nFaces++;
|
||||
}
|
||||
@ -521,9 +521,9 @@ void Foam::snappySnapDriver::calcNearestFacePointProperties
|
||||
labelList patchID(pbm.patchID());
|
||||
|
||||
// Unmark all non-coupled boundary faces
|
||||
forAll(pbm, patchI)
|
||||
forAll(pbm, patchi)
|
||||
{
|
||||
const polyPatch& pp = pbm[patchI];
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
|
||||
if (pp.coupled() || isA<emptyPolyPatch>(pp))
|
||||
{
|
||||
@ -562,15 +562,15 @@ void Foam::snappySnapDriver::calcNearestFacePointProperties
|
||||
label meshFaceI = pFaces[i];
|
||||
if (!mesh.isInternalFace(meshFaceI))
|
||||
{
|
||||
label patchI = patchID[meshFaceI-mesh.nInternalFaces()];
|
||||
label patchi = patchID[meshFaceI-mesh.nInternalFaces()];
|
||||
|
||||
if (patchI != -1)
|
||||
if (patchi != -1)
|
||||
{
|
||||
vector fn = mesh.faceAreas()[meshFaceI];
|
||||
pNormals.append(fn/mag(fn));
|
||||
pDisp.append(mesh.faceCentres()[meshFaceI]-pt);
|
||||
pFc.append(mesh.faceCentres()[meshFaceI]);
|
||||
pFid.append(patchI);
|
||||
pFid.append(patchi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1371,9 +1371,9 @@ void Foam::snappySnapDriver::releasePointsNextToMultiPatch
|
||||
|
||||
// 3. Knock out any attraction on faces with multi-patch points
|
||||
label nChanged = 0;
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
label nMultiPatchPoints = 0;
|
||||
forAll(f, fp)
|
||||
@ -1427,10 +1427,10 @@ Foam::labelPair Foam::snappySnapDriver::findDiagonalAttraction
|
||||
const indirectPrimitivePatch& pp,
|
||||
const vectorField& patchAttraction,
|
||||
const List<pointConstraint>& patchConstraints,
|
||||
const label faceI
|
||||
const label facei
|
||||
) const
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
// For now just detect any attraction. Improve this to look at
|
||||
// actual attraction position and orientation
|
||||
@ -1497,16 +1497,16 @@ void Foam::snappySnapDriver::avoidDiagonalAttraction
|
||||
List<pointConstraint>& patchConstraints
|
||||
) const
|
||||
{
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
labelPair diag = findDiagonalAttraction
|
||||
(
|
||||
pp,
|
||||
patchAttraction,
|
||||
patchConstraints,
|
||||
faceI
|
||||
facei
|
||||
);
|
||||
|
||||
if (diag[0] != -1 && diag[1] != -1)
|
||||
@ -2210,8 +2210,8 @@ void Foam::snappySnapDriver::determineBaffleFeatures
|
||||
eFc.setSize(eFaces.size());
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label faceI = eFaces[i];
|
||||
eFc[i] = pp.faceNormals()[faceI];
|
||||
label facei = eFaces[i];
|
||||
eFc[i] = pp.faceNormals()[facei];
|
||||
}
|
||||
}
|
||||
|
||||
@ -2512,9 +2512,9 @@ void Foam::snappySnapDriver::reverseAttractMeshPoints
|
||||
{
|
||||
boolList newIsFeatureEdgeOrPoint(isFeatureEdgeOrPoint);
|
||||
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -2962,9 +2962,9 @@ void Foam::snappySnapDriver::preventFaceSqueeze
|
||||
{
|
||||
pointField points;
|
||||
face singleF;
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
|
||||
if (f.size() != points.size())
|
||||
{
|
||||
@ -3066,12 +3066,12 @@ Foam::vectorField Foam::snappySnapDriver::calcNearestSurfaceFeature
|
||||
// Calculate attraction distance per face (from the attraction distance
|
||||
// per point)
|
||||
scalarField faceSnapDist(pp.size(), -GREAT);
|
||||
forAll(pp.localFaces(), faceI)
|
||||
forAll(pp.localFaces(), facei)
|
||||
{
|
||||
const face& f = pp.localFaces()[faceI];
|
||||
const face& f = pp.localFaces()[facei];
|
||||
forAll(f, fp)
|
||||
{
|
||||
faceSnapDist[faceI] = max(faceSnapDist[faceI], snapDist[f[fp]]);
|
||||
faceSnapDist[facei] = max(faceSnapDist[facei], snapDist[f[fp]]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ Foam::trackedParticle::trackedParticle
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const point& end,
|
||||
@ -42,7 +42,7 @@ Foam::trackedParticle::trackedParticle
|
||||
const label k
|
||||
)
|
||||
:
|
||||
particle(mesh, position, cellI, tetFaceI, tetPtI),
|
||||
particle(mesh, position, celli, tetFaceI, tetPtI),
|
||||
end_(end),
|
||||
level_(level),
|
||||
i_(i),
|
||||
|
||||
@ -113,7 +113,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const vector& position,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label tetFaceI,
|
||||
const label tetPtI,
|
||||
const point& end,
|
||||
@ -277,7 +277,7 @@ public:
|
||||
);
|
||||
|
||||
//- Convert processor patch addressing to the global equivalents
|
||||
// and set the cellI to the face-neighbour
|
||||
// and set the celli to the face-neighbour
|
||||
void correctAfterParallelTransfer(const label, trackingData&);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user