Further standardization of loop index naming: pointI -> pointi, patchI -> patchi
This commit is contained in:
@ -422,9 +422,9 @@ void Foam::invertManyToMany
|
||||
// Number of points per edge
|
||||
labelList nPointsPerEdge(nEdges, 0);
|
||||
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
const InList& pEdges = pointEdges[pointI];
|
||||
const InList& pEdges = pointEdges[pointi];
|
||||
|
||||
forAll(pEdges, j)
|
||||
{
|
||||
@ -442,15 +442,15 @@ void Foam::invertManyToMany
|
||||
nPointsPerEdge = 0;
|
||||
|
||||
// Fill edges
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
const InList& pEdges = pointEdges[pointI];
|
||||
const InList& pEdges = pointEdges[pointi];
|
||||
|
||||
forAll(pEdges, j)
|
||||
{
|
||||
label edgeI = pEdges[j];
|
||||
|
||||
edges[edgeI][nPointsPerEdge[edgeI]++] = pointI;
|
||||
edges[edgeI][nPointsPerEdge[edgeI]++] = pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,9 +196,9 @@ void Foam::pointPatchField<Type>::addToInternalField
|
||||
// Get the addressing
|
||||
const labelList& mp = patch().meshPoints();
|
||||
|
||||
forAll(mp, pointI)
|
||||
forAll(mp, pointi)
|
||||
{
|
||||
iF[mp[pointI]] += pF[pointI];
|
||||
iF[mp[pointi]] += pF[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
@ -236,8 +236,8 @@ void Foam::pointPatchField<Type>::addToInternalField
|
||||
|
||||
forAll(points, i)
|
||||
{
|
||||
label pointI = points[i];
|
||||
iF[mp[pointI]] += pF[pointI];
|
||||
label pointi = points[i];
|
||||
iF[mp[pointi]] += pF[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
@ -270,9 +270,9 @@ void Foam::pointPatchField<Type>::setInInternalField
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
forAll(meshPoints, pointI)
|
||||
forAll(meshPoints, pointi)
|
||||
{
|
||||
iF[meshPoints[pointI]] = pF[pointI];
|
||||
iF[meshPoints[pointi]] = pF[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,27 +73,27 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
|
||||
bool doWeights = false;
|
||||
|
||||
forAll(pointAddressing, pointI)
|
||||
forAll(pointAddressing, pointi)
|
||||
{
|
||||
doWeights = false;
|
||||
|
||||
const typename FromPatch::FaceType& hitFace =
|
||||
fromPatchFaces[proj[pointI].hitObject()];
|
||||
fromPatchFaces[proj[pointi].hitObject()];
|
||||
|
||||
point hitPoint = Zero;
|
||||
|
||||
if (proj[pointI].hit())
|
||||
if (proj[pointi].hit())
|
||||
{
|
||||
// A hit exists
|
||||
doWeights = true;
|
||||
|
||||
pointAddressing[pointI] = proj[pointI].hitObject();
|
||||
pointAddressing[pointi] = proj[pointi].hitObject();
|
||||
|
||||
pointHit curHit =
|
||||
hitFace.ray
|
||||
(
|
||||
toPatchPoints[pointI],
|
||||
projectionDirection[pointI],
|
||||
toPatchPoints[pointi],
|
||||
projectionDirection[pointi],
|
||||
fromPatchPoints,
|
||||
alg_,
|
||||
dir_
|
||||
@ -102,17 +102,17 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
// Grab distance to target
|
||||
if (dir_ == intersection::CONTACT_SPHERE)
|
||||
{
|
||||
pointDistance[pointI] =
|
||||
pointDistance[pointi] =
|
||||
hitFace.contactSphereDiameter
|
||||
(
|
||||
toPatchPoints[pointI],
|
||||
projectionDirection[pointI],
|
||||
toPatchPoints[pointi],
|
||||
projectionDirection[pointi],
|
||||
fromPatchPoints
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
pointDistance[pointI] = curHit.distance();
|
||||
pointDistance[pointi] = curHit.distance();
|
||||
}
|
||||
|
||||
// Grab hit point
|
||||
@ -124,8 +124,8 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
pointHit ph =
|
||||
hitFace.ray
|
||||
(
|
||||
toPatchPoints[pointI],
|
||||
projectionDirection[pointI],
|
||||
toPatchPoints[pointi],
|
||||
projectionDirection[pointi],
|
||||
fromPatchPoints,
|
||||
alg_,
|
||||
dir_
|
||||
@ -134,8 +134,8 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
scalar dist =
|
||||
Foam::mag
|
||||
(
|
||||
toPatchPoints[pointI]
|
||||
+ projectionDirection[pointI]*ph.distance()
|
||||
toPatchPoints[pointi]
|
||||
+ projectionDirection[pointi]*ph.distance()
|
||||
- ph.missPoint()
|
||||
);
|
||||
|
||||
@ -144,7 +144,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
|
||||
// Do shortest edge of hit object
|
||||
edgeList hitFaceEdges =
|
||||
fromPatchFaces[proj[pointI].hitObject()].edges();
|
||||
fromPatchFaces[proj[pointi].hitObject()].edges();
|
||||
|
||||
forAll(hitFaceEdges, edgeI)
|
||||
{
|
||||
@ -156,7 +156,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
);
|
||||
}
|
||||
|
||||
const labelList& curEdges = toPatchPointEdges[pointI];
|
||||
const labelList& curEdges = toPatchPointEdges[pointi];
|
||||
|
||||
forAll(curEdges, edgeI)
|
||||
{
|
||||
@ -173,7 +173,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
// This point is being corrected
|
||||
doWeights = true;
|
||||
|
||||
pointAddressing[pointI] = proj[pointI].hitObject();
|
||||
pointAddressing[pointi] = proj[pointi].hitObject();
|
||||
|
||||
// Grab nearest point on face as hit point
|
||||
hitPoint = ph.missPoint();
|
||||
@ -181,22 +181,22 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
// Grab distance to target
|
||||
if (dir_ == intersection::CONTACT_SPHERE)
|
||||
{
|
||||
pointDistance[pointI] =
|
||||
pointDistance[pointi] =
|
||||
hitFace.contactSphereDiameter
|
||||
(
|
||||
toPatchPoints[pointI],
|
||||
projectionDirection[pointI],
|
||||
toPatchPoints[pointi],
|
||||
projectionDirection[pointi],
|
||||
fromPatchPoints
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
pointDistance[pointI] =
|
||||
pointDistance[pointi] =
|
||||
(
|
||||
projectionDirection[pointI]
|
||||
/mag(projectionDirection[pointI])
|
||||
projectionDirection[pointi]
|
||||
/mag(projectionDirection[pointi])
|
||||
)
|
||||
& (hitPoint - toPatchPoints[pointI]);
|
||||
& (hitPoint - toPatchPoints[pointi]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -204,29 +204,29 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
|
||||
if (doWeights)
|
||||
{
|
||||
// Set interpolation pointWeights
|
||||
pointWeights.set(pointI, new scalarField(hitFace.size()));
|
||||
pointWeights.set(pointi, new scalarField(hitFace.size()));
|
||||
|
||||
pointField hitFacePoints = hitFace.points(fromPatchPoints);
|
||||
|
||||
forAll(hitFacePoints, masterPointI)
|
||||
forAll(hitFacePoints, masterPointi)
|
||||
{
|
||||
pointWeights[pointI][masterPointI] =
|
||||
pointWeights[pointi][masterPointi] =
|
||||
1.0/
|
||||
(
|
||||
mag
|
||||
(
|
||||
hitFacePoints[masterPointI]
|
||||
hitFacePoints[masterPointi]
|
||||
- hitPoint
|
||||
)
|
||||
+ VSMALL
|
||||
);
|
||||
}
|
||||
|
||||
pointWeights[pointI] /= sum(pointWeights[pointI]);
|
||||
pointWeights[pointi] /= sum(pointWeights[pointi]);
|
||||
}
|
||||
else
|
||||
{
|
||||
pointWeights.set(pointI, new scalarField(0));
|
||||
pointWeights.set(pointi, new scalarField(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,18 +63,18 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate
|
||||
|
||||
const labelList& addr = pointAddr();
|
||||
|
||||
forAll(result, pointI)
|
||||
forAll(result, pointi)
|
||||
{
|
||||
const scalarField& curWeights = weights[pointI];
|
||||
const scalarField& curWeights = weights[pointi];
|
||||
|
||||
if (addr[pointI] > -1)
|
||||
if (addr[pointi] > -1)
|
||||
{
|
||||
const labelList& hitFacePoints =
|
||||
fromPatchLocalFaces[addr[pointI]];
|
||||
fromPatchLocalFaces[addr[pointi]];
|
||||
|
||||
forAll(curWeights, wI)
|
||||
{
|
||||
result[pointI] += curWeights[wI]*pf[hitFacePoints[wI]];
|
||||
result[pointi] += curWeights[wI]*pf[hitFacePoints[wI]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -63,8 +63,8 @@ private:
|
||||
|
||||
// Private data
|
||||
|
||||
//- Local map from neighbour proc to patchI. Different per processor!
|
||||
// -1 or patchI for connection to procID
|
||||
//- Local map from neighbour proc to patchi. Different per processor!
|
||||
// -1 or patchi for connection to procID
|
||||
labelList procPatchMap_;
|
||||
|
||||
//- Order in which the patches should be initialised/evaluated
|
||||
|
||||
@ -52,9 +52,9 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
|
||||
// in the first face there is no duplicates
|
||||
const labelList& first = f[faces[0]];
|
||||
|
||||
forAll(first, pointI)
|
||||
forAll(first, pointi)
|
||||
{
|
||||
p[pointI] = first[pointI];
|
||||
p[pointi] = first[pointi];
|
||||
}
|
||||
|
||||
// re-use maxVert to count the real vertices
|
||||
@ -67,9 +67,9 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
|
||||
{
|
||||
const labelList& curFace = f[faces[facei]];
|
||||
|
||||
forAll(curFace, pointI)
|
||||
forAll(curFace, pointi)
|
||||
{
|
||||
const label curPoint = curFace[pointI];
|
||||
const label curPoint = curFace[pointi];
|
||||
|
||||
bool found = false;
|
||||
|
||||
|
||||
@ -70,13 +70,13 @@ Foam::label Foam::cell::opposingFaceLabel
|
||||
|
||||
// Compare every vertex of the current face agains the
|
||||
// vertices of the master face
|
||||
forAll(curFace, pointI)
|
||||
forAll(curFace, pointi)
|
||||
{
|
||||
const label l = curFace[pointI];
|
||||
const label l = curFace[pointi];
|
||||
|
||||
forAll(masterFace, masterPointI)
|
||||
forAll(masterFace, masterPointi)
|
||||
{
|
||||
if (masterFace[masterPointI] == l)
|
||||
if (masterFace[masterPointi] == l)
|
||||
{
|
||||
sharedPoint = true;
|
||||
break;
|
||||
@ -149,7 +149,7 @@ Foam::oppositeFace Foam::cell::opposingFace
|
||||
oppFaceLabel
|
||||
);
|
||||
|
||||
forAll(masterFace, pointI)
|
||||
forAll(masterFace, pointi)
|
||||
{
|
||||
// Go through the list of edges and find the edge from this vertex
|
||||
// to the slave face
|
||||
@ -159,19 +159,19 @@ Foam::oppositeFace Foam::cell::opposingFace
|
||||
{
|
||||
// Get the other vertex
|
||||
label otherVertex =
|
||||
e[edgeI].otherVertex(masterFace[pointI]);
|
||||
e[edgeI].otherVertex(masterFace[pointi]);
|
||||
|
||||
if (otherVertex != -1)
|
||||
{
|
||||
// Found an edge coming from this vertex.
|
||||
// Check all vertices of the slave to find out
|
||||
// if it exists.
|
||||
forAll(slaveFace, slavePointI)
|
||||
forAll(slaveFace, slavePointi)
|
||||
{
|
||||
if (slaveFace[slavePointI] == otherVertex)
|
||||
if (slaveFace[slavePointi] == otherVertex)
|
||||
{
|
||||
usedEdges[edgeI] = true;
|
||||
oppFace[pointI] = otherVertex;
|
||||
oppFace[pointi] = otherVertex;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@ -618,9 +618,9 @@ Foam::face Foam::face::reverseFace() const
|
||||
|
||||
newList[0] = f[0];
|
||||
|
||||
for (label pointI = 1; pointI < newList.size(); pointI++)
|
||||
for (label pointi = 1; pointi < newList.size(); pointi++)
|
||||
{
|
||||
newList[pointI] = f[size() - pointI];
|
||||
newList[pointi] = f[size() - pointi];
|
||||
}
|
||||
|
||||
return face(xferMove(newList));
|
||||
@ -764,9 +764,9 @@ Foam::edgeList Foam::face::edges() const
|
||||
|
||||
edgeList e(points.size());
|
||||
|
||||
for (label pointI = 0; pointI < points.size() - 1; ++pointI)
|
||||
for (label pointi = 0; pointi < points.size() - 1; ++pointi)
|
||||
{
|
||||
e[pointI] = edge(points[pointI], points[pointI + 1]);
|
||||
e[pointi] = edge(points[pointi], points[pointi + 1]);
|
||||
}
|
||||
|
||||
// Add last edge
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -73,9 +73,9 @@ Foam::label Foam::mergePoints
|
||||
const Field<Type> d(points - compareOrigin);
|
||||
|
||||
List<scalar> magSqrD(d.size());
|
||||
forAll(d, pointI)
|
||||
forAll(d, pointi)
|
||||
{
|
||||
magSqrD[pointI] = magSqr(d[pointI]);
|
||||
magSqrD[pointi] = magSqr(d[pointi]);
|
||||
}
|
||||
labelList order;
|
||||
sortedOrder(magSqrD, order);
|
||||
@ -84,42 +84,42 @@ Foam::label Foam::mergePoints
|
||||
Field<scalar> sortedTol(points.size());
|
||||
forAll(order, sortI)
|
||||
{
|
||||
label pointI = order[sortI];
|
||||
label pointi = order[sortI];
|
||||
|
||||
// Convert to scalar precision
|
||||
const point pt
|
||||
(
|
||||
scalar(d[pointI].x()),
|
||||
scalar(d[pointI].y()),
|
||||
scalar(d[pointI].z())
|
||||
scalar(d[pointi].x()),
|
||||
scalar(d[pointi].y()),
|
||||
scalar(d[pointi].z())
|
||||
);
|
||||
sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z()));
|
||||
}
|
||||
|
||||
label newPointI = 0;
|
||||
label newPointi = 0;
|
||||
|
||||
|
||||
// Handle 0th point separately (is always unique)
|
||||
label pointI = order[0];
|
||||
pointMap[pointI] = newPointI++;
|
||||
label pointi = order[0];
|
||||
pointMap[pointi] = newPointi++;
|
||||
|
||||
|
||||
for (label sortI = 1; sortI < order.size(); sortI++)
|
||||
{
|
||||
// Get original point index
|
||||
label pointI = order[sortI];
|
||||
label pointi = order[sortI];
|
||||
const scalar mag2 = magSqrD[order[sortI]];
|
||||
// Convert to scalar precision
|
||||
const point pt
|
||||
(
|
||||
scalar(points[pointI].x()),
|
||||
scalar(points[pointI].y()),
|
||||
scalar(points[pointI].z())
|
||||
scalar(points[pointi].x()),
|
||||
scalar(points[pointi].y()),
|
||||
scalar(points[pointi].z())
|
||||
);
|
||||
|
||||
|
||||
// Compare to previous points to find equal one.
|
||||
label equalPointI = -1;
|
||||
label equalPointi = -1;
|
||||
|
||||
for
|
||||
(
|
||||
@ -129,46 +129,46 @@ Foam::label Foam::mergePoints
|
||||
prevSortI--
|
||||
)
|
||||
{
|
||||
label prevPointI = order[prevSortI];
|
||||
label prevPointi = order[prevSortI];
|
||||
const point prevPt
|
||||
(
|
||||
scalar(points[prevPointI].x()),
|
||||
scalar(points[prevPointI].y()),
|
||||
scalar(points[prevPointI].z())
|
||||
scalar(points[prevPointi].x()),
|
||||
scalar(points[prevPointi].y()),
|
||||
scalar(points[prevPointi].z())
|
||||
);
|
||||
|
||||
if (magSqr(pt - prevPt) <= mergeTolSqr)
|
||||
{
|
||||
// Found match.
|
||||
equalPointI = prevPointI;
|
||||
equalPointi = prevPointi;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (equalPointI != -1)
|
||||
if (equalPointi != -1)
|
||||
{
|
||||
// Same coordinate as equalPointI. Map to same new point.
|
||||
pointMap[pointI] = pointMap[equalPointI];
|
||||
// Same coordinate as equalPointi. Map to same new point.
|
||||
pointMap[pointi] = pointMap[equalPointi];
|
||||
|
||||
if (verbose)
|
||||
{
|
||||
Pout<< "Foam::mergePoints : Merging points "
|
||||
<< pointI << " and " << equalPointI
|
||||
<< " with coordinates:" << points[pointI]
|
||||
<< " and " << points[equalPointI]
|
||||
<< pointi << " and " << equalPointi
|
||||
<< " with coordinates:" << points[pointi]
|
||||
<< " and " << points[equalPointi]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Differs. Store new point.
|
||||
pointMap[pointI] = newPointI++;
|
||||
pointMap[pointi] = newPointi++;
|
||||
}
|
||||
}
|
||||
|
||||
return newPointI;
|
||||
return newPointi;
|
||||
}
|
||||
|
||||
|
||||
@ -193,9 +193,9 @@ bool Foam::mergePoints
|
||||
);
|
||||
|
||||
newPoints.setSize(nUnique);
|
||||
forAll(pointMap, pointI)
|
||||
forAll(pointMap, pointi)
|
||||
{
|
||||
newPoints[pointMap[pointI]] = points[pointI];
|
||||
newPoints[pointMap[pointi]] = points[pointi];
|
||||
}
|
||||
|
||||
return (nUnique != points.size());
|
||||
|
||||
@ -60,13 +60,13 @@ void Foam::pointMapper::calcAddressing() const
|
||||
|
||||
label nInsertedPoints = 0;
|
||||
|
||||
forAll(directAddr, pointI)
|
||||
forAll(directAddr, pointi)
|
||||
{
|
||||
if (directAddr[pointI] < 0)
|
||||
if (directAddr[pointi] < 0)
|
||||
{
|
||||
// Found inserted point
|
||||
directAddr[pointI] = 0;
|
||||
insertedPoints[nInsertedPoints] = pointI;
|
||||
directAddr[pointi] = 0;
|
||||
insertedPoints[nInsertedPoints] = pointi;
|
||||
nInsertedPoints++;
|
||||
}
|
||||
}
|
||||
@ -91,19 +91,19 @@ void Foam::pointMapper::calcAddressing() const
|
||||
// Get addressing
|
||||
const labelList& mo = cfc[cfcI].masterObjects();
|
||||
|
||||
label pointI = cfc[cfcI].index();
|
||||
label pointi = cfc[cfcI].index();
|
||||
|
||||
if (addr[pointI].size())
|
||||
if (addr[pointi].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Master point " << pointI
|
||||
<< "Master point " << pointi
|
||||
<< " mapped from points " << mo
|
||||
<< " already destination of mapping." << abort(FatalError);
|
||||
}
|
||||
|
||||
// Map from masters, uniform weights
|
||||
addr[pointI] = mo;
|
||||
w[pointI] = scalarList(mo.size(), 1.0/mo.size());
|
||||
addr[pointi] = mo;
|
||||
w[pointi] = scalarList(mo.size(), 1.0/mo.size());
|
||||
}
|
||||
|
||||
|
||||
@ -112,13 +112,13 @@ void Foam::pointMapper::calcAddressing() const
|
||||
|
||||
const labelList& cm = mpm_.pointMap();
|
||||
|
||||
forAll(cm, pointI)
|
||||
forAll(cm, pointi)
|
||||
{
|
||||
if (cm[pointI] > -1 && addr[pointI].empty())
|
||||
if (cm[pointi] > -1 && addr[pointi].empty())
|
||||
{
|
||||
// Mapped from a single point
|
||||
addr[pointI] = labelList(1, cm[pointI]);
|
||||
w[pointI] = scalarList(1, 1.0);
|
||||
addr[pointi] = labelList(1, cm[pointi]);
|
||||
w[pointi] = scalarList(1, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -129,15 +129,15 @@ void Foam::pointMapper::calcAddressing() const
|
||||
|
||||
label nInsertedPoints = 0;
|
||||
|
||||
forAll(addr, pointI)
|
||||
forAll(addr, pointi)
|
||||
{
|
||||
if (addr[pointI].empty())
|
||||
if (addr[pointi].empty())
|
||||
{
|
||||
// Mapped from a dummy point. Take point 0 with weight 1.
|
||||
addr[pointI] = labelList(1, label(0));
|
||||
w[pointI] = scalarList(1, 1.0);
|
||||
addr[pointi] = labelList(1, label(0));
|
||||
w[pointi] = scalarList(1, 1.0);
|
||||
|
||||
insertedPoints[nInsertedPoints] = pointI;
|
||||
insertedPoints[nInsertedPoints] = pointi;
|
||||
nInsertedPoints++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -575,12 +575,12 @@ void Foam::globalMeshData::calcPointConnectivity
|
||||
|
||||
// Create field with my local data
|
||||
labelPairList myData(globalPointSlavesMap().constructSize());
|
||||
forAll(slaves, pointI)
|
||||
forAll(slaves, pointi)
|
||||
{
|
||||
myData[pointI] = globalIndexAndTransform::encode
|
||||
myData[pointi] = globalIndexAndTransform::encode
|
||||
(
|
||||
Pstream::myProcNo(),
|
||||
pointI,
|
||||
pointi,
|
||||
transforms.nullTransformIndex()
|
||||
);
|
||||
}
|
||||
@ -594,21 +594,21 @@ void Foam::globalMeshData::calcPointConnectivity
|
||||
|
||||
// Pass1: do the master points since these also update local slaves
|
||||
// (e.g. from local cyclics)
|
||||
forAll(slaves, pointI)
|
||||
forAll(slaves, pointi)
|
||||
{
|
||||
// Reconstruct string of connected points
|
||||
const labelList& pSlaves = slaves[pointI];
|
||||
const labelList& pTransformSlaves = transformedSlaves[pointI];
|
||||
const labelList& pSlaves = slaves[pointi];
|
||||
const labelList& pTransformSlaves = transformedSlaves[pointi];
|
||||
|
||||
if (pSlaves.size()+pTransformSlaves.size())
|
||||
{
|
||||
labelPairList& pConnectivity = allPointConnectivity[pointI];
|
||||
labelPairList& pConnectivity = allPointConnectivity[pointi];
|
||||
|
||||
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
|
||||
label connI = 0;
|
||||
|
||||
// Add myself
|
||||
pConnectivity[connI++] = myData[pointI];
|
||||
pConnectivity[connI++] = myData[pointi];
|
||||
// Add untransformed points
|
||||
forAll(pSlaves, i)
|
||||
{
|
||||
@ -648,13 +648,13 @@ void Foam::globalMeshData::calcPointConnectivity
|
||||
|
||||
|
||||
// Pass2: see if anything is still unset (should not be the case)
|
||||
forAll(slaves, pointI)
|
||||
forAll(slaves, pointi)
|
||||
{
|
||||
labelPairList& pConnectivity = allPointConnectivity[pointI];
|
||||
labelPairList& pConnectivity = allPointConnectivity[pointi];
|
||||
|
||||
if (pConnectivity.size() == 0)
|
||||
{
|
||||
pConnectivity.setSize(1, myData[pointI]);
|
||||
pConnectivity.setSize(1, myData[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -682,25 +682,25 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
||||
// Create local version
|
||||
globalPointEdges.setSize(globalPointSlavesMap().constructSize());
|
||||
globalPointPoints.setSize(globalPointSlavesMap().constructSize());
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
const labelList& pEdges = pointEdges[pointI];
|
||||
labelList& globalPEdges = globalPointEdges[pointI];
|
||||
const labelList& pEdges = pointEdges[pointi];
|
||||
labelList& globalPEdges = globalPointEdges[pointi];
|
||||
globalPEdges.setSize(pEdges.size());
|
||||
forAll(pEdges, i)
|
||||
{
|
||||
globalPEdges[i] = globalEdgeNumbers.toGlobal(pEdges[i]);
|
||||
}
|
||||
|
||||
labelPairList& globalPPoints = globalPointPoints[pointI];
|
||||
labelPairList& globalPPoints = globalPointPoints[pointi];
|
||||
globalPPoints.setSize(pEdges.size());
|
||||
forAll(pEdges, i)
|
||||
{
|
||||
label otherPointI = edges[pEdges[i]].otherVertex(pointI);
|
||||
label otherPointi = edges[pEdges[i]].otherVertex(pointi);
|
||||
globalPPoints[i] = globalIndexAndTransform::encode
|
||||
(
|
||||
Pstream::myProcNo(),
|
||||
otherPointI,
|
||||
otherPointi,
|
||||
globalTransforms().nullTransformIndex()
|
||||
);
|
||||
}
|
||||
@ -710,10 +710,10 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
||||
globalPointSlavesMap().distribute(globalPointEdges);
|
||||
globalPointSlavesMap().distribute(globalPointPoints);
|
||||
// Add all pointEdges
|
||||
forAll(slaves, pointI)
|
||||
forAll(slaves, pointi)
|
||||
{
|
||||
const labelList& pSlaves = slaves[pointI];
|
||||
const labelList& pTransformSlaves = transformedSlaves[pointI];
|
||||
const labelList& pSlaves = slaves[pointi];
|
||||
const labelList& pTransformSlaves = transformedSlaves[pointi];
|
||||
|
||||
label n = 0;
|
||||
forAll(pSlaves, i)
|
||||
@ -727,7 +727,7 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
||||
|
||||
// Add all the point edges of the slaves to those of the (master) point
|
||||
{
|
||||
labelList& globalPEdges = globalPointEdges[pointI];
|
||||
labelList& globalPEdges = globalPointEdges[pointi];
|
||||
label sz = globalPEdges.size();
|
||||
globalPEdges.setSize(sz+n);
|
||||
forAll(pSlaves, i)
|
||||
@ -762,7 +762,7 @@ void Foam::globalMeshData::calcGlobalPointEdges
|
||||
|
||||
// Same for corresponding pointPoints
|
||||
{
|
||||
labelPairList& globalPPoints = globalPointPoints[pointI];
|
||||
labelPairList& globalPPoints = globalPointPoints[pointi];
|
||||
label sz = globalPPoints.size();
|
||||
globalPPoints.setSize(sz + n);
|
||||
|
||||
@ -842,17 +842,17 @@ Foam::label Foam::globalMeshData::findTransform
|
||||
forAll(info, i)
|
||||
{
|
||||
label proci = globalIndexAndTransform::processor(info[i]);
|
||||
label pointI = globalIndexAndTransform::index(info[i]);
|
||||
label pointi = globalIndexAndTransform::index(info[i]);
|
||||
label transformI = globalIndexAndTransform::transformIndex(info[i]);
|
||||
|
||||
if (proci == Pstream::myProcNo() && pointI == localPoint)
|
||||
if (proci == Pstream::myProcNo() && pointi == localPoint)
|
||||
{
|
||||
localTransformI = transformI;
|
||||
//Pout<< "For local :" << localPoint
|
||||
// << " found transform:" << localTransformI
|
||||
// << endl;
|
||||
}
|
||||
if (proci == remoteProci && pointI == remoteIndex)
|
||||
if (proci == remoteProci && pointi == remoteIndex)
|
||||
{
|
||||
remoteTransformI = transformI;
|
||||
//Pout<< "For remote:" << remotePoint
|
||||
@ -1116,9 +1116,9 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const
|
||||
masterPoint.setSize(map.constructSize());
|
||||
masterPoint = labelMax;
|
||||
|
||||
for (label pointI = 0; pointI < coupledPatch().nPoints(); pointI++)
|
||||
for (label pointi = 0; pointi < coupledPatch().nPoints(); pointi++)
|
||||
{
|
||||
masterPoint[pointI] = globalPoints.toGlobal(pointI);
|
||||
masterPoint[pointi] = globalPoints.toGlobal(pointi);
|
||||
}
|
||||
syncData
|
||||
(
|
||||
@ -1259,9 +1259,9 @@ void Foam::globalMeshData::calcPointBoundaryFaces
|
||||
// 2. Size
|
||||
|
||||
pointBoundaryFaces.setSize(coupledPatch().nPoints());
|
||||
forAll(nPointFaces, pointI)
|
||||
forAll(nPointFaces, pointi)
|
||||
{
|
||||
pointBoundaryFaces[pointI].setSize(nPointFaces[pointI]);
|
||||
pointBoundaryFaces[pointi].setSize(nPointFaces[pointi]);
|
||||
}
|
||||
nPointFaces = 0;
|
||||
|
||||
@ -1326,10 +1326,10 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
||||
);
|
||||
labelListList& globalPointBoundaryFaces = globalPointBoundaryFacesPtr_();
|
||||
|
||||
forAll(pointBoundaryFaces, pointI)
|
||||
forAll(pointBoundaryFaces, pointi)
|
||||
{
|
||||
const labelList& bFaces = pointBoundaryFaces[pointI];
|
||||
labelList& globalFaces = globalPointBoundaryFaces[pointI];
|
||||
const labelList& bFaces = pointBoundaryFaces[pointi];
|
||||
labelList& globalFaces = globalPointBoundaryFaces[pointi];
|
||||
globalFaces.setSize(bFaces.size());
|
||||
forAll(bFaces, i)
|
||||
{
|
||||
@ -1357,14 +1357,14 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
||||
List<labelPairList> transformedFaces(pointSlaves.size());
|
||||
|
||||
|
||||
forAll(pointSlaves, pointI)
|
||||
forAll(pointSlaves, pointi)
|
||||
{
|
||||
const labelList& slaves = pointSlaves[pointI];
|
||||
const labelList& transformedSlaves = pointTransformSlaves[pointI];
|
||||
const labelList& slaves = pointSlaves[pointi];
|
||||
const labelList& transformedSlaves = pointTransformSlaves[pointi];
|
||||
|
||||
if (slaves.size() > 0)
|
||||
{
|
||||
labelList& myBFaces = globalPointBoundaryFaces[pointI];
|
||||
labelList& myBFaces = globalPointBoundaryFaces[pointi];
|
||||
label sz = myBFaces.size();
|
||||
|
||||
// Count
|
||||
@ -1399,9 +1399,9 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
||||
|
||||
if (transformedSlaves.size() > 0)
|
||||
{
|
||||
const labelList& untrafoFaces = globalPointBoundaryFaces[pointI];
|
||||
const labelList& untrafoFaces = globalPointBoundaryFaces[pointi];
|
||||
|
||||
labelPairList& myBFaces = transformedFaces[pointI];
|
||||
labelPairList& myBFaces = transformedFaces[pointi];
|
||||
label sz = myBFaces.size();
|
||||
|
||||
// Count
|
||||
@ -1447,7 +1447,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
|
||||
|
||||
if (slaves.size() + transformedSlaves.size() == 0)
|
||||
{
|
||||
globalPointBoundaryFaces[pointI].clear();
|
||||
globalPointBoundaryFaces[pointi].clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1508,12 +1508,12 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
||||
// Create addressing for point to boundary cells (local)
|
||||
labelListList pointBoundaryCells(coupledPatch().nPoints());
|
||||
|
||||
forAll(coupledPatch().meshPoints(), pointI)
|
||||
forAll(coupledPatch().meshPoints(), pointi)
|
||||
{
|
||||
label meshPointI = coupledPatch().meshPoints()[pointI];
|
||||
const labelList& pCells = mesh_.pointCells(meshPointI);
|
||||
label meshPointi = coupledPatch().meshPoints()[pointi];
|
||||
const labelList& pCells = mesh_.pointCells(meshPointi);
|
||||
|
||||
labelList& bCells = pointBoundaryCells[pointI];
|
||||
labelList& bCells = pointBoundaryCells[pointi];
|
||||
bCells.setSize(pCells.size());
|
||||
|
||||
forAll(pCells, i)
|
||||
@ -1557,10 +1557,10 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
||||
);
|
||||
labelListList& globalPointBoundaryCells = globalPointBoundaryCellsPtr_();
|
||||
|
||||
forAll(pointBoundaryCells, pointI)
|
||||
forAll(pointBoundaryCells, pointi)
|
||||
{
|
||||
const labelList& pCells = pointBoundaryCells[pointI];
|
||||
labelList& globalCells = globalPointBoundaryCells[pointI];
|
||||
const labelList& pCells = pointBoundaryCells[pointi];
|
||||
labelList& globalCells = globalPointBoundaryCells[pointi];
|
||||
globalCells.setSize(pCells.size());
|
||||
forAll(pCells, i)
|
||||
{
|
||||
@ -1585,14 +1585,14 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
||||
List<labelPairList> transformedCells(pointSlaves.size());
|
||||
|
||||
|
||||
forAll(pointSlaves, pointI)
|
||||
forAll(pointSlaves, pointi)
|
||||
{
|
||||
const labelList& slaves = pointSlaves[pointI];
|
||||
const labelList& transformedSlaves = pointTransformSlaves[pointI];
|
||||
const labelList& slaves = pointSlaves[pointi];
|
||||
const labelList& transformedSlaves = pointTransformSlaves[pointi];
|
||||
|
||||
if (slaves.size() > 0)
|
||||
{
|
||||
labelList& myBCells = globalPointBoundaryCells[pointI];
|
||||
labelList& myBCells = globalPointBoundaryCells[pointi];
|
||||
label sz = myBCells.size();
|
||||
|
||||
// Count
|
||||
@ -1627,9 +1627,9 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
||||
|
||||
if (transformedSlaves.size() > 0)
|
||||
{
|
||||
const labelList& untrafoCells = globalPointBoundaryCells[pointI];
|
||||
const labelList& untrafoCells = globalPointBoundaryCells[pointi];
|
||||
|
||||
labelPairList& myBCells = transformedCells[pointI];
|
||||
labelPairList& myBCells = transformedCells[pointi];
|
||||
label sz = myBCells.size();
|
||||
|
||||
// Count
|
||||
@ -1674,7 +1674,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
|
||||
|
||||
if (slaves.size() + transformedSlaves.size() == 0)
|
||||
{
|
||||
globalPointBoundaryCells[pointI].clear();
|
||||
globalPointBoundaryCells[pointi].clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1868,10 +1868,10 @@ const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const
|
||||
forAll(pointLabels, i)
|
||||
{
|
||||
// Get my mesh point
|
||||
label pointI = pointLabels[i];
|
||||
label pointi = pointLabels[i];
|
||||
|
||||
// Map to mesh point of original mesh
|
||||
sharedPointGlobalLabels[i] = pointProcAddressing[pointI];
|
||||
sharedPointGlobalLabels[i] = pointProcAddressing[pointi];
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1901,9 +1901,9 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
||||
// insert my own data first
|
||||
forAll(pointLabels, i)
|
||||
{
|
||||
label sharedPointI = pointAddr[i];
|
||||
label sharedPointi = pointAddr[i];
|
||||
|
||||
sharedPoints[sharedPointI] = mesh_.points()[pointLabels[i]];
|
||||
sharedPoints[sharedPointi] = mesh_.points()[pointLabels[i]];
|
||||
}
|
||||
|
||||
// Receive data from slaves and insert
|
||||
@ -1922,9 +1922,9 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
|
||||
|
||||
forAll(nbrSharedPointAddr, i)
|
||||
{
|
||||
label sharedPointI = nbrSharedPointAddr[i];
|
||||
label sharedPointi = nbrSharedPointAddr[i];
|
||||
|
||||
sharedPoints[sharedPointI] = nbrSharedPoints[i];
|
||||
sharedPoints[sharedPointi] = nbrSharedPoints[i];
|
||||
}
|
||||
}
|
||||
|
||||
@ -2402,12 +2402,12 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
// - other (since e.g. non-collocated cyclics not connected)
|
||||
|
||||
labelList masterGlobalPoint(cpp.nPoints(), -1);
|
||||
forAll(masterGlobalPoint, pointI)
|
||||
forAll(masterGlobalPoint, pointi)
|
||||
{
|
||||
const labelList& slavePoints = pointSlaves[pointI];
|
||||
const labelList& slavePoints = pointSlaves[pointi];
|
||||
if (slavePoints.size() > 0)
|
||||
{
|
||||
masterGlobalPoint[pointI] = globalCoupledPoints.toGlobal(pointI);
|
||||
masterGlobalPoint[pointi] = globalCoupledPoints.toGlobal(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2425,17 +2425,17 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
// 1. Count number of masters on my processor.
|
||||
label nMaster = 0;
|
||||
PackedBoolList isMaster(mesh_.nPoints(), 1);
|
||||
forAll(pointSlaves, pointI)
|
||||
forAll(pointSlaves, pointi)
|
||||
{
|
||||
if (masterGlobalPoint[pointI] == -1)
|
||||
if (masterGlobalPoint[pointi] == -1)
|
||||
{
|
||||
// unconnected point (e.g. from separated cyclic)
|
||||
nMaster++;
|
||||
}
|
||||
else if
|
||||
(
|
||||
masterGlobalPoint[pointI]
|
||||
== globalCoupledPoints.toGlobal(pointI)
|
||||
masterGlobalPoint[pointi]
|
||||
== globalCoupledPoints.toGlobal(pointi)
|
||||
)
|
||||
{
|
||||
// connected master
|
||||
@ -2444,7 +2444,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
else
|
||||
{
|
||||
// connected slave point
|
||||
isMaster[cpp.meshPoints()[pointI]] = 0;
|
||||
isMaster[cpp.meshPoints()[pointi]] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -2467,12 +2467,12 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
uniquePoints.setSize(myUniquePoints);
|
||||
nMaster = 0;
|
||||
|
||||
forAll(isMaster, meshPointI)
|
||||
forAll(isMaster, meshPointi)
|
||||
{
|
||||
if (isMaster[meshPointI])
|
||||
if (isMaster[meshPointi])
|
||||
{
|
||||
pointToGlobal[meshPointI] = globalPointsPtr().toGlobal(nMaster);
|
||||
uniquePoints[nMaster] = meshPointI;
|
||||
pointToGlobal[meshPointi] = globalPointsPtr().toGlobal(nMaster);
|
||||
uniquePoints[nMaster] = meshPointi;
|
||||
nMaster++;
|
||||
}
|
||||
}
|
||||
@ -2482,18 +2482,18 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
{
|
||||
labelList masterToGlobal(pointSlavesMap.constructSize(), -1);
|
||||
|
||||
forAll(pointSlaves, pointI)
|
||||
forAll(pointSlaves, pointi)
|
||||
{
|
||||
const labelList& slaves = pointSlaves[pointI];
|
||||
const labelList& slaves = pointSlaves[pointi];
|
||||
|
||||
if (slaves.size() > 0)
|
||||
{
|
||||
// Duplicate master globalpoint into slave slots
|
||||
label meshPointI = cpp.meshPoints()[pointI];
|
||||
masterToGlobal[pointI] = pointToGlobal[meshPointI];
|
||||
label meshPointi = cpp.meshPoints()[pointi];
|
||||
masterToGlobal[pointi] = pointToGlobal[meshPointi];
|
||||
forAll(slaves, i)
|
||||
{
|
||||
masterToGlobal[slaves[i]] = masterToGlobal[pointI];
|
||||
masterToGlobal[slaves[i]] = masterToGlobal[pointi];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2502,13 +2502,13 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
pointSlavesMap.reverseDistribute(cpp.nPoints(), masterToGlobal);
|
||||
|
||||
// On slave copy master index into overal map.
|
||||
forAll(pointSlaves, pointI)
|
||||
forAll(pointSlaves, pointi)
|
||||
{
|
||||
label meshPointI = cpp.meshPoints()[pointI];
|
||||
label meshPointi = cpp.meshPoints()[pointi];
|
||||
|
||||
if (!isMaster[meshPointI])
|
||||
if (!isMaster[meshPointi])
|
||||
{
|
||||
pointToGlobal[meshPointI] = masterToGlobal[pointI];
|
||||
pointToGlobal[meshPointi] = masterToGlobal[pointi];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2552,16 +2552,16 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
labelList coupledToGlobalPatch(pointSlavesMap.constructSize(), -1);
|
||||
|
||||
// Note: loop over patch since usually smaller
|
||||
forAll(meshPoints, patchPointI)
|
||||
forAll(meshPoints, patchPointi)
|
||||
{
|
||||
label meshPointI = meshPoints[patchPointI];
|
||||
label meshPointi = meshPoints[patchPointi];
|
||||
|
||||
Map<label>::const_iterator iter = cpp.meshPointMap().find(meshPointI);
|
||||
Map<label>::const_iterator iter = cpp.meshPointMap().find(meshPointi);
|
||||
|
||||
if (iter != cpp.meshPointMap().end())
|
||||
{
|
||||
patchToCoupled[patchPointI] = iter();
|
||||
coupledToGlobalPatch[iter()] = globalPPoints.toGlobal(patchPointI);
|
||||
patchToCoupled[patchPointi] = iter();
|
||||
coupledToGlobalPatch[iter()] = globalPPoints.toGlobal(patchPointi);
|
||||
nCoupled++;
|
||||
}
|
||||
}
|
||||
@ -2580,18 +2580,18 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
|
||||
// Get all data on master
|
||||
pointSlavesMap.distribute(coupledToGlobalPatch);
|
||||
forAll(pointSlaves, coupledPointI)
|
||||
forAll(pointSlaves, coupledPointi)
|
||||
{
|
||||
const labelList& slaves = pointSlaves[coupledPointI];
|
||||
const labelList& slaves = pointSlaves[coupledPointi];
|
||||
|
||||
if (slaves.size() > 0)
|
||||
{
|
||||
// I am master. What is the best candidate for patch-point master
|
||||
label masterI = labelMax;
|
||||
if (coupledToGlobalPatch[coupledPointI] != -1)
|
||||
if (coupledToGlobalPatch[coupledPointi] != -1)
|
||||
{
|
||||
// I am master and on the coupled patch. Use me.
|
||||
masterI = coupledToGlobalPatch[coupledPointI];
|
||||
masterI = coupledToGlobalPatch[coupledPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2609,7 +2609,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
if (masterI != labelMax)
|
||||
{
|
||||
// Push back
|
||||
coupledToGlobalPatch[coupledPointI] = masterI;
|
||||
coupledToGlobalPatch[coupledPointi] = masterI;
|
||||
forAll(slaves, i)
|
||||
{
|
||||
coupledToGlobalPatch[slaves[i]] = masterI;
|
||||
@ -2627,19 +2627,19 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
// compact numbering.
|
||||
|
||||
label nMasters = 0;
|
||||
forAll(meshPoints, patchPointI)
|
||||
forAll(meshPoints, patchPointi)
|
||||
{
|
||||
if (patchToCoupled[patchPointI] == -1)
|
||||
if (patchToCoupled[patchPointi] == -1)
|
||||
{
|
||||
nMasters++;
|
||||
}
|
||||
else
|
||||
{
|
||||
label coupledPointI = patchToCoupled[patchPointI];
|
||||
label coupledPointi = patchToCoupled[patchPointi];
|
||||
if
|
||||
(
|
||||
globalPPoints.toGlobal(patchPointI)
|
||||
== coupledToGlobalPatch[coupledPointI]
|
||||
globalPPoints.toGlobal(patchPointi)
|
||||
== coupledToGlobalPatch[coupledPointi]
|
||||
)
|
||||
{
|
||||
// I am the master
|
||||
@ -2669,24 +2669,24 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
labelList globalMaster(cpp.nPoints(), -1);
|
||||
|
||||
nMasters = 0;
|
||||
forAll(meshPoints, patchPointI)
|
||||
forAll(meshPoints, patchPointi)
|
||||
{
|
||||
if (patchToCoupled[patchPointI] == -1)
|
||||
if (patchToCoupled[patchPointi] == -1)
|
||||
{
|
||||
uniqueMeshPoints[nMasters++] = meshPoints[patchPointI];
|
||||
uniqueMeshPoints[nMasters++] = meshPoints[patchPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
label coupledPointI = patchToCoupled[patchPointI];
|
||||
label coupledPointi = patchToCoupled[patchPointi];
|
||||
if
|
||||
(
|
||||
globalPPoints.toGlobal(patchPointI)
|
||||
== coupledToGlobalPatch[coupledPointI]
|
||||
globalPPoints.toGlobal(patchPointi)
|
||||
== coupledToGlobalPatch[coupledPointi]
|
||||
)
|
||||
{
|
||||
globalMaster[coupledPointI] =
|
||||
globalMaster[coupledPointi] =
|
||||
globalPointsPtr().toGlobal(nMasters);
|
||||
uniqueMeshPoints[nMasters++] = meshPoints[patchPointI];
|
||||
uniqueMeshPoints[nMasters++] = meshPoints[patchPointi];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2706,21 +2706,21 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
|
||||
// Now everyone has the master point in globalPointsPtr numbering. Fill
|
||||
// in the pointToGlobal map.
|
||||
nMasters = 0;
|
||||
forAll(meshPoints, patchPointI)
|
||||
forAll(meshPoints, patchPointi)
|
||||
{
|
||||
if (patchToCoupled[patchPointI] == -1)
|
||||
if (patchToCoupled[patchPointi] == -1)
|
||||
{
|
||||
pointToGlobal[patchPointI] = globalPointsPtr().toGlobal(nMasters++);
|
||||
pointToGlobal[patchPointi] = globalPointsPtr().toGlobal(nMasters++);
|
||||
}
|
||||
else
|
||||
{
|
||||
label coupledPointI = patchToCoupled[patchPointI];
|
||||
pointToGlobal[patchPointI] = globalMaster[coupledPointI];
|
||||
label coupledPointi = patchToCoupled[patchPointi];
|
||||
pointToGlobal[patchPointi] = globalMaster[coupledPointi];
|
||||
|
||||
if
|
||||
(
|
||||
globalPPoints.toGlobal(patchPointI)
|
||||
== coupledToGlobalPatch[coupledPointI]
|
||||
globalPPoints.toGlobal(patchPointi)
|
||||
== coupledToGlobalPatch[coupledPointi]
|
||||
)
|
||||
{
|
||||
nMasters++;
|
||||
|
||||
@ -126,7 +126,7 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
|
||||
void Foam::globalPoints::addToSend
|
||||
(
|
||||
const polyPatch& pp,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const labelPairList& knownInfo,
|
||||
|
||||
DynamicList<label>& patchFaces,
|
||||
@ -138,11 +138,11 @@ void Foam::globalPoints::addToSend
|
||||
// information is the patch faces using the point and the relative position
|
||||
// of the point in the face)
|
||||
|
||||
label meshPointI = pp.meshPoints()[patchPointI];
|
||||
label meshPointi = pp.meshPoints()[patchPointi];
|
||||
|
||||
// Add all faces using the point so we are sure we find it on the
|
||||
// other side.
|
||||
const labelList& pFaces = pp.pointFaces()[patchPointI];
|
||||
const labelList& pFaces = pp.pointFaces()[patchPointi];
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
@ -151,7 +151,7 @@ void Foam::globalPoints::addToSend
|
||||
const face& f = pp[patchFacei];
|
||||
|
||||
patchFaces.append(patchFacei);
|
||||
indexInFace.append(findIndex(f, meshPointI));
|
||||
indexInFace.append(findIndex(f, meshPointi));
|
||||
|
||||
// Add patch transformation
|
||||
allInfo.append(addSendTransform(pp.index(), knownInfo));
|
||||
@ -162,7 +162,7 @@ void Foam::globalPoints::addToSend
|
||||
bool Foam::globalPoints::mergeInfo
|
||||
(
|
||||
const labelPairList& nbrInfo,
|
||||
const label localPointI,
|
||||
const label localPointi,
|
||||
labelPairList& myInfo
|
||||
) const
|
||||
{
|
||||
@ -194,7 +194,7 @@ bool Foam::globalPoints::mergeInfo
|
||||
}
|
||||
else
|
||||
{
|
||||
// Same point. So we already have a connection between localPointI
|
||||
// Same point. So we already have a connection between localPointi
|
||||
// and the nbrIndex. Two situations:
|
||||
// - same transform
|
||||
// - one transform takes two steps, the other just a single.
|
||||
@ -240,14 +240,14 @@ bool Foam::globalPoints::mergeInfo
|
||||
Foam::label Foam::globalPoints::meshToLocalPoint
|
||||
(
|
||||
const Map<label>& meshToPatchPoint, // from mesh point to local numbering
|
||||
const label meshPointI
|
||||
const label meshPointi
|
||||
)
|
||||
{
|
||||
return
|
||||
(
|
||||
meshToPatchPoint.size() == 0
|
||||
? meshPointI
|
||||
: meshToPatchPoint[meshPointI]
|
||||
? meshPointi
|
||||
: meshToPatchPoint[meshPointi]
|
||||
);
|
||||
}
|
||||
|
||||
@ -255,14 +255,14 @@ Foam::label Foam::globalPoints::meshToLocalPoint
|
||||
Foam::label Foam::globalPoints::localToMeshPoint
|
||||
(
|
||||
const labelList& patchToMeshPoint,
|
||||
const label localPointI
|
||||
const label localPointi
|
||||
)
|
||||
{
|
||||
return
|
||||
(
|
||||
patchToMeshPoint.size() == 0
|
||||
? localPointI
|
||||
: patchToMeshPoint[localPointI]
|
||||
? localPointi
|
||||
: patchToMeshPoint[localPointi]
|
||||
);
|
||||
}
|
||||
|
||||
@ -270,20 +270,20 @@ Foam::label Foam::globalPoints::localToMeshPoint
|
||||
bool Foam::globalPoints::mergeInfo
|
||||
(
|
||||
const labelPairList& nbrInfo,
|
||||
const label localPointI
|
||||
const label localPointi
|
||||
)
|
||||
{
|
||||
// Updates database of current information on meshpoints with nbrInfo. Uses
|
||||
// mergeInfo above. Returns true if data kept for meshPointI changed.
|
||||
// mergeInfo above. Returns true if data kept for meshPointi changed.
|
||||
|
||||
label infoChanged = false;
|
||||
|
||||
// Get the index into the procPoints list.
|
||||
Map<label>::iterator iter = meshToProcPoint_.find(localPointI);
|
||||
Map<label>::iterator iter = meshToProcPoint_.find(localPointi);
|
||||
|
||||
if (iter != meshToProcPoint_.end())
|
||||
{
|
||||
if (mergeInfo(nbrInfo, localPointI, procPoints_[iter()]))
|
||||
if (mergeInfo(nbrInfo, localPointi, procPoints_[iter()]))
|
||||
{
|
||||
infoChanged = true;
|
||||
}
|
||||
@ -297,15 +297,15 @@ bool Foam::globalPoints::mergeInfo
|
||||
globalIndexAndTransform::encode
|
||||
(
|
||||
Pstream::myProcNo(),
|
||||
localPointI,
|
||||
localPointi,
|
||||
globalTransforms_.nullTransformIndex()
|
||||
)
|
||||
);
|
||||
|
||||
if (mergeInfo(nbrInfo, localPointI, knownInfo))
|
||||
if (mergeInfo(nbrInfo, localPointi, knownInfo))
|
||||
{
|
||||
// Update addressing from into procPoints
|
||||
meshToProcPoint_.insert(localPointI, procPoints_.size());
|
||||
meshToProcPoint_.insert(localPointi, procPoints_.size());
|
||||
// Insert into list of equivalences.
|
||||
procPoints_.append(knownInfo);
|
||||
|
||||
@ -319,20 +319,20 @@ bool Foam::globalPoints::mergeInfo
|
||||
bool Foam::globalPoints::storeInitialInfo
|
||||
(
|
||||
const labelPairList& nbrInfo,
|
||||
const label localPointI
|
||||
const label localPointi
|
||||
)
|
||||
{
|
||||
// Updates database of current information on meshpoints with nbrInfo. Uses
|
||||
// mergeInfo above. Returns true if data kept for meshPointI changed.
|
||||
// mergeInfo above. Returns true if data kept for meshPointi changed.
|
||||
|
||||
label infoChanged = false;
|
||||
|
||||
// Get the index into the procPoints list.
|
||||
Map<label>::iterator iter = meshToProcPoint_.find(localPointI);
|
||||
Map<label>::iterator iter = meshToProcPoint_.find(localPointi);
|
||||
|
||||
if (iter != meshToProcPoint_.end())
|
||||
{
|
||||
if (mergeInfo(nbrInfo, localPointI, procPoints_[iter()]))
|
||||
if (mergeInfo(nbrInfo, localPointi, procPoints_[iter()]))
|
||||
{
|
||||
infoChanged = true;
|
||||
}
|
||||
@ -340,7 +340,7 @@ bool Foam::globalPoints::storeInitialInfo
|
||||
else
|
||||
{
|
||||
// Update addressing into procPoints
|
||||
meshToProcPoint_.insert(localPointI, procPoints_.size());
|
||||
meshToProcPoint_.insert(localPointi, procPoints_.size());
|
||||
// Insert into list of equivalences.
|
||||
procPoints_.append(nbrInfo);
|
||||
|
||||
@ -369,8 +369,8 @@ void Foam::globalPoints::printProcPoint
|
||||
|
||||
if (proci == Pstream::myProcNo())
|
||||
{
|
||||
label meshPointI = localToMeshPoint(patchToMeshPoint, index);
|
||||
Pout<< " at:" << mesh_.points()[meshPointI];
|
||||
label meshPointi = localToMeshPoint(patchToMeshPoint, index);
|
||||
Pout<< " at:" << mesh_.points()[meshPointi];
|
||||
}
|
||||
}
|
||||
|
||||
@ -409,13 +409,13 @@ void Foam::globalPoints::initOwnPoints
|
||||
if (allPoints)
|
||||
{
|
||||
// All points on patch
|
||||
forAll(meshPoints, patchPointI)
|
||||
forAll(meshPoints, patchPointi)
|
||||
{
|
||||
label meshPointI = meshPoints[patchPointI];
|
||||
label localPointI = meshToLocalPoint
|
||||
label meshPointi = meshPoints[patchPointi];
|
||||
label localPointi = meshToLocalPoint
|
||||
(
|
||||
meshToPatchPoint,
|
||||
meshPointI
|
||||
meshPointi
|
||||
);
|
||||
|
||||
labelPairList knownInfo
|
||||
@ -424,19 +424,19 @@ void Foam::globalPoints::initOwnPoints
|
||||
globalIndexAndTransform::encode
|
||||
(
|
||||
Pstream::myProcNo(),
|
||||
localPointI,
|
||||
localPointi,
|
||||
globalTransforms_.nullTransformIndex()
|
||||
)
|
||||
);
|
||||
|
||||
//Pout<< "For point "<< pp.points()[meshPointI]
|
||||
//Pout<< "For point "<< pp.points()[meshPointi]
|
||||
// << " inserting info " << knownInfo
|
||||
// << endl;
|
||||
|
||||
// Update changedpoints info.
|
||||
if (storeInitialInfo(knownInfo, localPointI))
|
||||
if (storeInitialInfo(knownInfo, localPointi))
|
||||
{
|
||||
changedPoints.insert(localPointI);
|
||||
changedPoints.insert(localPointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -447,11 +447,11 @@ void Foam::globalPoints::initOwnPoints
|
||||
|
||||
forAll(boundaryPoints, i)
|
||||
{
|
||||
label meshPointI = meshPoints[boundaryPoints[i]];
|
||||
label localPointI = meshToLocalPoint
|
||||
label meshPointi = meshPoints[boundaryPoints[i]];
|
||||
label localPointi = meshToLocalPoint
|
||||
(
|
||||
meshToPatchPoint,
|
||||
meshPointI
|
||||
meshPointi
|
||||
);
|
||||
|
||||
labelPairList knownInfo
|
||||
@ -460,14 +460,14 @@ void Foam::globalPoints::initOwnPoints
|
||||
globalIndexAndTransform::encode
|
||||
(
|
||||
Pstream::myProcNo(),
|
||||
localPointI,
|
||||
localPointi,
|
||||
globalTransforms_.nullTransformIndex()
|
||||
)
|
||||
);
|
||||
|
||||
if (storeInitialInfo(knownInfo, localPointI))
|
||||
if (storeInitialInfo(knownInfo, localPointi))
|
||||
{
|
||||
changedPoints.insert(localPointI);
|
||||
changedPoints.insert(localPointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -518,27 +518,27 @@ void Foam::globalPoints::sendPatchPoints
|
||||
|
||||
const labelList& meshPoints = pp.meshPoints();
|
||||
|
||||
forAll(meshPoints, patchPointI)
|
||||
forAll(meshPoints, patchPointi)
|
||||
{
|
||||
label meshPointI = meshPoints[patchPointI];
|
||||
label localPointI = meshToLocalPoint
|
||||
label meshPointi = meshPoints[patchPointi];
|
||||
label localPointi = meshToLocalPoint
|
||||
(
|
||||
meshToPatchPoint,
|
||||
meshPointI
|
||||
meshPointi
|
||||
);
|
||||
|
||||
if (changedPoints.found(localPointI))
|
||||
if (changedPoints.found(localPointi))
|
||||
{
|
||||
label index = meshToProcPoint_[localPointI];
|
||||
label index = meshToProcPoint_[localPointi];
|
||||
|
||||
const labelPairList& knownInfo = procPoints_[index];
|
||||
|
||||
// Add my information about localPointI to the
|
||||
// Add my information about localPointi to the
|
||||
// send buffers. Encode the transformation
|
||||
addToSend
|
||||
(
|
||||
pp,
|
||||
patchPointI,
|
||||
patchPointi,
|
||||
knownInfo,
|
||||
|
||||
patchFaces,
|
||||
@ -622,17 +622,17 @@ void Foam::globalPoints::receivePatchPoints
|
||||
label index = (f.size() - indexInFace[i]) % f.size();
|
||||
|
||||
// Get the meshpoint on my side
|
||||
label meshPointI = f[index];
|
||||
label meshPointi = f[index];
|
||||
|
||||
label localPointI = meshToLocalPoint
|
||||
label localPointi = meshToLocalPoint
|
||||
(
|
||||
meshToPatchPoint,
|
||||
meshPointI
|
||||
meshPointi
|
||||
);
|
||||
|
||||
if (mergeInfo(nbrInfo[i], localPointI))
|
||||
if (mergeInfo(nbrInfo[i], localPointi))
|
||||
{
|
||||
changedPoints.insert(localPointI);
|
||||
changedPoints.insert(localPointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -740,7 +740,7 @@ void Foam::globalPoints::remove
|
||||
// Go through all equivalences
|
||||
forAllConstIter(Map<label>, oldMeshToProcPoint, iter)
|
||||
{
|
||||
label localPointI = iter.key();
|
||||
label localPointi = iter.key();
|
||||
const labelPairList& pointInfo = oldProcPoints[iter()];
|
||||
|
||||
if (pointInfo.size() == 2)
|
||||
@ -801,7 +801,7 @@ void Foam::globalPoints::remove
|
||||
// be found if the two domains are face connected at all
|
||||
// (not shown in the picture)
|
||||
|
||||
meshToProcPoint_.insert(localPointI, procPoints_.size());
|
||||
meshToProcPoint_.insert(localPointi, procPoints_.size());
|
||||
procPoints_.append(pointInfo);
|
||||
}
|
||||
}
|
||||
@ -820,13 +820,13 @@ void Foam::globalPoints::remove
|
||||
)
|
||||
)
|
||||
{
|
||||
meshToProcPoint_.insert(localPointI, procPoints_.size());
|
||||
meshToProcPoint_.insert(localPointi, procPoints_.size());
|
||||
procPoints_.append(pointInfo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meshToProcPoint_.insert(localPointI, procPoints_.size());
|
||||
meshToProcPoint_.insert(localPointi, procPoints_.size());
|
||||
procPoints_.append(pointInfo);
|
||||
}
|
||||
}
|
||||
@ -972,7 +972,7 @@ void Foam::globalPoints::calculateSharedPoints
|
||||
//{
|
||||
// label localI = iter.key();
|
||||
// const labelPairList& pointInfo = procPoints_[iter()];
|
||||
// Pout<< "pointI:" << localI << " index:" << iter()
|
||||
// Pout<< "pointi:" << localI << " index:" << iter()
|
||||
// << " coord:"
|
||||
// << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)]
|
||||
// << endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -152,16 +152,16 @@ class globalPoints
|
||||
|
||||
labelPairList addSendTransform
|
||||
(
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const labelPairList& info
|
||||
) const;
|
||||
|
||||
//- Add information about patchPointI in relative indices to send
|
||||
//- Add information about patchPointi in relative indices to send
|
||||
// buffers (patchFaces, indexInFace etc.)
|
||||
void addToSend
|
||||
(
|
||||
const polyPatch&,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const labelPairList&,
|
||||
DynamicList<label>& patchFaces,
|
||||
DynamicList<label>& indexInFace,
|
||||
@ -172,7 +172,7 @@ class globalPoints
|
||||
bool mergeInfo
|
||||
(
|
||||
const labelPairList& nbrInfo,
|
||||
const label localPointI,
|
||||
const label localPointi,
|
||||
labelPairList& myInfo
|
||||
) const;
|
||||
|
||||
@ -181,28 +181,28 @@ class globalPoints
|
||||
static label meshToLocalPoint
|
||||
(
|
||||
const Map<label>& meshToPatchPoint,
|
||||
const label meshPointI
|
||||
const label meshPointi
|
||||
);
|
||||
|
||||
//- Opposite of meshToLocalPoint.
|
||||
static label localToMeshPoint
|
||||
(
|
||||
const labelList& patchToMeshPoint,
|
||||
const label localPointI
|
||||
const label localPointi
|
||||
);
|
||||
|
||||
//- Store (and merge) info for meshPointI
|
||||
//- Store (and merge) info for meshPointi
|
||||
bool storeInitialInfo
|
||||
(
|
||||
const labelPairList& nbrInfo,
|
||||
const label localPointI
|
||||
const label localPointi
|
||||
);
|
||||
|
||||
//- Store (and merge) info for meshPointI
|
||||
//- Store (and merge) info for meshPointi
|
||||
bool mergeInfo
|
||||
(
|
||||
const labelPairList& nbrInfo,
|
||||
const label localPointI
|
||||
const label localPointi
|
||||
);
|
||||
|
||||
//- Debug printing
|
||||
|
||||
@ -52,19 +52,19 @@ Description
|
||||
\par points
|
||||
|
||||
- unchanged:
|
||||
- pointMap[pointI] contains old point label
|
||||
- reversePointMap[oldPointI] contains new point label
|
||||
- pointMap[pointi] contains old point label
|
||||
- reversePointMap[oldPointi] contains new point label
|
||||
- removed:
|
||||
- reversePointMap[oldPointI] contains -1
|
||||
- reversePointMap[oldPointi] contains -1
|
||||
- merged into point:
|
||||
- reversePointMap[oldPointI] contains <-1 : -newPointI-2
|
||||
- pointMap[pointI] contains the old master point label
|
||||
- pointsFromPoints gives for pointI all the old point labels
|
||||
- reversePointMap[oldPointi] contains <-1 : -newPointi-2
|
||||
- pointMap[pointi] contains the old master point label
|
||||
- pointsFromPoints gives for pointi all the old point labels
|
||||
(including the old master point!)
|
||||
- added-from-same:
|
||||
- pointMap[pointI] contains the old master point label
|
||||
- pointMap[pointi] contains the old master point label
|
||||
- appended:
|
||||
- pointMap[pointI] contains -1
|
||||
- pointMap[pointi] contains -1
|
||||
|
||||
\par faces
|
||||
|
||||
@ -468,9 +468,9 @@ public:
|
||||
|
||||
//- If point is removed return point (on new mesh) it merged
|
||||
// into
|
||||
label mergedPoint(const label oldPointI) const
|
||||
label mergedPoint(const label oldPointi) const
|
||||
{
|
||||
label i = reversePointMap_[oldPointI];
|
||||
label i = reversePointMap_[oldPointi];
|
||||
|
||||
if (i == -1)
|
||||
{
|
||||
@ -483,7 +483,7 @@ public:
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "old point label " << oldPointI
|
||||
<< "old point label " << oldPointi
|
||||
<< " has reverseMap " << i << endl
|
||||
<< "Only call mergedPoint for removed points."
|
||||
<< abort(FatalError);
|
||||
|
||||
@ -1315,24 +1315,24 @@ bool Foam::polyMesh::pointInCell
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI;
|
||||
label nextPointI;
|
||||
label pointi;
|
||||
label nextPointi;
|
||||
|
||||
if (isOwn)
|
||||
{
|
||||
pointI = f[fp];
|
||||
nextPointI = f.nextLabel(fp);
|
||||
pointi = f[fp];
|
||||
nextPointi = f.nextLabel(fp);
|
||||
}
|
||||
else
|
||||
{
|
||||
pointI = f.nextLabel(fp);
|
||||
nextPointI = f[fp];
|
||||
pointi = f.nextLabel(fp);
|
||||
nextPointi = f[fp];
|
||||
}
|
||||
|
||||
triPointRef faceTri
|
||||
(
|
||||
points()[pointI],
|
||||
points()[nextPointI],
|
||||
points()[pointi],
|
||||
points()[nextPointi],
|
||||
fc
|
||||
);
|
||||
|
||||
|
||||
@ -61,9 +61,9 @@ Foam::labelListList Foam::polyMesh::cellShapePointCells
|
||||
|
||||
labelListList pointCellAddr(pc.size());
|
||||
|
||||
forAll(pc, pointI)
|
||||
forAll(pc, pointi)
|
||||
{
|
||||
pointCellAddr[pointI].transfer(pc[pointI]);
|
||||
pointCellAddr[pointi].transfer(pc[pointi]);
|
||||
}
|
||||
|
||||
return pointCellAddr;
|
||||
@ -89,9 +89,9 @@ Foam::labelList Foam::polyMesh::facePatchFaceCells
|
||||
const face& curFace = patchFaces[fI];
|
||||
const labelList& facePoints = patchFaces[fI];
|
||||
|
||||
forAll(facePoints, pointI)
|
||||
forAll(facePoints, pointi)
|
||||
{
|
||||
const labelList& facePointCells = pointCells[facePoints[pointI]];
|
||||
const labelList& facePointCells = pointCells[facePoints[pointi]];
|
||||
|
||||
forAll(facePointCells, celli)
|
||||
{
|
||||
@ -203,11 +203,11 @@ void Foam::polyMesh::setTopology
|
||||
const labelList& curPoints = curFace;
|
||||
|
||||
// For all points
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
// dGget the list of cells sharing this point
|
||||
const labelList& curNeighbours =
|
||||
PointCells[curPoints[pointI]];
|
||||
PointCells[curPoints[pointi]];
|
||||
|
||||
// For all neighbours
|
||||
forAll(curNeighbours, neiI)
|
||||
|
||||
@ -82,11 +82,11 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
|
||||
|
||||
// Any points created out-of-nothing get set to the current coordinate
|
||||
// for lack of anything better.
|
||||
forAll(mpm.pointMap(), newPointI)
|
||||
forAll(mpm.pointMap(), newPointi)
|
||||
{
|
||||
if (mpm.pointMap()[newPointI] == -1)
|
||||
if (mpm.pointMap()[newPointi] == -1)
|
||||
{
|
||||
newMotionPoints[newPointI] = points_[newPointI];
|
||||
newMotionPoints[newPointi] = points_[newPointi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -354,15 +354,15 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
|
||||
labelList pointFace(nPoints());
|
||||
labelList pointIndex(nPoints());
|
||||
|
||||
for (label patchPointI = 0; patchPointI < nPoints(); patchPointI++)
|
||||
for (label patchPointi = 0; patchPointi < nPoints(); patchPointi++)
|
||||
{
|
||||
label facei = pointFaces()[patchPointI][0];
|
||||
label facei = pointFaces()[patchPointi][0];
|
||||
|
||||
pointFace[patchPointI] = facei;
|
||||
pointFace[patchPointi] = facei;
|
||||
|
||||
const face& f = localFaces()[facei];
|
||||
|
||||
pointIndex[patchPointI] = findIndex(f, patchPointI);
|
||||
pointIndex[patchPointi] = findIndex(f, patchPointi);
|
||||
}
|
||||
|
||||
// Express all edges as patch face and index in face.
|
||||
@ -433,32 +433,32 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
|
||||
neighbPointsPtr_.reset(new labelList(nPoints(), -1));
|
||||
labelList& neighbPoints = neighbPointsPtr_();
|
||||
|
||||
forAll(nbrPointFace, nbrPointI)
|
||||
forAll(nbrPointFace, nbrPointi)
|
||||
{
|
||||
// Find face and index in face on this side.
|
||||
const face& f = localFaces()[nbrPointFace[nbrPointI]];
|
||||
const face& f = localFaces()[nbrPointFace[nbrPointi]];
|
||||
|
||||
label index = (f.size() - nbrPointIndex[nbrPointI]) % f.size();
|
||||
label patchPointI = f[index];
|
||||
label index = (f.size() - nbrPointIndex[nbrPointi]) % f.size();
|
||||
label patchPointi = f[index];
|
||||
|
||||
if (neighbPoints[patchPointI] == -1)
|
||||
if (neighbPoints[patchPointi] == -1)
|
||||
{
|
||||
// First reference of point
|
||||
neighbPoints[patchPointI] = nbrPointI;
|
||||
neighbPoints[patchPointi] = nbrPointi;
|
||||
}
|
||||
else if (neighbPoints[patchPointI] >= 0)
|
||||
else if (neighbPoints[patchPointi] >= 0)
|
||||
{
|
||||
// Point already visited. Mark as duplicate.
|
||||
neighbPoints[patchPointI] = -2;
|
||||
neighbPoints[patchPointi] = -2;
|
||||
}
|
||||
}
|
||||
|
||||
// Reset all duplicate entries to -1.
|
||||
forAll(neighbPoints, patchPointI)
|
||||
forAll(neighbPoints, patchPointi)
|
||||
{
|
||||
if (neighbPoints[patchPointI] == -2)
|
||||
if (neighbPoints[patchPointi] == -2)
|
||||
{
|
||||
neighbPoints[patchPointI] = -1;
|
||||
neighbPoints[patchPointi] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -73,32 +73,32 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
|
||||
const labelListList& transformedSlaves =
|
||||
globalData.globalPointTransformedSlaves();
|
||||
|
||||
forAll(meshPoints, coupledPointI)
|
||||
forAll(meshPoints, coupledPointi)
|
||||
{
|
||||
label meshPointI = meshPoints[coupledPointI];
|
||||
label meshPointi = meshPoints[coupledPointi];
|
||||
if
|
||||
(
|
||||
(
|
||||
slaves[coupledPointI].size()
|
||||
+ transformedSlaves[coupledPointI].size()
|
||||
slaves[coupledPointi].size()
|
||||
+ transformedSlaves[coupledPointi].size()
|
||||
)
|
||||
> 0
|
||||
)
|
||||
{
|
||||
isMasterPoint[meshPointI] = true;
|
||||
isMasterPoint[meshPointi] = true;
|
||||
}
|
||||
donePoint[meshPointI] = true;
|
||||
donePoint[meshPointi] = true;
|
||||
}
|
||||
|
||||
|
||||
// Do all other points
|
||||
// ~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
forAll(donePoint, pointI)
|
||||
forAll(donePoint, pointi)
|
||||
{
|
||||
if (!donePoint[pointI])
|
||||
if (!donePoint[pointi])
|
||||
{
|
||||
isMasterPoint[pointI] = true;
|
||||
isMasterPoint[pointi] = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -108,10 +108,10 @@ void Foam::syncTools::syncPointMap
|
||||
// Fill my entries in the shared points
|
||||
forAll(sharedPtLabels, i)
|
||||
{
|
||||
label meshPointI = sharedPtLabels[i];
|
||||
label meshPointi = sharedPtLabels[i];
|
||||
|
||||
typename Map<T>::const_iterator fnd =
|
||||
pointValues.find(meshPointI);
|
||||
pointValues.find(meshPointi);
|
||||
|
||||
if (fnd != pointValues.end())
|
||||
{
|
||||
@ -791,9 +791,9 @@ void Foam::syncTools::syncEdgeMap
|
||||
//
|
||||
// forAll(pd.sharedPointLabels(), i)
|
||||
// {
|
||||
// label meshPointI = pd.sharedPointLabels()[i];
|
||||
// label meshPointi = pd.sharedPointLabels()[i];
|
||||
// // Fill my entries in the shared points
|
||||
// sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI];
|
||||
// sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointi];
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@ -820,10 +820,10 @@ void Foam::syncTools::syncEdgeMap
|
||||
// const labelList& meshPts = procPatch.meshPoints();
|
||||
// const labelList& nbrPts = procPatch.neighbPoints();
|
||||
//
|
||||
// forAll(nbrPts, pointI)
|
||||
// forAll(nbrPts, pointi)
|
||||
// {
|
||||
// label nbrPointI = nbrPts[pointI];
|
||||
// patchInfo[nbrPointI] = pointValues[meshPts[pointI]];
|
||||
// label nbrPointi = nbrPts[pointi];
|
||||
// patchInfo[nbrPointi] = pointValues[meshPts[pointi]];
|
||||
// }
|
||||
//
|
||||
// UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
|
||||
@ -857,10 +857,10 @@ void Foam::syncTools::syncEdgeMap
|
||||
//
|
||||
// const labelList& meshPts = procPatch.meshPoints();
|
||||
//
|
||||
// forAll(meshPts, pointI)
|
||||
// forAll(meshPts, pointi)
|
||||
// {
|
||||
// label meshPointI = meshPts[pointI];
|
||||
// cop(pointValues[meshPointI], nbrPatchInfo[pointI]);
|
||||
// label meshPointi = meshPts[pointi];
|
||||
// cop(pointValues[meshPointi], nbrPatchInfo[pointi]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -924,8 +924,8 @@ void Foam::syncTools::syncEdgeMap
|
||||
// // my local information.
|
||||
// forAll(pd.sharedPointLabels(), i)
|
||||
// {
|
||||
// label meshPointI = pd.sharedPointLabels()[i];
|
||||
// pointValues[meshPointI] = sharedPts[pd.sharedPointAddr()[i]];
|
||||
// label meshPointi = pd.sharedPointLabels()[i];
|
||||
// pointValues[meshPointi] = sharedPts[pd.sharedPointAddr()[i]];
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@ -1046,8 +1046,8 @@ void Foam::syncTools::syncPointList
|
||||
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label pointI = meshPoints[i];
|
||||
Map<label>::const_iterator iter = mpm.find(pointI);
|
||||
label pointi = meshPoints[i];
|
||||
Map<label>::const_iterator iter = mpm.find(pointi);
|
||||
if (iter != mpm.end())
|
||||
{
|
||||
cppFld[iter()] = pointValues[i];
|
||||
@ -1067,8 +1067,8 @@ void Foam::syncTools::syncPointList
|
||||
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label pointI = meshPoints[i];
|
||||
Map<label>::const_iterator iter = mpm.find(pointI);
|
||||
label pointi = meshPoints[i];
|
||||
Map<label>::const_iterator iter = mpm.find(pointi);
|
||||
if (iter != mpm.end())
|
||||
{
|
||||
pointValues[i] = cppFld[iter()];
|
||||
@ -1102,8 +1102,8 @@ void Foam::syncTools::syncPointList
|
||||
//
|
||||
// forAll(meshPoints, i)
|
||||
// {
|
||||
// label pointI = meshPoints[i];
|
||||
// Map<label>::const_iterator iter = mpm.find(pointI);
|
||||
// label pointi = meshPoints[i];
|
||||
// Map<label>::const_iterator iter = mpm.find(pointi);
|
||||
// if (iter != mpm.end())
|
||||
// {
|
||||
// cppFld[iter()] = pointValues[i];
|
||||
@ -1124,8 +1124,8 @@ void Foam::syncTools::syncPointList
|
||||
//
|
||||
// forAll(meshPoints, i)
|
||||
// {
|
||||
// label pointI = meshPoints[i];
|
||||
// Map<label>::const_iterator iter = mpm.find(pointI);
|
||||
// label pointi = meshPoints[i];
|
||||
// Map<label>::const_iterator iter = mpm.find(pointi);
|
||||
// if (iter != mpm.end())
|
||||
// {
|
||||
// pointValues[i] = cppFld[iter()];
|
||||
|
||||
@ -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
|
||||
@ -143,37 +143,37 @@ bool Foam::pointZone::checkParallelSync(const bool report) const
|
||||
labelList minZone(mesh.nPoints(), labelMax);
|
||||
forAll(*this, i)
|
||||
{
|
||||
label pointI = operator[](i);
|
||||
maxZone[pointI] = index();
|
||||
minZone[pointI] = index();
|
||||
label pointi = operator[](i);
|
||||
maxZone[pointi] = index();
|
||||
minZone[pointi] = index();
|
||||
}
|
||||
syncTools::syncPointList(mesh, maxZone, maxEqOp<label>(), label(-1));
|
||||
syncTools::syncPointList(mesh, minZone, minEqOp<label>(), labelMax);
|
||||
|
||||
bool error = false;
|
||||
|
||||
forAll(maxZone, pointI)
|
||||
forAll(maxZone, pointi)
|
||||
{
|
||||
// Check point in same (or no) zone on all processors
|
||||
if
|
||||
(
|
||||
(
|
||||
maxZone[pointI] != -1
|
||||
|| minZone[pointI] != labelMax
|
||||
maxZone[pointi] != -1
|
||||
|| minZone[pointi] != labelMax
|
||||
)
|
||||
&& (maxZone[pointI] != minZone[pointI])
|
||||
&& (maxZone[pointi] != minZone[pointi])
|
||||
)
|
||||
{
|
||||
if (report && !error)
|
||||
{
|
||||
Info<< " ***Problem with pointZone " << index()
|
||||
<< " named " << name()
|
||||
<< ". Point " << pointI
|
||||
<< " at " << mesh.points()[pointI]
|
||||
<< ". Point " << pointi
|
||||
<< " at " << mesh.points()[pointi]
|
||||
<< " is in zone "
|
||||
<< (minZone[pointI] == labelMax ? -1 : minZone[pointI])
|
||||
<< (minZone[pointi] == labelMax ? -1 : minZone[pointi])
|
||||
<< " on some processors and in zone "
|
||||
<< maxZone[pointI]
|
||||
<< maxZone[pointi]
|
||||
<< " on some other processors." << nl
|
||||
<< "(suppressing further warnings)"
|
||||
<< endl;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -52,18 +52,18 @@ void Foam::PatchTools::matchPoints
|
||||
|
||||
label nMatches = 0;
|
||||
|
||||
forAll(p1.meshPoints(), pointI)
|
||||
forAll(p1.meshPoints(), pointi)
|
||||
{
|
||||
label meshPointI = p1.meshPoints()[pointI];
|
||||
label meshPointi = p1.meshPoints()[pointi];
|
||||
|
||||
Map<label>::const_iterator iter = p2.meshPointMap().find
|
||||
(
|
||||
meshPointI
|
||||
meshPointi
|
||||
);
|
||||
|
||||
if (iter != p2.meshPointMap().end())
|
||||
{
|
||||
p1PointLabels[nMatches] = pointI;
|
||||
p1PointLabels[nMatches] = pointi;
|
||||
p2PointLabels[nMatches] = iter();
|
||||
nMatches++;
|
||||
}
|
||||
|
||||
@ -64,16 +64,16 @@ Foam::PatchTools::pointNormals
|
||||
{
|
||||
// Collect local pointFaces (sized on patch points only)
|
||||
List<List<point>> pointFaceNormals(map.constructSize());
|
||||
forAll(p.meshPoints(), patchPointI)
|
||||
forAll(p.meshPoints(), patchPointi)
|
||||
{
|
||||
label meshPointI = p.meshPoints()[patchPointI];
|
||||
Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI);
|
||||
label meshPointi = p.meshPoints()[patchPointi];
|
||||
Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
|
||||
if (fnd != coupledPatchMP.end())
|
||||
{
|
||||
label coupledPointI = fnd();
|
||||
label coupledPointi = fnd();
|
||||
|
||||
List<point>& pNormals = pointFaceNormals[coupledPointI];
|
||||
const labelList& pFaces = p.pointFaces()[patchPointI];
|
||||
List<point>& pNormals = pointFaceNormals[coupledPointi];
|
||||
const labelList& pFaces = p.pointFaces()[patchPointi];
|
||||
pNormals.setSize(pFaces.size());
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
@ -99,16 +99,16 @@ Foam::PatchTools::pointNormals
|
||||
const labelListList& transformedSlaves =
|
||||
globalData.globalPointTransformedSlaves();
|
||||
|
||||
forAll(slaves, coupledPointI)
|
||||
forAll(slaves, coupledPointi)
|
||||
{
|
||||
const labelList& slaveSlots = slaves[coupledPointI];
|
||||
const labelList& slaveSlots = slaves[coupledPointi];
|
||||
const labelList& transformedSlaveSlots =
|
||||
transformedSlaves[coupledPointI];
|
||||
transformedSlaves[coupledPointi];
|
||||
|
||||
point& n = coupledPointNormals[coupledPointI];
|
||||
point& n = coupledPointNormals[coupledPointi];
|
||||
|
||||
// Local entries
|
||||
const List<point>& local = pointFaceNormals[coupledPointI];
|
||||
const List<point>& local = pointFaceNormals[coupledPointi];
|
||||
|
||||
label nFaces =
|
||||
local.size()
|
||||
@ -178,14 +178,14 @@ Foam::PatchTools::pointNormals
|
||||
|
||||
|
||||
// 2. Override patch normals on coupled points
|
||||
forAll(p.meshPoints(), patchPointI)
|
||||
forAll(p.meshPoints(), patchPointi)
|
||||
{
|
||||
label meshPointI = p.meshPoints()[patchPointI];
|
||||
Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI);
|
||||
label meshPointi = p.meshPoints()[patchPointi];
|
||||
Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
|
||||
if (fnd != coupledPatchMP.end())
|
||||
{
|
||||
label coupledPointI = fnd();
|
||||
extrudeN[patchPointI] = coupledPointNormals[coupledPointI];
|
||||
label coupledPointi = fnd();
|
||||
extrudeN[patchPointi] = coupledPointNormals[coupledPointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -167,7 +167,7 @@ Foam::PatchTools::subsetMap
|
||||
)
|
||||
{
|
||||
label facei = 0;
|
||||
label pointI = 0;
|
||||
label pointi = 0;
|
||||
|
||||
const List<Face>& localFaces = p.localFaces();
|
||||
|
||||
@ -192,7 +192,7 @@ Foam::PatchTools::subsetMap
|
||||
if (!pointHad[ptLabel])
|
||||
{
|
||||
pointHad[ptLabel] = true;
|
||||
pointMap[pointI++] = ptLabel;
|
||||
pointMap[pointi++] = ptLabel;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -200,7 +200,7 @@ Foam::PatchTools::subsetMap
|
||||
|
||||
// Trim
|
||||
faceMap.setSize(facei);
|
||||
pointMap.setSize(pointI);
|
||||
pointMap.setSize(pointi);
|
||||
}
|
||||
|
||||
|
||||
@ -233,11 +233,11 @@ void Foam::PatchTools::calcBounds
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
if (pointIsUsed.set(pointI, 1u))
|
||||
label pointi = f[fp];
|
||||
if (pointIsUsed.set(pointi, 1u))
|
||||
{
|
||||
bb.min() = ::Foam::min(bb.min(), points[pointI]);
|
||||
bb.max() = ::Foam::max(bb.max(), points[pointI]);
|
||||
bb.min() = ::Foam::min(bb.min(), points[pointi]);
|
||||
bb.max() = ::Foam::max(bb.max(), points[pointi]);
|
||||
nPoints++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,9 +53,9 @@ Foam::PatchTools::sortedPointEdges
|
||||
|
||||
DynamicList<label> newEdgeList;
|
||||
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
const labelList& pEdges = pointEdges[pointI];
|
||||
const labelList& pEdges = pointEdges[pointi];
|
||||
|
||||
label nPointEdges = pEdges.size();
|
||||
|
||||
@ -97,7 +97,7 @@ Foam::PatchTools::sortedPointEdges
|
||||
if
|
||||
(
|
||||
nextEdgeI != edgeI
|
||||
&& (nextEdge.start() == pointI || nextEdge.end() == pointI)
|
||||
&& (nextEdge.start() == pointi || nextEdge.end() == pointi)
|
||||
)
|
||||
{
|
||||
edgeI = nextEdgeI;
|
||||
@ -143,7 +143,7 @@ Foam::PatchTools::sortedPointEdges
|
||||
}
|
||||
}
|
||||
|
||||
sortedPointEdges[pointI] = newEdgeList;
|
||||
sortedPointEdges[pointi] = newEdgeList;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -224,7 +224,7 @@ private:
|
||||
// Used to determine if surface multiply connected through point.
|
||||
void visitPointRegion
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const labelList& pFaces,
|
||||
const label startFacei,
|
||||
const label startEdgeI,
|
||||
|
||||
@ -43,7 +43,7 @@ void
|
||||
Foam::PrimitivePatch<Face, FaceList, PointField, PointType>::
|
||||
visitPointRegion
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const labelList& pFaces,
|
||||
const label startFacei,
|
||||
const label startEdgeI,
|
||||
@ -57,7 +57,7 @@ visitPointRegion
|
||||
// Mark face as been visited.
|
||||
pFacesHad[index] = true;
|
||||
|
||||
// Step to next edge on face which is still using pointI
|
||||
// Step to next edge on face which is still using pointi
|
||||
const labelList& fEdges = faceEdges()[startFacei];
|
||||
|
||||
label nextEdgeI = -1;
|
||||
@ -68,7 +68,7 @@ visitPointRegion
|
||||
|
||||
const edge& e = edges()[edgeI];
|
||||
|
||||
if (edgeI != startEdgeI && (e[0] == pointI || e[1] == pointI))
|
||||
if (edgeI != startEdgeI && (e[0] == pointi || e[1] == pointi))
|
||||
{
|
||||
nextEdgeI = edgeI;
|
||||
|
||||
@ -80,7 +80,7 @@ visitPointRegion
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem: cannot find edge out of " << fEdges
|
||||
<< "on face " << startFacei << " that uses point " << pointI
|
||||
<< "on face " << startFacei << " that uses point " << pointi
|
||||
<< " and is not edge " << startEdgeI << abort(FatalError);
|
||||
}
|
||||
|
||||
@ -93,7 +93,7 @@ visitPointRegion
|
||||
{
|
||||
visitPointRegion
|
||||
(
|
||||
pointI,
|
||||
pointi,
|
||||
pFaces,
|
||||
eFaces[i],
|
||||
nextEdgeI,
|
||||
@ -237,26 +237,26 @@ checkPointManifold
|
||||
|
||||
bool foundError = false;
|
||||
|
||||
forAll(pf, pointI)
|
||||
forAll(pf, pointi)
|
||||
{
|
||||
const labelList& pFaces = pf[pointI];
|
||||
const labelList& pFaces = pf[pointi];
|
||||
|
||||
// Visited faces (as indices into pFaces)
|
||||
boolList pFacesHad(pFaces.size(), false);
|
||||
|
||||
// Starting edge
|
||||
const labelList& pEdges = pe[pointI];
|
||||
const labelList& pEdges = pe[pointi];
|
||||
label startEdgeI = pEdges[0];
|
||||
|
||||
const labelList& eFaces = ef[startEdgeI];
|
||||
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
// Visit all faces using pointI, starting from eFaces[i] and
|
||||
// Visit all faces using pointi, starting from eFaces[i] and
|
||||
// startEdgeI. Mark off all faces visited in pFacesHad.
|
||||
this->visitPointRegion
|
||||
(
|
||||
pointI,
|
||||
pointi,
|
||||
pFaces,
|
||||
eFaces[i], // starting face for walk
|
||||
startEdgeI, // starting edge for walk
|
||||
@ -264,7 +264,7 @@ checkPointManifold
|
||||
);
|
||||
}
|
||||
|
||||
// After this all faces using pointI should have been visited and
|
||||
// After this all faces using pointi should have been visited and
|
||||
// marked off in pFacesHad.
|
||||
|
||||
label unset = findIndex(pFacesHad, false);
|
||||
@ -273,16 +273,16 @@ checkPointManifold
|
||||
{
|
||||
foundError = true;
|
||||
|
||||
label meshPointI = mp[pointI];
|
||||
label meshPointi = mp[pointi];
|
||||
|
||||
if (setPtr)
|
||||
{
|
||||
setPtr->insert(meshPointI);
|
||||
setPtr->insert(meshPointi);
|
||||
}
|
||||
|
||||
if (report)
|
||||
{
|
||||
Info<< "Point " << meshPointI
|
||||
Info<< "Point " << meshPointi
|
||||
<< " uses faces which are not connected through an edge"
|
||||
<< nl
|
||||
<< "This means that the surface formed by this patched"
|
||||
|
||||
@ -96,13 +96,13 @@ calcLocalPointOrder() const
|
||||
const labelList& curPoints = lf[curFace];
|
||||
|
||||
// mark points
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
if (!visitedPoint[curPoints[pointI]])
|
||||
if (!visitedPoint[curPoints[pointi]])
|
||||
{
|
||||
visitedPoint[curPoints[pointI]] = true;
|
||||
visitedPoint[curPoints[pointi]] = true;
|
||||
|
||||
pointOrder[nPoints] = curPoints[pointI];
|
||||
pointOrder[nPoints] = curPoints[pointi];
|
||||
|
||||
nPoints++;
|
||||
}
|
||||
|
||||
@ -141,10 +141,10 @@ meshEdges
|
||||
// local-to-global point label translation is necessary
|
||||
forAll(PatchEdges, edgeI)
|
||||
{
|
||||
const label globalPointI = pp[PatchEdges[edgeI].start()];
|
||||
const edge curEdge(globalPointI, pp[PatchEdges[edgeI].end()]);
|
||||
const label globalPointi = pp[PatchEdges[edgeI].start()];
|
||||
const edge curEdge(globalPointi, pp[PatchEdges[edgeI].end()]);
|
||||
|
||||
const labelList& pe = pointEdges[globalPointI];
|
||||
const labelList& pe = pointEdges[globalPointi];
|
||||
|
||||
forAll(pe, i)
|
||||
{
|
||||
|
||||
@ -105,9 +105,9 @@ calcPointFaces() const
|
||||
{
|
||||
const Face& curPoints = f[facei];
|
||||
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
pointFcs[curPoints[pointI]].append(facei);
|
||||
pointFcs[curPoints[pointi]].append(facei);
|
||||
}
|
||||
}
|
||||
|
||||
@ -116,14 +116,14 @@ calcPointFaces() const
|
||||
|
||||
labelListList& pf = *pointFacesPtr_;
|
||||
|
||||
forAll(pointFcs, pointI)
|
||||
forAll(pointFcs, pointi)
|
||||
{
|
||||
pf[pointI].setSize(pointFcs[pointI].size());
|
||||
pf[pointi].setSize(pointFcs[pointi].size());
|
||||
|
||||
label i = 0;
|
||||
forAllIter(SLList<label>, pointFcs[pointI], curFacesIter)
|
||||
forAllIter(SLList<label>, pointFcs[pointi], curFacesIter)
|
||||
{
|
||||
pf[pointI][i++] = curFacesIter();
|
||||
pf[pointi][i++] = curFacesIter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -97,10 +97,10 @@ projectPoints
|
||||
label curFace = 0;
|
||||
label nNSquaredSearches = 0;
|
||||
|
||||
forAll(slavePointOrder, pointI)
|
||||
forAll(slavePointOrder, pointi)
|
||||
{
|
||||
// Pick up slave point and direction
|
||||
const label curLocalPointLabel = slavePointOrder[pointI];
|
||||
const label curLocalPointLabel = slavePointOrder[pointi];
|
||||
|
||||
const PointType& curPoint =
|
||||
points_[slaveMeshPoints[curLocalPointLabel]];
|
||||
@ -119,7 +119,7 @@ projectPoints
|
||||
|
||||
// Force the full search for the first point to ensure good
|
||||
// starting face
|
||||
if (pointI == 0)
|
||||
if (pointi == 0)
|
||||
{
|
||||
doNSquaredSearch = true;
|
||||
}
|
||||
|
||||
@ -149,11 +149,11 @@ bool Foam::primitiveMesh::calcPointOrder
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (oldToNew[pointI] == -1)
|
||||
if (oldToNew[pointi] == -1)
|
||||
{
|
||||
oldToNew[pointI] = nBoundaryPoints++;
|
||||
oldToNew[pointi] = nBoundaryPoints++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -163,11 +163,11 @@ bool Foam::primitiveMesh::calcPointOrder
|
||||
nInternalPoints = nPoints - nBoundaryPoints;
|
||||
|
||||
// Move the boundary addressing up
|
||||
forAll(oldToNew, pointI)
|
||||
forAll(oldToNew, pointi)
|
||||
{
|
||||
if (oldToNew[pointI] != -1)
|
||||
if (oldToNew[pointi] != -1)
|
||||
{
|
||||
oldToNew[pointI] += nInternalPoints;
|
||||
oldToNew[pointi] += nInternalPoints;
|
||||
}
|
||||
}
|
||||
|
||||
@ -175,7 +175,7 @@ bool Foam::primitiveMesh::calcPointOrder
|
||||
// 2. Compact the internal points. Detect whether internal and boundary
|
||||
// points are mixed.
|
||||
|
||||
label internalPointI = 0;
|
||||
label internalPointi = 0;
|
||||
|
||||
bool ordered = true;
|
||||
|
||||
@ -185,15 +185,15 @@ bool Foam::primitiveMesh::calcPointOrder
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (oldToNew[pointI] == -1)
|
||||
if (oldToNew[pointi] == -1)
|
||||
{
|
||||
if (pointI >= nInternalPoints)
|
||||
if (pointi >= nInternalPoints)
|
||||
{
|
||||
ordered = false;
|
||||
}
|
||||
oldToNew[pointI] = internalPointI++;
|
||||
oldToNew[pointi] = internalPointi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -830,20 +830,20 @@ public:
|
||||
//- pointCells using pointFaces
|
||||
const labelList& pointCells
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
DynamicList<label>&
|
||||
) const;
|
||||
|
||||
const labelList& pointCells(const label pointI) const;
|
||||
const labelList& pointCells(const label pointi) const;
|
||||
|
||||
//- pointPoints using edges, pointEdges
|
||||
const labelList& pointPoints
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
DynamicList<label>&
|
||||
) const;
|
||||
|
||||
const labelList& pointPoints(const label pointI) const;
|
||||
const labelList& pointPoints(const label pointi) const;
|
||||
|
||||
//- faceEdges using pointFaces, edges, pointEdges
|
||||
const labelList& faceEdges
|
||||
|
||||
@ -1312,13 +1312,13 @@ bool Foam::primitiveMesh::checkPoints
|
||||
|
||||
const labelListList& pf = pointFaces();
|
||||
|
||||
forAll(pf, pointI)
|
||||
forAll(pf, pointi)
|
||||
{
|
||||
if (pf[pointI].empty())
|
||||
if (pf[pointi].empty())
|
||||
{
|
||||
if (setPtr)
|
||||
{
|
||||
setPtr->insert(pointI);
|
||||
setPtr->insert(pointi);
|
||||
}
|
||||
|
||||
nFaceErrors++;
|
||||
@ -1326,15 +1326,15 @@ bool Foam::primitiveMesh::checkPoints
|
||||
}
|
||||
|
||||
|
||||
forAll(pf, pointI)
|
||||
forAll(pf, pointi)
|
||||
{
|
||||
const labelList& pc = pointCells(pointI);
|
||||
const labelList& pc = pointCells(pointi);
|
||||
|
||||
if (pc.empty())
|
||||
{
|
||||
if (setPtr)
|
||||
{
|
||||
setPtr->insert(pointI);
|
||||
setPtr->insert(pointi);
|
||||
}
|
||||
|
||||
nCellErrors++;
|
||||
@ -1598,9 +1598,9 @@ bool Foam::primitiveMesh::checkFaceFaces
|
||||
|
||||
forAll(curFace, fp)
|
||||
{
|
||||
label pointI = curFace[fp];
|
||||
label pointi = curFace[fp];
|
||||
|
||||
const labelList& nbs = pf[pointI];
|
||||
const labelList& nbs = pf[pointi];
|
||||
|
||||
forAll(nbs, nbI)
|
||||
{
|
||||
|
||||
@ -36,18 +36,18 @@ Foam::label Foam::primitiveMesh::getEdge
|
||||
List<DynamicList<label>>& pe,
|
||||
DynamicList<edge>& es,
|
||||
|
||||
const label pointI,
|
||||
const label nextPointI
|
||||
const label pointi,
|
||||
const label nextPointi
|
||||
)
|
||||
{
|
||||
// Find connection between pointI and nextPointI
|
||||
forAll(pe[pointI], ppI)
|
||||
// Find connection between pointi and nextPointi
|
||||
forAll(pe[pointi], ppI)
|
||||
{
|
||||
label eI = pe[pointI][ppI];
|
||||
label eI = pe[pointi][ppI];
|
||||
|
||||
const edge& e = es[eI];
|
||||
|
||||
if (e.start() == nextPointI || e.end() == nextPointI)
|
||||
if (e.start() == nextPointi || e.end() == nextPointi)
|
||||
{
|
||||
return eI;
|
||||
}
|
||||
@ -55,15 +55,15 @@ Foam::label Foam::primitiveMesh::getEdge
|
||||
|
||||
// Make new edge.
|
||||
label edgeI = es.size();
|
||||
pe[pointI].append(edgeI);
|
||||
pe[nextPointI].append(edgeI);
|
||||
if (pointI < nextPointI)
|
||||
pe[pointi].append(edgeI);
|
||||
pe[nextPointi].append(edgeI);
|
||||
if (pointi < nextPointi)
|
||||
{
|
||||
es.append(edge(pointI, nextPointI));
|
||||
es.append(edge(pointi, nextPointi));
|
||||
}
|
||||
else
|
||||
{
|
||||
es.append(edge(nextPointI, pointI));
|
||||
es.append(edge(nextPointi, pointi));
|
||||
}
|
||||
return edgeI;
|
||||
}
|
||||
@ -104,9 +104,9 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
|
||||
// Estimate pointEdges storage
|
||||
List<DynamicList<label>> pe(nPoints());
|
||||
forAll(pe, pointI)
|
||||
forAll(pe, pointi)
|
||||
{
|
||||
pe[pointI].setCapacity(primitiveMesh::edgesPerPoint_);
|
||||
pe[pointi].setCapacity(primitiveMesh::edgesPerPoint_);
|
||||
}
|
||||
|
||||
// Estimate edges storage
|
||||
@ -146,10 +146,10 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label nextPointI = f[f.fcIndex(fp)];
|
||||
label pointi = f[fp];
|
||||
label nextPointi = f[f.fcIndex(fp)];
|
||||
|
||||
label edgeI = getEdge(pe, es, pointI, nextPointI);
|
||||
label edgeI = getEdge(pe, es, pointi, nextPointi);
|
||||
|
||||
if (doFaceEdges)
|
||||
{
|
||||
@ -171,11 +171,11 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label nextPointI = f[f.fcIndex(fp)];
|
||||
label pointi = f[fp];
|
||||
label nextPointi = f[f.fcIndex(fp)];
|
||||
|
||||
label oldNEdges = es.size();
|
||||
label edgeI = getEdge(pe, es, pointI, nextPointI);
|
||||
label edgeI = getEdge(pe, es, pointi, nextPointi);
|
||||
|
||||
if (es.size() > oldNEdges)
|
||||
{
|
||||
@ -195,17 +195,17 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label nextPointI = f[f.fcIndex(fp)];
|
||||
label pointi = f[fp];
|
||||
label nextPointi = f[f.fcIndex(fp)];
|
||||
|
||||
label oldNEdges = es.size();
|
||||
label edgeI = getEdge(pe, es, pointI, nextPointI);
|
||||
label edgeI = getEdge(pe, es, pointi, nextPointi);
|
||||
|
||||
if (es.size() > oldNEdges)
|
||||
{
|
||||
if (pointI < nInternalPoints_)
|
||||
if (pointi < nInternalPoints_)
|
||||
{
|
||||
if (nextPointI < nInternalPoints_)
|
||||
if (nextPointi < nInternalPoints_)
|
||||
{
|
||||
nInternal0Edges_++;
|
||||
}
|
||||
@ -216,7 +216,7 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (nextPointI < nInternalPoints_)
|
||||
if (nextPointi < nInternalPoints_)
|
||||
{
|
||||
nInt1Edges++;
|
||||
}
|
||||
@ -295,9 +295,9 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
// no reallocations
|
||||
SortableList<label> nbrPoints(primitiveMesh::edgesPerPoint_);
|
||||
|
||||
forAll(pe, pointI)
|
||||
forAll(pe, pointi)
|
||||
{
|
||||
const DynamicList<label>& pEdges = pe[pointI];
|
||||
const DynamicList<label>& pEdges = pe[pointi];
|
||||
|
||||
nbrPoints.setSize(pEdges.size());
|
||||
|
||||
@ -305,15 +305,15 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
{
|
||||
const edge& e = es[pEdges[i]];
|
||||
|
||||
label nbrPointI = e.otherVertex(pointI);
|
||||
label nbrPointi = e.otherVertex(pointi);
|
||||
|
||||
if (nbrPointI < pointI)
|
||||
if (nbrPointi < pointi)
|
||||
{
|
||||
nbrPoints[i] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
nbrPoints[i] = nbrPointI;
|
||||
nbrPoints[i] = nbrPointi;
|
||||
}
|
||||
}
|
||||
nbrPoints.sort();
|
||||
@ -334,22 +334,22 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pointI < nInternalPoints_)
|
||||
if (pointi < nInternalPoints_)
|
||||
{
|
||||
forAll(nbrPoints, i)
|
||||
{
|
||||
label nbrPointI = nbrPoints[i];
|
||||
label nbrPointi = nbrPoints[i];
|
||||
|
||||
label edgeI = pEdges[nbrPoints.indices()[i]];
|
||||
|
||||
if (nbrPointI != -1)
|
||||
if (nbrPointi != -1)
|
||||
{
|
||||
if (edgeI < nExtEdges)
|
||||
{
|
||||
// External edge
|
||||
oldToNew[edgeI] = externalEdgeI++;
|
||||
}
|
||||
else if (nbrPointI < nInternalPoints_)
|
||||
else if (nbrPointi < nInternalPoints_)
|
||||
{
|
||||
// Both points inside
|
||||
oldToNew[edgeI] = internal0EdgeI++;
|
||||
@ -366,18 +366,18 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
{
|
||||
forAll(nbrPoints, i)
|
||||
{
|
||||
label nbrPointI = nbrPoints[i];
|
||||
label nbrPointi = nbrPoints[i];
|
||||
|
||||
label edgeI = pEdges[nbrPoints.indices()[i]];
|
||||
|
||||
if (nbrPointI != -1)
|
||||
if (nbrPointi != -1)
|
||||
{
|
||||
if (edgeI < nExtEdges)
|
||||
{
|
||||
// External edge
|
||||
oldToNew[edgeI] = externalEdgeI++;
|
||||
}
|
||||
else if (nbrPointI < nInternalPoints_)
|
||||
else if (nbrPointi < nInternalPoints_)
|
||||
{
|
||||
// Not possible!
|
||||
FatalErrorInFunction
|
||||
@ -431,13 +431,13 @@ void Foam::primitiveMesh::calcEdges(const bool doFaceEdges) const
|
||||
// pointEdges
|
||||
pePtr_ = new labelListList(nPoints());
|
||||
labelListList& pointEdges = *pePtr_;
|
||||
forAll(pe, pointI)
|
||||
forAll(pe, pointi)
|
||||
{
|
||||
DynamicList<label>& pEdges = pe[pointI];
|
||||
DynamicList<label>& pEdges = pe[pointi];
|
||||
pEdges.shrink();
|
||||
inplaceRenumber(oldToNew, pEdges);
|
||||
pointEdges[pointI].transfer(pEdges);
|
||||
Foam::sort(pointEdges[pointI]);
|
||||
pointEdges[pointi].transfer(pEdges);
|
||||
Foam::sort(pointEdges[pointi]);
|
||||
}
|
||||
|
||||
// faceEdges
|
||||
@ -542,17 +542,17 @@ const Foam::labelListList& Foam::primitiveMesh::faceEdges() const
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label nextPointI = f[f.fcIndex(fp)];
|
||||
label pointi = f[fp];
|
||||
label nextPointi = f[f.fcIndex(fp)];
|
||||
|
||||
// Find edge between pointI, nextPontI
|
||||
const labelList& pEdges = pe[pointI];
|
||||
// Find edge between pointi, nextPontI
|
||||
const labelList& pEdges = pe[pointi];
|
||||
|
||||
forAll(pEdges, i)
|
||||
{
|
||||
label edgeI = pEdges[i];
|
||||
|
||||
if (es[edgeI].otherVertex(pointI) == nextPointI)
|
||||
if (es[edgeI].otherVertex(pointi) == nextPointi)
|
||||
{
|
||||
fEdges[fp] = edgeI;
|
||||
break;
|
||||
|
||||
@ -67,9 +67,9 @@ void Foam::primitiveMesh::calcPointCells() const
|
||||
{
|
||||
const labelList curPoints = cf[celli].labels(faces());
|
||||
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
label ptI = curPoints[pointI];
|
||||
label ptI = curPoints[pointi];
|
||||
|
||||
npc[ptI]++;
|
||||
}
|
||||
@ -81,9 +81,9 @@ void Foam::primitiveMesh::calcPointCells() const
|
||||
pcPtr_ = new labelListList(npc.size());
|
||||
labelListList& pointCellAddr = *pcPtr_;
|
||||
|
||||
forAll(pointCellAddr, pointI)
|
||||
forAll(pointCellAddr, pointi)
|
||||
{
|
||||
pointCellAddr[pointI].setSize(npc[pointI]);
|
||||
pointCellAddr[pointi].setSize(npc[pointi]);
|
||||
}
|
||||
npc = 0;
|
||||
|
||||
@ -92,9 +92,9 @@ void Foam::primitiveMesh::calcPointCells() const
|
||||
{
|
||||
const labelList curPoints = cf[celli].labels(faces());
|
||||
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
label ptI = curPoints[pointI];
|
||||
label ptI = curPoints[pointi];
|
||||
|
||||
pointCellAddr[ptI][npc[ptI]++] = celli;
|
||||
}
|
||||
@ -118,19 +118,19 @@ const Foam::labelListList& Foam::primitiveMesh::pointCells() const
|
||||
|
||||
const Foam::labelList& Foam::primitiveMesh::pointCells
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
DynamicList<label>& storage
|
||||
) const
|
||||
{
|
||||
if (hasPointCells())
|
||||
{
|
||||
return pointCells()[pointI];
|
||||
return pointCells()[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
const labelList& own = faceOwner();
|
||||
const labelList& nei = faceNeighbour();
|
||||
const labelList& pFaces = pointFaces()[pointI];
|
||||
const labelList& pFaces = pointFaces()[pointi];
|
||||
|
||||
storage.clear();
|
||||
|
||||
@ -171,9 +171,9 @@ const Foam::labelList& Foam::primitiveMesh::pointCells
|
||||
}
|
||||
|
||||
|
||||
const Foam::labelList& Foam::primitiveMesh::pointCells(const label pointI) const
|
||||
const Foam::labelList& Foam::primitiveMesh::pointCells(const label pointi) const
|
||||
{
|
||||
return pointCells(pointI, labels_);
|
||||
return pointCells(pointi, labels_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -60,19 +60,19 @@ void Foam::primitiveMesh::calcPointPoints() const
|
||||
ppPtr_ = new labelListList(pe.size());
|
||||
labelListList& pp = *ppPtr_;
|
||||
|
||||
forAll(pe, pointI)
|
||||
forAll(pe, pointi)
|
||||
{
|
||||
pp[pointI].setSize(pe[pointI].size());
|
||||
pp[pointi].setSize(pe[pointi].size());
|
||||
|
||||
forAll(pe[pointI], ppi)
|
||||
forAll(pe[pointi], ppi)
|
||||
{
|
||||
if (e[pe[pointI][ppi]].start() == pointI)
|
||||
if (e[pe[pointi][ppi]].start() == pointi)
|
||||
{
|
||||
pp[pointI][ppi] = e[pe[pointI][ppi]].end();
|
||||
pp[pointi][ppi] = e[pe[pointi][ppi]].end();
|
||||
}
|
||||
else if (e[pe[pointI][ppi]].end() == pointI)
|
||||
else if (e[pe[pointi][ppi]].end() == pointi)
|
||||
{
|
||||
pp[pointI][ppi] = e[pe[pointI][ppi]].start();
|
||||
pp[pointi][ppi] = e[pe[pointi][ppi]].start();
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -101,18 +101,18 @@ const Foam::labelListList& Foam::primitiveMesh::pointPoints() const
|
||||
|
||||
const Foam::labelList& Foam::primitiveMesh::pointPoints
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
DynamicList<label>& storage
|
||||
) const
|
||||
{
|
||||
if (hasPointPoints())
|
||||
{
|
||||
return pointPoints()[pointI];
|
||||
return pointPoints()[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
const edgeList& edges = this->edges();
|
||||
const labelList& pEdges = pointEdges()[pointI];
|
||||
const labelList& pEdges = pointEdges()[pointi];
|
||||
|
||||
storage.clear();
|
||||
|
||||
@ -123,7 +123,7 @@ const Foam::labelList& Foam::primitiveMesh::pointPoints
|
||||
|
||||
forAll(pEdges, i)
|
||||
{
|
||||
storage.append(edges[pEdges[i]].otherVertex(pointI));
|
||||
storage.append(edges[pEdges[i]].otherVertex(pointi));
|
||||
}
|
||||
|
||||
return storage;
|
||||
@ -133,10 +133,10 @@ const Foam::labelList& Foam::primitiveMesh::pointPoints
|
||||
|
||||
const Foam::labelList& Foam::primitiveMesh::pointPoints
|
||||
(
|
||||
const label pointI
|
||||
const label pointi
|
||||
) const
|
||||
{
|
||||
return pointPoints(pointI, labels_);
|
||||
return pointPoints(pointi, labels_);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -194,7 +194,7 @@ public:
|
||||
inline label addToTransformIndex
|
||||
(
|
||||
const label transformIndex,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const bool isSendingSide = true,
|
||||
const scalar tol = SMALL
|
||||
) const;
|
||||
|
||||
@ -152,7 +152,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
|
||||
return;
|
||||
}
|
||||
|
||||
const label patchI = patch().index();
|
||||
const label patchi = patch().index();
|
||||
|
||||
const LESModel<EddyDiffusivity<compressible::turbulenceModel>>& turbModel =
|
||||
db().lookupObject
|
||||
@ -170,7 +170,7 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().lookupPatchField<surfaceScalarField, scalar>(phiName_);
|
||||
|
||||
const scalarField alphap(turbModel.alphaEff(patchI));
|
||||
const scalarField alphap(turbModel.alphaEff(patchi));
|
||||
|
||||
refValue() = massFluxFraction_;
|
||||
refGrad() = 0.0;
|
||||
|
||||
@ -113,7 +113,7 @@ void Foam::meshReader::calcPointCells() const
|
||||
|
||||
// report and remove unused points
|
||||
// - adjust points, pointCells, and cellFaces accordingly
|
||||
label pointI = 0;
|
||||
label pointi = 0;
|
||||
labelList oldToNew(nPoints, -1);
|
||||
|
||||
forAll(ptCells, i)
|
||||
@ -121,16 +121,16 @@ void Foam::meshReader::calcPointCells() const
|
||||
ptCells[i].setSize(cellCount[i]);
|
||||
if (cellCount[i] > 0)
|
||||
{
|
||||
oldToNew[i] = pointI++;
|
||||
oldToNew[i] = pointi++;
|
||||
}
|
||||
}
|
||||
|
||||
// report unused points
|
||||
if (nPoints > pointI)
|
||||
if (nPoints > pointi)
|
||||
{
|
||||
Info<< "removing " << (nPoints - pointI) << " unused points" << endl;
|
||||
Info<< "removing " << (nPoints - pointi) << " unused points" << endl;
|
||||
|
||||
nPoints = pointI;
|
||||
nPoints = pointi;
|
||||
|
||||
// adjust points and truncate - bend const-ness
|
||||
pointField& adjustedPoints = const_cast<pointField&>(points_);
|
||||
|
||||
@ -229,10 +229,10 @@ void Foam::meshReader::createPolyCells()
|
||||
const labelList& curPoints = curFace;
|
||||
|
||||
// For all points
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
// get the list of cells sharing this point
|
||||
const labelList& curNeighbours = ptCells[curPoints[pointI]];
|
||||
const labelList& curNeighbours = ptCells[curPoints[pointi]];
|
||||
|
||||
// For all neighbours
|
||||
forAll(curNeighbours, neiI)
|
||||
@ -257,7 +257,7 @@ void Foam::meshReader::createPolyCells()
|
||||
#ifdef DEBUG_FACE_ORDERING
|
||||
Info<< " cell " << celli
|
||||
<< " face " << facei
|
||||
<< " point " << pointI
|
||||
<< " point " << pointi
|
||||
<< " nei " << curNei
|
||||
<< " neiFace " << neiFacei
|
||||
<< endl;
|
||||
|
||||
@ -165,22 +165,22 @@ void Foam::meshReaders::STARCD::readPoints
|
||||
|
||||
label lineLabel;
|
||||
|
||||
label pointI = 0;
|
||||
label pointi = 0;
|
||||
while ((is >> lineLabel).good())
|
||||
{
|
||||
is >> points_[pointI].x()
|
||||
>> points_[pointI].y()
|
||||
>> points_[pointI].z();
|
||||
is >> points_[pointi].x()
|
||||
>> points_[pointi].y()
|
||||
>> points_[pointi].z();
|
||||
|
||||
// might need again in the future
|
||||
//// origPointId[pointI] = lineLabel;
|
||||
mapToFoamPointId_[lineLabel] = pointI;
|
||||
pointI++;
|
||||
//// origPointId[pointi] = lineLabel;
|
||||
mapToFoamPointId_[lineLabel] = pointi;
|
||||
pointi++;
|
||||
}
|
||||
|
||||
if (nPoints > pointI)
|
||||
if (nPoints > pointi)
|
||||
{
|
||||
nPoints = pointI;
|
||||
nPoints = pointi;
|
||||
points_.setSize(nPoints);
|
||||
// might need again in the future
|
||||
//// origPointId.setSize(nPoints);
|
||||
@ -999,20 +999,20 @@ void Foam::meshReaders::STARCD::cullPoints()
|
||||
}
|
||||
|
||||
// the new ordering and the count of unused points
|
||||
label pointI = 0;
|
||||
label pointi = 0;
|
||||
forAll(oldToNew, i)
|
||||
{
|
||||
if (oldToNew[i] >= 0)
|
||||
{
|
||||
oldToNew[i] = pointI++;
|
||||
oldToNew[i] = pointi++;
|
||||
}
|
||||
}
|
||||
|
||||
// report unused points
|
||||
if (nPoints > pointI)
|
||||
if (nPoints > pointi)
|
||||
{
|
||||
Info<< "Unused points = " << (nPoints - pointI) << endl;
|
||||
nPoints = pointI;
|
||||
Info<< "Unused points = " << (nPoints - pointi) << endl;
|
||||
nPoints = pointi;
|
||||
|
||||
// adjust points and truncate
|
||||
inplaceReorder(oldToNew, points_);
|
||||
|
||||
@ -136,16 +136,16 @@ Foam::labelList Foam::polyDualMesh::getFaceOrder
|
||||
}
|
||||
|
||||
|
||||
// Get the two edges on facei using pointI. Returns them such that the order
|
||||
// Get the two edges on facei using pointi. Returns them such that the order
|
||||
// - otherVertex of e0
|
||||
// - pointI
|
||||
// - otherVertex(pointI) of e1
|
||||
// - pointi
|
||||
// - otherVertex(pointi) of e1
|
||||
// is in face order
|
||||
void Foam::polyDualMesh::getPointEdges
|
||||
(
|
||||
const primitivePatch& patch,
|
||||
const label facei,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
label& e0,
|
||||
label& e1
|
||||
)
|
||||
@ -162,10 +162,10 @@ void Foam::polyDualMesh::getPointEdges
|
||||
|
||||
const edge& e = patch.edges()[edgeI];
|
||||
|
||||
if (e[0] == pointI)
|
||||
if (e[0] == pointi)
|
||||
{
|
||||
// One of the edges using pointI. Check which one.
|
||||
label index = findIndex(f, pointI);
|
||||
// One of the edges using pointi. Check which one.
|
||||
label index = findIndex(f, pointi);
|
||||
|
||||
if (f.nextLabel(index) == e[1])
|
||||
{
|
||||
@ -181,10 +181,10 @@ void Foam::polyDualMesh::getPointEdges
|
||||
return;
|
||||
}
|
||||
}
|
||||
else if (e[1] == pointI)
|
||||
else if (e[1] == pointi)
|
||||
{
|
||||
// One of the edges using pointI. Check which one.
|
||||
label index = findIndex(f, pointI);
|
||||
// One of the edges using pointi. Check which one.
|
||||
label index = findIndex(f, pointi);
|
||||
|
||||
if (f.nextLabel(index) == e[0])
|
||||
{
|
||||
@ -204,7 +204,7 @@ void Foam::polyDualMesh::getPointEdges
|
||||
|
||||
FatalErrorInFunction
|
||||
<< " vertices:" << patch.localFaces()[facei]
|
||||
<< " that uses point:" << pointI
|
||||
<< " that uses point:" << pointi
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -216,7 +216,7 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
|
||||
const label patchToDualOffset,
|
||||
const labelList& edgeToDualPoint,
|
||||
const labelList& pointToDualPoint,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
|
||||
label& edgeI
|
||||
)
|
||||
@ -224,17 +224,17 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
|
||||
// Construct face by walking around e[eI] starting from
|
||||
// patchEdgeI
|
||||
|
||||
label meshPointI = patch.meshPoints()[pointI];
|
||||
const labelList& pFaces = patch.pointFaces()[pointI];
|
||||
label meshPointi = patch.meshPoints()[pointi];
|
||||
const labelList& pFaces = patch.pointFaces()[pointi];
|
||||
|
||||
DynamicList<label> dualFace;
|
||||
|
||||
if (pointToDualPoint[meshPointI] >= 0)
|
||||
if (pointToDualPoint[meshPointi] >= 0)
|
||||
{
|
||||
// Number of pFaces + 2 boundary edge + feature point
|
||||
dualFace.setCapacity(pFaces.size()+2+1);
|
||||
// Store dualVertex for feature edge
|
||||
dualFace.append(pointToDualPoint[meshPointI]);
|
||||
dualFace.append(pointToDualPoint[meshPointi]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -256,7 +256,7 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
|
||||
bool reverseFace;
|
||||
|
||||
label e0, e1;
|
||||
getPointEdges(patch, facei, pointI, e0, e1);
|
||||
getPointEdges(patch, facei, pointi, e0, e1);
|
||||
|
||||
if (e0 == edgeI)
|
||||
{
|
||||
@ -272,9 +272,9 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
|
||||
// Store dual vertex for facei.
|
||||
dualFace.append(facei + patchToDualOffset);
|
||||
|
||||
// Cross face to other edge on pointI
|
||||
// Cross face to other edge on pointi
|
||||
label e0, e1;
|
||||
getPointEdges(patch, facei, pointI, e0, e1);
|
||||
getPointEdges(patch, facei, pointi, e0, e1);
|
||||
|
||||
if (e0 == edgeI)
|
||||
{
|
||||
@ -321,7 +321,7 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
|
||||
}
|
||||
|
||||
|
||||
// Collect face around pointI which is not on the outside of the patch.
|
||||
// Collect face around pointi which is not on the outside of the patch.
|
||||
// Returns the vertices of the face and the indices in these vertices of
|
||||
// any points which are on feature edges.
|
||||
void Foam::polyDualMesh::collectPatchInternalFace
|
||||
@ -330,16 +330,16 @@ void Foam::polyDualMesh::collectPatchInternalFace
|
||||
const label patchToDualOffset,
|
||||
const labelList& edgeToDualPoint,
|
||||
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label startEdgeI,
|
||||
|
||||
labelList& dualFace2,
|
||||
labelList& featEdgeIndices2
|
||||
)
|
||||
{
|
||||
// Construct face by walking around pointI starting from startEdgeI
|
||||
// Construct face by walking around pointi starting from startEdgeI
|
||||
const labelList& meshEdges = patch.meshEdges();
|
||||
const labelList& pFaces = patch.pointFaces()[pointI];
|
||||
const labelList& pFaces = patch.pointFaces()[pointi];
|
||||
|
||||
// Vertices of dualFace
|
||||
DynamicList<label> dualFace(pFaces.size());
|
||||
@ -354,7 +354,7 @@ void Foam::polyDualMesh::collectPatchInternalFace
|
||||
bool reverseFace;
|
||||
|
||||
label e0, e1;
|
||||
getPointEdges(patch, facei, pointI, e0, e1);
|
||||
getPointEdges(patch, facei, pointi, e0, e1);
|
||||
|
||||
if (e0 == edgeI)
|
||||
{
|
||||
@ -370,9 +370,9 @@ void Foam::polyDualMesh::collectPatchInternalFace
|
||||
// Insert dual vertex for face
|
||||
dualFace.append(facei + patchToDualOffset);
|
||||
|
||||
// Cross face to other edge on pointI
|
||||
// Cross face to other edge on pointi
|
||||
label e0, e1;
|
||||
getPointEdges(patch, facei, pointI, e0, e1);
|
||||
getPointEdges(patch, facei, pointi, e0, e1);
|
||||
|
||||
if (e0 == edgeI)
|
||||
{
|
||||
@ -432,7 +432,7 @@ void Foam::polyDualMesh::splitFace
|
||||
const polyPatch& patch,
|
||||
const labelList& pointToDualPoint,
|
||||
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const labelList& dualFace,
|
||||
const labelList& featEdgeIndices,
|
||||
|
||||
@ -445,9 +445,9 @@ void Foam::polyDualMesh::splitFace
|
||||
|
||||
// Split face because of feature edges/points
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
label meshPointI = patch.meshPoints()[pointI];
|
||||
label meshPointi = patch.meshPoints()[pointi];
|
||||
|
||||
if (pointToDualPoint[meshPointI] >= 0)
|
||||
if (pointToDualPoint[meshPointi] >= 0)
|
||||
{
|
||||
// Feature point. Do face-centre decomposition.
|
||||
|
||||
@ -455,7 +455,7 @@ void Foam::polyDualMesh::splitFace
|
||||
{
|
||||
// Feature point but no feature edges. Not handled at the moment
|
||||
dualFaces.append(face(dualFace));
|
||||
dualOwner.append(meshPointI);
|
||||
dualOwner.append(meshPointi);
|
||||
dualNeighbour.append(-1);
|
||||
dualRegion.append(patch.index());
|
||||
}
|
||||
@ -484,7 +484,7 @@ void Foam::polyDualMesh::splitFace
|
||||
face subFace(sz);
|
||||
|
||||
// feature point becomes face centre.
|
||||
subFace[0] = pointToDualPoint[patch.meshPoints()[pointI]];
|
||||
subFace[0] = pointToDualPoint[patch.meshPoints()[pointi]];
|
||||
|
||||
// Copy from startFp up to endFp.
|
||||
for (label subFp = 1; subFp < subFace.size(); subFp++)
|
||||
@ -495,7 +495,7 @@ void Foam::polyDualMesh::splitFace
|
||||
}
|
||||
|
||||
dualFaces.append(face(subFace));
|
||||
dualOwner.append(meshPointI);
|
||||
dualOwner.append(meshPointi);
|
||||
dualNeighbour.append(-1);
|
||||
dualRegion.append(patch.index());
|
||||
}
|
||||
@ -508,7 +508,7 @@ void Foam::polyDualMesh::splitFace
|
||||
{
|
||||
// Not enough feature edges. No split.
|
||||
dualFaces.append(face(dualFace));
|
||||
dualOwner.append(meshPointI);
|
||||
dualOwner.append(meshPointi);
|
||||
dualNeighbour.append(-1);
|
||||
dualRegion.append(patch.index());
|
||||
}
|
||||
@ -548,7 +548,7 @@ void Foam::polyDualMesh::splitFace
|
||||
subFace.shrink();
|
||||
|
||||
dualFaces.append(face(subFace));
|
||||
dualOwner.append(meshPointI);
|
||||
dualOwner.append(meshPointi);
|
||||
dualNeighbour.append(-1);
|
||||
dualRegion.append(patch.index());
|
||||
|
||||
@ -562,7 +562,7 @@ void Foam::polyDualMesh::splitFace
|
||||
subFace.shrink();
|
||||
|
||||
dualFaces.append(face(subFace));
|
||||
dualOwner.append(meshPointI);
|
||||
dualOwner.append(meshPointi);
|
||||
dualNeighbour.append(-1);
|
||||
dualRegion.append(patch.index());
|
||||
|
||||
@ -621,7 +621,7 @@ void Foam::polyDualMesh::dualPatch
|
||||
// Construct face by walking around e[eI] starting from
|
||||
// patchEdgeI
|
||||
|
||||
label pointI = e[eI];
|
||||
label pointi = e[eI];
|
||||
|
||||
label edgeI = patchEdgeI;
|
||||
labelList dualFace
|
||||
@ -633,13 +633,13 @@ void Foam::polyDualMesh::dualPatch
|
||||
edgeToDualPoint,
|
||||
pointToDualPoint,
|
||||
|
||||
pointI,
|
||||
pointi,
|
||||
edgeI
|
||||
)
|
||||
);
|
||||
|
||||
// Now edgeI is end edge. Mark as visited
|
||||
if (patch.edges()[edgeI][0] == pointI)
|
||||
if (patch.edges()[edgeI][0] == pointi)
|
||||
{
|
||||
doneEdgeSide[edgeI] |= 1;
|
||||
}
|
||||
@ -649,12 +649,12 @@ void Foam::polyDualMesh::dualPatch
|
||||
}
|
||||
|
||||
dualFaces.append(face(dualFace));
|
||||
dualOwner.append(patch.meshPoints()[pointI]);
|
||||
dualOwner.append(patch.meshPoints()[pointi]);
|
||||
dualNeighbour.append(-1);
|
||||
dualRegion.append(patch.index());
|
||||
|
||||
doneEdgeSide[patchEdgeI] |= bitMask;
|
||||
donePoint[pointI] = true;
|
||||
donePoint[pointi] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -665,9 +665,9 @@ void Foam::polyDualMesh::dualPatch
|
||||
// Do patch-internal points
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
forAll(donePoint, pointI)
|
||||
forAll(donePoint, pointi)
|
||||
{
|
||||
if (!donePoint[pointI])
|
||||
if (!donePoint[pointi])
|
||||
{
|
||||
labelList dualFace, featEdgeIndices;
|
||||
|
||||
@ -676,8 +676,8 @@ void Foam::polyDualMesh::dualPatch
|
||||
patch,
|
||||
patchToDualOffset,
|
||||
edgeToDualPoint,
|
||||
pointI,
|
||||
patch.pointEdges()[pointI][0], // Arbitrary starting edge
|
||||
pointi,
|
||||
patch.pointEdges()[pointi][0], // Arbitrary starting edge
|
||||
|
||||
dualFace,
|
||||
featEdgeIndices
|
||||
@ -687,7 +687,7 @@ void Foam::polyDualMesh::dualPatch
|
||||
|
||||
//// Keep face in one piece.
|
||||
//dualFaces.append(face(dualFace));
|
||||
//dualOwner.append(patch.meshPoints()[pointI]);
|
||||
//dualOwner.append(patch.meshPoints()[pointi]);
|
||||
//dualNeighbour.append(-1);
|
||||
//dualRegion.append(patch.index());
|
||||
|
||||
@ -695,7 +695,7 @@ void Foam::polyDualMesh::dualPatch
|
||||
(
|
||||
patch,
|
||||
pointToDualPoint,
|
||||
pointI,
|
||||
pointi,
|
||||
dualFace,
|
||||
featEdgeIndices,
|
||||
|
||||
@ -705,7 +705,7 @@ void Foam::polyDualMesh::dualPatch
|
||||
dualRegion
|
||||
);
|
||||
|
||||
donePoint[pointI] = true;
|
||||
donePoint[pointi] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -777,7 +777,7 @@ void Foam::polyDualMesh::calcDual
|
||||
// celli celli
|
||||
// facei nCells+facei-nIntFaces
|
||||
// featEdgeI nCells+nFaces-nIntFaces+featEdgeI
|
||||
// featPointI nCells+nFaces-nIntFaces+nFeatEdges+featPointI
|
||||
// featPointi nCells+nFaces-nIntFaces+nFeatEdges+featPointi
|
||||
|
||||
pointField dualPoints
|
||||
(
|
||||
@ -787,7 +787,7 @@ void Foam::polyDualMesh::calcDual
|
||||
+ featurePoints.size() // additional boundary points
|
||||
);
|
||||
|
||||
label dualPointI = 0;
|
||||
label dualPointi = 0;
|
||||
|
||||
|
||||
// Cell centres.
|
||||
@ -797,8 +797,8 @@ void Foam::polyDualMesh::calcDual
|
||||
|
||||
forAll(cellCentres, celli)
|
||||
{
|
||||
cellPoint_[celli] = dualPointI;
|
||||
dualPoints[dualPointI++] = cellCentres[celli];
|
||||
cellPoint_[celli] = dualPointi;
|
||||
dualPoints[dualPointi++] = cellCentres[celli];
|
||||
}
|
||||
|
||||
// Boundary faces centres
|
||||
@ -808,8 +808,8 @@ void Foam::polyDualMesh::calcDual
|
||||
|
||||
for (label facei = nIntFaces; facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
boundaryFacePoint_[facei - nIntFaces] = dualPointI;
|
||||
dualPoints[dualPointI++] = faceCentres[facei];
|
||||
boundaryFacePoint_[facei - nIntFaces] = dualPointi;
|
||||
dualPoints[dualPointi++] = faceCentres[facei];
|
||||
}
|
||||
|
||||
// Edge status:
|
||||
@ -831,8 +831,8 @@ void Foam::polyDualMesh::calcDual
|
||||
|
||||
const edge& e = mesh.edges()[edgeI];
|
||||
|
||||
edgeToDualPoint[edgeI] = dualPointI;
|
||||
dualPoints[dualPointI++] = e.centre(mesh.points());
|
||||
edgeToDualPoint[edgeI] = dualPointi;
|
||||
dualPoints[dualPointi++] = e.centre(mesh.points());
|
||||
}
|
||||
|
||||
|
||||
@ -868,10 +868,10 @@ void Foam::polyDualMesh::calcDual
|
||||
|
||||
forAll(featurePoints, i)
|
||||
{
|
||||
label pointI = featurePoints[i];
|
||||
label pointi = featurePoints[i];
|
||||
|
||||
pointToDualPoint[pointI] = dualPointI;
|
||||
dualPoints[dualPointI++] = mesh.points()[pointI];
|
||||
pointToDualPoint[pointi] = dualPointi;
|
||||
dualPoints[dualPointi++] = mesh.points()[pointi];
|
||||
}
|
||||
|
||||
|
||||
@ -1149,9 +1149,9 @@ void Foam::polyDualMesh::calcDual
|
||||
Pout<< "polyDualMesh::calcDual : dumping internal faces to "
|
||||
<< str.name() << endl;
|
||||
|
||||
forAll(dualPoints, dualPointI)
|
||||
forAll(dualPoints, dualPointi)
|
||||
{
|
||||
meshTools::writeOBJ(str, dualPoints[dualPointI]);
|
||||
meshTools::writeOBJ(str, dualPoints[dualPointi]);
|
||||
}
|
||||
forAll(dynDualFaces, dualFacei)
|
||||
{
|
||||
@ -1215,9 +1215,9 @@ void Foam::polyDualMesh::calcDual
|
||||
Pout<< "polyDualMesh::calcDual : dumping all faces to "
|
||||
<< str.name() << endl;
|
||||
|
||||
forAll(dualPoints, dualPointI)
|
||||
forAll(dualPoints, dualPointi)
|
||||
{
|
||||
meshTools::writeOBJ(str, dualPoints[dualPointI]);
|
||||
meshTools::writeOBJ(str, dualPoints[dualPointi]);
|
||||
}
|
||||
forAll(dualFaces, dualFacei)
|
||||
{
|
||||
@ -1562,9 +1562,9 @@ void Foam::polyDualMesh::calcFeatures
|
||||
|
||||
DynamicList<label> allFeaturePoints(pointEdges.size());
|
||||
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
const labelList& pEdges = pointEdges[pointI];
|
||||
const labelList& pEdges = pointEdges[pointi];
|
||||
|
||||
label nFeatEdges = 0;
|
||||
|
||||
@ -1578,7 +1578,7 @@ void Foam::polyDualMesh::calcFeatures
|
||||
if (nFeatEdges > 2)
|
||||
{
|
||||
// Store in mesh vertex label
|
||||
allFeaturePoints.append(allBoundary.meshPoints()[pointI]);
|
||||
allFeaturePoints.append(allBoundary.meshPoints()[pointi]);
|
||||
}
|
||||
}
|
||||
featurePoints.transfer(allFeaturePoints);
|
||||
@ -1592,8 +1592,8 @@ void Foam::polyDualMesh::calcFeatures
|
||||
|
||||
forAll(featurePoints, i)
|
||||
{
|
||||
label pointI = featurePoints[i];
|
||||
meshTools::writeOBJ(str, mesh.points()[pointI]);
|
||||
label pointi = featurePoints[i];
|
||||
meshTools::writeOBJ(str, mesh.points()[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -80,7 +80,7 @@ class polyDualMesh
|
||||
(
|
||||
const primitivePatch& patch,
|
||||
const label facei,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
label& e0,
|
||||
label& e1
|
||||
);
|
||||
@ -91,7 +91,7 @@ class polyDualMesh
|
||||
const label patchToDualOffset,
|
||||
const labelList& edgeToDualPoint,
|
||||
const labelList& pointToDualPoint,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
|
||||
label& edgeI
|
||||
);
|
||||
@ -102,7 +102,7 @@ class polyDualMesh
|
||||
const label patchToDualOffset,
|
||||
const labelList& edgeToDualPoint,
|
||||
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label startEdgeI,
|
||||
|
||||
labelList& dualFace2,
|
||||
@ -114,7 +114,7 @@ class polyDualMesh
|
||||
const polyPatch& patch,
|
||||
const labelList& pointToDualPoint,
|
||||
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const labelList& dualFace,
|
||||
const labelList& featEdgeIndices,
|
||||
|
||||
|
||||
@ -488,19 +488,19 @@ Foam::dynamicRefineFvMesh::unrefine
|
||||
{
|
||||
forAll(splitPoints, i)
|
||||
{
|
||||
label pointI = splitPoints[i];
|
||||
label pointi = splitPoints[i];
|
||||
|
||||
const labelList& pEdges = pointEdges()[pointI];
|
||||
const labelList& pEdges = pointEdges()[pointi];
|
||||
|
||||
forAll(pEdges, j)
|
||||
{
|
||||
label otherPointI = edges()[pEdges[j]].otherVertex(pointI);
|
||||
label otherPointi = edges()[pEdges[j]].otherVertex(pointi);
|
||||
|
||||
const labelList& pFaces = pointFaces()[otherPointI];
|
||||
const labelList& pFaces = pointFaces()[otherPointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
faceToSplitPoint.insert(pFaces[pFacei], otherPointI);
|
||||
faceToSplitPoint.insert(pFaces[pFacei], otherPointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -590,9 +590,9 @@ Foam::dynamicRefineFvMesh::unrefine
|
||||
forAllConstIter(Map<label>, faceToSplitPoint, iter)
|
||||
{
|
||||
label oldFacei = iter.key();
|
||||
label oldPointI = iter();
|
||||
label oldPointi = iter();
|
||||
|
||||
if (reversePointMap[oldPointI] < 0)
|
||||
if (reversePointMap[oldPointi] < 0)
|
||||
{
|
||||
// midpoint was removed. See if face still exists.
|
||||
label facei = reverseFaceMap[oldFacei];
|
||||
@ -652,13 +652,13 @@ Foam::dynamicRefineFvMesh::maxPointField(const scalarField& pFld) const
|
||||
{
|
||||
scalarField vFld(nCells(), -GREAT);
|
||||
|
||||
forAll(pointCells(), pointI)
|
||||
forAll(pointCells(), pointi)
|
||||
{
|
||||
const labelList& pCells = pointCells()[pointI];
|
||||
const labelList& pCells = pointCells()[pointi];
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
vFld[pCells[i]] = max(vFld[pCells[i]], pFld[pointI]);
|
||||
vFld[pCells[i]] = max(vFld[pCells[i]], pFld[pointi]);
|
||||
}
|
||||
}
|
||||
return vFld;
|
||||
@ -671,13 +671,13 @@ Foam::dynamicRefineFvMesh::maxCellField(const volScalarField& vFld) const
|
||||
{
|
||||
scalarField pFld(nPoints(), -GREAT);
|
||||
|
||||
forAll(pointCells(), pointI)
|
||||
forAll(pointCells(), pointi)
|
||||
{
|
||||
const labelList& pCells = pointCells()[pointI];
|
||||
const labelList& pCells = pointCells()[pointi];
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
pFld[pointI] = max(pFld[pointI], vFld[pCells[i]]);
|
||||
pFld[pointi] = max(pFld[pointi], vFld[pCells[i]]);
|
||||
}
|
||||
}
|
||||
return pFld;
|
||||
@ -690,16 +690,16 @@ Foam::dynamicRefineFvMesh::cellToPoint(const scalarField& vFld) const
|
||||
{
|
||||
scalarField pFld(nPoints());
|
||||
|
||||
forAll(pointCells(), pointI)
|
||||
forAll(pointCells(), pointi)
|
||||
{
|
||||
const labelList& pCells = pointCells()[pointI];
|
||||
const labelList& pCells = pointCells()[pointi];
|
||||
|
||||
scalar sum = 0.0;
|
||||
forAll(pCells, i)
|
||||
{
|
||||
sum += vFld[pCells[i]];
|
||||
}
|
||||
pFld[pointI] = sum/pCells.size();
|
||||
pFld[pointi] = sum/pCells.size();
|
||||
}
|
||||
return pFld;
|
||||
}
|
||||
@ -864,12 +864,12 @@ Foam::labelList Foam::dynamicRefineFvMesh::selectUnrefinePoints
|
||||
|
||||
forAll(splitPoints, i)
|
||||
{
|
||||
label pointI = splitPoints[i];
|
||||
label pointi = splitPoints[i];
|
||||
|
||||
if (pFld[pointI] < unrefineLevel)
|
||||
if (pFld[pointi] < unrefineLevel)
|
||||
{
|
||||
// Check that all cells are not marked
|
||||
const labelList& pCells = pointCells()[pointI];
|
||||
const labelList& pCells = pointCells()[pointi];
|
||||
|
||||
bool hasMarked = false;
|
||||
|
||||
@ -884,7 +884,7 @@ Foam::labelList Foam::dynamicRefineFvMesh::selectUnrefinePoints
|
||||
|
||||
if (!hasMarked)
|
||||
{
|
||||
newSplitPoints.append(pointI);
|
||||
newSplitPoints.append(pointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -963,15 +963,15 @@ void Foam::dynamicRefineFvMesh::checkEightAnchorPoints
|
||||
|
||||
labelList nAnchorPoints(nCells(), 0);
|
||||
|
||||
forAll(pointLevel, pointI)
|
||||
forAll(pointLevel, pointi)
|
||||
{
|
||||
const labelList& pCells = pointCells(pointI);
|
||||
const labelList& pCells = pointCells(pointi);
|
||||
|
||||
forAll(pCells, pCelli)
|
||||
{
|
||||
label celli = pCells[pCelli];
|
||||
|
||||
if (pointLevel[pointI] <= cellLevel[celli])
|
||||
if (pointLevel[pointi] <= cellLevel[celli])
|
||||
{
|
||||
// Check if cell has already 8 anchor points -> protect cell
|
||||
if (nAnchorPoints[celli] == 8)
|
||||
@ -1031,9 +1031,9 @@ Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io)
|
||||
|
||||
label nProtected = 0;
|
||||
|
||||
forAll(pointCells(), pointI)
|
||||
forAll(pointCells(), pointi)
|
||||
{
|
||||
const labelList& pCells = pointCells()[pointI];
|
||||
const labelList& pCells = pointCells()[pointi];
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
@ -1041,7 +1041,7 @@ Foam::dynamicRefineFvMesh::dynamicRefineFvMesh(const IOobject& io)
|
||||
|
||||
if (!protectedCell_.get(celli))
|
||||
{
|
||||
if (pointLevel[pointI] <= cellLevel[celli])
|
||||
if (pointLevel[pointi] <= cellLevel[celli])
|
||||
{
|
||||
nAnchors[celli]++;
|
||||
|
||||
|
||||
@ -134,8 +134,8 @@ Foam::multiSolidBodyMotionFvMesh::multiSolidBodyMotionFvMesh(const IOobject& io)
|
||||
const face& f = faces()[c[j]];
|
||||
forAll(f, k)
|
||||
{
|
||||
label pointI = f[k];
|
||||
movePts[pointI] = true;
|
||||
label pointi = f[k];
|
||||
movePts[pointi] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -155,8 +155,8 @@ Foam::solidBodyMotionFvMesh::solidBodyMotionFvMesh(const IOobject& io)
|
||||
const face& f = faces()[c[j]];
|
||||
forAll(f, k)
|
||||
{
|
||||
label pointI = f[k];
|
||||
movePts[pointI] = true;
|
||||
label pointi = f[k];
|
||||
movePts[pointi] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -95,28 +95,28 @@ void Foam::attachDetach::calcPointMatchMap() const
|
||||
const face& curMasterPoints = masterLocalFaces[facei];
|
||||
const face& curSlavePoints = slaveLocalFaces[facei];
|
||||
|
||||
forAll(curMasterPoints, pointI)
|
||||
forAll(curMasterPoints, pointi)
|
||||
{
|
||||
// If the master and slave point labels are the same, the
|
||||
// point remains. Otherwise, the slave point is removed and
|
||||
// replaced by the master
|
||||
if
|
||||
(
|
||||
masterMeshPoints[curMasterPoints[pointI]]
|
||||
!= slaveMeshPoints[curSlavePoints[pointI]]
|
||||
masterMeshPoints[curMasterPoints[pointi]]
|
||||
!= slaveMeshPoints[curSlavePoints[pointi]]
|
||||
)
|
||||
{
|
||||
// Pout<< "Matching slave point "
|
||||
// << slaveMeshPoints[curSlavePoints[pointI]]
|
||||
// << slaveMeshPoints[curSlavePoints[pointi]]
|
||||
// << " with "
|
||||
// << masterMeshPoints[curMasterPoints[pointI]]
|
||||
// << masterMeshPoints[curMasterPoints[pointi]]
|
||||
// << endl;
|
||||
|
||||
// Grab the addressing
|
||||
removedPointMap.insert
|
||||
(
|
||||
slaveMeshPoints[curSlavePoints[pointI]],
|
||||
masterMeshPoints[curMasterPoints[pointI]]
|
||||
slaveMeshPoints[curSlavePoints[pointi]],
|
||||
masterMeshPoints[curMasterPoints[pointi]]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,13 +81,13 @@ void Foam::attachDetach::attachInterface
|
||||
|
||||
const labelList removedPoints = removedPointMap.toc();
|
||||
|
||||
forAll(removedPoints, pointI)
|
||||
forAll(removedPoints, pointi)
|
||||
{
|
||||
//Pout<< "Removing point:" << removedPoints[pointI]
|
||||
// << " currently at:" << ref.points()[removedPoints[pointI]]
|
||||
//Pout<< "Removing point:" << removedPoints[pointi]
|
||||
// << " currently at:" << ref.points()[removedPoints[pointi]]
|
||||
// << endl;
|
||||
|
||||
ref.setAction(polyRemovePoint(removedPoints[pointI]));
|
||||
ref.setAction(polyRemovePoint(removedPoints[pointi]));
|
||||
}
|
||||
|
||||
// Pout<< "Points to be mapped: " << removedPoints << endl;
|
||||
@ -167,9 +167,9 @@ void Foam::attachDetach::attachInterface
|
||||
|
||||
// Grab all the faces off the points in the slave patch. If the face has
|
||||
// not been removed, add it to the map of faces to renumber
|
||||
forAll(slaveMeshPoints, pointI)
|
||||
forAll(slaveMeshPoints, pointi)
|
||||
{
|
||||
const labelList& curFaces = pf[slaveMeshPoints[pointI]];
|
||||
const labelList& curFaces = pf[slaveMeshPoints[pointi]];
|
||||
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
@ -192,15 +192,15 @@ void Foam::attachDetach::attachInterface
|
||||
|
||||
face newFace(faces[curFaceID]);
|
||||
|
||||
forAll(newFace, pointI)
|
||||
forAll(newFace, pointi)
|
||||
{
|
||||
Map<label>::const_iterator rpmIter =
|
||||
removedPointMap.find(newFace[pointI]);
|
||||
removedPointMap.find(newFace[pointi]);
|
||||
|
||||
if (rpmIter != removedPointMap.end())
|
||||
{
|
||||
// Point mapped. Replace it
|
||||
newFace[pointI] = rpmIter();
|
||||
newFace[pointi] = rpmIter();
|
||||
}
|
||||
}
|
||||
|
||||
@ -282,13 +282,13 @@ void Foam::attachDetach::modifyMotionPoints
|
||||
// Calculate the difference in motion point positions
|
||||
scalar pointDiff = 0;
|
||||
|
||||
forAll(removedPoints, pointI)
|
||||
forAll(removedPoints, pointi)
|
||||
{
|
||||
pointDiff +=
|
||||
mag
|
||||
(
|
||||
motionPoints[removedPoints[pointI]]
|
||||
- motionPoints[removedPointMap.find(removedPoints[pointI])()]
|
||||
motionPoints[removedPoints[pointi]]
|
||||
- motionPoints[removedPointMap.find(removedPoints[pointi])()]
|
||||
);
|
||||
}
|
||||
|
||||
@ -299,10 +299,10 @@ void Foam::attachDetach::modifyMotionPoints
|
||||
}
|
||||
|
||||
// Put the slave point on top of the master point
|
||||
forAll(removedPoints, pointI)
|
||||
forAll(removedPoints, pointi)
|
||||
{
|
||||
motionPoints[removedPoints[pointI]] =
|
||||
motionPoints[removedPointMap.find(removedPoints[pointI])()];
|
||||
motionPoints[removedPoints[pointi]] =
|
||||
motionPoints[removedPointMap.find(removedPoints[pointi])()];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -146,25 +146,25 @@ void Foam::attachDetach::detachInterface
|
||||
// Pout<< "addedPoints before point creation: " << addedPoints << endl;
|
||||
|
||||
// Create new points for face zone
|
||||
forAll(addedPoints, pointI)
|
||||
forAll(addedPoints, pointi)
|
||||
{
|
||||
if (addedPoints[pointI] < 0)
|
||||
if (addedPoints[pointi] < 0)
|
||||
{
|
||||
addedPoints[pointI] =
|
||||
addedPoints[pointi] =
|
||||
ref.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
(
|
||||
points[mp[pointI]], // point
|
||||
mp[pointI], // master point
|
||||
points[mp[pointi]], // point
|
||||
mp[pointi], // master point
|
||||
-1, // zone ID
|
||||
true // supports a cell
|
||||
)
|
||||
);
|
||||
//Pout<< "Adding point " << addedPoints[pointI]
|
||||
// << " coord1:" << points[mp[pointI]]
|
||||
// << " coord2:" << masterFaceLayer.localPoints()[pointI]
|
||||
// << " for original point " << mp[pointI] << endl;
|
||||
//Pout<< "Adding point " << addedPoints[pointi]
|
||||
// << " coord1:" << points[mp[pointi]]
|
||||
// << " coord2:" << masterFaceLayer.localPoints()[pointi]
|
||||
// << " for original point " << mp[pointi] << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -187,9 +187,9 @@ void Foam::attachDetach::detachInterface
|
||||
|
||||
face newFace(oldFace.size());
|
||||
|
||||
forAll(oldFace, pointI)
|
||||
forAll(oldFace, pointi)
|
||||
{
|
||||
newFace[pointI] = addedPoints[oldFace[pointI]];
|
||||
newFace[pointi] = addedPoints[oldFace[pointi]];
|
||||
}
|
||||
|
||||
if (mfFlip[facei])
|
||||
@ -378,12 +378,12 @@ void Foam::attachDetach::detachInterface
|
||||
// Create the master layer point map
|
||||
Map<label> masterLayerPointMap(2*mp.size());
|
||||
|
||||
forAll(mp, pointI)
|
||||
forAll(mp, pointi)
|
||||
{
|
||||
masterLayerPointMap.insert
|
||||
(
|
||||
mp[pointI],
|
||||
addedPoints[pointI]
|
||||
mp[pointi],
|
||||
addedPoints[pointi]
|
||||
);
|
||||
}
|
||||
|
||||
@ -403,17 +403,17 @@ void Foam::attachDetach::detachInterface
|
||||
|
||||
bool changed = false;
|
||||
|
||||
forAll(oldFace, pointI)
|
||||
forAll(oldFace, pointi)
|
||||
{
|
||||
if (masterLayerPointMap.found(oldFace[pointI]))
|
||||
if (masterLayerPointMap.found(oldFace[pointi]))
|
||||
{
|
||||
changed = true;
|
||||
|
||||
newFace[pointI] = masterLayerPointMap.find(oldFace[pointI])();
|
||||
newFace[pointi] = masterLayerPointMap.find(oldFace[pointi])();
|
||||
}
|
||||
else
|
||||
{
|
||||
newFace[pointI] = oldFace[pointI];
|
||||
newFace[pointi] = oldFace[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,12 +51,12 @@ const scalar boundaryMesh::distanceTol_ = 1e-2;
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Returns number of feature edges connected to pointI
|
||||
Foam::label Foam::boundaryMesh::nFeatureEdges(label pointI) const
|
||||
// Returns number of feature edges connected to pointi
|
||||
Foam::label Foam::boundaryMesh::nFeatureEdges(label pointi) const
|
||||
{
|
||||
label nFeats = 0;
|
||||
|
||||
const labelList& pEdges = mesh().pointEdges()[pointI];
|
||||
const labelList& pEdges = mesh().pointEdges()[pointi];
|
||||
|
||||
forAll(pEdges, pEdgeI)
|
||||
{
|
||||
@ -71,7 +71,7 @@ Foam::label Foam::boundaryMesh::nFeatureEdges(label pointI) const
|
||||
}
|
||||
|
||||
|
||||
// Returns next feature edge connected to pointI
|
||||
// Returns next feature edge connected to pointi
|
||||
Foam::label Foam::boundaryMesh::nextFeatureEdge
|
||||
(
|
||||
const label edgeI,
|
||||
@ -99,7 +99,7 @@ Foam::label Foam::boundaryMesh::nextFeatureEdge
|
||||
}
|
||||
|
||||
|
||||
// Finds connected feature edges, starting from startPointI and returns
|
||||
// Finds connected feature edges, starting from startPointi and returns
|
||||
// feature labels (not edge labels). Marks feature edges handled in
|
||||
// featVisited.
|
||||
Foam::labelList Foam::boundaryMesh::collectSegment
|
||||
@ -575,10 +575,10 @@ void Foam::boundaryMesh::read(const polyMesh& mesh)
|
||||
|
||||
Pout<< "** Start of Points **" << endl;
|
||||
|
||||
forAll(msh.points(), pointI)
|
||||
forAll(msh.points(), pointi)
|
||||
{
|
||||
Pout<< " " << pointI
|
||||
<< " coord:" << msh.points()[pointI]
|
||||
Pout<< " " << pointi
|
||||
<< " coord:" << msh.points()[pointi]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ class boundaryMesh
|
||||
// Private Member Functions
|
||||
|
||||
//- Number of connected feature edges.
|
||||
label nFeatureEdges(label pointI) const;
|
||||
label nFeatureEdges(label pointi) const;
|
||||
|
||||
//- Step to next feature edge
|
||||
label nextFeatureEdge(const label edgeI, const label vertI) const;
|
||||
|
||||
@ -522,21 +522,21 @@ void Foam::createShellMesh::setRefinement
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
// Original point numbers in local point ordering so no need to store.
|
||||
forAll(patch_.localPoints(), pointI)
|
||||
forAll(patch_.localPoints(), pointi)
|
||||
{
|
||||
//label addedPointI =
|
||||
//label addedPointi =
|
||||
meshMod.addPoint
|
||||
(
|
||||
patch_.localPoints()[pointI], // point
|
||||
patch_.localPoints()[pointi], // point
|
||||
pointToPointMap.size(), // masterPointID
|
||||
-1, // zoneID
|
||||
true // inCell
|
||||
);
|
||||
pointToPointMap.append(pointI);
|
||||
pointToPointMap.append(pointi);
|
||||
|
||||
//Pout<< "Added bottom point " << addedPointI
|
||||
// << " at " << patch_.localPoints()[pointI]
|
||||
// << " from point " << pointI
|
||||
//Pout<< "Added bottom point " << addedPointi
|
||||
// << " at " << patch_.localPoints()[pointi]
|
||||
// << " from point " << pointi
|
||||
// << endl;
|
||||
}
|
||||
|
||||
@ -547,9 +547,9 @@ void Foam::createShellMesh::setRefinement
|
||||
labelList addedPoints(nLayers*regionPoints_.size());
|
||||
forAll(regionPoints_, regionI)
|
||||
{
|
||||
label pointI = regionPoints_[regionI];
|
||||
label pointi = regionPoints_[regionI];
|
||||
|
||||
point pt = patch_.localPoints()[pointI];
|
||||
point pt = patch_.localPoints()[pointi];
|
||||
point disp = firstLayerDisp[regionI];
|
||||
for (label layerI = 0; layerI < nLayers; layerI++)
|
||||
{
|
||||
@ -562,7 +562,7 @@ void Foam::createShellMesh::setRefinement
|
||||
-1, // zoneID
|
||||
true // inCell
|
||||
);
|
||||
pointToPointMap.append(pointI);
|
||||
pointToPointMap.append(pointi);
|
||||
|
||||
disp *= expansionRatio;
|
||||
}
|
||||
@ -617,16 +617,16 @@ void Foam::createShellMesh::setRefinement
|
||||
|
||||
label own = addedCells[facei*nLayers+layerI];
|
||||
label nei;
|
||||
label patchI;
|
||||
label patchi;
|
||||
if (layerI == nLayers-1)
|
||||
{
|
||||
nei = -1;
|
||||
patchI = topPatchID[facei];
|
||||
patchi = topPatchID[facei];
|
||||
}
|
||||
else
|
||||
{
|
||||
nei = addedCells[facei*nLayers+layerI+1];
|
||||
patchI = -1;
|
||||
patchi = -1;
|
||||
}
|
||||
|
||||
meshMod.addFace
|
||||
@ -638,7 +638,7 @@ void Foam::createShellMesh::setRefinement
|
||||
-1, // masterEdgeID
|
||||
faceToFaceMap.size(), // masterFaceID : current facei
|
||||
false, // flipFaceFlux
|
||||
patchI, // patchID
|
||||
patchi, // patchID
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
@ -746,7 +746,7 @@ void Foam::createShellMesh::setRefinement
|
||||
|
||||
label minCelli = addedCells[nLayers*eFaces[0]+layerI];
|
||||
label maxCelli;
|
||||
label patchI;
|
||||
label patchi;
|
||||
if (ePatches.size() == 0)
|
||||
{
|
||||
maxCelli = addedCells[nLayers*eFaces[1]+layerI];
|
||||
@ -756,12 +756,12 @@ void Foam::createShellMesh::setRefinement
|
||||
Swap(minCelli, maxCelli);
|
||||
newF = newF.reverseFace();
|
||||
}
|
||||
patchI = -1;
|
||||
patchi = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
maxCelli = -1;
|
||||
patchI = ePatches[0];
|
||||
patchi = ePatches[0];
|
||||
}
|
||||
|
||||
//{
|
||||
@ -789,7 +789,7 @@ void Foam::createShellMesh::setRefinement
|
||||
-1, // masterEdgeID
|
||||
faceToFaceMap.size(), // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
patchI, // patchID
|
||||
patchi, // patchID
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
|
||||
@ -618,23 +618,23 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::mergeSharedPoints
|
||||
|
||||
forAll(constructMap, i)
|
||||
{
|
||||
label oldPointI = constructMap[i];
|
||||
label oldPointi = constructMap[i];
|
||||
|
||||
label newPointI = map().reversePointMap()[oldPointI];
|
||||
label newPointi = map().reversePointMap()[oldPointi];
|
||||
|
||||
if (newPointI < -1)
|
||||
if (newPointi < -1)
|
||||
{
|
||||
constructMap[i] = -newPointI-2;
|
||||
constructMap[i] = -newPointi-2;
|
||||
}
|
||||
else if (newPointI >= 0)
|
||||
else if (newPointi >= 0)
|
||||
{
|
||||
constructMap[i] = newPointI;
|
||||
constructMap[i] = newPointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. oldPointI:" << oldPointI
|
||||
<< " newPointI:" << newPointI << abort(FatalError);
|
||||
<< "Problem. oldPointi:" << oldPointi
|
||||
<< " newPointi:" << newPointi << abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,8 +149,8 @@ class fvMeshDistribute
|
||||
void correctBoundaryConditions();
|
||||
|
||||
//- Delete all processor patches. Move any processor faces into
|
||||
// patchI.
|
||||
autoPtr<mapPolyMesh> deleteProcPatches(const label patchI);
|
||||
// patchi.
|
||||
autoPtr<mapPolyMesh> deleteProcPatches(const label patchi);
|
||||
|
||||
//- Repatch the mesh. This is only necessary for the proc
|
||||
// boundary faces. newPatchID is over all boundary faces: -1 or
|
||||
|
||||
@ -211,9 +211,9 @@ void Foam::fvMeshDistribute::mapExposedFaces
|
||||
|
||||
// Pull from old internal field into bfld.
|
||||
|
||||
forAll(bfld, patchI)
|
||||
forAll(bfld, patchi)
|
||||
{
|
||||
fvsPatchField<T>& patchFld = bfld[patchI];
|
||||
fvsPatchField<T>& patchFld = bfld[patchi];
|
||||
|
||||
forAll(patchFld, i)
|
||||
{
|
||||
|
||||
@ -69,10 +69,10 @@ void Foam::fvMeshSubset::markPoints
|
||||
Map<label>& pointMap
|
||||
)
|
||||
{
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
// Note: insert will only insert if not yet there.
|
||||
pointMap.insert(curPoints[pointI], 0);
|
||||
pointMap.insert(curPoints[pointi], 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,9 +83,9 @@ void Foam::fvMeshSubset::markPoints
|
||||
labelList& pointMap
|
||||
)
|
||||
{
|
||||
forAll(curPoints, pointI)
|
||||
forAll(curPoints, pointi)
|
||||
{
|
||||
pointMap[curPoints[pointI]] = 0;
|
||||
pointMap[curPoints[pointi]] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -580,9 +580,9 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
pointMap_ = globalPointMap.toc();
|
||||
sort(pointMap_);
|
||||
|
||||
forAll(pointMap_, pointI)
|
||||
forAll(pointMap_, pointi)
|
||||
{
|
||||
globalPointMap[pointMap_[pointI]] = pointI;
|
||||
globalPointMap[pointMap_[pointi]] = pointi;
|
||||
}
|
||||
|
||||
Pout<< "Number of cells in new mesh: " << nCellsInSet << endl;
|
||||
@ -594,9 +594,9 @@ void Foam::fvMeshSubset::setCellSubset
|
||||
|
||||
label nNewPoints = 0;
|
||||
|
||||
forAll(pointMap_, pointI)
|
||||
forAll(pointMap_, pointi)
|
||||
{
|
||||
newPoints[nNewPoints] = oldPoints[pointMap_[pointI]];
|
||||
newPoints[nNewPoints] = oldPoints[pointMap_[pointi]];
|
||||
nNewPoints++;
|
||||
}
|
||||
|
||||
@ -1086,9 +1086,9 @@ void Foam::fvMeshSubset::setLargeCellSubset
|
||||
// Grab the points map
|
||||
label nPointsInSet = 0;
|
||||
|
||||
forAll(globalPointMap, pointI)
|
||||
forAll(globalPointMap, pointi)
|
||||
{
|
||||
if (globalPointMap[pointI] != -1)
|
||||
if (globalPointMap[pointi] != -1)
|
||||
{
|
||||
nPointsInSet++;
|
||||
}
|
||||
@ -1097,12 +1097,12 @@ void Foam::fvMeshSubset::setLargeCellSubset
|
||||
|
||||
nPointsInSet = 0;
|
||||
|
||||
forAll(globalPointMap, pointI)
|
||||
forAll(globalPointMap, pointi)
|
||||
{
|
||||
if (globalPointMap[pointI] != -1)
|
||||
if (globalPointMap[pointi] != -1)
|
||||
{
|
||||
pointMap_[nPointsInSet] = pointI;
|
||||
globalPointMap[pointI] = nPointsInSet;
|
||||
pointMap_[nPointsInSet] = pointi;
|
||||
globalPointMap[pointi] = nPointsInSet;
|
||||
nPointsInSet++;
|
||||
}
|
||||
}
|
||||
@ -1116,9 +1116,9 @@ void Foam::fvMeshSubset::setLargeCellSubset
|
||||
|
||||
label nNewPoints = 0;
|
||||
|
||||
forAll(pointMap_, pointI)
|
||||
forAll(pointMap_, pointi)
|
||||
{
|
||||
newPoints[nNewPoints] = oldPoints[pointMap_[pointI]];
|
||||
newPoints[nNewPoints] = oldPoints[pointMap_[pointi]];
|
||||
nNewPoints++;
|
||||
}
|
||||
|
||||
|
||||
@ -461,9 +461,9 @@ fvMeshSubset::interpolate
|
||||
forAll(subMeshPoints, localI)
|
||||
{
|
||||
// Get mesh point on original mesh.
|
||||
label meshPointI = pointMap[subMeshPoints[localI]];
|
||||
label meshPointi = pointMap[subMeshPoints[localI]];
|
||||
|
||||
Map<label>::const_iterator iter = meshPointMap.find(meshPointI);
|
||||
Map<label>::const_iterator iter = meshPointMap.find(meshPointi);
|
||||
|
||||
if (iter != meshPointMap.end())
|
||||
{
|
||||
|
||||
@ -62,7 +62,7 @@ class fvMeshTools
|
||||
static void setPatchFields
|
||||
(
|
||||
fvMesh& mesh,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const dictionary& patchFieldDict
|
||||
);
|
||||
|
||||
@ -71,7 +71,7 @@ class fvMeshTools
|
||||
static void setPatchFields
|
||||
(
|
||||
fvMesh& mesh,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const typename GeoField::value_type& value
|
||||
);
|
||||
|
||||
@ -105,12 +105,12 @@ public:
|
||||
static void setPatchFields
|
||||
(
|
||||
fvMesh& mesh,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const dictionary& patchFieldDict
|
||||
);
|
||||
|
||||
//- Change patchField to zero on registered fields
|
||||
static void zeroPatchFields(fvMesh& mesh, const label patchI);
|
||||
static void zeroPatchFields(fvMesh& mesh, const label patchi);
|
||||
|
||||
//- Reorder and remove trailing patches. If validBoundary call is parallel
|
||||
// synced and all add the same patch with same settings
|
||||
|
||||
@ -125,18 +125,18 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
// Add the new points
|
||||
labelList addedPoints(mp.size());
|
||||
|
||||
forAll(mp, pointI)
|
||||
forAll(mp, pointi)
|
||||
{
|
||||
// Add the point nominal thickness away from the master zone point
|
||||
// and grab the label
|
||||
addedPoints[pointI] =
|
||||
addedPoints[pointi] =
|
||||
ref.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
(
|
||||
points[mp[pointI]] // point
|
||||
+ addDelta_*pointOffsets[pointI],
|
||||
mp[pointI], // master point
|
||||
points[mp[pointi]] // point
|
||||
+ addDelta_*pointOffsets[pointi],
|
||||
mp[pointi], // master point
|
||||
-1, // zone for point
|
||||
true // supports a cell
|
||||
)
|
||||
@ -200,9 +200,9 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
|
||||
face newFace(oldFace.size());
|
||||
|
||||
forAll(oldFace, pointI)
|
||||
forAll(oldFace, pointi)
|
||||
{
|
||||
newFace[pointI] = addedPoints[oldFace[pointI]];
|
||||
newFace[pointi] = addedPoints[oldFace[pointi]];
|
||||
}
|
||||
|
||||
bool flipFaceFlux = false;
|
||||
@ -509,12 +509,12 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
// Create the master layer point map
|
||||
Map<label> masterLayerPointMap(2*mp.size());
|
||||
|
||||
forAll(mp, pointI)
|
||||
forAll(mp, pointi)
|
||||
{
|
||||
masterLayerPointMap.insert
|
||||
(
|
||||
mp[pointI],
|
||||
addedPoints[pointI]
|
||||
mp[pointi],
|
||||
addedPoints[pointi]
|
||||
);
|
||||
}
|
||||
|
||||
@ -534,17 +534,17 @@ void Foam::layerAdditionRemoval::addCellLayer
|
||||
|
||||
bool changed = false;
|
||||
|
||||
forAll(oldFace, pointI)
|
||||
forAll(oldFace, pointi)
|
||||
{
|
||||
if (masterLayerPointMap.found(oldFace[pointI]))
|
||||
if (masterLayerPointMap.found(oldFace[pointi]))
|
||||
{
|
||||
changed = true;
|
||||
|
||||
newFace[pointI] = masterLayerPointMap.find(oldFace[pointI])();
|
||||
newFace[pointi] = masterLayerPointMap.find(oldFace[pointi])();
|
||||
}
|
||||
else
|
||||
{
|
||||
newFace[pointI] = oldFace[pointI];
|
||||
newFace[pointi] = oldFace[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -159,9 +159,9 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
}
|
||||
|
||||
// Remove all points that will be collapsed
|
||||
forAll(ptc, pointI)
|
||||
forAll(ptc, pointi)
|
||||
{
|
||||
ref.setAction(polyRemovePoint(ptc[pointI]));
|
||||
ref.setAction(polyRemovePoint(ptc[pointi]));
|
||||
}
|
||||
|
||||
// Grab all faces coming off points to be deleted. If the face
|
||||
@ -176,9 +176,9 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
const labelList& meshPoints =
|
||||
mesh.faceZones()[faceZoneID_.index()]().meshPoints();
|
||||
|
||||
forAll(ptc, pointI)
|
||||
forAll(ptc, pointi)
|
||||
{
|
||||
removedPointMap.insert(ptc[pointI], meshPoints[pointI]);
|
||||
removedPointMap.insert(ptc[pointi], meshPoints[pointi]);
|
||||
}
|
||||
|
||||
const labelListList& pf = mesh.pointFaces();
|
||||
@ -188,9 +188,9 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
// Make a list of faces to be modified using the map to avoid duplicates
|
||||
labelHashSet facesToModify(ptc.size()*primitiveMesh::facesPerPoint_);
|
||||
|
||||
forAll(ptc, pointI)
|
||||
forAll(ptc, pointi)
|
||||
{
|
||||
const labelList& curFaces = pf[ptc[pointI]];
|
||||
const labelList& curFaces = pf[ptc[pointi]];
|
||||
|
||||
forAll(curFaces, facei)
|
||||
{
|
||||
@ -217,15 +217,15 @@ void Foam::layerAdditionRemoval::removeCellLayer
|
||||
|
||||
face newFace(faces[curFaceID]);
|
||||
|
||||
forAll(newFace, pointI)
|
||||
forAll(newFace, pointi)
|
||||
{
|
||||
Map<label>::iterator rpmIter =
|
||||
removedPointMap.find(newFace[pointI]);
|
||||
removedPointMap.find(newFace[pointi]);
|
||||
|
||||
if (rpmIter != removedPointMap.end())
|
||||
{
|
||||
// Point mapped. Replace it
|
||||
newFace[pointI] = rpmIter();
|
||||
newFace[pointi] = rpmIter();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -135,19 +135,19 @@ bool Foam::layerAdditionRemoval::setLayerPairing() const
|
||||
ftc[facei] = lidFace.oppositeIndex();
|
||||
|
||||
// Using the local face insert the points into the lid list
|
||||
forAll(curLocalFace, pointI)
|
||||
forAll(curLocalFace, pointi)
|
||||
{
|
||||
const label clp = curLocalFace[pointI];
|
||||
const label clp = curLocalFace[pointi];
|
||||
|
||||
if (ptc[clp] == -1)
|
||||
{
|
||||
// Point not mapped yet. Insert the label
|
||||
ptc[clp] = lidFace[pointI];
|
||||
ptc[clp] = lidFace[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Point mapped from some other face. Check the label
|
||||
if (ptc[clp] != lidFace[pointI])
|
||||
if (ptc[clp] != lidFace[pointi])
|
||||
{
|
||||
nPointErrors++;
|
||||
|
||||
@ -159,7 +159,7 @@ bool Foam::layerAdditionRemoval::setLayerPairing() const
|
||||
<< "consistently. Please check the "
|
||||
<< "face zone flip map." << nl
|
||||
<< "First index: " << ptc[clp]
|
||||
<< " new index: " << lidFace[pointI] << endl;
|
||||
<< " new index: " << lidFace[pointi] << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,10 +145,10 @@ void Foam::cellCuts::writeUncutOBJ
|
||||
|
||||
forAll(cPoints, i)
|
||||
{
|
||||
label pointI = cPoints[i];
|
||||
if (pointIsCut_[pointI])
|
||||
label pointi = cPoints[i];
|
||||
if (pointIsCut_[pointi])
|
||||
{
|
||||
meshTools::writeOBJ(cutStream, mesh().points()[pointI]);
|
||||
meshTools::writeOBJ(cutStream, mesh().points()[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1129,18 +1129,18 @@ void Foam::cellCuts::calcCellLoops(const labelList& cutCells)
|
||||
void Foam::cellCuts::walkEdges
|
||||
(
|
||||
const label celli,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label status,
|
||||
|
||||
Map<label>& edgeStatus,
|
||||
Map<label>& pointStatus
|
||||
) const
|
||||
{
|
||||
if (pointStatus.insert(pointI, status))
|
||||
if (pointStatus.insert(pointi, status))
|
||||
{
|
||||
// First visit to pointI
|
||||
// First visit to pointi
|
||||
|
||||
const labelList& pEdges = mesh().pointEdges()[pointI];
|
||||
const labelList& pEdges = mesh().pointEdges()[pointi];
|
||||
|
||||
forAll(pEdges, pEdgeI)
|
||||
{
|
||||
@ -1154,7 +1154,7 @@ void Foam::cellCuts::walkEdges
|
||||
{
|
||||
// First visit to edgeI so recurse.
|
||||
|
||||
label v2 = mesh().edges()[edgeI].otherVertex(pointI);
|
||||
label v2 = mesh().edges()[edgeI].otherVertex(pointi);
|
||||
|
||||
walkEdges(celli, v2, status, edgeStatus, pointStatus);
|
||||
}
|
||||
@ -1175,15 +1175,15 @@ Foam::labelList Foam::cellCuts::nonAnchorPoints
|
||||
|
||||
forAll(cellPoints, i)
|
||||
{
|
||||
label pointI = cellPoints[i];
|
||||
label pointi = cellPoints[i];
|
||||
|
||||
if
|
||||
(
|
||||
findIndex(anchorPoints, pointI) == -1
|
||||
&& findIndex(loop, vertToEVert(pointI)) == -1
|
||||
findIndex(anchorPoints, pointi) == -1
|
||||
&& findIndex(loop, vertToEVert(pointi)) == -1
|
||||
)
|
||||
{
|
||||
newElems[newElemI++] = pointI;
|
||||
newElems[newElemI++] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1358,9 +1358,9 @@ bool Foam::cellCuts::calcAnchors
|
||||
|
||||
forAllConstIter(Map<label>, pointStatus, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
const labelList& pFaces = mesh().pointFaces()[pointI];
|
||||
const labelList& pFaces = mesh().pointFaces()[pointi];
|
||||
|
||||
if (iter() == 1)
|
||||
{
|
||||
|
||||
@ -322,7 +322,7 @@ class cellCuts
|
||||
void walkEdges
|
||||
(
|
||||
const label celli,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label status,
|
||||
|
||||
Map<label>& edgeStatus,
|
||||
|
||||
@ -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
|
||||
@ -155,7 +155,7 @@ public:
|
||||
return getVertex(mesh_, eVert);
|
||||
}
|
||||
|
||||
//- Convert pointI to eVert
|
||||
//- Convert pointi to eVert
|
||||
static label vertToEVert(const primitiveMesh& mesh, const label vertI)
|
||||
{
|
||||
if ((vertI < 0) || (vertI >= mesh.nPoints()))
|
||||
|
||||
@ -338,16 +338,16 @@ bool Foam::boundaryCutter::splitFace
|
||||
|
||||
forAll(extendedFace, i)
|
||||
{
|
||||
label pointI = extendedFace[fp];
|
||||
label pointi = extendedFace[fp];
|
||||
|
||||
newFace.append(pointI);
|
||||
newFace.append(pointi);
|
||||
|
||||
if
|
||||
(
|
||||
newFace.size() > 2
|
||||
&& (
|
||||
pointI >= mesh_.nPoints()
|
||||
|| pointToPos.found(pointI)
|
||||
pointi >= mesh_.nPoints()
|
||||
|| pointToPos.found(pointi)
|
||||
)
|
||||
)
|
||||
{
|
||||
@ -460,7 +460,7 @@ void Foam::boundaryCutter::setRefinement
|
||||
// point on feature to move to
|
||||
const point& featurePoint = cuts[cutI];
|
||||
|
||||
label addedPointI =
|
||||
label addedPointi =
|
||||
meshMod.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
@ -480,16 +480,16 @@ void Foam::boundaryCutter::setRefinement
|
||||
|
||||
label sz = addedPoints.size();
|
||||
addedPoints.setSize(sz+1);
|
||||
addedPoints[sz] = addedPointI;
|
||||
addedPoints[sz] = addedPointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
edgeToAddedPoints.insert(edgeI, labelList(1, addedPointI));
|
||||
edgeToAddedPoints.insert(edgeI, labelList(1, addedPointi));
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Added point " << addedPointI << " for edge " << edgeI
|
||||
Pout<< "Added point " << addedPointi << " for edge " << edgeI
|
||||
<< " with cuts:" << edgeToAddedPoints[edgeI] << endl;
|
||||
}
|
||||
}
|
||||
@ -523,7 +523,7 @@ void Foam::boundaryCutter::setRefinement
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
label addedPointI =
|
||||
label addedPointi =
|
||||
meshMod.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
@ -534,11 +534,11 @@ void Foam::boundaryCutter::setRefinement
|
||||
true // supports a cell
|
||||
)
|
||||
);
|
||||
faceAddedPoint_.insert(facei, addedPointI);
|
||||
faceAddedPoint_.insert(facei, addedPointi);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Added point " << addedPointI << " for feature point "
|
||||
Pout<< "Added point " << addedPointi << " for feature point "
|
||||
<< iter() << " on face " << facei << " with centre "
|
||||
<< mesh_.faceCentres()[facei] << endl;
|
||||
}
|
||||
@ -563,7 +563,7 @@ void Foam::boundaryCutter::setRefinement
|
||||
// Get face with new points on cut edges.
|
||||
face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
|
||||
|
||||
label addedPointI = iter();
|
||||
label addedPointi = iter();
|
||||
|
||||
// Information about old face
|
||||
label patchID, zoneID, zoneFlip;
|
||||
@ -581,7 +581,7 @@ void Foam::boundaryCutter::setRefinement
|
||||
|
||||
tri[0] = newFace[fp];
|
||||
tri[1] = nextV;
|
||||
tri[2] = addedPointI;
|
||||
tri[2] = addedPointi;
|
||||
|
||||
if (fp == 0)
|
||||
{
|
||||
@ -847,13 +847,13 @@ void Foam::boundaryCutter::updateMesh(const mapPolyMesh& morphMap)
|
||||
|
||||
label newFacei = morphMap.reverseFaceMap()[oldFacei];
|
||||
|
||||
label oldPointI = iter();
|
||||
label oldPointi = iter();
|
||||
|
||||
label newPointI = morphMap.reversePointMap()[oldPointI];
|
||||
label newPointi = morphMap.reversePointMap()[oldPointi];
|
||||
|
||||
if (newFacei >= 0 && newPointI >= 0)
|
||||
if (newFacei >= 0 && newPointi >= 0)
|
||||
{
|
||||
newAddedPoints.insert(newFacei, newPointI);
|
||||
newAddedPoints.insert(newFacei, newPointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -895,12 +895,12 @@ void Foam::boundaryCutter::updateMesh(const mapPolyMesh& morphMap)
|
||||
|
||||
forAll(addedPoints, i)
|
||||
{
|
||||
label newAddedPointI =
|
||||
label newAddedPointi =
|
||||
morphMap.reversePointMap()[addedPoints[i]];
|
||||
|
||||
if (newAddedPointI >= 0)
|
||||
if (newAddedPointi >= 0)
|
||||
{
|
||||
newAddedPoints[newI++] = newAddedPointI;
|
||||
newAddedPoints[newI++] = newAddedPointi;
|
||||
}
|
||||
}
|
||||
if (newI > 0)
|
||||
|
||||
@ -115,9 +115,9 @@ Foam::label Foam::meshCutAndRemove::findInternalFacePoint
|
||||
{
|
||||
forAll(pointLabels, labelI)
|
||||
{
|
||||
label pointI = pointLabels[labelI];
|
||||
label pointi = pointLabels[labelI];
|
||||
|
||||
const labelList& pFaces = mesh().pointFaces()[pointI];
|
||||
const labelList& pFaces = mesh().pointFaces()[pointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
@ -125,7 +125,7 @@ Foam::label Foam::meshCutAndRemove::findInternalFacePoint
|
||||
|
||||
if (mesh().isInternalFace(facei))
|
||||
{
|
||||
return pointI;
|
||||
return pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -151,17 +151,17 @@ Foam::label Foam::meshCutAndRemove::findPatchFacePoint
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (pointI < mesh().nPoints())
|
||||
if (pointi < mesh().nPoints())
|
||||
{
|
||||
const labelList& pFaces = pointFaces[pointI];
|
||||
const labelList& pFaces = pointFaces[pointi];
|
||||
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
if (patches.whichPatch(pFaces[i]) == exposedPatchi)
|
||||
{
|
||||
return pointI;
|
||||
return pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -239,7 +239,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
(
|
||||
polyTopoChange& meshMod,
|
||||
const label facei,
|
||||
const label masterPointI,
|
||||
const label masterPointi,
|
||||
const face& newFace,
|
||||
const label own,
|
||||
const label nei,
|
||||
@ -260,7 +260,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
<< " with new owner:" << own
|
||||
<< " with new neighbour:" << nei
|
||||
<< " patchID:" << patchID
|
||||
<< " anchor:" << masterPointI
|
||||
<< " anchor:" << masterPointi
|
||||
<< " zoneID:" << zoneID
|
||||
<< " zoneFlip:" << zoneFlip
|
||||
<< endl;
|
||||
@ -273,7 +273,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
newFace, // face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
masterPointI, // master point
|
||||
masterPointi, // master point
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
@ -292,7 +292,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
<< " with new owner:" << nei
|
||||
<< " with new neighbour:" << own
|
||||
<< " patchID:" << patchID
|
||||
<< " anchor:" << masterPointI
|
||||
<< " anchor:" << masterPointi
|
||||
<< " zoneID:" << zoneID
|
||||
<< " zoneFlip:" << zoneFlip
|
||||
<< endl;
|
||||
@ -305,7 +305,7 @@ void Foam::meshCutAndRemove::addFace
|
||||
newFace.reverseFace(), // face
|
||||
nei, // owner
|
||||
own, // neighbour
|
||||
masterPointI, // master point
|
||||
masterPointi, // master point
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
@ -623,7 +623,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
}
|
||||
|
||||
// One of the edge end points should be master point of nbCelli.
|
||||
label masterPointI = e.start();
|
||||
label masterPointi = e.start();
|
||||
|
||||
const point& v0 = mesh().points()[e.start()];
|
||||
const point& v1 = mesh().points()[e.end()];
|
||||
@ -632,26 +632,26 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
|
||||
point newPt = weight*v1 + (1.0-weight)*v0;
|
||||
|
||||
label addedPointI =
|
||||
label addedPointi =
|
||||
meshMod.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
(
|
||||
newPt, // point
|
||||
masterPointI, // master point
|
||||
masterPointi, // master point
|
||||
-1, // zone for point
|
||||
true // supports a cell
|
||||
)
|
||||
);
|
||||
|
||||
// Store on (hash of) edge.
|
||||
addedPoints_.insert(e, addedPointI);
|
||||
addedPoints_.insert(e, addedPointi);
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< "Added point " << addedPointI
|
||||
Pout<< "Added point " << addedPointi
|
||||
<< " to vertex "
|
||||
<< masterPointI << " of edge " << edgeI
|
||||
<< masterPointi << " of edge " << edgeI
|
||||
<< " vertices " << e << endl;
|
||||
}
|
||||
}
|
||||
@ -714,33 +714,33 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
|
||||
if (!isEdge(cut))
|
||||
{
|
||||
label pointI = getVertex(cut);
|
||||
label pointi = getVertex(cut);
|
||||
|
||||
if (!usedPoint[pointI])
|
||||
if (!usedPoint[pointi])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem: faceSplitCut not used by any loop"
|
||||
<< " or cell anchor point"
|
||||
<< "face:" << iter.key() << " point:" << pointI
|
||||
<< " coord:" << mesh().points()[pointI]
|
||||
<< "face:" << iter.key() << " point:" << pointi
|
||||
<< " coord:" << mesh().points()[pointi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
forAll(cuts.pointIsCut(), pointI)
|
||||
forAll(cuts.pointIsCut(), pointi)
|
||||
{
|
||||
if (cuts.pointIsCut()[pointI])
|
||||
if (cuts.pointIsCut()[pointi])
|
||||
{
|
||||
if (!usedPoint[pointI])
|
||||
if (!usedPoint[pointi])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem: point is marked as cut but"
|
||||
<< " not used by any loop"
|
||||
<< " or cell anchor point"
|
||||
<< "point:" << pointI
|
||||
<< " coord:" << mesh().points()[pointI]
|
||||
<< "point:" << pointi
|
||||
<< " coord:" << mesh().points()[pointi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -748,15 +748,15 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
|
||||
|
||||
// Remove unused points.
|
||||
forAll(usedPoint, pointI)
|
||||
forAll(usedPoint, pointi)
|
||||
{
|
||||
if (!usedPoint[pointI])
|
||||
if (!usedPoint[pointi])
|
||||
{
|
||||
meshMod.setAction(polyRemovePoint(pointI));
|
||||
meshMod.setAction(polyRemovePoint(pointi));
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< "Removing unused point " << pointI << endl;
|
||||
Pout<< "Removing unused point " << pointi << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -790,7 +790,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
reverse(newFace);
|
||||
|
||||
// Pick any anchor point on cell
|
||||
label masterPointI = findPatchFacePoint(newFace, exposedPatchi);
|
||||
label masterPointi = findPatchFacePoint(newFace, exposedPatchi);
|
||||
|
||||
label addedFacei =
|
||||
meshMod.setAction
|
||||
@ -800,7 +800,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
newFace, // face
|
||||
celli, // owner
|
||||
-1, // neighbour
|
||||
masterPointI, // master point
|
||||
masterPointi, // master point
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
@ -815,7 +815,7 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< "Added splitting face " << newFace << " index:"
|
||||
<< addedFacei << " from masterPoint:" << masterPointI
|
||||
<< addedFacei << " from masterPoint:" << masterPointi
|
||||
<< " to owner " << celli << " with anchors:"
|
||||
<< anchorPts[celli]
|
||||
<< " from Loop:";
|
||||
@ -1080,13 +1080,13 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
label masterPointI = findPatchFacePoint(f1, patchID);
|
||||
label masterPointi = findPatchFacePoint(f1, patchID);
|
||||
|
||||
addFace
|
||||
(
|
||||
meshMod,
|
||||
facei, // face for zone info
|
||||
masterPointI, // inflation point
|
||||
masterPointi, // inflation point
|
||||
f1, // vertices of face
|
||||
f1Own,
|
||||
f1Nei,
|
||||
@ -1107,13 +1107,13 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
label masterPointI = findPatchFacePoint(f1, patchID);
|
||||
label masterPointi = findPatchFacePoint(f1, patchID);
|
||||
|
||||
addFace
|
||||
(
|
||||
meshMod,
|
||||
facei,
|
||||
masterPointI,
|
||||
masterPointi,
|
||||
f1,
|
||||
f1Own,
|
||||
f1Nei,
|
||||
@ -1131,9 +1131,9 @@ void Foam::meshCutAndRemove::setRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
label masterPointI = findPatchFacePoint(f1, -1);
|
||||
label masterPointi = findPatchFacePoint(f1, -1);
|
||||
|
||||
addFace(meshMod, facei, masterPointI, f1, f1Own, f1Nei, -1);
|
||||
addFace(meshMod, facei, masterPointi, f1, f1Own, f1Nei, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1318,28 +1318,28 @@ void Foam::meshCutAndRemove::updateMesh(const mapPolyMesh& map)
|
||||
|
||||
label newEnd = map.reversePointMap()[e.end()];
|
||||
|
||||
label addedPointI = iter();
|
||||
label addedPointi = iter();
|
||||
|
||||
label newAddedPointI = map.reversePointMap()[addedPointI];
|
||||
label newAddedPointi = map.reversePointMap()[addedPointi];
|
||||
|
||||
if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointI >= 0))
|
||||
if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointi >= 0))
|
||||
{
|
||||
edge newE = edge(newStart, newEnd);
|
||||
|
||||
if
|
||||
(
|
||||
(debug & 2)
|
||||
&& (e != newE || newAddedPointI != addedPointI)
|
||||
&& (e != newE || newAddedPointi != addedPointi)
|
||||
)
|
||||
{
|
||||
Pout<< "meshCutAndRemove::updateMesh :"
|
||||
<< " updating addedPoints for edge " << e
|
||||
<< " from " << addedPointI
|
||||
<< " to " << newAddedPointI
|
||||
<< " from " << addedPointi
|
||||
<< " to " << newAddedPointi
|
||||
<< endl;
|
||||
}
|
||||
|
||||
newAddedPoints.insert(newE, newAddedPointI);
|
||||
newAddedPoints.insert(newE, newAddedPointi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,14 +87,14 @@ class meshCutAndRemove
|
||||
//- Returns -1 or the cell in cellLabels that is cut.
|
||||
label findCutCell(const cellCuts&, const labelList&) const;
|
||||
|
||||
//- Returns first pointI in pointLabels that uses an internal
|
||||
//- Returns first pointi in pointLabels that uses an internal
|
||||
// face. Used to find point to inflate cell/face from (has to be
|
||||
// connected to internal face)
|
||||
label findInternalFacePoint(const labelList& pointLabels) const;
|
||||
|
||||
//- Find point on face that is part of original mesh and that is
|
||||
// point connected to the patch
|
||||
label findPatchFacePoint(const face& f, const label patchI) const;
|
||||
label findPatchFacePoint(const face& f, const label patchi) const;
|
||||
|
||||
//- Get new owner and neighbour of face. Checks anchor points to see if
|
||||
// need to get original or added cell.
|
||||
@ -121,7 +121,7 @@ class meshCutAndRemove
|
||||
(
|
||||
polyTopoChange& meshMod,
|
||||
const label facei,
|
||||
const label masterPointI,
|
||||
const label masterPointi,
|
||||
const face& newFace,
|
||||
const label owner,
|
||||
const label neighbour,
|
||||
|
||||
@ -106,9 +106,9 @@ Foam::label Foam::meshCutter::findInternalFacePoint
|
||||
{
|
||||
forAll(pointLabels, labelI)
|
||||
{
|
||||
label pointI = pointLabels[labelI];
|
||||
label pointi = pointLabels[labelI];
|
||||
|
||||
const labelList& pFaces = mesh().pointFaces()[pointI];
|
||||
const labelList& pFaces = mesh().pointFaces()[pointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
@ -116,7 +116,7 @@ Foam::label Foam::meshCutter::findInternalFacePoint
|
||||
|
||||
if (mesh().isInternalFace(facei))
|
||||
{
|
||||
return pointI;
|
||||
return pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -564,7 +564,7 @@ void Foam::meshCutter::setRefinement
|
||||
}
|
||||
|
||||
// One of the edge end points should be master point of nbCelli.
|
||||
label masterPointI = e.start();
|
||||
label masterPointi = e.start();
|
||||
|
||||
const point& v0 = mesh().points()[e.start()];
|
||||
const point& v1 = mesh().points()[e.end()];
|
||||
@ -573,26 +573,26 @@ void Foam::meshCutter::setRefinement
|
||||
|
||||
point newPt = weight*v1 + (1.0-weight)*v0;
|
||||
|
||||
label addedPointI =
|
||||
label addedPointi =
|
||||
meshMod.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
(
|
||||
newPt, // point
|
||||
masterPointI, // master point
|
||||
masterPointi, // master point
|
||||
-1, // zone for point
|
||||
true // supports a cell
|
||||
)
|
||||
);
|
||||
|
||||
// Store on (hash of) edge.
|
||||
addedPoints_.insert(e, addedPointI);
|
||||
addedPoints_.insert(e, addedPointi);
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< "Added point " << addedPointI
|
||||
Pout<< "Added point " << addedPointi
|
||||
<< " to vertex "
|
||||
<< masterPointI << " of edge " << edgeI
|
||||
<< masterPointi << " of edge " << edgeI
|
||||
<< " vertices " << e << endl;
|
||||
}
|
||||
}
|
||||
@ -647,7 +647,7 @@ void Foam::meshCutter::setRefinement
|
||||
face newFace(loopToFace(celli, loop));
|
||||
|
||||
// Pick any anchor point on cell
|
||||
label masterPointI = findInternalFacePoint(anchorPts[celli]);
|
||||
label masterPointi = findInternalFacePoint(anchorPts[celli]);
|
||||
|
||||
label addedFacei =
|
||||
meshMod.setAction
|
||||
@ -657,7 +657,7 @@ void Foam::meshCutter::setRefinement
|
||||
newFace, // face
|
||||
celli, // owner
|
||||
addedCells_[celli], // neighbour
|
||||
masterPointI, // master point
|
||||
masterPointi, // master point
|
||||
-1, // master edge
|
||||
-1, // master face for addition
|
||||
false, // flux flip
|
||||
@ -1059,28 +1059,28 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
|
||||
|
||||
label newEnd = morphMap.reversePointMap()[e.end()];
|
||||
|
||||
label addedPointI = iter();
|
||||
label addedPointi = iter();
|
||||
|
||||
label newAddedPointI = morphMap.reversePointMap()[addedPointI];
|
||||
label newAddedPointi = morphMap.reversePointMap()[addedPointi];
|
||||
|
||||
if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointI >= 0))
|
||||
if ((newStart >= 0) && (newEnd >= 0) && (newAddedPointi >= 0))
|
||||
{
|
||||
edge newE = edge(newStart, newEnd);
|
||||
|
||||
if
|
||||
(
|
||||
(debug & 2)
|
||||
&& (e != newE || newAddedPointI != addedPointI)
|
||||
&& (e != newE || newAddedPointi != addedPointi)
|
||||
)
|
||||
{
|
||||
Pout<< "meshCutter::updateMesh :"
|
||||
<< " updating addedPoints for edge " << e
|
||||
<< " from " << addedPointI
|
||||
<< " to " << newAddedPointI
|
||||
<< " from " << addedPointi
|
||||
<< " to " << newAddedPointi
|
||||
<< endl;
|
||||
}
|
||||
|
||||
newAddedPoints.insert(newE, newAddedPointI);
|
||||
newAddedPoints.insert(newE, newAddedPointi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ class meshCutter
|
||||
//- Returns -1 or the cell in cellLabels that is cut.
|
||||
label findCutCell(const cellCuts&, const labelList&) const;
|
||||
|
||||
//- Returns first pointI in pointLabels that uses an internal
|
||||
//- Returns first pointi in pointLabels that uses an internal
|
||||
// face. Used to find point to inflate cell/face from (has to be
|
||||
// connected to internal face)
|
||||
label findInternalFacePoint(const labelList& pointLabels) const;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ Description
|
||||
E.g.
|
||||
\verbatim
|
||||
// Construct iterative mesh mover.
|
||||
motionSmoother meshMover(mesh, labelList(1, patchI));
|
||||
motionSmoother meshMover(mesh, labelList(1, patchi));
|
||||
|
||||
// Set desired displacement:
|
||||
meshMover.displacement() = ..
|
||||
|
||||
@ -74,16 +74,16 @@ void Foam::motionSmootherAlgo::testSyncPositions
|
||||
|
||||
void Foam::motionSmootherAlgo::checkFld(const pointScalarField& fld)
|
||||
{
|
||||
forAll(fld, pointI)
|
||||
forAll(fld, pointi)
|
||||
{
|
||||
const scalar val = fld[pointI];
|
||||
const scalar val = fld[pointi];
|
||||
|
||||
if ((val > -GREAT) && (val < GREAT))
|
||||
{}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem : point:" << pointI << " value:" << val
|
||||
<< "Problem : point:" << pointi << " value:" << val
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -148,13 +148,13 @@ void Foam::motionSmootherAlgo::minSmooth
|
||||
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label pointI = meshPoints[i];
|
||||
if (isAffectedPoint.get(pointI) == 1)
|
||||
label pointi = meshPoints[i];
|
||||
if (isAffectedPoint.get(pointi) == 1)
|
||||
{
|
||||
newFld[pointI] = min
|
||||
newFld[pointi] = min
|
||||
(
|
||||
fld[pointI],
|
||||
0.5*fld[pointI] + 0.5*avgFld[pointI]
|
||||
fld[pointi],
|
||||
0.5*fld[pointi] + 0.5*avgFld[pointi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -180,14 +180,14 @@ void Foam::motionSmootherAlgo::minSmooth
|
||||
);
|
||||
const pointScalarField& avgFld = tavgFld();
|
||||
|
||||
forAll(fld, pointI)
|
||||
forAll(fld, pointi)
|
||||
{
|
||||
if (isAffectedPoint.get(pointI) == 1 && isInternalPoint(pointI))
|
||||
if (isAffectedPoint.get(pointi) == 1 && isInternalPoint(pointi))
|
||||
{
|
||||
newFld[pointI] = min
|
||||
newFld[pointi] = min
|
||||
(
|
||||
fld[pointI],
|
||||
0.5*fld[pointI] + 0.5*avgFld[pointI]
|
||||
fld[pointi],
|
||||
0.5*fld[pointi] + 0.5*avgFld[pointi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -230,11 +230,11 @@ void Foam::motionSmootherAlgo::scaleField
|
||||
{
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label pointI = meshPoints[i];
|
||||
label pointi = meshPoints[i];
|
||||
|
||||
if (pointLabels.found(pointI))
|
||||
if (pointLabels.found(pointi))
|
||||
{
|
||||
fld[pointI] *= scale;
|
||||
fld[pointi] *= scale;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -272,19 +272,19 @@ void Foam::motionSmootherAlgo::subtractField
|
||||
{
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label pointI = meshPoints[i];
|
||||
label pointi = meshPoints[i];
|
||||
|
||||
if (pointLabels.found(pointI))
|
||||
if (pointLabels.found(pointi))
|
||||
{
|
||||
fld[pointI] = max(0.0, fld[pointI]-f);
|
||||
fld[pointi] = max(0.0, fld[pointi]-f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Foam::motionSmootherAlgo::isInternalPoint(const label pointI) const
|
||||
bool Foam::motionSmootherAlgo::isInternalPoint(const label pointi) const
|
||||
{
|
||||
return isInternalPoint_.get(pointI) == 1;
|
||||
return isInternalPoint_.get(pointi) == 1;
|
||||
}
|
||||
|
||||
|
||||
@ -516,9 +516,9 @@ void Foam::motionSmootherAlgo::setDisplacement
|
||||
const labelList& ppMeshPoints = pp.meshPoints();
|
||||
|
||||
// Set internal point data from displacement on combined patch points.
|
||||
forAll(ppMeshPoints, patchPointI)
|
||||
forAll(ppMeshPoints, patchPointi)
|
||||
{
|
||||
displacement[ppMeshPoints[patchPointI]] = patchDisp[patchPointI];
|
||||
displacement[ppMeshPoints[patchPointi]] = patchDisp[patchPointi];
|
||||
}
|
||||
|
||||
|
||||
@ -541,18 +541,18 @@ void Foam::motionSmootherAlgo::setDisplacement
|
||||
{
|
||||
OFstream str(mesh.db().path()/"changedPoints.obj");
|
||||
label nVerts = 0;
|
||||
forAll(ppMeshPoints, patchPointI)
|
||||
forAll(ppMeshPoints, patchPointi)
|
||||
{
|
||||
const vector& newDisp = displacement[ppMeshPoints[patchPointI]];
|
||||
const vector& newDisp = displacement[ppMeshPoints[patchPointi]];
|
||||
|
||||
if (mag(newDisp-patchDisp[patchPointI]) > SMALL)
|
||||
if (mag(newDisp-patchDisp[patchPointi]) > SMALL)
|
||||
{
|
||||
const point& pt = mesh.points()[ppMeshPoints[patchPointI]];
|
||||
const point& pt = mesh.points()[ppMeshPoints[patchPointi]];
|
||||
|
||||
meshTools::writeOBJ(str, pt);
|
||||
nVerts++;
|
||||
//Pout<< "Point:" << pt
|
||||
// << " oldDisp:" << patchDisp[patchPointI]
|
||||
// << " oldDisp:" << patchDisp[patchPointi]
|
||||
// << " newDisp:" << newDisp << endl;
|
||||
}
|
||||
}
|
||||
@ -561,9 +561,9 @@ void Foam::motionSmootherAlgo::setDisplacement
|
||||
}
|
||||
|
||||
// Now reset input displacement
|
||||
forAll(ppMeshPoints, patchPointI)
|
||||
forAll(ppMeshPoints, patchPointi)
|
||||
{
|
||||
patchDisp[patchPointI] = displacement[ppMeshPoints[patchPointI]];
|
||||
patchDisp[patchPointi] = displacement[ppMeshPoints[patchPointi]];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -35,7 +35,7 @@ Description
|
||||
E.g.
|
||||
\verbatim
|
||||
// Construct iterative mesh mover.
|
||||
motionSmoother meshMover(mesh, labelList(1, patchI));
|
||||
motionSmoother meshMover(mesh, labelList(1, patchi));
|
||||
|
||||
// Set desired displacement:
|
||||
meshMover.displacement() = ..
|
||||
@ -269,7 +269,7 @@ class motionSmootherAlgo
|
||||
) const;
|
||||
|
||||
//- Helper function. Is point internal?
|
||||
bool isInternalPoint(const label pointI) const;
|
||||
bool isInternalPoint(const label pointi) const;
|
||||
|
||||
//- Given a set of faces that cause smoothing and a number of
|
||||
// iterations determine the maximum set of points who are affected
|
||||
|
||||
@ -211,16 +211,16 @@ Foam::motionSmootherAlgo::avg
|
||||
// Average
|
||||
// ~~~~~~~
|
||||
|
||||
forAll(res, pointI)
|
||||
forAll(res, pointi)
|
||||
{
|
||||
if (mag(sumWeight[pointI]) < VSMALL)
|
||||
if (mag(sumWeight[pointi]) < VSMALL)
|
||||
{
|
||||
// Unconnected point. Take over original value
|
||||
res[pointI] = fld[pointI];
|
||||
res[pointi] = fld[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
res[pointI] /= sumWeight[pointI];
|
||||
res[pointi] /= sumWeight[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,11 +242,11 @@ void Foam::motionSmootherAlgo::smooth
|
||||
tmp<pointVectorField> tavgFld = avg(fld, edgeWeight);
|
||||
const pointVectorField& avgFld = tavgFld();
|
||||
|
||||
forAll(fld, pointI)
|
||||
forAll(fld, pointi)
|
||||
{
|
||||
if (isInternalPoint(pointI))
|
||||
if (isInternalPoint(pointi))
|
||||
{
|
||||
newFld[pointI] = 0.5*fld[pointI] + 0.5*avgFld[pointI];
|
||||
newFld[pointi] = 0.5*fld[pointi] + 0.5*avgFld[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -166,32 +166,32 @@ void Foam::componentDisplacementMotionSolver::updateMesh(const mapPolyMesh& mpm)
|
||||
|
||||
scalarField newPoints0(mpm.pointMap().size());
|
||||
|
||||
forAll(newPoints0, pointI)
|
||||
forAll(newPoints0, pointi)
|
||||
{
|
||||
label oldPointI = mpm.pointMap()[pointI];
|
||||
label oldPointi = mpm.pointMap()[pointi];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
if (oldPointi >= 0)
|
||||
{
|
||||
label masterPointI = mpm.reversePointMap()[oldPointI];
|
||||
label masterPointi = mpm.reversePointMap()[oldPointi];
|
||||
|
||||
if (masterPointI == pointI)
|
||||
if (masterPointi == pointi)
|
||||
{
|
||||
newPoints0[pointI] = points0_[oldPointI];
|
||||
newPoints0[pointi] = points0_[oldPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
// New point. Assume motion is scaling.
|
||||
newPoints0[pointI] =
|
||||
points0_[oldPointI]
|
||||
+ scale*(points[pointI]-points[masterPointI]);
|
||||
newPoints0[pointi] =
|
||||
points0_[oldPointi]
|
||||
+ scale*(points[pointi]-points[masterPointi]);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot work out coordinates of introduced vertices."
|
||||
<< " New vertex " << pointI << " at coordinate "
|
||||
<< points[pointI] << exit(FatalError);
|
||||
<< " New vertex " << pointi << " at coordinate "
|
||||
<< points[pointi] << exit(FatalError);
|
||||
}
|
||||
}
|
||||
points0_.transfer(newPoints0);
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -190,25 +190,25 @@ void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm)
|
||||
|
||||
pointField newPoints0(mpm.pointMap().size());
|
||||
|
||||
forAll(newPoints0, pointI)
|
||||
forAll(newPoints0, pointi)
|
||||
{
|
||||
label oldPointI = mpm.pointMap()[pointI];
|
||||
label oldPointi = mpm.pointMap()[pointi];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
if (oldPointi >= 0)
|
||||
{
|
||||
label masterPointI = mpm.reversePointMap()[oldPointI];
|
||||
label masterPointi = mpm.reversePointMap()[oldPointi];
|
||||
|
||||
if (masterPointI == pointI)
|
||||
if (masterPointi == pointi)
|
||||
{
|
||||
newPoints0[pointI] = points0_[oldPointI];
|
||||
newPoints0[pointi] = points0_[oldPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
// New point - assume motion is scaling
|
||||
newPoints0[pointI] = points0_[oldPointI] + cmptMultiply
|
||||
newPoints0[pointi] = points0_[oldPointi] + cmptMultiply
|
||||
(
|
||||
scaleFactors,
|
||||
points[pointI] - points[masterPointI]
|
||||
points[pointi] - points[masterPointi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -216,8 +216,8 @@ void Foam::displacementMotionSolver::updateMesh(const mapPolyMesh& mpm)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot determine co-ordinates of introduced vertices."
|
||||
<< " New vertex " << pointI << " at co-ordinate "
|
||||
<< points[pointI] << exit(FatalError);
|
||||
<< " New vertex " << pointi << " at co-ordinate "
|
||||
<< points[pointi] << exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -258,11 +258,11 @@ void Foam::perfectInterface::setRefinement
|
||||
labelHashSet affectedFaces(2*pp1.size());
|
||||
forAll(meshPts1, i)
|
||||
{
|
||||
label meshPointI = meshPts1[i];
|
||||
label meshPointi = meshPts1[i];
|
||||
|
||||
if (meshPointI != renumberPoints[meshPointI])
|
||||
if (meshPointi != renumberPoints[meshPointi])
|
||||
{
|
||||
const labelList& pFaces = mesh.pointFaces()[meshPointI];
|
||||
const labelList& pFaces = mesh.pointFaces()[meshPointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
@ -307,7 +307,7 @@ void Foam::perfectInterface::setRefinement
|
||||
|
||||
label nbr = -1;
|
||||
|
||||
label patchI = -1;
|
||||
label patchi = -1;
|
||||
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
@ -315,7 +315,7 @@ void Foam::perfectInterface::setRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
patchI = patches.whichPatch(facei);
|
||||
patchi = patches.whichPatch(facei);
|
||||
}
|
||||
|
||||
label zoneID = mesh.faceZones().whichZone(facei);
|
||||
@ -338,7 +338,7 @@ void Foam::perfectInterface::setRefinement
|
||||
mesh.faceOwner()[facei], // owner
|
||||
nbr, // neighbour
|
||||
false, // face flip
|
||||
patchI, // patch for face
|
||||
patchi, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
@ -350,11 +350,11 @@ void Foam::perfectInterface::setRefinement
|
||||
// 3. Remove patch1 points
|
||||
forAll(meshPts1, i)
|
||||
{
|
||||
label meshPointI = meshPts1[i];
|
||||
label meshPointi = meshPts1[i];
|
||||
|
||||
if (meshPointI != renumberPoints[meshPointI])
|
||||
if (meshPointi != renumberPoints[meshPointi])
|
||||
{
|
||||
ref.setAction(polyRemovePoint(meshPointI));
|
||||
ref.setAction(polyRemovePoint(meshPointi));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -148,7 +148,7 @@ public:
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -158,7 +158,7 @@ public:
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -176,7 +176,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const externalPointEdgePoint& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -189,7 +189,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const externalPointEdgePoint& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -211,7 +211,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const externalPointEdgePoint& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -197,7 +197,7 @@ template<class TrackingData>
|
||||
inline void Foam::externalPointEdgePoint::leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -221,7 +221,7 @@ template<class TrackingData>
|
||||
inline void Foam::externalPointEdgePoint::enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -235,14 +235,14 @@ template<class TrackingData>
|
||||
inline bool Foam::externalPointEdgePoint::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const externalPointEdgePoint& edgeInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
)
|
||||
{
|
||||
return update(td.points_[pointI], edgeInfo, tol, td);
|
||||
return update(td.points_[pointi], edgeInfo, tol, td);
|
||||
}
|
||||
|
||||
|
||||
@ -250,13 +250,13 @@ template<class TrackingData>
|
||||
inline bool Foam::externalPointEdgePoint::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const externalPointEdgePoint& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
)
|
||||
{
|
||||
return update(td.points_[pointI], newPointInfo, tol, td);
|
||||
return update(td.points_[pointi], newPointInfo, tol, td);
|
||||
}
|
||||
|
||||
|
||||
@ -277,7 +277,7 @@ inline bool Foam::externalPointEdgePoint::updateEdge
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const externalPointEdgePoint& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -92,11 +92,11 @@ void Foam::pointPatchDist::correct()
|
||||
|
||||
forAll(mp, ppI)
|
||||
{
|
||||
label meshPointI = mp[ppI];
|
||||
wallPoints[nPoints] = meshPointI;
|
||||
label meshPointi = mp[ppI];
|
||||
wallPoints[nPoints] = meshPointi;
|
||||
wallInfo[nPoints] = externalPointEdgePoint
|
||||
(
|
||||
td.points_[meshPointI],
|
||||
td.points_[meshPointi],
|
||||
0.0
|
||||
);
|
||||
nPoints++;
|
||||
@ -128,11 +128,11 @@ void Foam::pointPatchDist::correct()
|
||||
pointScalarField& psf = *this;
|
||||
|
||||
|
||||
forAll(allPointInfo, pointI)
|
||||
forAll(allPointInfo, pointi)
|
||||
{
|
||||
if (allPointInfo[pointI].valid(td))
|
||||
if (allPointInfo[pointi].valid(td))
|
||||
{
|
||||
psf[pointI] = Foam::sqrt(allPointInfo[pointI].distSqr());
|
||||
psf[pointi] = Foam::sqrt(allPointInfo[pointi].distSqr());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -57,7 +57,7 @@ void Foam::faceCoupleInfo::writeOBJ
|
||||
|
||||
if (compact)
|
||||
{
|
||||
label newPointI = 0;
|
||||
label newPointi = 0;
|
||||
|
||||
forAll(edges, edgeI)
|
||||
{
|
||||
@ -65,22 +65,22 @@ void Foam::faceCoupleInfo::writeOBJ
|
||||
|
||||
forAll(e, eI)
|
||||
{
|
||||
label pointI = e[eI];
|
||||
label pointi = e[eI];
|
||||
|
||||
if (pointMap[pointI] == -1)
|
||||
if (pointMap[pointi] == -1)
|
||||
{
|
||||
pointMap[pointI] = newPointI++;
|
||||
pointMap[pointi] = newPointi++;
|
||||
|
||||
meshTools::writeOBJ(str, points[pointI]);
|
||||
meshTools::writeOBJ(str, points[pointi]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
meshTools::writeOBJ(str, points[pointI]);
|
||||
meshTools::writeOBJ(str, points[pointi]);
|
||||
}
|
||||
|
||||
pointMap = identity(points.size());
|
||||
@ -352,13 +352,13 @@ bool Foam::faceCoupleInfo::regionEdge
|
||||
|
||||
label meshFacei = slavePatch().addressing()[facei];
|
||||
|
||||
label patchI = slaveMesh.boundaryMesh().whichPatch(meshFacei);
|
||||
label patchi = slaveMesh.boundaryMesh().whichPatch(meshFacei);
|
||||
|
||||
if (patch0 == -1)
|
||||
{
|
||||
patch0 = patchI;
|
||||
patch0 = patchi;
|
||||
}
|
||||
else if (patchI != patch0)
|
||||
else if (patchi != patch0)
|
||||
{
|
||||
// Found two different patches connected to this edge.
|
||||
return true;
|
||||
@ -376,25 +376,25 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
|
||||
const bool patchDivision,
|
||||
const labelList& cutToMasterEdges,
|
||||
const labelList& cutToSlaveEdges,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeStart,
|
||||
const label edgeEnd
|
||||
) const
|
||||
{
|
||||
// Find edge using pointI that is most aligned with vector between master
|
||||
// Find edge using pointi that is most aligned with vector between master
|
||||
// points. Patchdivision tells us whether or not to use patch information to
|
||||
// match edges.
|
||||
|
||||
const pointField& localPoints = cutFaces().localPoints();
|
||||
|
||||
const labelList& pEdges = cutFaces().pointEdges()[pointI];
|
||||
const labelList& pEdges = cutFaces().pointEdges()[pointi];
|
||||
|
||||
if (report)
|
||||
{
|
||||
Pout<< "mostAlignedEdge : finding nearest edge among "
|
||||
<< UIndirectList<edge>(cutFaces().edges(), pEdges)()
|
||||
<< " connected to point " << pointI
|
||||
<< " coord:" << localPoints[pointI]
|
||||
<< " connected to point " << pointi
|
||||
<< " coord:" << localPoints[pointi]
|
||||
<< " running between " << edgeStart << " coord:"
|
||||
<< localPoints[edgeStart]
|
||||
<< " and " << edgeEnd << " coord:"
|
||||
@ -425,9 +425,9 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
|
||||
{
|
||||
const edge& e = cutFaces().edges()[edgeI];
|
||||
|
||||
label otherPointI = e.otherVertex(pointI);
|
||||
label otherPointi = e.otherVertex(pointi);
|
||||
|
||||
if (otherPointI == edgeEnd)
|
||||
if (otherPointi == edgeEnd)
|
||||
{
|
||||
// Shortcut: found edge end point.
|
||||
if (report)
|
||||
@ -440,7 +440,7 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
|
||||
|
||||
// Get angle between edge and edge to masterEnd
|
||||
|
||||
vector eVec(localPoints[otherPointI] - localPoints[pointI]);
|
||||
vector eVec(localPoints[otherPointi] - localPoints[pointi]);
|
||||
|
||||
scalar magEVec = mag(eVec);
|
||||
|
||||
@ -448,8 +448,8 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Crossing zero sized edge " << edgeI
|
||||
<< " coords:" << localPoints[otherPointI]
|
||||
<< localPoints[pointI]
|
||||
<< " coords:" << localPoints[otherPointi]
|
||||
<< localPoints[pointi]
|
||||
<< " when walking from " << localPoints[edgeStart]
|
||||
<< " to " << localPoints[edgeEnd]
|
||||
<< endl;
|
||||
@ -458,15 +458,15 @@ Foam::label Foam::faceCoupleInfo::mostAlignedCutEdge
|
||||
|
||||
eVec /= magEVec;
|
||||
|
||||
vector eToEndPoint(localPoints[edgeEnd] - localPoints[otherPointI]);
|
||||
vector eToEndPoint(localPoints[edgeEnd] - localPoints[otherPointi]);
|
||||
eToEndPoint /= mag(eToEndPoint);
|
||||
|
||||
scalar cosAngle = eVec & eToEndPoint;
|
||||
|
||||
if (report)
|
||||
{
|
||||
Pout<< " edge:" << e << " points:" << localPoints[pointI]
|
||||
<< localPoints[otherPointI]
|
||||
Pout<< " edge:" << e << " points:" << localPoints[pointi]
|
||||
<< localPoints[otherPointi]
|
||||
<< " vec:" << eVec
|
||||
<< " vecToEnd:" << eToEndPoint
|
||||
<< " cosAngle:" << cosAngle
|
||||
@ -751,11 +751,11 @@ bool Foam::faceCoupleInfo::matchPointsThroughFaces
|
||||
|
||||
forAll(cutF, cutFp)
|
||||
{
|
||||
label cutPointI = cutF[cutFp];
|
||||
label patchPointI = patchF[patchFp];
|
||||
label cutPointi = cutF[cutFp];
|
||||
label patchPointi = patchF[patchFp];
|
||||
|
||||
//const point& cutPt = cutPoints[cutPointI];
|
||||
//const point& patchPt = patchPoints[patchPointI];
|
||||
//const point& cutPt = cutPoints[cutPointi];
|
||||
//const point& patchPt = patchPoints[patchPointi];
|
||||
//if (mag(cutPt - patchPt) > SMALL)
|
||||
//{
|
||||
// FatalErrorInFunction
|
||||
@ -764,34 +764,34 @@ bool Foam::faceCoupleInfo::matchPointsThroughFaces
|
||||
// << abort(FatalError);
|
||||
//}
|
||||
|
||||
if (patchToCutPoints[patchPointI] == -1)
|
||||
if (patchToCutPoints[patchPointi] == -1)
|
||||
{
|
||||
patchToCutPoints[patchPointI] = cutPointI;
|
||||
patchToCutPoints[patchPointi] = cutPointi;
|
||||
}
|
||||
else if (patchToCutPoints[patchPointI] != cutPointI)
|
||||
else if (patchToCutPoints[patchPointi] != cutPointi)
|
||||
{
|
||||
// Multiple cut points connecting to same patch.
|
||||
// Check if already have region & region master for this set
|
||||
label otherCutPointI = patchToCutPoints[patchPointI];
|
||||
label otherCutPointi = patchToCutPoints[patchPointi];
|
||||
|
||||
//Pout<< "PatchPoint:" << patchPt
|
||||
// << " matches to:" << cutPointI
|
||||
// << " coord:" << cutPoints[cutPointI]
|
||||
// << " and to:" << otherCutPointI
|
||||
// << " coord:" << cutPoints[otherCutPointI]
|
||||
// << " matches to:" << cutPointi
|
||||
// << " coord:" << cutPoints[cutPointi]
|
||||
// << " and to:" << otherCutPointi
|
||||
// << " coord:" << cutPoints[otherCutPointi]
|
||||
// << endl;
|
||||
|
||||
if (cutPointRegion[otherCutPointI] != -1)
|
||||
if (cutPointRegion[otherCutPointi] != -1)
|
||||
{
|
||||
// Have region for this set. Copy.
|
||||
label region = cutPointRegion[otherCutPointI];
|
||||
cutPointRegion[cutPointI] = region;
|
||||
label region = cutPointRegion[otherCutPointi];
|
||||
cutPointRegion[cutPointi] = region;
|
||||
|
||||
// Update region master with min point label
|
||||
cutPointRegionMaster[region] = min
|
||||
(
|
||||
cutPointRegionMaster[region],
|
||||
cutPointI
|
||||
cutPointi
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -800,10 +800,10 @@ bool Foam::faceCoupleInfo::matchPointsThroughFaces
|
||||
label region = cutPointRegionMaster.size();
|
||||
cutPointRegionMaster.append
|
||||
(
|
||||
min(cutPointI, otherCutPointI)
|
||||
min(cutPointi, otherCutPointi)
|
||||
);
|
||||
cutPointRegion[cutPointI] = region;
|
||||
cutPointRegion[otherCutPointI] = region;
|
||||
cutPointRegion[cutPointi] = region;
|
||||
cutPointRegion[otherCutPointi] = region;
|
||||
}
|
||||
}
|
||||
|
||||
@ -822,33 +822,33 @@ bool Foam::faceCoupleInfo::matchPointsThroughFaces
|
||||
compactToCut.setSize(cutPointRegion.size());
|
||||
cutToCompact.setSize(cutPointRegion.size());
|
||||
cutToCompact = -1;
|
||||
label compactPointI = 0;
|
||||
label compactPointi = 0;
|
||||
|
||||
forAll(cutPointRegion, i)
|
||||
{
|
||||
if (cutPointRegion[i] == -1)
|
||||
{
|
||||
// Unduplicated point. Allocate new compacted point.
|
||||
cutToCompact[i] = compactPointI;
|
||||
compactToCut[compactPointI] = i;
|
||||
compactPointI++;
|
||||
cutToCompact[i] = compactPointi;
|
||||
compactToCut[compactPointi] = i;
|
||||
compactPointi++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Duplicate point. Get master.
|
||||
|
||||
label masterPointI = cutPointRegionMaster[cutPointRegion[i]];
|
||||
label masterPointi = cutPointRegionMaster[cutPointRegion[i]];
|
||||
|
||||
if (cutToCompact[masterPointI] == -1)
|
||||
if (cutToCompact[masterPointi] == -1)
|
||||
{
|
||||
cutToCompact[masterPointI] = compactPointI;
|
||||
compactToCut[compactPointI] = masterPointI;
|
||||
compactPointI++;
|
||||
cutToCompact[masterPointi] = compactPointi;
|
||||
compactToCut[compactPointi] = masterPointi;
|
||||
compactPointi++;
|
||||
}
|
||||
cutToCompact[i] = cutToCompact[masterPointI];
|
||||
cutToCompact[i] = cutToCompact[masterPointi];
|
||||
}
|
||||
}
|
||||
compactToCut.setSize(compactPointI);
|
||||
compactToCut.setSize(compactPointi);
|
||||
|
||||
return compactToCut.size() != cutToCompact.size();
|
||||
}
|
||||
@ -1681,10 +1681,10 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
||||
|
||||
// Find edges between cutPoint0 and cutPoint1.
|
||||
|
||||
label cutPointI = cutPoint0;
|
||||
label cutPointi = cutPoint0;
|
||||
do
|
||||
{
|
||||
// Find edge (starting at pointI on cut), aligned with master
|
||||
// Find edge (starting at pointi on cut), aligned with master
|
||||
// edge.
|
||||
label cutEdgeI =
|
||||
mostAlignedCutEdge
|
||||
@ -1694,7 +1694,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
||||
patchDivision,
|
||||
cutToMasterEdges,
|
||||
cutToSlaveEdges,
|
||||
cutPointI,
|
||||
cutPointi,
|
||||
cutPoint0,
|
||||
cutPoint1
|
||||
);
|
||||
@ -1709,7 +1709,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
||||
patchDivision,
|
||||
cutToMasterEdges,
|
||||
cutToSlaveEdges,
|
||||
cutPointI,
|
||||
cutPointi,
|
||||
cutPoint0,
|
||||
cutPoint1
|
||||
);
|
||||
@ -1725,7 +1725,7 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
||||
UIndirectList<edge>
|
||||
(
|
||||
cutFaces().edges(),
|
||||
cutFaces().pointEdges()[cutPointI]
|
||||
cutFaces().pointEdges()[cutPointi]
|
||||
)
|
||||
),
|
||||
cutFaces().localPoints(),
|
||||
@ -1744,9 +1744,9 @@ void Foam::faceCoupleInfo::subDivisionMatch
|
||||
|
||||
cutToMasterEdges[cutEdgeI] = masterEdgeI;
|
||||
|
||||
cutPointI = cutEdges[cutEdgeI].otherVertex(cutPointI);
|
||||
cutPointi = cutEdges[cutEdgeI].otherVertex(cutPointi);
|
||||
|
||||
} while (cutPointI != cutPoint1);
|
||||
} while (cutPointi != cutPoint1);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -266,7 +266,7 @@ class faceCoupleInfo
|
||||
const bool patchDivision,
|
||||
const labelList& cutToMasterEdges,
|
||||
const labelList& cutToSlaveEdges,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeStart,
|
||||
const label edgeEnd
|
||||
) const;
|
||||
|
||||
@ -518,7 +518,7 @@ void Foam::polyMeshAdder::mergePrimitives
|
||||
|
||||
// Storage for new points
|
||||
allPoints.setSize(mesh0.nPoints() + mesh1.nPoints());
|
||||
label allPointI = 0;
|
||||
label allPointi = 0;
|
||||
|
||||
from0ToAllPoints.setSize(mesh0.nPoints());
|
||||
from0ToAllPoints = -1;
|
||||
@ -553,7 +553,7 @@ void Foam::polyMeshAdder::mergePrimitives
|
||||
|
||||
forAll(cutPoints, i)
|
||||
{
|
||||
allPoints[allPointI] = cutPoints[i];
|
||||
allPoints[allPointi] = cutPoints[i];
|
||||
|
||||
// Mark all master and slave points referring to this point.
|
||||
|
||||
@ -561,44 +561,44 @@ void Foam::polyMeshAdder::mergePrimitives
|
||||
|
||||
forAll(masterPoints, j)
|
||||
{
|
||||
label mesh0PointI = masterPatch.meshPoints()[masterPoints[j]];
|
||||
from0ToAllPoints[mesh0PointI] = allPointI;
|
||||
label mesh0Pointi = masterPatch.meshPoints()[masterPoints[j]];
|
||||
from0ToAllPoints[mesh0Pointi] = allPointi;
|
||||
}
|
||||
|
||||
const labelList& slavePoints = cutToSlavePoints[i];
|
||||
|
||||
forAll(slavePoints, j)
|
||||
{
|
||||
label mesh1PointI = slavePatch.meshPoints()[slavePoints[j]];
|
||||
from1ToAllPoints[mesh1PointI] = allPointI;
|
||||
label mesh1Pointi = slavePatch.meshPoints()[slavePoints[j]];
|
||||
from1ToAllPoints[mesh1Pointi] = allPointi;
|
||||
}
|
||||
allPointI++;
|
||||
allPointi++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add uncoupled mesh0 points
|
||||
forAll(mesh0.points(), pointI)
|
||||
forAll(mesh0.points(), pointi)
|
||||
{
|
||||
if (from0ToAllPoints[pointI] == -1)
|
||||
if (from0ToAllPoints[pointi] == -1)
|
||||
{
|
||||
allPoints[allPointI] = mesh0.points()[pointI];
|
||||
from0ToAllPoints[pointI] = allPointI;
|
||||
allPointI++;
|
||||
allPoints[allPointi] = mesh0.points()[pointi];
|
||||
from0ToAllPoints[pointi] = allPointi;
|
||||
allPointi++;
|
||||
}
|
||||
}
|
||||
|
||||
// Add uncoupled mesh1 points
|
||||
forAll(mesh1.points(), pointI)
|
||||
forAll(mesh1.points(), pointi)
|
||||
{
|
||||
if (from1ToAllPoints[pointI] == -1)
|
||||
if (from1ToAllPoints[pointi] == -1)
|
||||
{
|
||||
allPoints[allPointI] = mesh1.points()[pointI];
|
||||
from1ToAllPoints[pointI] = allPointI;
|
||||
allPointI++;
|
||||
allPoints[allPointi] = mesh1.points()[pointi];
|
||||
from1ToAllPoints[pointi] = allPointi;
|
||||
allPointi++;
|
||||
}
|
||||
}
|
||||
|
||||
allPoints.setSize(allPointI);
|
||||
allPoints.setSize(allPointi);
|
||||
|
||||
|
||||
// Faces
|
||||
@ -903,15 +903,15 @@ void Foam::polyMeshAdder::mergePointZones
|
||||
forAll(pz, i)
|
||||
{
|
||||
label point0 = pz[i];
|
||||
label allPointI = from0ToAllPoints[point0];
|
||||
label allPointi = from0ToAllPoints[point0];
|
||||
|
||||
if (pointToZone[allPointI] == -1)
|
||||
if (pointToZone[allPointi] == -1)
|
||||
{
|
||||
pointToZone[allPointI] = zoneI;
|
||||
pointToZone[allPointi] = zoneI;
|
||||
}
|
||||
else if (pointToZone[allPointI] != zoneI)
|
||||
else if (pointToZone[allPointi] != zoneI)
|
||||
{
|
||||
labelList& pZones = addPointToZones[allPointI];
|
||||
labelList& pZones = addPointToZones[allPointi];
|
||||
if (findIndex(pZones, zoneI) == -1)
|
||||
{
|
||||
pZones.append(zoneI);
|
||||
@ -929,15 +929,15 @@ void Foam::polyMeshAdder::mergePointZones
|
||||
forAll(pz, i)
|
||||
{
|
||||
label point1 = pz[i];
|
||||
label allPointI = from1ToAllPoints[point1];
|
||||
label allPointi = from1ToAllPoints[point1];
|
||||
|
||||
if (pointToZone[allPointI] == -1)
|
||||
if (pointToZone[allPointi] == -1)
|
||||
{
|
||||
pointToZone[allPointI] = allZoneI;
|
||||
pointToZone[allPointi] = allZoneI;
|
||||
}
|
||||
else if (pointToZone[allPointI] != allZoneI)
|
||||
else if (pointToZone[allPointi] != allZoneI)
|
||||
{
|
||||
labelList& pZones = addPointToZones[allPointI];
|
||||
labelList& pZones = addPointToZones[allPointi];
|
||||
if (findIndex(pZones, allZoneI) == -1)
|
||||
{
|
||||
pZones.append(allZoneI);
|
||||
@ -950,17 +950,17 @@ void Foam::polyMeshAdder::mergePointZones
|
||||
|
||||
// 1. Count
|
||||
labelList nPoints(zoneNames.size(), 0);
|
||||
forAll(pointToZone, allPointI)
|
||||
forAll(pointToZone, allPointi)
|
||||
{
|
||||
label zoneI = pointToZone[allPointI];
|
||||
label zoneI = pointToZone[allPointi];
|
||||
if (zoneI != -1)
|
||||
{
|
||||
nPoints[zoneI]++;
|
||||
}
|
||||
}
|
||||
forAll(addPointToZones, allPointI)
|
||||
forAll(addPointToZones, allPointi)
|
||||
{
|
||||
const labelList& pZones = addPointToZones[allPointI];
|
||||
const labelList& pZones = addPointToZones[allPointi];
|
||||
forAll(pZones, i)
|
||||
{
|
||||
nPoints[pZones[i]]++;
|
||||
@ -973,20 +973,20 @@ void Foam::polyMeshAdder::mergePointZones
|
||||
{
|
||||
pzPoints[zoneI].setCapacity(nPoints[zoneI]);
|
||||
}
|
||||
forAll(pointToZone, allPointI)
|
||||
forAll(pointToZone, allPointi)
|
||||
{
|
||||
label zoneI = pointToZone[allPointI];
|
||||
label zoneI = pointToZone[allPointi];
|
||||
if (zoneI != -1)
|
||||
{
|
||||
pzPoints[zoneI].append(allPointI);
|
||||
pzPoints[zoneI].append(allPointi);
|
||||
}
|
||||
}
|
||||
forAll(addPointToZones, allPointI)
|
||||
forAll(addPointToZones, allPointi)
|
||||
{
|
||||
const labelList& pZones = addPointToZones[allPointI];
|
||||
const labelList& pZones = addPointToZones[allPointi];
|
||||
forAll(pZones, i)
|
||||
{
|
||||
pzPoints[pZones[i]].append(allPointI);
|
||||
pzPoints[pZones[i]].append(allPointi);
|
||||
}
|
||||
}
|
||||
forAll(pzPoints, i)
|
||||
@ -2018,7 +2018,7 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
|
||||
|
||||
forAll(sharedPointLabels, i)
|
||||
{
|
||||
label pointI = sharedPointLabels[i];
|
||||
label pointi = sharedPointLabels[i];
|
||||
|
||||
label sharedI = sharedPointAddr[i];
|
||||
|
||||
@ -2035,22 +2035,22 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
|
||||
label sz = connectedPointLabels.size();
|
||||
|
||||
// Check just to make sure.
|
||||
if (findIndex(connectedPointLabels, pointI) != -1)
|
||||
if (findIndex(connectedPointLabels, pointi) != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Duplicate point in sharedPoint addressing." << endl
|
||||
<< "When trying to add point " << pointI << " on shared "
|
||||
<< "When trying to add point " << pointi << " on shared "
|
||||
<< sharedI << " with connected points "
|
||||
<< connectedPointLabels
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
connectedPointLabels.setSize(sz+1);
|
||||
connectedPointLabels[sz] = pointI;
|
||||
connectedPointLabels[sz] = pointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
sharedToMesh.insert(sharedI, labelList(1, pointI));
|
||||
sharedToMesh.insert(sharedI, labelList(1, pointi));
|
||||
}
|
||||
}
|
||||
|
||||
@ -2106,27 +2106,27 @@ Foam::Map<Foam::label> Foam::polyMeshAdder::findSharedPoints
|
||||
if (mergeSet.size() > 1)
|
||||
{
|
||||
// Pick lowest numbered point
|
||||
label masterPointI = labelMax;
|
||||
label masterPointi = labelMax;
|
||||
|
||||
forAll(mergeSet, i)
|
||||
{
|
||||
label pointI = connectedPointLabels[mergeSet[i]];
|
||||
label pointi = connectedPointLabels[mergeSet[i]];
|
||||
|
||||
masterPointI = min(masterPointI, pointI);
|
||||
masterPointi = min(masterPointi, pointi);
|
||||
}
|
||||
|
||||
forAll(mergeSet, i)
|
||||
{
|
||||
label pointI = connectedPointLabels[mergeSet[i]];
|
||||
label pointi = connectedPointLabels[mergeSet[i]];
|
||||
|
||||
//Pout<< "Merging point " << pointI
|
||||
// << " at " << mesh.points()[pointI]
|
||||
//Pout<< "Merging point " << pointi
|
||||
// << " at " << mesh.points()[pointi]
|
||||
// << " into master point "
|
||||
// << masterPointI
|
||||
// << " at " << mesh.points()[masterPointI]
|
||||
// << masterPointi
|
||||
// << " at " << mesh.points()[masterPointi]
|
||||
// << endl;
|
||||
|
||||
pointToMaster.insert(pointI, masterPointI);
|
||||
pointToMaster.insert(pointi, masterPointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2216,15 +2216,15 @@ void Foam::polyMeshAdder::mergePoints
|
||||
)
|
||||
{
|
||||
// Remove all non-master points.
|
||||
forAll(mesh.points(), pointI)
|
||||
forAll(mesh.points(), pointi)
|
||||
{
|
||||
Map<label>::const_iterator iter = pointToMaster.find(pointI);
|
||||
Map<label>::const_iterator iter = pointToMaster.find(pointi);
|
||||
|
||||
if (iter != pointToMaster.end())
|
||||
{
|
||||
if (iter() != pointI)
|
||||
if (iter() != pointi)
|
||||
{
|
||||
meshMod.removePoint(pointI, iter());
|
||||
meshMod.removePoint(pointi, iter());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2241,13 +2241,13 @@ void Foam::polyMeshAdder::mergePoints
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
Map<label>::const_iterator iter = pointToMaster.find(pointI);
|
||||
Map<label>::const_iterator iter = pointToMaster.find(pointi);
|
||||
|
||||
if (iter != pointToMaster.end())
|
||||
{
|
||||
if (iter() != pointI)
|
||||
if (iter() != pointi)
|
||||
{
|
||||
hasMerged = true;
|
||||
break;
|
||||
@ -2261,9 +2261,9 @@ void Foam::polyMeshAdder::mergePoints
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
Map<label>::const_iterator iter = pointToMaster.find(pointI);
|
||||
Map<label>::const_iterator iter = pointToMaster.find(pointi);
|
||||
|
||||
if (iter != pointToMaster.end())
|
||||
{
|
||||
|
||||
@ -590,9 +590,9 @@ void Foam::polyMeshFilter::checkMeshEdgesAndRelaxEdges
|
||||
scalar sumMinEdgeLen = 0;
|
||||
label nEdges = 0;
|
||||
|
||||
forAll(e, pointI)
|
||||
forAll(e, pointi)
|
||||
{
|
||||
const labelList& pEdges = mesh_.pointEdges()[e[pointI]];
|
||||
const labelList& pEdges = mesh_.pointEdges()[e[pointi]];
|
||||
|
||||
forAll(pEdges, pEdgeI)
|
||||
{
|
||||
@ -862,25 +862,25 @@ void Foam::polyMeshFilter::updateOldToNewPointMap
|
||||
labelList& origToCurrentPointMap
|
||||
) const
|
||||
{
|
||||
forAll(origToCurrentPointMap, origPointI)
|
||||
forAll(origToCurrentPointMap, origPointi)
|
||||
{
|
||||
label oldPointI = origToCurrentPointMap[origPointI];
|
||||
label oldPointi = origToCurrentPointMap[origPointi];
|
||||
|
||||
if (oldPointI != -1)
|
||||
if (oldPointi != -1)
|
||||
{
|
||||
label newPointI = currToNew[oldPointI];
|
||||
label newPointi = currToNew[oldPointi];
|
||||
|
||||
if (newPointI >= 0)
|
||||
if (newPointi >= 0)
|
||||
{
|
||||
origToCurrentPointMap[origPointI] = newPointI;
|
||||
origToCurrentPointMap[origPointi] = newPointi;
|
||||
}
|
||||
else if (newPointI == -1)
|
||||
else if (newPointi == -1)
|
||||
{
|
||||
origToCurrentPointMap[origPointI] = -1;
|
||||
origToCurrentPointMap[origPointi] = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
origToCurrentPointMap[origPointI] = -newPointI-2;
|
||||
origToCurrentPointMap[origPointi] = -newPointi-2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,20 +67,20 @@ Foam::label Foam::addPatchCellLayer::nbrFace
|
||||
|
||||
void Foam::addPatchCellLayer::addVertex
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
face& f,
|
||||
label& fp
|
||||
)
|
||||
{
|
||||
if (fp == 0)
|
||||
{
|
||||
f[fp++] = pointI;
|
||||
f[fp++] = pointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (f[fp-1] != pointI && f[0] != pointI)
|
||||
if (f[fp-1] != pointi && f[0] != pointi)
|
||||
{
|
||||
f[fp++] = pointI;
|
||||
f[fp++] = pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -875,16 +875,16 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
// Non-synced
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label meshPointI = meshPoints[i];
|
||||
label meshPointi = meshPoints[i];
|
||||
|
||||
if (n[meshPointI] != nPointLayers[i])
|
||||
if (n[meshPointi] != nPointLayers[i])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "At mesh point:" << meshPointI
|
||||
<< " coordinate:" << mesh_.points()[meshPointI]
|
||||
<< "At mesh point:" << meshPointi
|
||||
<< " coordinate:" << mesh_.points()[meshPointi]
|
||||
<< " specified nLayers:" << nPointLayers[i] << endl
|
||||
<< "On coupled point a different nLayers:"
|
||||
<< n[meshPointI] << " was specified."
|
||||
<< n[meshPointi] << " was specified."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -899,9 +899,9 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
nFromFace[pointI] = max(nFromFace[pointI], nFaceLayers[i]);
|
||||
nFromFace[pointi] = max(nFromFace[pointi], nFaceLayers[i]);
|
||||
}
|
||||
}
|
||||
syncTools::syncPointList
|
||||
@ -914,20 +914,20 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
|
||||
forAll(nPointLayers, i)
|
||||
{
|
||||
label meshPointI = meshPoints[i];
|
||||
label meshPointi = meshPoints[i];
|
||||
|
||||
if
|
||||
(
|
||||
nPointLayers[i] > 0
|
||||
&& nPointLayers[i] != nFromFace[meshPointI]
|
||||
&& nPointLayers[i] != nFromFace[meshPointi]
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "At mesh point:" << meshPointI
|
||||
<< " coordinate:" << mesh_.points()[meshPointI]
|
||||
<< "At mesh point:" << meshPointi
|
||||
<< " coordinate:" << mesh_.points()[meshPointi]
|
||||
<< " specified nLayers:" << nPointLayers[i] << endl
|
||||
<< "but the max nLayers of surrounding faces is:"
|
||||
<< nFromFace[meshPointI]
|
||||
<< nFromFace[meshPointi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -946,17 +946,17 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
|
||||
forAll(meshPoints, i)
|
||||
{
|
||||
label meshPointI = meshPoints[i];
|
||||
label meshPointi = meshPoints[i];
|
||||
|
||||
if (mag(d[meshPointI] - firstLayerDisp[i]) > SMALL)
|
||||
if (mag(d[meshPointi] - firstLayerDisp[i]) > SMALL)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "At mesh point:" << meshPointI
|
||||
<< " coordinate:" << mesh_.points()[meshPointI]
|
||||
<< "At mesh point:" << meshPointi
|
||||
<< " coordinate:" << mesh_.points()[meshPointi]
|
||||
<< " specified displacement:" << firstLayerDisp[i]
|
||||
<< endl
|
||||
<< "On coupled point a different displacement:"
|
||||
<< d[meshPointI] << " was specified."
|
||||
<< d[meshPointi] << " was specified."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1057,11 +1057,11 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
// Mark points that do not get extruded by setting size of addedPoints_ to 0
|
||||
label nTruncated = 0;
|
||||
|
||||
forAll(nPointLayers, patchPointI)
|
||||
forAll(nPointLayers, patchPointi)
|
||||
{
|
||||
if (nPointLayers[patchPointI] > 0)
|
||||
if (nPointLayers[patchPointi] > 0)
|
||||
{
|
||||
addedPoints_[patchPointI].setSize(nPointLayers[patchPointI]);
|
||||
addedPoints_[patchPointi].setSize(nPointLayers[patchPointi]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1085,17 +1085,17 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
if (!addToMesh_)
|
||||
{
|
||||
copiedPatchPoints.setSize(firstLayerDisp.size());
|
||||
forAll(firstLayerDisp, patchPointI)
|
||||
forAll(firstLayerDisp, patchPointi)
|
||||
{
|
||||
if (addedPoints_[patchPointI].size())
|
||||
if (addedPoints_[patchPointi].size())
|
||||
{
|
||||
label meshPointI = meshPoints[patchPointI];
|
||||
label zoneI = mesh_.pointZones().whichZone(meshPointI);
|
||||
copiedPatchPoints[patchPointI] = meshMod.setAction
|
||||
label meshPointi = meshPoints[patchPointi];
|
||||
label zoneI = mesh_.pointZones().whichZone(meshPointi);
|
||||
copiedPatchPoints[patchPointi] = meshMod.setAction
|
||||
(
|
||||
polyAddPoint
|
||||
(
|
||||
mesh_.points()[meshPointI], // point
|
||||
mesh_.points()[meshPointi], // point
|
||||
-1, // master point
|
||||
zoneI, // zone for point
|
||||
true // supports a cell
|
||||
@ -1107,19 +1107,19 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
|
||||
|
||||
// Create points for additional layers
|
||||
forAll(firstLayerDisp, patchPointI)
|
||||
forAll(firstLayerDisp, patchPointi)
|
||||
{
|
||||
if (addedPoints_[patchPointI].size())
|
||||
if (addedPoints_[patchPointi].size())
|
||||
{
|
||||
label meshPointI = meshPoints[patchPointI];
|
||||
label meshPointi = meshPoints[patchPointi];
|
||||
|
||||
label zoneI = mesh_.pointZones().whichZone(meshPointI);
|
||||
label zoneI = mesh_.pointZones().whichZone(meshPointi);
|
||||
|
||||
point pt = mesh_.points()[meshPointI];
|
||||
point pt = mesh_.points()[meshPointi];
|
||||
|
||||
vector disp = firstLayerDisp[patchPointI];
|
||||
vector disp = firstLayerDisp[patchPointi];
|
||||
|
||||
forAll(addedPoints_[patchPointI], i)
|
||||
forAll(addedPoints_[patchPointi], i)
|
||||
{
|
||||
pt += disp;
|
||||
|
||||
@ -1128,15 +1128,15 @@ void Foam::addPatchCellLayer::setRefinement
|
||||
polyAddPoint
|
||||
(
|
||||
pt, // point
|
||||
(addToMesh_ ? meshPointI : -1), // master point
|
||||
(addToMesh_ ? meshPointi : -1), // master point
|
||||
zoneI, // zone for point
|
||||
true // supports a cell
|
||||
)
|
||||
);
|
||||
|
||||
addedPoints_[patchPointI][i] = addedVertI;
|
||||
addedPoints_[patchPointi][i] = addedVertI;
|
||||
|
||||
disp *= expansionRatio[patchPointI];
|
||||
disp *= expansionRatio[patchPointi];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1729,23 +1729,23 @@ void Foam::addPatchCellLayer::updateMesh
|
||||
{
|
||||
labelListList newAddedPoints(pointMap.size());
|
||||
|
||||
forAll(newAddedPoints, newPointI)
|
||||
forAll(newAddedPoints, newPointi)
|
||||
{
|
||||
label oldPointI = pointMap[newPointI];
|
||||
label oldPointi = pointMap[newPointi];
|
||||
|
||||
const labelList& added = addedPoints_[oldPointI];
|
||||
const labelList& added = addedPoints_[oldPointi];
|
||||
|
||||
labelList& newAdded = newAddedPoints[newPointI];
|
||||
labelList& newAdded = newAddedPoints[newPointi];
|
||||
newAdded.setSize(added.size());
|
||||
label newI = 0;
|
||||
|
||||
forAll(added, i)
|
||||
{
|
||||
label newPointI = morphMap.reversePointMap()[added[i]];
|
||||
label newPointi = morphMap.reversePointMap()[added[i]];
|
||||
|
||||
if (newPointI >= 0)
|
||||
if (newPointi >= 0)
|
||||
{
|
||||
newAdded[newI++] = newPointI;
|
||||
newAdded[newI++] = newPointi;
|
||||
}
|
||||
}
|
||||
newAdded.setSize(newI);
|
||||
|
||||
@ -305,7 +305,7 @@ public:
|
||||
|
||||
//- Boundary edges get extruded into boundary faces. Determine patch
|
||||
// for these faces. This might be a to-be-created processor patch
|
||||
// (patchI >= mesh.boundaryMesh().size()) in which case the
|
||||
// (patchi >= mesh.boundaryMesh().size()) in which case the
|
||||
// nbrProcToPatch, patchToNbrProc give the correspondence. nPatches
|
||||
// is the new number of patches.
|
||||
static void calcSidePatch
|
||||
|
||||
@ -566,9 +566,9 @@ void Foam::combineFaces::setRefinement
|
||||
|
||||
const labelListList& pointFaces = mesh_.pointFaces();
|
||||
|
||||
forAll(pointFaces, pointI)
|
||||
forAll(pointFaces, pointi)
|
||||
{
|
||||
nPointFaces[pointI] = pointFaces[pointI].size();
|
||||
nPointFaces[pointi] = pointFaces[pointi].size();
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
@ -700,11 +700,11 @@ void Foam::combineFaces::setRefinement
|
||||
// Remove all unused points. Store position if undoable.
|
||||
if (!undoable_)
|
||||
{
|
||||
forAll(nPointFaces, pointI)
|
||||
forAll(nPointFaces, pointi)
|
||||
{
|
||||
if (nPointFaces[pointI] == 0)
|
||||
if (nPointFaces[pointi] == 0)
|
||||
{
|
||||
meshMod.setAction(polyRemovePoint(pointI));
|
||||
meshMod.setAction(polyRemovePoint(pointi));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -712,9 +712,9 @@ void Foam::combineFaces::setRefinement
|
||||
{
|
||||
// Count removed points
|
||||
label n = 0;
|
||||
forAll(nPointFaces, pointI)
|
||||
forAll(nPointFaces, pointi)
|
||||
{
|
||||
if (nPointFaces[pointI] == 0)
|
||||
if (nPointFaces[pointi] == 0)
|
||||
{
|
||||
n++;
|
||||
}
|
||||
@ -726,16 +726,16 @@ void Foam::combineFaces::setRefinement
|
||||
|
||||
// Remove points and store position
|
||||
n = 0;
|
||||
forAll(nPointFaces, pointI)
|
||||
forAll(nPointFaces, pointi)
|
||||
{
|
||||
if (nPointFaces[pointI] == 0)
|
||||
if (nPointFaces[pointi] == 0)
|
||||
{
|
||||
meshMod.setAction(polyRemovePoint(pointI));
|
||||
meshMod.setAction(polyRemovePoint(pointi));
|
||||
|
||||
savedPointLabels_[n] = pointI;
|
||||
savedPoints_[n] = mesh_.points()[pointI];
|
||||
savedPointLabels_[n] = pointi;
|
||||
savedPoints_[n] = mesh_.points()[pointi];
|
||||
|
||||
meshToSaved.insert(pointI, n);
|
||||
meshToSaved.insert(pointi, n);
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@ -751,11 +751,11 @@ void Foam::combineFaces::setRefinement
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (nPointFaces[pointI] == 0)
|
||||
if (nPointFaces[pointi] == 0)
|
||||
{
|
||||
f[fp] = -meshToSaved[pointI]-1;
|
||||
f[fp] = -meshToSaved[pointi]-1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -784,11 +784,11 @@ void Foam::combineFaces::updateMesh(const mapPolyMesh& map)
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (pointI >= 0)
|
||||
if (pointi >= 0)
|
||||
{
|
||||
f[fp] = map.reversePointMap()[pointI];
|
||||
f[fp] = map.reversePointMap()[pointi];
|
||||
|
||||
if (f[fp] < 0)
|
||||
{
|
||||
@ -879,11 +879,11 @@ void Foam::combineFaces::setUnrefinement
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (pointI < 0)
|
||||
if (pointi < 0)
|
||||
{
|
||||
label localI = -pointI-1;
|
||||
label localI = -pointi-1;
|
||||
|
||||
if (addedPoints[localI] == -1)
|
||||
{
|
||||
|
||||
@ -75,24 +75,24 @@ void Foam::duplicatePoints::setRefinement
|
||||
|
||||
forAllConstIter(Map<label>, meshPointMap, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
label localI = iter();
|
||||
const labelList& regions = pointRegions[localI];
|
||||
|
||||
duplicates_[localI].setSize(regions.size());
|
||||
duplicates_[localI][0] = pointI;
|
||||
duplicates_[localI][0] = pointi;
|
||||
for (label i = 1; i < regions.size(); i++)
|
||||
{
|
||||
duplicates_[localI][i] = meshMod.addPoint
|
||||
(
|
||||
mesh_.points()[pointI], // point
|
||||
pointI, // master point
|
||||
mesh_.points()[pointi], // point
|
||||
pointi, // master point
|
||||
-1, // zone for point
|
||||
true // supports a cell
|
||||
);
|
||||
}
|
||||
|
||||
//Pout<< "For point:" << pointI << " coord:" << mesh_.points()[pointI]
|
||||
//Pout<< "For point:" << pointi << " coord:" << mesh_.points()[pointi]
|
||||
// << endl;
|
||||
//forAll(duplicates_[localI], i)
|
||||
//{
|
||||
@ -121,9 +121,9 @@ void Foam::duplicatePoints::setRefinement
|
||||
newFace.setSize(f.size());
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
Map<label>::const_iterator iter = meshPointMap.find(pointI);
|
||||
Map<label>::const_iterator iter = meshPointMap.find(pointi);
|
||||
|
||||
if (iter != meshPointMap.end())
|
||||
{
|
||||
@ -141,7 +141,7 @@ void Foam::duplicatePoints::setRefinement
|
||||
}
|
||||
else
|
||||
{
|
||||
newFace[fp] = pointI;
|
||||
newFace[fp] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -192,18 +192,18 @@ void Foam::edgeCollapser::collapseToEdge
|
||||
|
||||
forAll(facePtsNeg, fPtI)
|
||||
{
|
||||
const label facePointI = facePtsNeg[fPtI];
|
||||
const label facePtPriority = pointPriority[facePointI];
|
||||
const label facePointi = facePtsNeg[fPtI];
|
||||
const label facePtPriority = pointPriority[facePointi];
|
||||
|
||||
if (facePtPriority > maxPriority)
|
||||
{
|
||||
maxPriority = facePtPriority;
|
||||
maxPriorityPts.clear();
|
||||
maxPriorityPts.append(facePointI);
|
||||
maxPriorityPts.append(facePointi);
|
||||
}
|
||||
else if (facePtPriority == maxPriority)
|
||||
{
|
||||
maxPriorityPts.append(facePointI);
|
||||
maxPriorityPts.append(facePointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -242,18 +242,18 @@ void Foam::edgeCollapser::collapseToEdge
|
||||
|
||||
forAll(facePtsPos, fPtI)
|
||||
{
|
||||
const label facePointI = facePtsPos[fPtI];
|
||||
const label facePtPriority = pointPriority[facePointI];
|
||||
const label facePointi = facePtsPos[fPtI];
|
||||
const label facePtPriority = pointPriority[facePointi];
|
||||
|
||||
if (facePtPriority > maxPriority)
|
||||
{
|
||||
maxPriority = facePtPriority;
|
||||
maxPriorityPts.clear();
|
||||
maxPriorityPts.append(facePointI);
|
||||
maxPriorityPts.append(facePointi);
|
||||
}
|
||||
else if (facePtPriority == maxPriority)
|
||||
{
|
||||
maxPriorityPts.append(facePointI);
|
||||
maxPriorityPts.append(facePointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -304,18 +304,18 @@ void Foam::edgeCollapser::collapseToPoint
|
||||
|
||||
forAll(facePts, fPtI)
|
||||
{
|
||||
const label facePointI = facePts[fPtI];
|
||||
const label facePtPriority = pointPriority[facePointI];
|
||||
const label facePointi = facePts[fPtI];
|
||||
const label facePtPriority = pointPriority[facePointi];
|
||||
|
||||
if (facePtPriority > maxPriority)
|
||||
{
|
||||
maxPriority = facePtPriority;
|
||||
maxPriorityPts.clear();
|
||||
maxPriorityPts.append(facePointI);
|
||||
maxPriorityPts.append(facePointi);
|
||||
}
|
||||
else if (facePtPriority == maxPriority)
|
||||
{
|
||||
maxPriorityPts.append(facePointI);
|
||||
maxPriorityPts.append(facePointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -806,48 +806,48 @@ Foam::label Foam::edgeCollapser::edgeMaster
|
||||
|
||||
void Foam::edgeCollapser::checkBoundaryPointMergeEdges
|
||||
(
|
||||
const label pointI,
|
||||
const label otherPointI,
|
||||
const label pointi,
|
||||
const label otherPointi,
|
||||
const labelList& pointPriority,
|
||||
Map<point>& collapsePointToLocation
|
||||
) const
|
||||
{
|
||||
const pointField& points = mesh_.points();
|
||||
|
||||
const label e0Priority = pointPriority[pointI];
|
||||
const label e1Priority = pointPriority[otherPointI];
|
||||
const label e0Priority = pointPriority[pointi];
|
||||
const label e1Priority = pointPriority[otherPointi];
|
||||
|
||||
if (e0Priority > e1Priority)
|
||||
{
|
||||
collapsePointToLocation.set
|
||||
(
|
||||
otherPointI,
|
||||
points[pointI]
|
||||
otherPointi,
|
||||
points[pointi]
|
||||
);
|
||||
}
|
||||
else if (e0Priority < e1Priority)
|
||||
{
|
||||
collapsePointToLocation.set
|
||||
(
|
||||
pointI,
|
||||
points[otherPointI]
|
||||
pointi,
|
||||
points[otherPointi]
|
||||
);
|
||||
}
|
||||
else // e0Priority == e1Priority
|
||||
{
|
||||
collapsePointToLocation.set
|
||||
(
|
||||
pointI,
|
||||
points[otherPointI]
|
||||
pointi,
|
||||
points[otherPointi]
|
||||
);
|
||||
|
||||
// Foam::point averagePt
|
||||
// (
|
||||
// 0.5*(points[otherPointI] + points[pointI])
|
||||
// 0.5*(points[otherPointi] + points[pointi])
|
||||
// );
|
||||
//
|
||||
// collapsePointToLocation.set(pointI, averagePt);
|
||||
// collapsePointToLocation.set(otherPointI, averagePt);
|
||||
// collapsePointToLocation.set(pointi, averagePt);
|
||||
// collapsePointToLocation.set(otherPointi, averagePt);
|
||||
}
|
||||
}
|
||||
|
||||
@ -890,10 +890,10 @@ Foam::label Foam::edgeCollapser::breakStringsAtEdges
|
||||
{
|
||||
const label edgeI = ptEdgesStart[ptEdgeI];
|
||||
|
||||
const label nbrPointI
|
||||
const label nbrPointi
|
||||
= edges[edgeI].otherVertex(e.start());
|
||||
const label nbrIndex
|
||||
= allPointInfo[nbrPointI].collapseIndex();
|
||||
= allPointInfo[nbrPointi].collapseIndex();
|
||||
|
||||
if
|
||||
(
|
||||
@ -964,20 +964,20 @@ Foam::label Foam::edgeCollapser::countEdgesOnFace
|
||||
|
||||
forAll(f, fpI)
|
||||
{
|
||||
const label pointI = f[fpI];
|
||||
const label newPointI = allPointInfo[pointI].collapseIndex();
|
||||
const label pointi = f[fpI];
|
||||
const label newPointi = allPointInfo[pointi].collapseIndex();
|
||||
|
||||
if (newPointI == -2)
|
||||
if (newPointi == -2)
|
||||
{
|
||||
nEdges++;
|
||||
}
|
||||
else
|
||||
{
|
||||
const label prevPointI = f[f.fcIndex(fpI)];
|
||||
const label prevNewPointI
|
||||
= allPointInfo[prevPointI].collapseIndex();
|
||||
const label prevPointi = f[f.fcIndex(fpI)];
|
||||
const label prevNewPointi
|
||||
= allPointInfo[prevPointi].collapseIndex();
|
||||
|
||||
if (newPointI != prevNewPointI)
|
||||
if (newPointi != prevNewPointi)
|
||||
{
|
||||
nEdges++;
|
||||
}
|
||||
@ -1045,38 +1045,38 @@ Foam::label Foam::edgeCollapser::syncCollapse
|
||||
{
|
||||
const edge& e = edges[edgeI];
|
||||
|
||||
label masterPointI = e.start();
|
||||
label masterPointi = e.start();
|
||||
|
||||
// Choose the point on the edge with the highest priority.
|
||||
if (pointPriority[e.end()] > pointPriority[e.start()])
|
||||
{
|
||||
masterPointI = e.end();
|
||||
masterPointi = e.end();
|
||||
}
|
||||
|
||||
label masterPointPriority = pointPriority[masterPointI];
|
||||
label masterPointPriority = pointPriority[masterPointi];
|
||||
|
||||
label index = globalPoints.toGlobal(masterPointI);
|
||||
label index = globalPoints.toGlobal(masterPointi);
|
||||
|
||||
if (!collapsePointToLocation.found(masterPointI))
|
||||
if (!collapsePointToLocation.found(masterPointi))
|
||||
{
|
||||
const label otherVertex = e.otherVertex(masterPointI);
|
||||
const label otherVertex = e.otherVertex(masterPointi);
|
||||
|
||||
if (!collapsePointToLocation.found(otherVertex))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< masterPointI << " on edge " << edgeI << " " << e
|
||||
<< masterPointi << " on edge " << edgeI << " " << e
|
||||
<< " is not marked for collapse."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
else
|
||||
{
|
||||
masterPointI = otherVertex;
|
||||
masterPointPriority = pointPriority[masterPointI];
|
||||
index = globalPoints.toGlobal(masterPointI);
|
||||
masterPointi = otherVertex;
|
||||
masterPointPriority = pointPriority[masterPointi];
|
||||
index = globalPoints.toGlobal(masterPointi);
|
||||
}
|
||||
}
|
||||
|
||||
const point& collapsePoint = collapsePointToLocation[masterPointI];
|
||||
const point& collapsePoint = collapsePointToLocation[masterPointi];
|
||||
|
||||
const pointEdgeCollapse pec
|
||||
(
|
||||
@ -1131,29 +1131,29 @@ void Foam::edgeCollapser::filterFace
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
label collapseIndex = allPointInfo[pointI].collapseIndex();
|
||||
label collapseIndex = allPointInfo[pointi].collapseIndex();
|
||||
|
||||
// Do we have a local point for this index?
|
||||
if (collapseStrings.found(collapseIndex))
|
||||
{
|
||||
label localPointI = collapseStrings[collapseIndex][0];
|
||||
label localPointi = collapseStrings[collapseIndex][0];
|
||||
|
||||
if (findIndex(SubList<label>(f, newFp), localPointI) == -1)
|
||||
if (findIndex(SubList<label>(f, newFp), localPointi) == -1)
|
||||
{
|
||||
f[newFp++] = localPointI;
|
||||
f[newFp++] = localPointi;
|
||||
}
|
||||
}
|
||||
else if (collapseIndex == -1)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Point " << pointI << " was not visited by PointEdgeWave"
|
||||
<< "Point " << pointi << " was not visited by PointEdgeWave"
|
||||
<< endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
f[newFp++] = pointI;
|
||||
f[newFp++] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1173,35 +1173,35 @@ void Foam::edgeCollapser::filterFace
|
||||
label fp1 = fp-1;
|
||||
label fp2 = fp-2;
|
||||
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
// Search for previous occurrence.
|
||||
label index = findIndex(SubList<label>(f, fp), pointI);
|
||||
label index = findIndex(SubList<label>(f, fp), pointi);
|
||||
|
||||
if (index == fp1)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Removing consecutive duplicate vertex in face "
|
||||
<< f << endl;
|
||||
// Don't store current pointI
|
||||
// Don't store current pointi
|
||||
}
|
||||
else if (index == fp2)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Removing non-consecutive duplicate vertex in face "
|
||||
<< f << endl;
|
||||
// Don't store current pointI and remove previous
|
||||
// Don't store current pointi and remove previous
|
||||
newFp--;
|
||||
}
|
||||
else if (index != -1)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Pinched face " << f << endl;
|
||||
f[newFp++] = pointI;
|
||||
f[newFp++] = pointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
f[newFp++] = pointI;
|
||||
f[newFp++] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1321,9 +1321,9 @@ bool Foam::edgeCollapser::setRefinement
|
||||
{
|
||||
// 1. Count elements per collapseIndex
|
||||
Map<label> nPerIndex(mesh_.nPoints()/10);
|
||||
forAll(allPointInfo, pointI)
|
||||
forAll(allPointInfo, pointi)
|
||||
{
|
||||
label collapseIndex = allPointInfo[pointI].collapseIndex();
|
||||
label collapseIndex = allPointInfo[pointi].collapseIndex();
|
||||
|
||||
if (collapseIndex != -1 && collapseIndex != -2)
|
||||
{
|
||||
@ -1347,13 +1347,13 @@ bool Foam::edgeCollapser::setRefinement
|
||||
}
|
||||
|
||||
// 3. Fill
|
||||
forAll(allPointInfo, pointI)
|
||||
forAll(allPointInfo, pointi)
|
||||
{
|
||||
const label collapseIndex = allPointInfo[pointI].collapseIndex();
|
||||
const label collapseIndex = allPointInfo[pointi].collapseIndex();
|
||||
|
||||
if (collapseIndex != -1 && collapseIndex != -2)
|
||||
{
|
||||
collapseStrings[collapseIndex].append(pointI);
|
||||
collapseStrings[collapseIndex].append(pointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1532,35 +1532,35 @@ bool Foam::edgeCollapser::setRefinement
|
||||
}
|
||||
|
||||
// Remove unused vertices that have not been marked for removal already
|
||||
forAll(usedPoint, pointI)
|
||||
forAll(usedPoint, pointi)
|
||||
{
|
||||
if (!usedPoint[pointI])
|
||||
if (!usedPoint[pointi])
|
||||
{
|
||||
removedPoints[pointI] = true;
|
||||
meshMod.removePoint(pointI, -1);
|
||||
removedPoints[pointi] = true;
|
||||
meshMod.removePoint(pointi, -1);
|
||||
meshChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Modify the point location of the remaining points
|
||||
forAll(allPointInfo, pointI)
|
||||
forAll(allPointInfo, pointi)
|
||||
{
|
||||
const label collapseIndex = allPointInfo[pointI].collapseIndex();
|
||||
const point& collapsePoint = allPointInfo[pointI].collapsePoint();
|
||||
const label collapseIndex = allPointInfo[pointi].collapseIndex();
|
||||
const point& collapsePoint = allPointInfo[pointi].collapsePoint();
|
||||
|
||||
if
|
||||
(
|
||||
removedPoints[pointI] == false
|
||||
removedPoints[pointi] == false
|
||||
&& collapseIndex != -1
|
||||
&& collapseIndex != -2
|
||||
)
|
||||
{
|
||||
meshMod.modifyPoint
|
||||
(
|
||||
pointI,
|
||||
pointi,
|
||||
collapsePoint,
|
||||
pointZones.whichZone(pointI),
|
||||
pointZones.whichZone(pointi),
|
||||
false
|
||||
);
|
||||
}
|
||||
@ -1571,11 +1571,11 @@ bool Foam::edgeCollapser::setRefinement
|
||||
const faceZoneMesh& faceZones = mesh_.faceZones();
|
||||
|
||||
// Renumber faces that use points
|
||||
forAll(allPointInfo, pointI)
|
||||
forAll(allPointInfo, pointi)
|
||||
{
|
||||
if (removedPoints[pointI] == true)
|
||||
if (removedPoints[pointi] == true)
|
||||
{
|
||||
const labelList& changedFaces = pointFaces[pointI];
|
||||
const labelList& changedFaces = pointFaces[pointi];
|
||||
|
||||
forAll(changedFaces, changedFacei)
|
||||
{
|
||||
@ -1712,20 +1712,20 @@ void Foam::edgeCollapser::consistentCollapse
|
||||
);
|
||||
|
||||
// Mark all edges attached to the point for collapse
|
||||
forAll(markedPoints, pointI)
|
||||
forAll(markedPoints, pointi)
|
||||
{
|
||||
if (markedPoints[pointI])
|
||||
if (markedPoints[pointi])
|
||||
{
|
||||
const label index = allPointInfo[pointI].collapseIndex();
|
||||
const label index = allPointInfo[pointi].collapseIndex();
|
||||
|
||||
const labelList& ptEdges = pointEdges[pointI];
|
||||
const labelList& ptEdges = pointEdges[pointi];
|
||||
|
||||
forAll(ptEdges, ptEdgeI)
|
||||
{
|
||||
const label edgeI = ptEdges[ptEdgeI];
|
||||
const label nbrPointI = edges[edgeI].otherVertex(pointI);
|
||||
const label nbrPointi = edges[edgeI].otherVertex(pointi);
|
||||
const label nbrIndex
|
||||
= allPointInfo[nbrPointI].collapseIndex();
|
||||
= allPointInfo[nbrPointi].collapseIndex();
|
||||
|
||||
if (collapseEdge[edgeI] && nbrIndex == index)
|
||||
{
|
||||
@ -1850,9 +1850,9 @@ Foam::label Foam::edgeCollapser::markSmallEdges
|
||||
{
|
||||
collapseEdge[edgeI] = true;
|
||||
|
||||
label masterPointI = edgeMaster(pointPriority, e);
|
||||
label masterPointi = edgeMaster(pointPriority, e);
|
||||
|
||||
if (masterPointI == -1)
|
||||
if (masterPointi == -1)
|
||||
{
|
||||
const point average
|
||||
= 0.5*(points[e.start()] + points[e.end()]);
|
||||
@ -1861,9 +1861,9 @@ Foam::label Foam::edgeCollapser::markSmallEdges
|
||||
}
|
||||
else
|
||||
{
|
||||
const point& collapsePt = points[masterPointI];
|
||||
const point& collapsePt = points[masterPointi];
|
||||
|
||||
collapsePointToLocation.set(masterPointI, collapsePt);
|
||||
collapsePointToLocation.set(masterPointi, collapsePt);
|
||||
}
|
||||
|
||||
|
||||
@ -1901,11 +1901,11 @@ Foam::label Foam::edgeCollapser::markMergeEdges
|
||||
|
||||
if (nTotRemove > 0)
|
||||
{
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
if (pointCanBeDeleted[pointI])
|
||||
if (pointCanBeDeleted[pointi])
|
||||
{
|
||||
const labelList& pEdges = pointEdges[pointI];
|
||||
const labelList& pEdges = pointEdges[pointi];
|
||||
|
||||
if (pEdges.size() == 2)
|
||||
{
|
||||
@ -1933,8 +1933,8 @@ Foam::label Foam::edgeCollapser::markMergeEdges
|
||||
|
||||
checkBoundaryPointMergeEdges
|
||||
(
|
||||
pointI,
|
||||
edges[e0].otherVertex(pointI),
|
||||
pointi,
|
||||
edges[e0].otherVertex(pointi),
|
||||
pointPriority,
|
||||
collapsePointToLocation
|
||||
);
|
||||
@ -1945,8 +1945,8 @@ Foam::label Foam::edgeCollapser::markMergeEdges
|
||||
|
||||
checkBoundaryPointMergeEdges
|
||||
(
|
||||
pointI,
|
||||
edges[e1].otherVertex(pointI),
|
||||
pointi,
|
||||
edges[e1].otherVertex(pointi),
|
||||
pointPriority,
|
||||
collapsePointToLocation
|
||||
);
|
||||
|
||||
@ -173,8 +173,8 @@ private:
|
||||
//- Decides which points in an edge to collapse, based on their priority
|
||||
void checkBoundaryPointMergeEdges
|
||||
(
|
||||
const label pointI,
|
||||
const label otherPointI,
|
||||
const label pointi,
|
||||
const label otherPointi,
|
||||
const labelList& pointPriority,
|
||||
Map<point>& collapsePointToLocation
|
||||
) const;
|
||||
|
||||
@ -153,7 +153,7 @@ void Foam::faceCollapser::filterFace
|
||||
{
|
||||
label nei = -1;
|
||||
|
||||
label patchI = -1;
|
||||
label patchi = -1;
|
||||
|
||||
if (mesh_.isInternalFace(facei))
|
||||
{
|
||||
@ -161,7 +161,7 @@ void Foam::faceCollapser::filterFace
|
||||
}
|
||||
else
|
||||
{
|
||||
patchI = mesh_.boundaryMesh().whichPatch(facei);
|
||||
patchi = mesh_.boundaryMesh().whichPatch(facei);
|
||||
}
|
||||
|
||||
// Get current zone info
|
||||
@ -185,7 +185,7 @@ void Foam::faceCollapser::filterFace
|
||||
mesh_.faceOwner()[facei], // owner
|
||||
nei, // neighbour
|
||||
false, // face flip
|
||||
patchI, // patch for face
|
||||
patchi, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -129,7 +129,7 @@ class hexRef8
|
||||
(
|
||||
polyTopoChange& meshMod,
|
||||
const label meshFacei,
|
||||
const label meshPointI,
|
||||
const label meshPointi,
|
||||
const face& newFace,
|
||||
const label own,
|
||||
const label nei
|
||||
@ -155,17 +155,17 @@ class hexRef8
|
||||
const labelListList& cellAddedCells,
|
||||
const label celli,
|
||||
const label facei,
|
||||
const label pointI
|
||||
const label pointi
|
||||
) const;
|
||||
|
||||
//- Get new owner and neighbour (in unspecified order) of pointI
|
||||
//- Get new owner and neighbour (in unspecified order) of pointi
|
||||
// on facei.
|
||||
void getFaceNeighbours
|
||||
(
|
||||
const labelListList& cellAnchorPoints,
|
||||
const labelListList& cellAddedCells,
|
||||
const label facei,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
|
||||
label& own,
|
||||
label& nei
|
||||
@ -235,9 +235,9 @@ class hexRef8
|
||||
const label celli,
|
||||
const label facei,
|
||||
const bool faceOrder,
|
||||
const label midPointI,
|
||||
const label anchorPointI,
|
||||
const label faceMidPointI,
|
||||
const label midPointi,
|
||||
const label anchorPointi,
|
||||
const label faceMidPointi,
|
||||
|
||||
Map<edge>& midPointToAnchors,
|
||||
Map<edge>& midPointToFaceMids,
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -121,7 +121,7 @@ public:
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -131,7 +131,7 @@ public:
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -149,7 +149,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const pointEdgeCollapse& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -162,7 +162,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgeCollapse& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -184,7 +184,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgeCollapse& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -170,7 +170,7 @@ template<class TrackingData>
|
||||
inline void Foam::pointEdgeCollapse::leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -196,7 +196,7 @@ template<class TrackingData>
|
||||
inline void Foam::pointEdgeCollapse::enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -211,7 +211,7 @@ template<class TrackingData>
|
||||
inline bool Foam::pointEdgeCollapse::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const pointEdgeCollapse& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -227,7 +227,7 @@ template<class TrackingData>
|
||||
inline bool Foam::pointEdgeCollapse::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgeCollapse& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -256,7 +256,7 @@ inline bool Foam::pointEdgeCollapse::updateEdge
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgeCollapse& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -931,26 +931,26 @@ void Foam::polyTopoChange::compact
|
||||
label nActivePoints = 0;
|
||||
{
|
||||
labelList localPointMap(points_.size(), -1);
|
||||
label newPointI = 0;
|
||||
label newPointi = 0;
|
||||
|
||||
if (!orderPoints)
|
||||
{
|
||||
nInternalPoints = -1;
|
||||
|
||||
forAll(points_, pointI)
|
||||
forAll(points_, pointi)
|
||||
{
|
||||
if (!pointRemoved(pointI) && !retiredPoints_.found(pointI))
|
||||
if (!pointRemoved(pointi) && !retiredPoints_.found(pointi))
|
||||
{
|
||||
localPointMap[pointI] = newPointI++;
|
||||
localPointMap[pointi] = newPointi++;
|
||||
}
|
||||
}
|
||||
nActivePoints = newPointI;
|
||||
nActivePoints = newPointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(points_, pointI)
|
||||
forAll(points_, pointi)
|
||||
{
|
||||
if (!pointRemoved(pointI) && !retiredPoints_.found(pointI))
|
||||
if (!pointRemoved(pointi) && !retiredPoints_.found(pointi))
|
||||
{
|
||||
nActivePoints++;
|
||||
}
|
||||
@ -971,42 +971,42 @@ void Foam::polyTopoChange::compact
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (localPointMap[pointI] == -1)
|
||||
if (localPointMap[pointi] == -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
pointRemoved(pointI)
|
||||
|| retiredPoints_.found(pointI)
|
||||
pointRemoved(pointi)
|
||||
|| retiredPoints_.found(pointi)
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Removed or retired point " << pointI
|
||||
<< "Removed or retired point " << pointi
|
||||
<< " in face " << f
|
||||
<< " at position " << facei << endl
|
||||
<< "Probably face has not been adapted for"
|
||||
<< " removed points." << abort(FatalError);
|
||||
}
|
||||
localPointMap[pointI] = newPointI++;
|
||||
localPointMap[pointi] = newPointi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
label nBoundaryPoints = newPointI;
|
||||
label nBoundaryPoints = newPointi;
|
||||
nInternalPoints = nActivePoints - nBoundaryPoints;
|
||||
|
||||
// Move the boundary addressing up
|
||||
forAll(localPointMap, pointI)
|
||||
forAll(localPointMap, pointi)
|
||||
{
|
||||
if (localPointMap[pointI] != -1)
|
||||
if (localPointMap[pointi] != -1)
|
||||
{
|
||||
localPointMap[pointI] += nInternalPoints;
|
||||
localPointMap[pointi] += nInternalPoints;
|
||||
}
|
||||
}
|
||||
|
||||
newPointI = 0;
|
||||
newPointi = 0;
|
||||
|
||||
// Mark internal points
|
||||
forAll(faceOwner_, facei)
|
||||
@ -1023,55 +1023,55 @@ void Foam::polyTopoChange::compact
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (localPointMap[pointI] == -1)
|
||||
if (localPointMap[pointi] == -1)
|
||||
{
|
||||
if
|
||||
(
|
||||
pointRemoved(pointI)
|
||||
|| retiredPoints_.found(pointI)
|
||||
pointRemoved(pointi)
|
||||
|| retiredPoints_.found(pointi)
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Removed or retired point " << pointI
|
||||
<< "Removed or retired point " << pointi
|
||||
<< " in face " << f
|
||||
<< " at position " << facei << endl
|
||||
<< "Probably face has not been adapted for"
|
||||
<< " removed points." << abort(FatalError);
|
||||
}
|
||||
localPointMap[pointI] = newPointI++;
|
||||
localPointMap[pointi] = newPointi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (newPointI != nInternalPoints)
|
||||
if (newPointi != nInternalPoints)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem." << abort(FatalError);
|
||||
}
|
||||
newPointI = nActivePoints;
|
||||
newPointi = nActivePoints;
|
||||
}
|
||||
|
||||
forAllConstIter(labelHashSet, retiredPoints_, iter)
|
||||
{
|
||||
localPointMap[iter.key()] = newPointI++;
|
||||
localPointMap[iter.key()] = newPointi++;
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Points : active:" << nActivePoints
|
||||
<< " removed:" << points_.size()-newPointI << endl;
|
||||
<< " removed:" << points_.size()-newPointi << endl;
|
||||
}
|
||||
|
||||
reorder(localPointMap, points_);
|
||||
points_.setCapacity(newPointI);
|
||||
points_.setCapacity(newPointi);
|
||||
|
||||
// Update pointMaps
|
||||
reorder(localPointMap, pointMap_);
|
||||
pointMap_.setCapacity(newPointI);
|
||||
pointMap_.setCapacity(newPointi);
|
||||
renumberReverseMap(localPointMap, reversePointMap_);
|
||||
|
||||
renumberKey(localPointMap, pointZone_);
|
||||
@ -1887,28 +1887,28 @@ void Foam::polyTopoChange::calcFaceZonePointMap
|
||||
|
||||
curFzPointRnb.setSize(newZoneMeshPoints.size());
|
||||
|
||||
forAll(newZoneMeshPoints, pointI)
|
||||
forAll(newZoneMeshPoints, pointi)
|
||||
{
|
||||
if (newZoneMeshPoints[pointI] < pointMap_.size())
|
||||
if (newZoneMeshPoints[pointi] < pointMap_.size())
|
||||
{
|
||||
Map<label>::const_iterator ozmpmIter =
|
||||
oldZoneMeshPointMap.find
|
||||
(
|
||||
pointMap_[newZoneMeshPoints[pointI]]
|
||||
pointMap_[newZoneMeshPoints[pointi]]
|
||||
);
|
||||
|
||||
if (ozmpmIter != oldZoneMeshPointMap.end())
|
||||
{
|
||||
curFzPointRnb[pointI] = ozmpmIter();
|
||||
curFzPointRnb[pointi] = ozmpmIter();
|
||||
}
|
||||
else
|
||||
{
|
||||
curFzPointRnb[pointI] = -1;
|
||||
curFzPointRnb[pointi] = -1;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
curFzPointRnb[pointI] = -1;
|
||||
curFzPointRnb[pointi] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2314,13 +2314,13 @@ void Foam::polyTopoChange::addMesh
|
||||
}
|
||||
|
||||
// Add points in mesh order
|
||||
for (label pointI = 0; pointI < mesh.nPoints(); pointI++)
|
||||
for (label pointi = 0; pointi < mesh.nPoints(); pointi++)
|
||||
{
|
||||
addPoint
|
||||
(
|
||||
points[pointI],
|
||||
pointI,
|
||||
newZoneID[pointI],
|
||||
points[pointi],
|
||||
pointi,
|
||||
newZoneID[pointi],
|
||||
true
|
||||
);
|
||||
}
|
||||
@ -2648,50 +2648,50 @@ Foam::label Foam::polyTopoChange::addPoint
|
||||
const bool inCell
|
||||
)
|
||||
{
|
||||
label pointI = points_.size();
|
||||
label pointi = points_.size();
|
||||
|
||||
points_.append(pt);
|
||||
pointMap_.append(masterPointID);
|
||||
reversePointMap_.append(pointI);
|
||||
reversePointMap_.append(pointi);
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
pointZone_.insert(pointI, zoneID);
|
||||
pointZone_.insert(pointi, zoneID);
|
||||
}
|
||||
|
||||
if (!inCell)
|
||||
{
|
||||
retiredPoints_.insert(pointI);
|
||||
retiredPoints_.insert(pointi);
|
||||
}
|
||||
|
||||
return pointI;
|
||||
return pointi;
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyTopoChange::modifyPoint
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const point& pt,
|
||||
const label newZoneID,
|
||||
const bool inCell
|
||||
)
|
||||
{
|
||||
if (pointI < 0 || pointI >= points_.size())
|
||||
if (pointi < 0 || pointi >= points_.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "illegal point label " << pointI << endl
|
||||
<< "illegal point label " << pointi << endl
|
||||
<< "Valid point labels are 0 .. " << points_.size()-1
|
||||
<< abort(FatalError);
|
||||
}
|
||||
if (pointRemoved(pointI) || pointMap_[pointI] == -1)
|
||||
if (pointRemoved(pointi) || pointMap_[pointi] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "point " << pointI << " already marked for removal"
|
||||
<< "point " << pointi << " already marked for removal"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
points_[pointI] = pt;
|
||||
points_[pointi] = pt;
|
||||
|
||||
Map<label>::iterator pointFnd = pointZone_.find(pointI);
|
||||
Map<label>::iterator pointFnd = pointZone_.find(pointi);
|
||||
|
||||
if (pointFnd != pointZone_.end())
|
||||
{
|
||||
@ -2706,16 +2706,16 @@ void Foam::polyTopoChange::modifyPoint
|
||||
}
|
||||
else if (newZoneID >= 0)
|
||||
{
|
||||
pointZone_.insert(pointI, newZoneID);
|
||||
pointZone_.insert(pointi, newZoneID);
|
||||
}
|
||||
|
||||
if (inCell)
|
||||
{
|
||||
retiredPoints_.erase(pointI);
|
||||
retiredPoints_.erase(pointi);
|
||||
}
|
||||
else
|
||||
{
|
||||
retiredPoints_.insert(pointI);
|
||||
retiredPoints_.insert(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2731,23 +2731,23 @@ void Foam::polyTopoChange::movePoints(const pointField& newPoints)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
forAll(points_, pointI)
|
||||
forAll(points_, pointi)
|
||||
{
|
||||
points_[pointI] = newPoints[pointI];
|
||||
points_[pointi] = newPoints[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::polyTopoChange::removePoint
|
||||
(
|
||||
const label pointI,
|
||||
const label mergePointI
|
||||
const label pointi,
|
||||
const label mergePointi
|
||||
)
|
||||
{
|
||||
if (pointI < 0 || pointI >= points_.size())
|
||||
if (pointi < 0 || pointi >= points_.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "illegal point label " << pointI << endl
|
||||
<< "illegal point label " << pointi << endl
|
||||
<< "Valid point labels are 0 .. " << points_.size()-1
|
||||
<< abort(FatalError);
|
||||
}
|
||||
@ -2755,34 +2755,34 @@ void Foam::polyTopoChange::removePoint
|
||||
if
|
||||
(
|
||||
strict_
|
||||
&& (pointRemoved(pointI) || pointMap_[pointI] == -1)
|
||||
&& (pointRemoved(pointi) || pointMap_[pointi] == -1)
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "point " << pointI << " already marked for removal" << nl
|
||||
<< "Point:" << points_[pointI] << " pointMap:" << pointMap_[pointI]
|
||||
<< "point " << pointi << " already marked for removal" << nl
|
||||
<< "Point:" << points_[pointi] << " pointMap:" << pointMap_[pointi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (pointI == mergePointI)
|
||||
if (pointi == mergePointi)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot remove/merge point " << pointI << " onto itself."
|
||||
<< "Cannot remove/merge point " << pointi << " onto itself."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
points_[pointI] = point::max;
|
||||
pointMap_[pointI] = -1;
|
||||
if (mergePointI >= 0)
|
||||
points_[pointi] = point::max;
|
||||
pointMap_[pointi] = -1;
|
||||
if (mergePointi >= 0)
|
||||
{
|
||||
reversePointMap_[pointI] = -mergePointI-2;
|
||||
reversePointMap_[pointi] = -mergePointi-2;
|
||||
}
|
||||
else
|
||||
{
|
||||
reversePointMap_[pointI] = -1;
|
||||
reversePointMap_[pointi] = -1;
|
||||
}
|
||||
pointZone_.erase(pointI);
|
||||
retiredPoints_.erase(pointI);
|
||||
pointZone_.erase(pointi);
|
||||
retiredPoints_.erase(pointi);
|
||||
}
|
||||
|
||||
|
||||
@ -3107,17 +3107,17 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::polyTopoChange::changeMesh
|
||||
// (appended points (i.e. from nowhere) get value zero)
|
||||
pointField renumberedMeshPoints(newPoints.size());
|
||||
|
||||
forAll(pointMap_, newPointI)
|
||||
forAll(pointMap_, newPointi)
|
||||
{
|
||||
label oldPointI = pointMap_[newPointI];
|
||||
label oldPointi = pointMap_[newPointi];
|
||||
|
||||
if (oldPointI >= 0)
|
||||
if (oldPointi >= 0)
|
||||
{
|
||||
renumberedMeshPoints[newPointI] = mesh.points()[oldPointI];
|
||||
renumberedMeshPoints[newPointi] = mesh.points()[oldPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
renumberedMeshPoints[newPointI] = Zero;
|
||||
renumberedMeshPoints[newPointi] = Zero;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -252,7 +252,7 @@ class polyTopoChange
|
||||
const label facei,
|
||||
const label own,
|
||||
const label nei,
|
||||
const label patchI,
|
||||
const label patchi,
|
||||
const label zoneI
|
||||
) const;
|
||||
|
||||
@ -445,7 +445,7 @@ public:
|
||||
}
|
||||
|
||||
//- Is point removed?
|
||||
inline bool pointRemoved(const label pointI) const;
|
||||
inline bool pointRemoved(const label pointi) const;
|
||||
|
||||
//- Is face removed?
|
||||
inline bool faceRemoved(const label facei) const;
|
||||
|
||||
@ -27,9 +27,9 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
inline bool Foam::polyTopoChange::pointRemoved(const label pointI) const
|
||||
inline bool Foam::polyTopoChange::pointRemoved(const label pointi) const
|
||||
{
|
||||
const point& pt = points_[pointI];
|
||||
const point& pt = points_[pointi];
|
||||
|
||||
return
|
||||
pt.x() > 0.5*vector::max.x()
|
||||
|
||||
@ -459,20 +459,20 @@ void Foam::removeCells::setRefinement
|
||||
// Remove points that are no longer used.
|
||||
// Loop rewritten to not use pointFaces.
|
||||
|
||||
forAll(nFacesUsingPoint, pointI)
|
||||
forAll(nFacesUsingPoint, pointi)
|
||||
{
|
||||
if (nFacesUsingPoint[pointI] == 0)
|
||||
if (nFacesUsingPoint[pointi] == 0)
|
||||
{
|
||||
//Pout<< "Removing unused point " << pointI
|
||||
// << " at:" << mesh_.points()[pointI] << endl;
|
||||
//Pout<< "Removing unused point " << pointi
|
||||
// << " at:" << mesh_.points()[pointi] << endl;
|
||||
|
||||
meshMod.setAction(polyRemovePoint(pointI));
|
||||
meshMod.setAction(polyRemovePoint(pointi));
|
||||
}
|
||||
else if (nFacesUsingPoint[pointI] == 1)
|
||||
else if (nFacesUsingPoint[pointi] == 1)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "point " << pointI << " at coordinate "
|
||||
<< mesh_.points()[pointI]
|
||||
<< "point " << pointi << " at coordinate "
|
||||
<< mesh_.points()[pointi]
|
||||
<< " is only used by 1 face after removing cells."
|
||||
<< " This probably results in an illegal mesh."
|
||||
<< endl;
|
||||
|
||||
@ -183,9 +183,9 @@ Foam::boolList Foam::removeFaces::getFacesAffected
|
||||
// Mark faces affected by removal of points
|
||||
forAllConstIter(labelHashSet, pointsToRemove, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
const labelList& pFaces = mesh_.pointFaces()[pointI];
|
||||
const labelList& pFaces = mesh_.pointFaces()[pointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
@ -350,16 +350,16 @@ void Foam::removeFaces::mergeFaces
|
||||
|
||||
forAll(edgeLoop, i)
|
||||
{
|
||||
label pointI = fp.meshPoints()[edgeLoop[i]];
|
||||
label pointi = fp.meshPoints()[edgeLoop[i]];
|
||||
|
||||
if (pointsToRemove.found(pointI))
|
||||
if (pointsToRemove.found(pointi))
|
||||
{
|
||||
//Pout<< "**Removing point " << pointI << " from "
|
||||
//Pout<< "**Removing point " << pointi << " from "
|
||||
// << edgeLoop << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
faceVerts.append(pointI);
|
||||
faceVerts.append(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1255,9 +1255,9 @@ void Foam::removeFaces::setRefinement
|
||||
|
||||
const labelListList& pointEdges = mesh_.pointEdges();
|
||||
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
nEdgesPerPoint[pointI] = pointEdges[pointI].size();
|
||||
nEdgesPerPoint[pointi] = pointEdges[pointi].size();
|
||||
}
|
||||
|
||||
forAllConstIter(labelHashSet, edgesToRemove, iter)
|
||||
@ -1272,14 +1272,14 @@ void Foam::removeFaces::setRefinement
|
||||
}
|
||||
|
||||
// Check locally (before synchronizing) for strangeness
|
||||
forAll(nEdgesPerPoint, pointI)
|
||||
forAll(nEdgesPerPoint, pointi)
|
||||
{
|
||||
if (nEdgesPerPoint[pointI] == 1)
|
||||
if (nEdgesPerPoint[pointi] == 1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem : point would get 1 edge using it only."
|
||||
<< " pointI:" << pointI
|
||||
<< " coord:" << mesh_.points()[pointI]
|
||||
<< " pointi:" << pointi
|
||||
<< " coord:" << mesh_.points()[pointi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1294,20 +1294,20 @@ void Foam::removeFaces::setRefinement
|
||||
labelMin
|
||||
);
|
||||
|
||||
forAll(nEdgesPerPoint, pointI)
|
||||
forAll(nEdgesPerPoint, pointi)
|
||||
{
|
||||
if (nEdgesPerPoint[pointI] == 0)
|
||||
if (nEdgesPerPoint[pointi] == 0)
|
||||
{
|
||||
pointsToRemove.insert(pointI);
|
||||
pointsToRemove.insert(pointi);
|
||||
}
|
||||
else if (nEdgesPerPoint[pointI] == 1)
|
||||
else if (nEdgesPerPoint[pointi] == 1)
|
||||
{
|
||||
// Already checked before
|
||||
}
|
||||
else if (nEdgesPerPoint[pointI] == 2)
|
||||
else if (nEdgesPerPoint[pointi] == 2)
|
||||
{
|
||||
// Remove point and merge edges.
|
||||
pointsToRemove.insert(pointI);
|
||||
pointsToRemove.insert(pointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1376,9 +1376,9 @@ void Foam::removeFaces::setRefinement
|
||||
// Remove points.
|
||||
forAllConstIter(labelHashSet, pointsToRemove, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
meshMod.setAction(polyRemovePoint(pointI, -1));
|
||||
meshMod.setAction(polyRemovePoint(pointi, -1));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user