mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Further standardization of loop index naming: pointI -> pointi, patchI -> patchi
This commit is contained in:
@ -83,11 +83,11 @@ void Foam::PointEdgeWave<Type, TrackingData>::leaveDomain
|
||||
|
||||
forAll(patchPointLabels, i)
|
||||
{
|
||||
label patchPointI = patchPointLabels[i];
|
||||
label patchPointi = patchPointLabels[i];
|
||||
|
||||
const point& pt = patch.points()[meshPoints[patchPointI]];
|
||||
const point& pt = patch.points()[meshPoints[patchPointi]];
|
||||
|
||||
pointInfo[i].leaveDomain(patch, patchPointI, pt, td_);
|
||||
pointInfo[i].leaveDomain(patch, patchPointi, pt, td_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,11 +105,11 @@ void Foam::PointEdgeWave<Type, TrackingData>::enterDomain
|
||||
|
||||
forAll(patchPointLabels, i)
|
||||
{
|
||||
label patchPointI = patchPointLabels[i];
|
||||
label patchPointi = patchPointLabels[i];
|
||||
|
||||
const point& pt = patch.points()[meshPoints[patchPointI]];
|
||||
const point& pt = patch.points()[meshPoints[patchPointi]];
|
||||
|
||||
pointInfo[i].enterDomain(patch, patchPointI, pt, td_);
|
||||
pointInfo[i].enterDomain(patch, patchPointi, pt, td_);
|
||||
}
|
||||
}
|
||||
|
||||
@ -148,7 +148,7 @@ void Foam::PointEdgeWave<Type, TrackingData>::transform
|
||||
}
|
||||
|
||||
|
||||
// Update info for pointI, at position pt, with information from
|
||||
// Update info for pointi, at position pt, with information from
|
||||
// neighbouring edge.
|
||||
// Updates:
|
||||
// - changedPoint_, changedPoints_, nChangedPoints_,
|
||||
@ -156,7 +156,7 @@ void Foam::PointEdgeWave<Type, TrackingData>::transform
|
||||
template<class Type, class TrackingData>
|
||||
bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label neighbourEdgeI,
|
||||
const Type& neighbourInfo,
|
||||
Type& pointInfo
|
||||
@ -170,7 +170,7 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
pointInfo.updatePoint
|
||||
(
|
||||
mesh_,
|
||||
pointI,
|
||||
pointi,
|
||||
neighbourEdgeI,
|
||||
neighbourInfo,
|
||||
propagationTol_,
|
||||
@ -179,10 +179,10 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
|
||||
if (propagate)
|
||||
{
|
||||
if (!changedPoint_[pointI])
|
||||
if (!changedPoint_[pointi])
|
||||
{
|
||||
changedPoint_[pointI] = true;
|
||||
changedPoints_[nChangedPoints_++] = pointI;
|
||||
changedPoint_[pointi] = true;
|
||||
changedPoints_[nChangedPoints_++] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -195,7 +195,7 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
}
|
||||
|
||||
|
||||
// Update info for pointI, at position pt, with information from
|
||||
// Update info for pointi, at position pt, with information from
|
||||
// same point.
|
||||
// Updates:
|
||||
// - changedPoint_, changedPoints_, nChangedPoints_,
|
||||
@ -203,7 +203,7 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
template<class Type, class TrackingData>
|
||||
bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const Type& neighbourInfo,
|
||||
Type& pointInfo
|
||||
)
|
||||
@ -216,7 +216,7 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
pointInfo.updatePoint
|
||||
(
|
||||
mesh_,
|
||||
pointI,
|
||||
pointi,
|
||||
neighbourInfo,
|
||||
propagationTol_,
|
||||
td_
|
||||
@ -224,10 +224,10 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updatePoint
|
||||
|
||||
if (propagate)
|
||||
{
|
||||
if (!changedPoint_[pointI])
|
||||
if (!changedPoint_[pointi])
|
||||
{
|
||||
changedPoint_[pointI] = true;
|
||||
changedPoints_[nChangedPoints_++] = pointI;
|
||||
changedPoint_[pointi] = true;
|
||||
changedPoints_[nChangedPoints_++] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -249,7 +249,7 @@ template<class Type, class TrackingData>
|
||||
bool Foam::PointEdgeWave<Type, TrackingData>::updateEdge
|
||||
(
|
||||
const label edgeI,
|
||||
const label neighbourPointI,
|
||||
const label neighbourPointi,
|
||||
const Type& neighbourInfo,
|
||||
Type& edgeInfo
|
||||
)
|
||||
@ -263,7 +263,7 @@ bool Foam::PointEdgeWave<Type, TrackingData>::updateEdge
|
||||
(
|
||||
mesh_,
|
||||
edgeI,
|
||||
neighbourPointI,
|
||||
neighbourPointi,
|
||||
neighbourInfo,
|
||||
propagationTol_,
|
||||
td_
|
||||
@ -332,14 +332,14 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleProcPatches()
|
||||
|
||||
// Get all changed points in reverse order
|
||||
const labelList& neighbPoints = procPatch.neighbPoints();
|
||||
forAll(neighbPoints, thisPointI)
|
||||
forAll(neighbPoints, thisPointi)
|
||||
{
|
||||
label meshPointI = procPatch.meshPoints()[thisPointI];
|
||||
if (changedPoint_[meshPointI])
|
||||
label meshPointi = procPatch.meshPoints()[thisPointi];
|
||||
if (changedPoint_[meshPointi])
|
||||
{
|
||||
patchInfo.append(allPointInfo_[meshPointI]);
|
||||
thisPoints.append(thisPointI);
|
||||
nbrPoints.append(neighbPoints[thisPointI]);
|
||||
patchInfo.append(allPointInfo_[meshPointi]);
|
||||
thisPoints.append(thisPointi);
|
||||
nbrPoints.append(neighbPoints[thisPointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -398,15 +398,15 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleProcPatches()
|
||||
const labelList& meshPoints = procPatch.meshPoints();
|
||||
forAll(patchInfo, i)
|
||||
{
|
||||
label meshPointI = meshPoints[patchPoints[i]];
|
||||
label meshPointi = meshPoints[patchPoints[i]];
|
||||
|
||||
if (!allPointInfo_[meshPointI].equal(patchInfo[i], td_))
|
||||
if (!allPointInfo_[meshPointi].equal(patchInfo[i], td_))
|
||||
{
|
||||
updatePoint
|
||||
(
|
||||
meshPointI,
|
||||
meshPointi,
|
||||
patchInfo[i],
|
||||
allPointInfo_[meshPointI]
|
||||
allPointInfo_[meshPointi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -452,15 +452,15 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
|
||||
|
||||
forAll(pairs, pairI)
|
||||
{
|
||||
label thisPointI = pairs[pairI][0];
|
||||
label nbrPointI = pairs[pairI][1];
|
||||
label meshPointI = meshPoints[nbrPointI];
|
||||
label thisPointi = pairs[pairI][0];
|
||||
label nbrPointi = pairs[pairI][1];
|
||||
label meshPointi = meshPoints[nbrPointi];
|
||||
|
||||
if (changedPoint_[meshPointI])
|
||||
if (changedPoint_[meshPointi])
|
||||
{
|
||||
nbrInfo.append(allPointInfo_[meshPointI]);
|
||||
nbrPoints.append(nbrPointI);
|
||||
thisPoints.append(thisPointI);
|
||||
nbrInfo.append(allPointInfo_[meshPointi]);
|
||||
nbrPoints.append(nbrPointi);
|
||||
thisPoints.append(thisPointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -491,15 +491,15 @@ void Foam::PointEdgeWave<Type, TrackingData>::handleCyclicPatches()
|
||||
const labelList& meshPoints = cycPatch.meshPoints();
|
||||
forAll(nbrInfo, i)
|
||||
{
|
||||
label meshPointI = meshPoints[thisPoints[i]];
|
||||
label meshPointi = meshPoints[thisPoints[i]];
|
||||
|
||||
if (!allPointInfo_[meshPointI].equal(nbrInfo[i], td_))
|
||||
if (!allPointInfo_[meshPointi].equal(nbrInfo[i], td_))
|
||||
{
|
||||
updatePoint
|
||||
(
|
||||
meshPointI,
|
||||
meshPointi,
|
||||
nbrInfo[i],
|
||||
allPointInfo_[meshPointI]
|
||||
allPointInfo_[meshPointi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -522,9 +522,9 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::handleCollocatedPoints()
|
||||
const labelListList& slaves = gmd.globalPointSlaves();
|
||||
|
||||
List<Type> elems(slavesMap.constructSize());
|
||||
forAll(meshPoints, pointI)
|
||||
forAll(meshPoints, pointi)
|
||||
{
|
||||
elems[pointI] = allPointInfo_[meshPoints[pointI]];
|
||||
elems[pointi] = allPointInfo_[meshPoints[pointi]];
|
||||
}
|
||||
|
||||
// Pull slave data onto master (which might or might not have any
|
||||
@ -534,11 +534,11 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::handleCollocatedPoints()
|
||||
// Combine master data with slave data
|
||||
combineEqOp<Type, TrackingData> cop(td_);
|
||||
|
||||
forAll(slaves, pointI)
|
||||
forAll(slaves, pointi)
|
||||
{
|
||||
Type& elem = elems[pointI];
|
||||
Type& elem = elems[pointi];
|
||||
|
||||
const labelList& slavePoints = slaves[pointI];
|
||||
const labelList& slavePoints = slaves[pointi];
|
||||
|
||||
// Combine master with untransformed slave data
|
||||
forAll(slavePoints, j)
|
||||
@ -557,23 +557,23 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::handleCollocatedPoints()
|
||||
slavesMap.reverseDistribute(elems.size(), elems, false);
|
||||
|
||||
// Extract back onto mesh
|
||||
forAll(meshPoints, pointI)
|
||||
forAll(meshPoints, pointi)
|
||||
{
|
||||
if (elems[pointI].valid(td_))
|
||||
if (elems[pointi].valid(td_))
|
||||
{
|
||||
label meshPointI = meshPoints[pointI];
|
||||
label meshPointi = meshPoints[pointi];
|
||||
|
||||
Type& elem = allPointInfo_[meshPointI];
|
||||
Type& elem = allPointInfo_[meshPointi];
|
||||
|
||||
bool wasValid = elem.valid(td_);
|
||||
|
||||
// Like updatePoint but bypass Type::updatePoint with its tolerance
|
||||
// checking
|
||||
//if (!elem.valid(td_) || !elem.equal(elems[pointI], td_))
|
||||
if (!elem.equal(elems[pointI], td_))
|
||||
//if (!elem.valid(td_) || !elem.equal(elems[pointi], td_))
|
||||
if (!elem.equal(elems[pointi], td_))
|
||||
{
|
||||
nEvals_++;
|
||||
elem = elems[pointI];
|
||||
elem = elems[pointi];
|
||||
|
||||
// See if element now valid
|
||||
if (!wasValid && elem.valid(td_))
|
||||
@ -582,10 +582,10 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::handleCollocatedPoints()
|
||||
}
|
||||
|
||||
// Update database of changed points
|
||||
if (!changedPoint_[meshPointI])
|
||||
if (!changedPoint_[meshPointi])
|
||||
{
|
||||
changedPoint_[meshPointI] = true;
|
||||
changedPoints_[nChangedPoints_++] = meshPointI;
|
||||
changedPoint_[meshPointi] = true;
|
||||
changedPoints_[nChangedPoints_++] = meshPointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -735,27 +735,27 @@ void Foam::PointEdgeWave<Type, TrackingData>::setPointInfo
|
||||
const List<Type>& changedPointsInfo
|
||||
)
|
||||
{
|
||||
forAll(changedPoints, changedPointI)
|
||||
forAll(changedPoints, changedPointi)
|
||||
{
|
||||
label pointI = changedPoints[changedPointI];
|
||||
label pointi = changedPoints[changedPointi];
|
||||
|
||||
bool wasValid = allPointInfo_[pointI].valid(td_);
|
||||
bool wasValid = allPointInfo_[pointi].valid(td_);
|
||||
|
||||
// Copy info for pointI
|
||||
allPointInfo_[pointI] = changedPointsInfo[changedPointI];
|
||||
// Copy info for pointi
|
||||
allPointInfo_[pointi] = changedPointsInfo[changedPointi];
|
||||
|
||||
// Maintain count of unset points
|
||||
if (!wasValid && allPointInfo_[pointI].valid(td_))
|
||||
if (!wasValid && allPointInfo_[pointi].valid(td_))
|
||||
{
|
||||
--nUnvisitedPoints_;
|
||||
}
|
||||
|
||||
// Mark pointI as changed, both on list and on point itself.
|
||||
// Mark pointi as changed, both on list and on point itself.
|
||||
|
||||
if (!changedPoint_[pointI])
|
||||
if (!changedPoint_[pointi])
|
||||
{
|
||||
changedPoint_[pointI] = true;
|
||||
changedPoints_[nChangedPoints_++] = pointI;
|
||||
changedPoint_[pointi] = true;
|
||||
changedPoints_[nChangedPoints_++] = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -848,27 +848,27 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::pointToEdge()
|
||||
|
||||
for
|
||||
(
|
||||
label changedPointI = 0;
|
||||
changedPointI < nChangedPoints_;
|
||||
changedPointI++
|
||||
label changedPointi = 0;
|
||||
changedPointi < nChangedPoints_;
|
||||
changedPointi++
|
||||
)
|
||||
{
|
||||
label pointI = changedPoints_[changedPointI];
|
||||
label pointi = changedPoints_[changedPointi];
|
||||
|
||||
if (!changedPoint_[pointI])
|
||||
if (!changedPoint_[pointi])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Point " << pointI
|
||||
<< "Point " << pointi
|
||||
<< " not marked as having been changed" << nl
|
||||
<< "This might be caused by multiple occurences of the same"
|
||||
<< " seed point." << abort(FatalError);
|
||||
}
|
||||
|
||||
const Type& neighbourWallInfo = allPointInfo_[pointI];
|
||||
const Type& neighbourWallInfo = allPointInfo_[pointi];
|
||||
|
||||
// Evaluate all connected edges
|
||||
|
||||
const labelList& edgeLabels = pointEdges[pointI];
|
||||
const labelList& edgeLabels = pointEdges[pointi];
|
||||
forAll(edgeLabels, edgeLabelI)
|
||||
{
|
||||
label edgeI = edgeLabels[edgeLabelI];
|
||||
@ -880,7 +880,7 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::pointToEdge()
|
||||
updateEdge
|
||||
(
|
||||
edgeI,
|
||||
pointI,
|
||||
pointi,
|
||||
neighbourWallInfo,
|
||||
currentWallInfo
|
||||
);
|
||||
@ -888,7 +888,7 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::pointToEdge()
|
||||
}
|
||||
|
||||
// Reset status of point
|
||||
changedPoint_[pointI] = false;
|
||||
changedPoint_[pointi] = false;
|
||||
}
|
||||
|
||||
// Handled all changed points by now
|
||||
|
||||
@ -168,7 +168,7 @@ class PointEdgeWave
|
||||
// statistics.
|
||||
bool updatePoint
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label neighbourEdgeI,
|
||||
const Type& neighbourInfo,
|
||||
Type& pointInfo
|
||||
@ -178,7 +178,7 @@ class PointEdgeWave
|
||||
// statistics.
|
||||
bool updatePoint
|
||||
(
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const Type& neighbourInfo,
|
||||
Type& pointInfo
|
||||
);
|
||||
@ -188,7 +188,7 @@ class PointEdgeWave
|
||||
bool updateEdge
|
||||
(
|
||||
const label edgeI,
|
||||
const label neighbourPointI,
|
||||
const label neighbourPointi,
|
||||
const Type& neighbourInfo,
|
||||
Type& edgeInfo
|
||||
);
|
||||
|
||||
@ -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
|
||||
@ -138,7 +138,7 @@ public:
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -148,7 +148,7 @@ public:
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -166,7 +166,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const pointEdgePoint& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -179,7 +179,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgePoint& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -201,7 +201,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgePoint& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -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
|
||||
@ -199,7 +199,7 @@ template<class TrackingData>
|
||||
inline void Foam::pointEdgePoint::leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -225,7 +225,7 @@ template<class TrackingData>
|
||||
inline void Foam::pointEdgePoint::enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -240,14 +240,14 @@ template<class TrackingData>
|
||||
inline bool Foam::pointEdgePoint::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const pointEdgePoint& edgeInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
)
|
||||
{
|
||||
return update(mesh.points()[pointI], edgeInfo, tol, td);
|
||||
return update(mesh.points()[pointi], edgeInfo, tol, td);
|
||||
}
|
||||
|
||||
|
||||
@ -256,13 +256,13 @@ template<class TrackingData>
|
||||
inline bool Foam::pointEdgePoint::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgePoint& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
)
|
||||
{
|
||||
return update(mesh.points()[pointI], newPointInfo, tol, td);
|
||||
return update(mesh.points()[pointi], newPointInfo, tol, td);
|
||||
}
|
||||
|
||||
|
||||
@ -285,7 +285,7 @@ inline bool Foam::pointEdgePoint::updateEdge
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointEdgePoint& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -354,11 +354,11 @@ void Foam::cellClassification::classifyPoints
|
||||
{
|
||||
pointSide.setSize(mesh_.nPoints());
|
||||
|
||||
forAll(mesh_.pointCells(), pointI)
|
||||
forAll(mesh_.pointCells(), pointi)
|
||||
{
|
||||
const labelList& pCells = mesh_.pointCells()[pointI];
|
||||
const labelList& pCells = mesh_.pointCells()[pointi];
|
||||
|
||||
pointSide[pointI] = UNSET;
|
||||
pointSide[pointi] = UNSET;
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
@ -366,26 +366,26 @@ void Foam::cellClassification::classifyPoints
|
||||
|
||||
if (type == meshType)
|
||||
{
|
||||
if (pointSide[pointI] == UNSET)
|
||||
if (pointSide[pointi] == UNSET)
|
||||
{
|
||||
pointSide[pointI] = MESH;
|
||||
pointSide[pointi] = MESH;
|
||||
}
|
||||
else if (pointSide[pointI] == NONMESH)
|
||||
else if (pointSide[pointi] == NONMESH)
|
||||
{
|
||||
pointSide[pointI] = MIXED;
|
||||
pointSide[pointi] = MIXED;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pointSide[pointI] == UNSET)
|
||||
if (pointSide[pointi] == UNSET)
|
||||
{
|
||||
pointSide[pointI] = NONMESH;
|
||||
pointSide[pointi] = NONMESH;
|
||||
}
|
||||
else if (pointSide[pointI] == MESH)
|
||||
else if (pointSide[pointi] == MESH)
|
||||
{
|
||||
pointSide[pointI] = MIXED;
|
||||
pointSide[pointi] = MIXED;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -568,12 +568,12 @@ Foam::label Foam::cellClassification::trimCutCells
|
||||
classifyPoints(meshType, newCellType, pointSide);
|
||||
|
||||
// Grow layer of outside cells
|
||||
forAll(pointSide, pointI)
|
||||
forAll(pointSide, pointi)
|
||||
{
|
||||
if (pointSide[pointI] == MIXED)
|
||||
if (pointSide[pointi] == MIXED)
|
||||
{
|
||||
// Make cut
|
||||
const labelList& pCells = mesh_.pointCells()[pointI];
|
||||
const labelList& pCells = mesh_.pointCells()[pointi];
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
@ -626,9 +626,9 @@ Foam::label Foam::cellClassification::growSurface
|
||||
|
||||
// Mark points used by meshType cells
|
||||
|
||||
forAll(mesh_.pointCells(), pointI)
|
||||
forAll(mesh_.pointCells(), pointi)
|
||||
{
|
||||
const labelList& myCells = mesh_.pointCells()[pointI];
|
||||
const labelList& myCells = mesh_.pointCells()[pointi];
|
||||
|
||||
// Check if one of cells has meshType
|
||||
forAll(myCells, myCelli)
|
||||
@ -637,7 +637,7 @@ Foam::label Foam::cellClassification::growSurface
|
||||
|
||||
if (type == meshType)
|
||||
{
|
||||
hasMeshType[pointI] = true;
|
||||
hasMeshType[pointi] = true;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -648,11 +648,11 @@ Foam::label Foam::cellClassification::growSurface
|
||||
|
||||
label nChanged = 0;
|
||||
|
||||
forAll(hasMeshType, pointI)
|
||||
forAll(hasMeshType, pointi)
|
||||
{
|
||||
if (hasMeshType[pointI])
|
||||
if (hasMeshType[pointi])
|
||||
{
|
||||
const labelList& myCells = mesh_.pointCells()[pointI];
|
||||
const labelList& myCells = mesh_.pointCells()[pointi];
|
||||
|
||||
forAll(myCells, myCelli)
|
||||
{
|
||||
@ -693,11 +693,11 @@ Foam::label Foam::cellClassification::fillHangingCells
|
||||
// Check all cells using mixed point type for whether they use mixed
|
||||
// points only. Note: could probably speed this up by counting number
|
||||
// of mixed verts per face and mixed faces per cell or something?
|
||||
forAll(pointSide, pointI)
|
||||
forAll(pointSide, pointi)
|
||||
{
|
||||
if (pointSide[pointI] == MIXED)
|
||||
if (pointSide[pointi] == MIXED)
|
||||
{
|
||||
const labelList& pCells = mesh_.pointCells()[pointI];
|
||||
const labelList& pCells = mesh_.pointCells()[pointi];
|
||||
|
||||
forAll(pCells, i)
|
||||
{
|
||||
@ -832,9 +832,9 @@ Foam::label Foam::cellClassification::fillRegionPoints
|
||||
forAllConstIter(labelHashSet, nonManifoldPoints, iter)
|
||||
{
|
||||
// Find a face on fp using point and remove it.
|
||||
const label patchPointI = meshPointMap[iter.key()];
|
||||
const label patchPointi = meshPointMap[iter.key()];
|
||||
|
||||
const labelList& pFaces = fp.pointFaces()[patchPointI];
|
||||
const labelList& pFaces = fp.pointFaces()[patchPointi];
|
||||
|
||||
// Remove any face using conflicting point. Does first face which
|
||||
// has not yet been done. Could be more intelligent and decide which
|
||||
|
||||
@ -145,9 +145,9 @@ Foam::label Foam::cellDistFuncs::getPointNeighbours
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
const labelList& pointNbs = patch.pointFaces()[pointI];
|
||||
const labelList& pointNbs = patch.pointFaces()[pointi];
|
||||
|
||||
forAll(pointNbs, nbI)
|
||||
{
|
||||
@ -344,9 +344,9 @@ void Foam::cellDistFuncs::correctBoundaryPointCells
|
||||
const labelList& meshPoints = patch.meshPoints();
|
||||
const labelListList& pointFaces = patch.pointFaces();
|
||||
|
||||
forAll(meshPoints, meshPointI)
|
||||
forAll(meshPoints, meshPointi)
|
||||
{
|
||||
label vertI = meshPoints[meshPointI];
|
||||
label vertI = meshPoints[meshPointi];
|
||||
|
||||
const labelList& neighbours = mesh().pointCells(vertI);
|
||||
|
||||
@ -356,7 +356,7 @@ void Foam::cellDistFuncs::correctBoundaryPointCells
|
||||
|
||||
if (!nearestFace.found(celli))
|
||||
{
|
||||
const labelList& wallFaces = pointFaces[meshPointI];
|
||||
const labelList& wallFaces = pointFaces[meshPointi];
|
||||
|
||||
label minFacei = -1;
|
||||
|
||||
|
||||
@ -104,8 +104,8 @@ bool Foam::treeDataPoint::overlaps
|
||||
const treeBoundBox& cubeBb
|
||||
) const
|
||||
{
|
||||
label pointI = (useSubset_ ? pointLabels_[index] : index);
|
||||
return cubeBb.contains(points_[pointI]);
|
||||
label pointi = (useSubset_ ? pointLabels_[index] : index);
|
||||
return cubeBb.contains(points_[pointi]);
|
||||
}
|
||||
|
||||
|
||||
@ -116,9 +116,9 @@ bool Foam::treeDataPoint::overlaps
|
||||
const scalar radiusSqr
|
||||
) const
|
||||
{
|
||||
label pointI = (useSubset_ ? pointLabels_[index] : index);
|
||||
label pointi = (useSubset_ ? pointLabels_[index] : index);
|
||||
|
||||
if (magSqr(points_[pointI] - centre) <= radiusSqr)
|
||||
if (magSqr(points_[pointi] - centre) <= radiusSqr)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@ -142,14 +142,14 @@ void Foam::treeDataPoint::findNearestOp::operator()
|
||||
forAll(indices, i)
|
||||
{
|
||||
const label index = indices[i];
|
||||
label pointI =
|
||||
label pointi =
|
||||
(
|
||||
shape.useSubset()
|
||||
? shape.pointLabels()[index]
|
||||
: index
|
||||
);
|
||||
|
||||
const point& pt = shape.points()[pointI];
|
||||
const point& pt = shape.points()[pointi];
|
||||
|
||||
scalar distSqr = magSqr(pt - sample);
|
||||
|
||||
@ -186,14 +186,14 @@ void Foam::treeDataPoint::findNearestOp::operator()
|
||||
forAll(indices, i)
|
||||
{
|
||||
const label index = indices[i];
|
||||
label pointI =
|
||||
label pointi =
|
||||
(
|
||||
shape.useSubset()
|
||||
? shape.pointLabels()[index]
|
||||
: index
|
||||
);
|
||||
|
||||
const point& shapePt = shape.points()[pointI];
|
||||
const point& shapePt = shape.points()[pointi];
|
||||
|
||||
if (tightest.contains(shapePt))
|
||||
{
|
||||
|
||||
@ -53,14 +53,14 @@ bool Foam::meshSearch::findNearer
|
||||
{
|
||||
bool nearer = false;
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
scalar distSqr = magSqr(points[pointI] - sample);
|
||||
scalar distSqr = magSqr(points[pointi] - sample);
|
||||
|
||||
if (distSqr < nearestDistSqr)
|
||||
{
|
||||
nearestDistSqr = distSqr;
|
||||
nearestI = pointI;
|
||||
nearestI = pointi;
|
||||
nearer = true;
|
||||
}
|
||||
}
|
||||
@ -82,14 +82,14 @@ bool Foam::meshSearch::findNearer
|
||||
|
||||
forAll(indices, i)
|
||||
{
|
||||
label pointI = indices[i];
|
||||
label pointi = indices[i];
|
||||
|
||||
scalar distSqr = magSqr(points[pointI] - sample);
|
||||
scalar distSqr = magSqr(points[pointi] - sample);
|
||||
|
||||
if (distSqr < nearestDistSqr)
|
||||
{
|
||||
nearestDistSqr = distSqr;
|
||||
nearestI = pointI;
|
||||
nearestI = pointi;
|
||||
nearer = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,12 +74,12 @@ bool Foam::meshStructure::isStructuredCell
|
||||
label nLayerPlus1 = 0;
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
if (pointLayer_[pointI] == layerI)
|
||||
label pointi = f[fp];
|
||||
if (pointLayer_[pointi] == layerI)
|
||||
{
|
||||
nLayer++;
|
||||
}
|
||||
else if (pointLayer_[pointI] == layerI+1)
|
||||
else if (pointLayer_[pointi] == layerI+1)
|
||||
{
|
||||
nLayerPlus1++;
|
||||
}
|
||||
@ -227,10 +227,10 @@ void Foam::meshStructure::correct
|
||||
// Start of changes
|
||||
labelList patchPoints(pp.nPoints());
|
||||
List<pointTopoDistanceData> patchData(pp.nPoints());
|
||||
forAll(pp.meshPoints(), patchPointI)
|
||||
forAll(pp.meshPoints(), patchPointi)
|
||||
{
|
||||
patchPoints[patchPointI] = pp.meshPoints()[patchPointI];
|
||||
patchData[patchPointI] = pointTopoDistanceData(patchPointI, 0);
|
||||
patchPoints[patchPointi] = pp.meshPoints()[patchPointi];
|
||||
patchData[patchPointi] = pointTopoDistanceData(patchPointi, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -246,10 +246,10 @@ void Foam::meshStructure::correct
|
||||
mesh.globalData().nTotalPoints() // max iterations
|
||||
);
|
||||
|
||||
forAll(pointData, pointI)
|
||||
forAll(pointData, pointi)
|
||||
{
|
||||
pointToPatchPointAddressing_[pointI] = pointData[pointI].data();
|
||||
pointLayer_[pointI] = pointData[pointI].distance();
|
||||
pointToPatchPointAddressing_[pointi] = pointData[pointi].data();
|
||||
pointLayer_[pointi] = pointData[pointi].distance();
|
||||
}
|
||||
|
||||
|
||||
@ -304,15 +304,15 @@ void Foam::meshStructure::correct
|
||||
// See if there is any edge
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label nextPointI = f.nextLabel(fp);
|
||||
label pointi = f[fp];
|
||||
label nextPointi = f.nextLabel(fp);
|
||||
|
||||
EdgeMap<label>::const_iterator fnd = pointsToEdge.find
|
||||
(
|
||||
edge
|
||||
(
|
||||
pointData[pointI].data(),
|
||||
pointData[nextPointI].data()
|
||||
pointData[pointi].data(),
|
||||
pointData[nextPointi].data()
|
||||
)
|
||||
);
|
||||
if (fnd != pointsToEdge.end())
|
||||
|
||||
@ -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
|
||||
@ -116,7 +116,7 @@ public:
|
||||
inline void leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -126,7 +126,7 @@ public:
|
||||
inline void enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& pos,
|
||||
TrackingData& td
|
||||
);
|
||||
@ -144,7 +144,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const pointTopoDistanceData& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -157,7 +157,7 @@ public:
|
||||
inline bool updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointTopoDistanceData& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -179,7 +179,7 @@ public:
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointTopoDistanceData& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -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
|
||||
@ -77,7 +77,7 @@ template<class TrackingData>
|
||||
inline void Foam::pointTopoDistanceData::leaveDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -99,7 +99,7 @@ template<class TrackingData>
|
||||
inline void Foam::pointTopoDistanceData::enterDomain
|
||||
(
|
||||
const polyPatch& patch,
|
||||
const label patchPointI,
|
||||
const label patchPointi,
|
||||
const point& coord,
|
||||
TrackingData& td
|
||||
)
|
||||
@ -111,7 +111,7 @@ template<class TrackingData>
|
||||
inline bool Foam::pointTopoDistanceData::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const label edgeI,
|
||||
const pointTopoDistanceData& edgeInfo,
|
||||
const scalar tol,
|
||||
@ -136,7 +136,7 @@ template<class TrackingData>
|
||||
inline bool Foam::pointTopoDistanceData::updatePoint
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointTopoDistanceData& newPointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
@ -181,7 +181,7 @@ inline bool Foam::pointTopoDistanceData::updateEdge
|
||||
(
|
||||
const polyMesh& mesh,
|
||||
const label edgeI,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const pointTopoDistanceData& pointInfo,
|
||||
const scalar tol,
|
||||
TrackingData& td
|
||||
|
||||
@ -71,19 +71,19 @@ Foam::vectorField Foam::meshTools::calcBoxPointNormals(const primitivePatch& pp)
|
||||
const vectorField& pointNormals = pp.pointNormals();
|
||||
const labelListList& pointFaces = pp.pointFaces();
|
||||
|
||||
forAll(pointFaces, pointI)
|
||||
forAll(pointFaces, pointi)
|
||||
{
|
||||
const labelList& pFaces = pointFaces[pointI];
|
||||
const labelList& pFaces = pointFaces[pointi];
|
||||
|
||||
if (visNormal(pointNormals[pointI], faceNormals, pFaces))
|
||||
if (visNormal(pointNormals[pointi], faceNormals, pFaces))
|
||||
{
|
||||
pn[pointI] = pointNormals[pointI];
|
||||
pn[pointi] = pointNormals[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Average point normal not visible for point:"
|
||||
<< pp.meshPoints()[pointI] << endl;
|
||||
<< pp.meshPoints()[pointi] << endl;
|
||||
|
||||
label visOctant =
|
||||
mXmYmZMask
|
||||
@ -167,16 +167,16 @@ Foam::vectorField Foam::meshTools::calcBoxPointNormals(const primitivePatch& pp)
|
||||
if (visI != -1)
|
||||
{
|
||||
// Take a vector in this octant.
|
||||
pn[pointI] = octantNormal[visI];
|
||||
pn[pointi] = octantNormal[visI];
|
||||
}
|
||||
else
|
||||
{
|
||||
pn[pointI] = Zero;
|
||||
pn[pointi] = Zero;
|
||||
|
||||
WarningInFunction
|
||||
<< "No visible octant for point:" << pp.meshPoints()[pointI]
|
||||
<< " cooord:" << pp.points()[pp.meshPoints()[pointI]] << nl
|
||||
<< "Normal set to " << pn[pointI] << endl;
|
||||
<< "No visible octant for point:" << pp.meshPoints()[pointi]
|
||||
<< " cooord:" << pp.points()[pp.meshPoints()[pointi]] << nl
|
||||
<< "Normal set to " << pn[pointi] << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -183,15 +183,15 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
||||
{
|
||||
const edge& curEdge = singleEdges[edgeI];
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
forAll(cellPoints, pointi)
|
||||
{
|
||||
if
|
||||
(
|
||||
cellPoints[pointI] == curEdge.start()
|
||||
|| cellPoints[pointI] == curEdge.end()
|
||||
cellPoints[pointi] == curEdge.start()
|
||||
|| cellPoints[pointi] == curEdge.end()
|
||||
)
|
||||
{
|
||||
pointUsage[pointI]++;
|
||||
pointUsage[pointi]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -209,18 +209,18 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
||||
label newEdgeEnd = singleEdges[edgeI].end();
|
||||
|
||||
// check that the edge has not got all ends blocked
|
||||
forAll(cellPoints, pointI)
|
||||
forAll(cellPoints, pointi)
|
||||
{
|
||||
if (cellPoints[pointI] == newEdgeStart)
|
||||
if (cellPoints[pointi] == newEdgeStart)
|
||||
{
|
||||
if (pointUsage[pointI] > 2)
|
||||
if (pointUsage[pointi] > 2)
|
||||
{
|
||||
blockedHead = true;
|
||||
}
|
||||
}
|
||||
else if (cellPoints[pointI] == newEdgeEnd)
|
||||
else if (cellPoints[pointi] == newEdgeEnd)
|
||||
{
|
||||
if (pointUsage[pointI] > 2)
|
||||
if (pointUsage[pointi] > 2)
|
||||
{
|
||||
blockedTail = true;
|
||||
}
|
||||
@ -266,11 +266,11 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
||||
#endif
|
||||
|
||||
// Check if head or tail are blocked
|
||||
forAll(cellPoints, pointI)
|
||||
forAll(cellPoints, pointi)
|
||||
{
|
||||
if (cellPoints[pointI] == newEdgeStart)
|
||||
if (cellPoints[pointi] == newEdgeStart)
|
||||
{
|
||||
if (pointUsage[pointI] > 2)
|
||||
if (pointUsage[pointi] > 2)
|
||||
{
|
||||
#ifdef DEBUG_CHAIN
|
||||
Info<< "start head blocked" << endl;
|
||||
@ -279,9 +279,9 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
||||
blockHead = true;
|
||||
}
|
||||
}
|
||||
else if (cellPoints[pointI] == newEdgeEnd)
|
||||
else if (cellPoints[pointi] == newEdgeEnd)
|
||||
{
|
||||
if (pointUsage[pointI] > 2)
|
||||
if (pointUsage[pointi] > 2)
|
||||
{
|
||||
#ifdef DEBUG_CHAIN
|
||||
Info<< "start tail blocked" << endl;
|
||||
@ -361,11 +361,11 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
||||
<< " curEdgeEnd: " << curEdgeEnd << endl;
|
||||
#endif
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
forAll(cellPoints, pointi)
|
||||
{
|
||||
if (cellPoints[pointI] == curEdgeStart)
|
||||
if (cellPoints[pointi] == curEdgeStart)
|
||||
{
|
||||
if (pointUsage[pointI] > 2)
|
||||
if (pointUsage[pointi] > 2)
|
||||
{
|
||||
#ifdef DEBUG_CHAIN
|
||||
Info<< "head blocked" << endl;
|
||||
@ -374,9 +374,9 @@ bool Foam::polyMeshZipUpCells(polyMesh& mesh)
|
||||
blockHead = true;
|
||||
}
|
||||
}
|
||||
else if (cellPoints[pointI] == curEdgeEnd)
|
||||
else if (cellPoints[pointi] == curEdgeEnd)
|
||||
{
|
||||
if (pointUsage[pointI] > 2)
|
||||
if (pointUsage[pointi] > 2)
|
||||
{
|
||||
#ifdef DEBUG_CHAIN
|
||||
Info<< "tail blocked" << endl;
|
||||
|
||||
@ -135,23 +135,23 @@ void Foam::localPointRegion::countPointRegions
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
// Even points which were not candidates for splitting might
|
||||
// be on multiple baffles that are being split so check.
|
||||
|
||||
if (candidatePoint[pointI])
|
||||
if (candidatePoint[pointi])
|
||||
{
|
||||
label region = minRegion[facei][fp];
|
||||
|
||||
if (minPointRegion[pointI] == -1)
|
||||
if (minPointRegion[pointi] == -1)
|
||||
{
|
||||
minPointRegion[pointI] = region;
|
||||
minPointRegion[pointi] = region;
|
||||
}
|
||||
else if (minPointRegion[pointI] != region)
|
||||
else if (minPointRegion[pointi] != region)
|
||||
{
|
||||
// Multiple regions for this point. Add.
|
||||
Map<label>::iterator iter = meshPointMap_.find(pointI);
|
||||
Map<label>::iterator iter = meshPointMap_.find(pointi);
|
||||
if (iter != meshPointMap_.end())
|
||||
{
|
||||
labelList& regions = pointRegions[iter()];
|
||||
@ -164,10 +164,10 @@ void Foam::localPointRegion::countPointRegions
|
||||
}
|
||||
else
|
||||
{
|
||||
label localPointI = meshPointMap_.size();
|
||||
meshPointMap_.insert(pointI, localPointI);
|
||||
label localPointi = meshPointMap_.size();
|
||||
meshPointMap_.insert(pointi, localPointi);
|
||||
labelList regions(2);
|
||||
regions[0] = minPointRegion[pointI];
|
||||
regions[0] = minPointRegion[pointi];
|
||||
regions[1] = region;
|
||||
pointRegions.append(regions);
|
||||
}
|
||||
@ -360,12 +360,12 @@ void Foam::localPointRegion::calcPointRegions
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
Map<label>::iterator iter = minPointValue.find(pointI);
|
||||
label pointi = f[fp];
|
||||
Map<label>::iterator iter = minPointValue.find(pointi);
|
||||
|
||||
if (iter == minPointValue.end())
|
||||
{
|
||||
minPointValue.insert(pointI, minRegion[facei][fp]);
|
||||
minPointValue.insert(pointi, minRegion[facei][fp]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -657,11 +657,11 @@ void Foam::localPointRegion::updateMesh(const mapPolyMesh& map)
|
||||
|
||||
forAllConstIter(Map<label>, meshPointMap_, iter)
|
||||
{
|
||||
label newPointI = map.reversePointMap()[iter.key()];
|
||||
label newPointi = map.reversePointMap()[iter.key()];
|
||||
|
||||
if (newPointI >= 0)
|
||||
if (newPointi >= 0)
|
||||
{
|
||||
newMap.insert(newPointI, iter());
|
||||
newMap.insert(newPointi, iter());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -519,22 +519,22 @@ void Foam::searchableBox::findLineAll
|
||||
+ vector(ROOTVSMALL,ROOTVSMALL,ROOTVSMALL)
|
||||
);
|
||||
|
||||
forAll(start, pointI)
|
||||
forAll(start, pointi)
|
||||
{
|
||||
// See if any intersection between pt and end
|
||||
pointIndexHit inter = findLine(start[pointI], end[pointI]);
|
||||
pointIndexHit inter = findLine(start[pointi], end[pointi]);
|
||||
|
||||
if (inter.hit())
|
||||
{
|
||||
hits.clear();
|
||||
hits.append(inter);
|
||||
|
||||
point pt = inter.hitPoint() + smallVec[pointI];
|
||||
point pt = inter.hitPoint() + smallVec[pointi];
|
||||
|
||||
while (((pt-start[pointI])&dirVec[pointI]) <= magSqrDirVec[pointI])
|
||||
while (((pt-start[pointi])&dirVec[pointi]) <= magSqrDirVec[pointi])
|
||||
{
|
||||
// See if any intersection between pt and end
|
||||
pointIndexHit inter = findLine(pt, end[pointI]);
|
||||
pointIndexHit inter = findLine(pt, end[pointi]);
|
||||
|
||||
// Check for not hit or hit same face as before (can happen
|
||||
// if vector along surface of face)
|
||||
@ -548,14 +548,14 @@ void Foam::searchableBox::findLineAll
|
||||
}
|
||||
hits.append(inter);
|
||||
|
||||
pt = inter.hitPoint() + smallVec[pointI];
|
||||
pt = inter.hitPoint() + smallVec[pointi];
|
||||
}
|
||||
|
||||
info[pointI].transfer(hits);
|
||||
info[pointi].transfer(hits);
|
||||
}
|
||||
else
|
||||
{
|
||||
info[pointI].clear();
|
||||
info[pointi].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -604,15 +604,15 @@ void Foam::searchableBox::getVolumeType
|
||||
volType.setSize(points.size());
|
||||
volType = volumeType::INSIDE;
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
for (direction dir = 0; dir < vector::nComponents; dir++)
|
||||
{
|
||||
if (pt[dir] < min()[dir] || pt[dir] > max()[dir])
|
||||
{
|
||||
volType[pointI] = volumeType::OUTSIDE;
|
||||
volType[pointi] = volumeType::OUTSIDE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -730,9 +730,9 @@ void Foam::searchableCylinder::getVolumeType
|
||||
volType.setSize(points.size());
|
||||
volType = volumeType::INSIDE;
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
vector v(pt - point1_);
|
||||
|
||||
@ -742,12 +742,12 @@ void Foam::searchableCylinder::getVolumeType
|
||||
if (parallel < 0)
|
||||
{
|
||||
// left of point1 endcap
|
||||
volType[pointI] = volumeType::OUTSIDE;
|
||||
volType[pointi] = volumeType::OUTSIDE;
|
||||
}
|
||||
else if (parallel > magDir_)
|
||||
{
|
||||
// right of point2 endcap
|
||||
volType[pointI] = volumeType::OUTSIDE;
|
||||
volType[pointi] = volumeType::OUTSIDE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -756,11 +756,11 @@ void Foam::searchableCylinder::getVolumeType
|
||||
|
||||
if (mag(v) > radius_)
|
||||
{
|
||||
volType[pointI] = volumeType::OUTSIDE;
|
||||
volType[pointi] = volumeType::OUTSIDE;
|
||||
}
|
||||
else
|
||||
{
|
||||
volType[pointI] = volumeType::INSIDE;
|
||||
volType[pointi] = volumeType::INSIDE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -213,16 +213,16 @@ void Foam::searchablePlane::findLineAll
|
||||
findLine(start, end, nearestInfo);
|
||||
|
||||
info.setSize(start.size());
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (nearestInfo[pointI].hit())
|
||||
if (nearestInfo[pointi].hit())
|
||||
{
|
||||
info[pointI].setSize(1);
|
||||
info[pointI][0] = nearestInfo[pointI];
|
||||
info[pointi].setSize(1);
|
||||
info[pointi][0] = nearestInfo[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
info[pointI].clear();
|
||||
info[pointi].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -391,16 +391,16 @@ void Foam::searchablePlate::findLineAll
|
||||
findLine(start, end, nearestInfo);
|
||||
|
||||
info.setSize(start.size());
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (nearestInfo[pointI].hit())
|
||||
if (nearestInfo[pointi].hit())
|
||||
{
|
||||
info[pointI].setSize(1);
|
||||
info[pointI][0] = nearestInfo[pointI];
|
||||
info[pointi].setSize(1);
|
||||
info[pointi][0] = nearestInfo[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
info[pointI].clear();
|
||||
info[pointi].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -353,17 +353,17 @@ void Foam::searchableSphere::getVolumeType
|
||||
volType.setSize(points.size());
|
||||
volType = volumeType::INSIDE;
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
if (magSqr(pt - centre_) <= sqr(radius_))
|
||||
{
|
||||
volType[pointI] = volumeType::INSIDE;
|
||||
volType[pointi] = volumeType::INSIDE;
|
||||
}
|
||||
else
|
||||
{
|
||||
volType[pointI] = volumeType::OUTSIDE;
|
||||
volType[pointi] = volumeType::OUTSIDE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,9 +78,9 @@ void Foam::searchableSurfaceCollection::findNearest
|
||||
hitInfo
|
||||
);
|
||||
|
||||
forAll(hitInfo, pointI)
|
||||
forAll(hitInfo, pointi)
|
||||
{
|
||||
if (hitInfo[pointI].hit())
|
||||
if (hitInfo[pointi].hit())
|
||||
{
|
||||
// Rework back into global coordinate sys. Multiply then
|
||||
// transform
|
||||
@ -88,24 +88,24 @@ void Foam::searchableSurfaceCollection::findNearest
|
||||
(
|
||||
cmptMultiply
|
||||
(
|
||||
hitInfo[pointI].rawPoint(),
|
||||
hitInfo[pointi].rawPoint(),
|
||||
scale_[surfI]
|
||||
)
|
||||
);
|
||||
|
||||
scalar distSqr = magSqr(globalPt - samples[pointI]);
|
||||
scalar distSqr = magSqr(globalPt - samples[pointi]);
|
||||
|
||||
if (distSqr < minDistSqr[pointI])
|
||||
if (distSqr < minDistSqr[pointi])
|
||||
{
|
||||
minDistSqr[pointI] = distSqr;
|
||||
nearestInfo[pointI].setPoint(globalPt);
|
||||
nearestInfo[pointI].setHit();
|
||||
nearestInfo[pointI].setIndex
|
||||
minDistSqr[pointi] = distSqr;
|
||||
nearestInfo[pointi].setPoint(globalPt);
|
||||
nearestInfo[pointi].setHit();
|
||||
nearestInfo[pointi].setIndex
|
||||
(
|
||||
hitInfo[pointI].index()
|
||||
hitInfo[pointi].index()
|
||||
+ indexOffset_[surfI]
|
||||
);
|
||||
nearestSurf[pointI] = surfI;
|
||||
nearestSurf[pointi] = surfI;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -125,11 +125,11 @@ void Foam::searchableSurfaceCollection::sortHits
|
||||
// Count hits per surface.
|
||||
labelList nHits(subGeom_.size(), 0);
|
||||
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (info[pointI].hit())
|
||||
if (info[pointi].hit())
|
||||
{
|
||||
label index = info[pointI].index();
|
||||
label index = info[pointi].index();
|
||||
label surfI = findLower(indexOffset_, index+1);
|
||||
nHits[surfI]++;
|
||||
}
|
||||
@ -147,11 +147,11 @@ void Foam::searchableSurfaceCollection::sortHits
|
||||
}
|
||||
nHits = 0;
|
||||
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (info[pointI].hit())
|
||||
if (info[pointi].hit())
|
||||
{
|
||||
label index = info[pointI].index();
|
||||
label index = info[pointi].index();
|
||||
label surfI = findLower(indexOffset_, index+1);
|
||||
|
||||
// Store for correct surface and adapt indices back to local
|
||||
@ -159,11 +159,11 @@ void Foam::searchableSurfaceCollection::sortHits
|
||||
label localI = nHits[surfI]++;
|
||||
surfInfo[surfI][localI] = pointIndexHit
|
||||
(
|
||||
info[pointI].hit(),
|
||||
info[pointI].rawPoint(),
|
||||
info[pointi].hit(),
|
||||
info[pointi].rawPoint(),
|
||||
index-indexOffset_[surfI]
|
||||
);
|
||||
infoMap[surfI][localI] = pointI;
|
||||
infoMap[surfI][localI] = pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -486,24 +486,24 @@ void Foam::searchableSurfaceCollection::findLine
|
||||
|
||||
subGeom_[surfI].findLine(e0, e1, hitInfo);
|
||||
|
||||
forAll(hitInfo, pointI)
|
||||
forAll(hitInfo, pointi)
|
||||
{
|
||||
if (hitInfo[pointI].hit())
|
||||
if (hitInfo[pointi].hit())
|
||||
{
|
||||
// Transform back to global coordinate sys.
|
||||
nearest[pointI] = transform_[surfI].globalPosition
|
||||
nearest[pointi] = transform_[surfI].globalPosition
|
||||
(
|
||||
cmptMultiply
|
||||
(
|
||||
hitInfo[pointI].rawPoint(),
|
||||
hitInfo[pointi].rawPoint(),
|
||||
scale_[surfI]
|
||||
)
|
||||
);
|
||||
info[pointI] = hitInfo[pointI];
|
||||
info[pointI].rawPoint() = nearest[pointI];
|
||||
info[pointI].setIndex
|
||||
info[pointi] = hitInfo[pointi];
|
||||
info[pointi].rawPoint() = nearest[pointi];
|
||||
info[pointi].setIndex
|
||||
(
|
||||
hitInfo[pointI].index()
|
||||
hitInfo[pointi].index()
|
||||
+ indexOffset_[surfI]
|
||||
);
|
||||
}
|
||||
@ -514,27 +514,27 @@ void Foam::searchableSurfaceCollection::findLine
|
||||
// Debug check
|
||||
if (false)
|
||||
{
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (info[pointI].hit())
|
||||
if (info[pointi].hit())
|
||||
{
|
||||
vector n(end[pointI] - start[pointI]);
|
||||
vector n(end[pointi] - start[pointi]);
|
||||
scalar magN = mag(n);
|
||||
|
||||
if (magN > SMALL)
|
||||
{
|
||||
n /= mag(n);
|
||||
|
||||
scalar s = ((info[pointI].rawPoint()-start[pointI])&n);
|
||||
scalar s = ((info[pointi].rawPoint()-start[pointi])&n);
|
||||
|
||||
if (s < 0 || s > 1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "point:" << info[pointI]
|
||||
<< "point:" << info[pointi]
|
||||
<< " s:" << s
|
||||
<< " outside vector "
|
||||
<< " start:" << start[pointI]
|
||||
<< " end:" << end[pointI]
|
||||
<< " start:" << start[pointi]
|
||||
<< " end:" << end[pointi]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -568,16 +568,16 @@ void Foam::searchableSurfaceCollection::findLineAll
|
||||
findLine(start, end, nearestInfo);
|
||||
|
||||
info.setSize(start.size());
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (nearestInfo[pointI].hit())
|
||||
if (nearestInfo[pointi].hit())
|
||||
{
|
||||
info[pointI].setSize(1);
|
||||
info[pointI][0] = nearestInfo[pointI];
|
||||
info[pointi].setSize(1);
|
||||
info[pointi][0] = nearestInfo[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
info[pointI].clear();
|
||||
info[pointi].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -349,16 +349,16 @@ void Foam::searchableSurfaceWithGaps::findLineAll
|
||||
findLine(start, end, nearestInfo);
|
||||
|
||||
info.setSize(start.size());
|
||||
forAll(info, pointI)
|
||||
forAll(info, pointi)
|
||||
{
|
||||
if (nearestInfo[pointI].hit())
|
||||
if (nearestInfo[pointi].hit())
|
||||
{
|
||||
info[pointI].setSize(1);
|
||||
info[pointI][0] = nearestInfo[pointI];
|
||||
info[pointi].setSize(1);
|
||||
info[pointi][0] = nearestInfo[pointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
info[pointI].clear();
|
||||
info[pointi].clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -483,19 +483,19 @@ void Foam::searchableSurfacesQueries::findAllIntersections
|
||||
|
||||
// Set hitSurfaces and distance
|
||||
List<scalarList> hitDistSqr(hitInfo.size());
|
||||
forAll(hitInfo, pointI)
|
||||
forAll(hitInfo, pointi)
|
||||
{
|
||||
const List<pointIndexHit>& pHits = hitInfo[pointI];
|
||||
const List<pointIndexHit>& pHits = hitInfo[pointi];
|
||||
|
||||
labelList& pSurfaces = hitSurfaces[pointI];
|
||||
labelList& pSurfaces = hitSurfaces[pointi];
|
||||
pSurfaces.setSize(pHits.size());
|
||||
pSurfaces = 0;
|
||||
|
||||
scalarList& pDistSqr = hitDistSqr[pointI];
|
||||
scalarList& pDistSqr = hitDistSqr[pointi];
|
||||
pDistSqr.setSize(pHits.size());
|
||||
forAll(pHits, i)
|
||||
{
|
||||
pDistSqr[i] = magSqr(pHits[i].hitPoint() - start[pointI]);
|
||||
pDistSqr[i] = magSqr(pHits[i].hitPoint() - start[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -513,18 +513,18 @@ void Foam::searchableSurfacesQueries::findAllIntersections
|
||||
surfHits
|
||||
);
|
||||
|
||||
forAll(surfHits, pointI)
|
||||
forAll(surfHits, pointi)
|
||||
{
|
||||
mergeHits
|
||||
(
|
||||
start[pointI], // Current segment
|
||||
start[pointi], // Current segment
|
||||
|
||||
testI, // Surface and its hits
|
||||
surfHits[pointI],
|
||||
surfHits[pointi],
|
||||
|
||||
hitSurfaces[pointI], // Merge into overall hit info
|
||||
hitInfo[pointI],
|
||||
hitDistSqr[pointI]
|
||||
hitSurfaces[pointi], // Merge into overall hit info
|
||||
hitInfo[pointi],
|
||||
hitDistSqr[pointi]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -568,13 +568,13 @@ void Foam::searchableSurfacesQueries::findNearestIntersection
|
||||
nearestInfo
|
||||
);
|
||||
|
||||
forAll(nearestInfo, pointI)
|
||||
forAll(nearestInfo, pointi)
|
||||
{
|
||||
if (nearestInfo[pointI].hit())
|
||||
if (nearestInfo[pointi].hit())
|
||||
{
|
||||
hit1[pointI] = nearestInfo[pointI];
|
||||
surface1[pointI] = testI;
|
||||
nearest[pointI] = hit1[pointI].hitPoint();
|
||||
hit1[pointi] = nearestInfo[pointi];
|
||||
surface1[pointi] = testI;
|
||||
nearest[pointi] = hit1[pointi].hitPoint();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -589,16 +589,16 @@ void Foam::searchableSurfacesQueries::findNearestIntersection
|
||||
hit2 = hit1;
|
||||
|
||||
// Set current end of segment to test.
|
||||
forAll(nearest, pointI)
|
||||
forAll(nearest, pointi)
|
||||
{
|
||||
if (hit1[pointI].hit())
|
||||
if (hit1[pointi].hit())
|
||||
{
|
||||
nearest[pointI] = hit1[pointI].hitPoint();
|
||||
nearest[pointi] = hit1[pointi].hitPoint();
|
||||
}
|
||||
else
|
||||
{
|
||||
// Disable testing by setting to end.
|
||||
nearest[pointI] = end[pointI];
|
||||
nearest[pointi] = end[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
@ -607,13 +607,13 @@ void Foam::searchableSurfacesQueries::findNearestIntersection
|
||||
// See if any intersection between end and current nearest
|
||||
allSurfaces[surfacesToTest[testI]].findLine(end, nearest, nearestInfo);
|
||||
|
||||
forAll(nearestInfo, pointI)
|
||||
forAll(nearestInfo, pointi)
|
||||
{
|
||||
if (nearestInfo[pointI].hit())
|
||||
if (nearestInfo[pointi].hit())
|
||||
{
|
||||
hit2[pointI] = nearestInfo[pointI];
|
||||
surface2[pointI] = testI;
|
||||
nearest[pointI] = hit2[pointI].hitPoint();
|
||||
hit2[pointi] = nearestInfo[pointi];
|
||||
surface2[pointi] = testI;
|
||||
nearest[pointi] = hit2[pointi].hitPoint();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -650,17 +650,17 @@ void Foam::searchableSurfacesQueries::findNearest
|
||||
);
|
||||
|
||||
// Update minDistSqr and arguments
|
||||
forAll(hitInfo, pointI)
|
||||
forAll(hitInfo, pointi)
|
||||
{
|
||||
if (hitInfo[pointI].hit())
|
||||
if (hitInfo[pointi].hit())
|
||||
{
|
||||
minDistSqr[pointI] = magSqr
|
||||
minDistSqr[pointi] = magSqr
|
||||
(
|
||||
hitInfo[pointI].hitPoint()
|
||||
- samples[pointI]
|
||||
hitInfo[pointi].hitPoint()
|
||||
- samples[pointi]
|
||||
);
|
||||
nearestInfo[pointI] = hitInfo[pointI];
|
||||
nearestSurfaces[pointI] = testI;
|
||||
nearestInfo[pointi] = hitInfo[pointi];
|
||||
nearestSurfaces[pointi] = testI;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -712,17 +712,17 @@ void Foam::searchableSurfacesQueries::findNearest
|
||||
);
|
||||
|
||||
// Update minDistSqr and arguments
|
||||
forAll(hitInfo, pointI)
|
||||
forAll(hitInfo, pointi)
|
||||
{
|
||||
if (hitInfo[pointI].hit())
|
||||
if (hitInfo[pointi].hit())
|
||||
{
|
||||
minDistSqr[pointI] = magSqr
|
||||
minDistSqr[pointi] = magSqr
|
||||
(
|
||||
hitInfo[pointI].hitPoint()
|
||||
- samples[pointI]
|
||||
hitInfo[pointi].hitPoint()
|
||||
- samples[pointi]
|
||||
);
|
||||
nearestInfo[pointI] = hitInfo[pointI];
|
||||
nearestSurfaces[pointI] = testI;
|
||||
nearestInfo[pointi] = hitInfo[pointi];
|
||||
nearestSurfaces[pointi] = testI;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -781,14 +781,14 @@ void Foam::searchableSurfacesQueries::signedDistance
|
||||
// Push back to original
|
||||
forAll(volType, i)
|
||||
{
|
||||
label pointI = surfIndices[i];
|
||||
scalar dist = mag(samples[pointI] - nearestInfo[pointI].hitPoint());
|
||||
label pointi = surfIndices[i];
|
||||
scalar dist = mag(samples[pointi] - nearestInfo[pointi].hitPoint());
|
||||
|
||||
volumeType vT = volType[i];
|
||||
|
||||
if (vT == volumeType::OUTSIDE)
|
||||
{
|
||||
distance[pointI] = dist;
|
||||
distance[pointi] = dist;
|
||||
}
|
||||
else if (vT == volumeType::INSIDE)
|
||||
{
|
||||
@ -800,12 +800,12 @@ void Foam::searchableSurfacesQueries::signedDistance
|
||||
{
|
||||
case volumeType::OUTSIDE:
|
||||
{
|
||||
distance[pointI] = dist;
|
||||
distance[pointi] = dist;
|
||||
break;
|
||||
}
|
||||
case volumeType::INSIDE:
|
||||
{
|
||||
distance[pointI] = -dist;
|
||||
distance[pointi] = -dist;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
||||
@ -151,15 +151,15 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const
|
||||
// To prevent doing work twice per edge only look at edges to higher
|
||||
// point
|
||||
EdgeMap<label> facesPerEdge(100);
|
||||
forAll(pointFaces, pointI)
|
||||
forAll(pointFaces, pointi)
|
||||
{
|
||||
const labelList& pFaces = pointFaces[pointI];
|
||||
const labelList& pFaces = pointFaces[pointi];
|
||||
|
||||
facesPerEdge.clear();
|
||||
forAll(pFaces, i)
|
||||
{
|
||||
const triSurface::FaceType& f = triSurface::operator[](pFaces[i]);
|
||||
label fp = findIndex(f, pointI);
|
||||
label fp = findIndex(f, pointi);
|
||||
|
||||
// Something weird: if I expand the code of addFaceToEdge in both
|
||||
// below instances it gives a segmentation violation on some
|
||||
@ -167,13 +167,13 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const
|
||||
|
||||
|
||||
// Forward edge
|
||||
label nextPointI = f[f.fcIndex(fp)];
|
||||
label nextPointi = f[f.fcIndex(fp)];
|
||||
|
||||
if (nextPointI > pointI)
|
||||
if (nextPointi > pointi)
|
||||
{
|
||||
bool okFace = addFaceToEdge
|
||||
(
|
||||
edge(pointI, nextPointI),
|
||||
edge(pointi, nextPointi),
|
||||
facesPerEdge
|
||||
);
|
||||
|
||||
@ -183,13 +183,13 @@ bool Foam::triSurfaceMesh::isSurfaceClosed() const
|
||||
}
|
||||
}
|
||||
// Reverse edge
|
||||
label prevPointI = f[f.rcIndex(fp)];
|
||||
label prevPointi = f[f.rcIndex(fp)];
|
||||
|
||||
if (prevPointI > pointI)
|
||||
if (prevPointi > pointi)
|
||||
{
|
||||
bool okFace = addFaceToEdge
|
||||
(
|
||||
edge(pointI, prevPointI),
|
||||
edge(pointi, prevPointi),
|
||||
facesPerEdge
|
||||
);
|
||||
|
||||
@ -769,19 +769,19 @@ void Foam::triSurfaceMesh::getVolumeType
|
||||
scalar oldTol = indexedOctree<treeDataTriSurface>::perturbTol();
|
||||
indexedOctree<treeDataTriSurface>::perturbTol() = tolerance();
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
if (!tree().bb().contains(pt))
|
||||
{
|
||||
// Have to calculate directly as outside the octree
|
||||
volType[pointI] = tree().shapes().getVolumeType(tree(), pt);
|
||||
volType[pointi] = tree().shapes().getVolumeType(tree(), pt);
|
||||
}
|
||||
else
|
||||
{
|
||||
// - use cached volume type per each tree node
|
||||
volType[pointI] = tree().getVolumeType(pt);
|
||||
volType[pointi] = tree().getVolumeType(pt);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -53,9 +53,9 @@ Foam::topoSetSource::addToUsageTable Foam::nearestToCell::usage_
|
||||
|
||||
void Foam::nearestToCell::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
forAll(points_, pointI)
|
||||
forAll(points_, pointi)
|
||||
{
|
||||
addOrDelete(set, mesh_.findNearestCell(points_[pointI]), add);
|
||||
addOrDelete(set, mesh_.findNearestCell(points_[pointi]), add);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -75,8 +75,8 @@ void Foam::pointToCell::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
forAllConstIter(pointSet, loadedSet, iter)
|
||||
{
|
||||
const label pointI = iter.key();
|
||||
const labelList& pCells = mesh_.pointCells()[pointI];
|
||||
const label pointi = iter.key();
|
||||
const labelList& pCells = mesh_.pointCells()[pointi];
|
||||
|
||||
forAll(pCells, pCelli)
|
||||
{
|
||||
|
||||
@ -224,11 +224,11 @@ void Foam::regionToCell::shrinkRegions
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
label nChanged = 0;
|
||||
forAll(boundaryPoint, pointI)
|
||||
forAll(boundaryPoint, pointi)
|
||||
{
|
||||
if (boundaryPoint[pointI])
|
||||
if (boundaryPoint[pointi])
|
||||
{
|
||||
const labelList& pCells = mesh_.pointCells(pointI);
|
||||
const labelList& pCells = mesh_.pointCells(pointi);
|
||||
forAll(pCells, i)
|
||||
{
|
||||
label celli = pCells[i];
|
||||
@ -313,11 +313,11 @@ void Foam::regionToCell::erode
|
||||
// Select all cells using these points
|
||||
|
||||
label nChanged = 0;
|
||||
forAll(boundaryPoint, pointI)
|
||||
forAll(boundaryPoint, pointi)
|
||||
{
|
||||
if (boundaryPoint[pointI])
|
||||
if (boundaryPoint[pointi])
|
||||
{
|
||||
const labelList& pCells = mesh_.pointCells(pointI);
|
||||
const labelList& pCells = mesh_.pointCells(pointi);
|
||||
forAll(pCells, i)
|
||||
{
|
||||
label celli = pCells[i];
|
||||
|
||||
@ -66,13 +66,13 @@ Foam::topoSetSource::addToUsageTable Foam::surfaceToCell::usage_
|
||||
Foam::label Foam::surfaceToCell::getNearest
|
||||
(
|
||||
const triSurfaceSearch& querySurf,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const point& pt,
|
||||
const vector& span,
|
||||
Map<label>& cache
|
||||
)
|
||||
{
|
||||
Map<label>::const_iterator iter = cache.find(pointI);
|
||||
Map<label>::const_iterator iter = cache.find(pointi);
|
||||
|
||||
if (iter != cache.end())
|
||||
{
|
||||
@ -87,7 +87,7 @@ Foam::label Foam::surfaceToCell::getNearest
|
||||
label triI = inter.index();
|
||||
|
||||
// Store triangle on point
|
||||
cache.insert(pointI, triI);
|
||||
cache.insert(pointi, triI);
|
||||
|
||||
return triI;
|
||||
}
|
||||
@ -119,14 +119,14 @@ bool Foam::surfaceToCell::differingPointNormals
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
label pointTriI =
|
||||
getNearest
|
||||
(
|
||||
querySurf,
|
||||
pointI,
|
||||
points[pointI],
|
||||
pointi,
|
||||
points[pointi],
|
||||
span,
|
||||
pointToNearest
|
||||
);
|
||||
|
||||
@ -110,11 +110,11 @@ class surfaceToCell
|
||||
|
||||
//- Find index of nearest triangle to point. Returns triangle or -1 if
|
||||
// not found within search span.
|
||||
// Cache result under pointI.
|
||||
// Cache result under pointi.
|
||||
static label getNearest
|
||||
(
|
||||
const triSurfaceSearch& querySurf,
|
||||
const label pointI,
|
||||
const label pointi,
|
||||
const point& pt,
|
||||
const vector& searchSpan,
|
||||
Map<label>& cache
|
||||
|
||||
@ -139,20 +139,20 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const
|
||||
const boundBox& bb = mesh_.bounds();
|
||||
pointField points(bb.points());
|
||||
|
||||
//label minPointI = -1;
|
||||
label maxPointI = -1;
|
||||
forAll(points, pointI)
|
||||
//label minPointi = -1;
|
||||
label maxPointi = -1;
|
||||
forAll(points, pointi)
|
||||
{
|
||||
scalar c = (points[pointI]&n_);
|
||||
scalar c = (points[pointi]&n_);
|
||||
if (c > maxComp)
|
||||
{
|
||||
maxComp = c;
|
||||
maxPointI = pointI;
|
||||
maxPointi = pointi;
|
||||
}
|
||||
else if (c < minComp)
|
||||
{
|
||||
minComp = c;
|
||||
//minPointI = pointI;
|
||||
//minPointi = pointi;
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,7 +164,7 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const
|
||||
if (maxCells != nTotCells)
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Plane " << plane(points[maxPointI], n_)
|
||||
<< "Plane " << plane(points[maxPointi], n_)
|
||||
<< " selects " << maxCells
|
||||
<< " cells instead of all " << nTotCells
|
||||
<< " cells. Results might be wrong." << endl;
|
||||
|
||||
@ -77,8 +77,8 @@ void Foam::pointToFace::combine(topoSet& set, const bool add) const
|
||||
// Add faces with any point in loadedSet
|
||||
forAllConstIter(pointSet, loadedSet, iter)
|
||||
{
|
||||
const label pointI = iter.key();
|
||||
const labelList& pFaces = mesh_.pointFaces()[pointI];
|
||||
const label pointi = iter.key();
|
||||
const labelList& pFaces = mesh_.pointFaces()[pointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
@ -95,8 +95,8 @@ void Foam::pointToFace::combine(topoSet& set, const bool add) const
|
||||
|
||||
forAllConstIter(pointSet, loadedSet, iter)
|
||||
{
|
||||
const label pointI = iter.key();
|
||||
const labelList& pFaces = mesh_.pointFaces()[pointI];
|
||||
const label pointi = iter.key();
|
||||
const labelList& pFaces = mesh_.pointFaces()[pointi];
|
||||
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -56,13 +56,13 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
const pointField& pts = mesh_.points();
|
||||
|
||||
forAll(pts, pointI)
|
||||
forAll(pts, pointi)
|
||||
{
|
||||
forAll(bbs_, i)
|
||||
{
|
||||
if (bbs_[i].contains(pts[pointI]))
|
||||
if (bbs_[i].contains(pts[pointi]))
|
||||
{
|
||||
addOrDelete(set, pointI, add);
|
||||
addOrDelete(set, pointi, add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -55,27 +55,27 @@ void Foam::nearestToPoint::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
// Do linear search since usually just a few points.
|
||||
|
||||
forAll(points_, pointI)
|
||||
forAll(points_, pointi)
|
||||
{
|
||||
const pointField& pts = mesh_.points();
|
||||
|
||||
if (pts.size())
|
||||
{
|
||||
label minPointI = 0;
|
||||
scalar minDistSqr = magSqr(pts[minPointI] - points_[pointI]);
|
||||
label minPointi = 0;
|
||||
scalar minDistSqr = magSqr(pts[minPointi] - points_[pointi]);
|
||||
|
||||
for (label i = 1; i < pts.size(); i++)
|
||||
{
|
||||
scalar distSqr = magSqr(pts[i] - points_[pointI]);
|
||||
scalar distSqr = magSqr(pts[i] - points_[pointi]);
|
||||
|
||||
if (distSqr < minDistSqr)
|
||||
{
|
||||
minDistSqr = distSqr;
|
||||
minPointI = i;
|
||||
minPointi = i;
|
||||
}
|
||||
}
|
||||
|
||||
addOrDelete(set, minPointI, add);
|
||||
addOrDelete(set, minPointi, add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -71,13 +71,13 @@ void Foam::surfaceToPoint::combine(topoSet& set, const bool add) const
|
||||
{
|
||||
boolList pointInside(querySurf.calcInside(mesh_.points()));
|
||||
|
||||
forAll(pointInside, pointI)
|
||||
forAll(pointInside, pointi)
|
||||
{
|
||||
bool isInside = pointInside[pointI];
|
||||
bool isInside = pointInside[pointi];
|
||||
|
||||
if ((isInside && includeInside_) || (!isInside && includeOutside_))
|
||||
{
|
||||
addOrDelete(set, pointI, add);
|
||||
addOrDelete(set, pointi, add);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -89,15 +89,15 @@ void Foam::surfaceToPoint::combine(topoSet& set, const bool add) const
|
||||
// Box dimensions to search in octree.
|
||||
const vector span(nearDist_, nearDist_, nearDist_);
|
||||
|
||||
forAll(meshPoints, pointI)
|
||||
forAll(meshPoints, pointi)
|
||||
{
|
||||
const point& pt = meshPoints[pointI];
|
||||
const point& pt = meshPoints[pointi];
|
||||
|
||||
pointIndexHit inter = querySurf.nearest(pt, span);
|
||||
|
||||
if (inter.hit() && (mag(inter.hitPoint() - pt) < nearDist_))
|
||||
{
|
||||
addOrDelete(set, pointI, add);
|
||||
addOrDelete(set, pointi, add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -125,11 +125,11 @@ void Foam::setToPointZone::applyToSet
|
||||
|
||||
forAllConstIter(pointSet, fSet, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
if (!fzSet.found(pointI))
|
||||
if (!fzSet.found(pointi))
|
||||
{
|
||||
newAddressing.append(pointI);
|
||||
newAddressing.append(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -132,11 +132,11 @@ void pointSet::sync(const polyMesh& mesh)
|
||||
|
||||
labelHashSet newContents(size());
|
||||
|
||||
forAll(contents, pointI)
|
||||
forAll(contents, pointi)
|
||||
{
|
||||
if (contents[pointI])
|
||||
if (contents[pointi])
|
||||
{
|
||||
newContents.insert(pointI);
|
||||
newContents.insert(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -141,9 +141,9 @@ void pointZoneSet::invert(const label maxLen)
|
||||
// Count
|
||||
label n = 0;
|
||||
|
||||
for (label pointI = 0; pointI < maxLen; pointI++)
|
||||
for (label pointi = 0; pointi < maxLen; pointi++)
|
||||
{
|
||||
if (!found(pointI))
|
||||
if (!found(pointi))
|
||||
{
|
||||
n++;
|
||||
}
|
||||
@ -153,11 +153,11 @@ void pointZoneSet::invert(const label maxLen)
|
||||
addressing_.setSize(n);
|
||||
n = 0;
|
||||
|
||||
for (label pointI = 0; pointI < maxLen; pointI++)
|
||||
for (label pointi = 0; pointi < maxLen; pointi++)
|
||||
{
|
||||
if (!found(pointI))
|
||||
if (!found(pointi))
|
||||
{
|
||||
addressing_[n] = pointI;
|
||||
addressing_[n] = pointi;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@ -173,11 +173,11 @@ void pointZoneSet::subset(const topoSet& set)
|
||||
|
||||
forAll(fSet.addressing(), i)
|
||||
{
|
||||
label pointI = fSet.addressing()[i];
|
||||
label pointi = fSet.addressing()[i];
|
||||
|
||||
if (found(pointI))
|
||||
if (found(pointi))
|
||||
{
|
||||
newAddressing.append(pointI);
|
||||
newAddressing.append(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -194,11 +194,11 @@ void pointZoneSet::addSet(const topoSet& set)
|
||||
|
||||
forAll(fSet.addressing(), i)
|
||||
{
|
||||
label pointI = fSet.addressing()[i];
|
||||
label pointi = fSet.addressing()[i];
|
||||
|
||||
if (!found(pointI))
|
||||
if (!found(pointi))
|
||||
{
|
||||
newAddressing.append(pointI);
|
||||
newAddressing.append(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -215,12 +215,12 @@ void pointZoneSet::deleteSet(const topoSet& set)
|
||||
|
||||
forAll(addressing_, i)
|
||||
{
|
||||
label pointI = addressing_[i];
|
||||
label pointi = addressing_[i];
|
||||
|
||||
if (!fSet.found(pointI))
|
||||
if (!fSet.found(pointi))
|
||||
{
|
||||
// Not found in fSet so add
|
||||
newAddressing.append(pointI);
|
||||
newAddressing.append(pointi);
|
||||
}
|
||||
}
|
||||
|
||||
@ -291,11 +291,11 @@ void pointZoneSet::updateMesh(const mapPolyMesh& morphMap)
|
||||
label n = 0;
|
||||
forAll(addressing_, i)
|
||||
{
|
||||
label pointI = addressing_[i];
|
||||
label newPointI = morphMap.reversePointMap()[pointI];
|
||||
if (newPointI >= 0)
|
||||
label pointi = addressing_[i];
|
||||
label newPointi = morphMap.reversePointMap()[pointi];
|
||||
if (newPointi >= 0)
|
||||
{
|
||||
newAddressing[n] = newPointI;
|
||||
newAddressing[n] = newPointi;
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,14 +45,14 @@ License
|
||||
//Foam::scalar Foam::surfaceSets::minEdgeLen
|
||||
//(
|
||||
// const primitiveMesh& mesh,
|
||||
// const label pointI
|
||||
// const label pointi
|
||||
//)
|
||||
//{
|
||||
// const edgeList& edges = mesh.edges();
|
||||
//
|
||||
// const pointField& points = mesh.points();
|
||||
//
|
||||
// const labelList& pEdges = mesh.pointEdges()[pointI];
|
||||
// const labelList& pEdges = mesh.pointEdges()[pointi];
|
||||
//
|
||||
// scalar minLen = GREAT;
|
||||
//
|
||||
@ -131,14 +131,14 @@ License
|
||||
//
|
||||
// forAll(f, fp)
|
||||
// {
|
||||
// label pointI = f[fp];
|
||||
// label pointi = f[fp];
|
||||
//
|
||||
// if (outsidePoints.insert(pointI))
|
||||
// if (outsidePoints.insert(pointi))
|
||||
// {
|
||||
// // Calculate new position for this outside point
|
||||
// tmp<pointField> tnearest =
|
||||
// querySurf.calcNearest(pointField(1, points[pointI]));
|
||||
// newPoints[pointI] = tnearest()[0];
|
||||
// querySurf.calcNearest(pointField(1, points[pointi]));
|
||||
// newPoints[pointi] = tnearest()[0];
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
@ -200,15 +200,15 @@ License
|
||||
//
|
||||
// forAll(candidates, i)
|
||||
// {
|
||||
// label pointI = candidates[i];
|
||||
// label pointi = candidates[i];
|
||||
//
|
||||
// scalar minLen = minEdgeLen(mesh, pointI);
|
||||
// scalar minLen = minEdgeLen(mesh, pointi);
|
||||
//
|
||||
// scalar dist = mag(nearest[i] - points[pointI]);
|
||||
// scalar dist = mag(nearest[i] - points[pointi]);
|
||||
//
|
||||
// if (dist < edgeFactor * minLen)
|
||||
// {
|
||||
// nearPointSet.insert(pointI);
|
||||
// nearPointSet.insert(pointi);
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
@ -308,15 +308,15 @@ Foam::labelHashSet Foam::surfaceSets::getHangingCells
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (pointSide[pointI] == NOTSET)
|
||||
if (pointSide[pointi] == NOTSET)
|
||||
{
|
||||
pointSide[pointI] = INSIDE;
|
||||
pointSide[pointi] = INSIDE;
|
||||
}
|
||||
else if (pointSide[pointI] == OUTSIDE)
|
||||
else if (pointSide[pointi] == OUTSIDE)
|
||||
{
|
||||
pointSide[pointI] = MIXED;
|
||||
pointSide[pointi] = MIXED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -336,15 +336,15 @@ Foam::labelHashSet Foam::surfaceSets::getHangingCells
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label pointI = f[fp];
|
||||
label pointi = f[fp];
|
||||
|
||||
if (pointSide[pointI] == NOTSET)
|
||||
if (pointSide[pointi] == NOTSET)
|
||||
{
|
||||
pointSide[pointI] = OUTSIDE;
|
||||
pointSide[pointi] = OUTSIDE;
|
||||
}
|
||||
else if (pointSide[pointI] == INSIDE)
|
||||
else if (pointSide[pointi] == INSIDE)
|
||||
{
|
||||
pointSide[pointI] = MIXED;
|
||||
pointSide[pointi] = MIXED;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -358,11 +358,11 @@ Foam::labelHashSet Foam::surfaceSets::getHangingCells
|
||||
|
||||
//OFstream mixedStr("mixed.obj");
|
||||
//
|
||||
//forAll(pointSide, pointI)
|
||||
//forAll(pointSide, pointi)
|
||||
//{
|
||||
// if (pointSide[pointI] == MIXED)
|
||||
// if (pointSide[pointi] == MIXED)
|
||||
// {
|
||||
// const point& pt = points[pointI];
|
||||
// const point& pt = points[pointi];
|
||||
//
|
||||
// mixedStr << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z()
|
||||
// << endl;
|
||||
|
||||
@ -79,7 +79,7 @@ class surfaceSets
|
||||
//static scalar minEdgeLen
|
||||
//(
|
||||
// const primitiveMesh& mesh,
|
||||
// const label pointI
|
||||
// const label pointi
|
||||
//);
|
||||
//
|
||||
////- Returns true if cell uses at least one selected point
|
||||
|
||||
@ -582,44 +582,44 @@ Foam::booleanSurface::booleanSurface
|
||||
cutSurf1.nPoints() - cutSurf1.nSurfacePoints()
|
||||
);
|
||||
|
||||
label combinedPointI = 0;
|
||||
label combinedPointi = 0;
|
||||
|
||||
forAll(subSurf1.points(), pointI)
|
||||
forAll(subSurf1.points(), pointi)
|
||||
{
|
||||
// Label in cutSurf
|
||||
label cutSurfPointI = pointMap1[pointI];
|
||||
label cutSurfPointi = pointMap1[pointi];
|
||||
|
||||
if (!cutSurf1.isSurfacePoint(cutSurfPointI))
|
||||
if (!cutSurf1.isSurfacePoint(cutSurfPointi))
|
||||
{
|
||||
// Label in original intersection is equal to the cutSurfPointI
|
||||
// Label in original intersection is equal to the cutSurfPointi
|
||||
|
||||
// Remember label in combinedPoints for intersection point.
|
||||
intersectionLabels[cutSurfPointI] = combinedPointI;
|
||||
intersectionLabels[cutSurfPointi] = combinedPointi;
|
||||
}
|
||||
|
||||
// Copy point
|
||||
combinedPoints[combinedPointI++] = subSurf1.points()[pointI];
|
||||
combinedPoints[combinedPointi++] = subSurf1.points()[pointi];
|
||||
}
|
||||
|
||||
// Append points from subSurf2 (if they are not intersection points)
|
||||
// and construct mapping
|
||||
labelList pointMap(subSurf2.nPoints());
|
||||
|
||||
forAll(subSurf2.points(), pointI)
|
||||
forAll(subSurf2.points(), pointi)
|
||||
{
|
||||
// Label in cutSurf
|
||||
label cutSurfPointI = pointMap2[pointI];
|
||||
label cutSurfPointi = pointMap2[pointi];
|
||||
|
||||
if (!cutSurf2.isSurfacePoint(cutSurfPointI))
|
||||
if (!cutSurf2.isSurfacePoint(cutSurfPointi))
|
||||
{
|
||||
// Lookup its label in combined point list.
|
||||
pointMap[pointI] = intersectionLabels[cutSurfPointI];
|
||||
pointMap[pointi] = intersectionLabels[cutSurfPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
pointMap[pointI] = combinedPointI;
|
||||
pointMap[pointi] = combinedPointi;
|
||||
|
||||
combinedPoints[combinedPointI++] = subSurf2.points()[pointI];
|
||||
combinedPoints[combinedPointi++] = subSurf2.points()[pointi];
|
||||
}
|
||||
}
|
||||
|
||||
@ -813,21 +813,21 @@ Foam::booleanSurface::booleanSurface
|
||||
|
||||
// Copy all points from 1 and non-intersection ones from 2.
|
||||
|
||||
label combinedPointI = 0;
|
||||
label combinedPointi = 0;
|
||||
|
||||
forAll(cutSurf1.points(), pointI)
|
||||
forAll(cutSurf1.points(), pointi)
|
||||
{
|
||||
combinedPoints[combinedPointI++] = cutSurf1.points()[pointI];
|
||||
combinedPoints[combinedPointi++] = cutSurf1.points()[pointi];
|
||||
}
|
||||
|
||||
for
|
||||
(
|
||||
label pointI = 0;
|
||||
pointI < cutSurf2.nSurfacePoints();
|
||||
pointI++
|
||||
label pointi = 0;
|
||||
pointi < cutSurf2.nSurfacePoints();
|
||||
pointi++
|
||||
)
|
||||
{
|
||||
combinedPoints[combinedPointI++] = cutSurf2.points()[pointI];
|
||||
combinedPoints[combinedPointi++] = cutSurf2.points()[pointi];
|
||||
}
|
||||
|
||||
// Point order is now
|
||||
|
||||
@ -47,9 +47,9 @@ void Foam::edgeSurface::writeOBJ
|
||||
Ostream& os
|
||||
)
|
||||
{
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
@ -71,9 +71,9 @@ void Foam::edgeSurface::writeOBJ
|
||||
Ostream& os
|
||||
)
|
||||
{
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
@ -101,9 +101,9 @@ void Foam::edgeSurface::calcPointEdges()
|
||||
pointNEdges[e[1]]++;
|
||||
}
|
||||
|
||||
forAll(pointEdges_, pointI)
|
||||
forAll(pointEdges_, pointi)
|
||||
{
|
||||
pointEdges_[pointI].setSize(pointNEdges[pointI]);
|
||||
pointEdges_[pointi].setSize(pointNEdges[pointi]);
|
||||
}
|
||||
|
||||
pointNEdges = 0;
|
||||
@ -142,20 +142,20 @@ Foam::edgeSurface::edgeSurface
|
||||
// Copy points (surface ones first)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
label pointI = 0;
|
||||
label pointi = 0;
|
||||
|
||||
const pointField& surfPoints = surf.localPoints();
|
||||
|
||||
forAll(surfPoints, i)
|
||||
{
|
||||
points_[pointI++] = surfPoints[i];
|
||||
points_[pointi++] = surfPoints[i];
|
||||
}
|
||||
|
||||
const pointField& cutPoints = inter.cutPoints();
|
||||
|
||||
forAll(cutPoints, i)
|
||||
{
|
||||
points_[pointI++] = cutPoints[i];
|
||||
points_[pointi++] = cutPoints[i];
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -59,9 +59,9 @@ void Foam::intersectedSurface::writeOBJ
|
||||
Ostream& os
|
||||
)
|
||||
{
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
}
|
||||
@ -83,9 +83,9 @@ void Foam::intersectedSurface::writeOBJ
|
||||
Ostream& os
|
||||
)
|
||||
{
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
}
|
||||
@ -119,15 +119,15 @@ void Foam::intersectedSurface::writeLocalOBJ
|
||||
|
||||
forAll(e, i)
|
||||
{
|
||||
label pointI = e[i];
|
||||
label pointi = e[i];
|
||||
|
||||
if (pointMap[pointI] == -1)
|
||||
if (pointMap[pointi] == -1)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
|
||||
pointMap[pointI] = maxVertI++;
|
||||
pointMap[pointi] = maxVertI++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -150,9 +150,9 @@ void Foam::intersectedSurface::writeOBJ
|
||||
Ostream& os
|
||||
)
|
||||
{
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
const point& pt = points[pointI];
|
||||
const point& pt = points[pointi];
|
||||
|
||||
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
}
|
||||
@ -640,7 +640,7 @@ void Foam::intersectedSurface::findNearestVisited
|
||||
const Map<DynamicList<label>>& facePointEdges,
|
||||
const Map<label>& pointVisited,
|
||||
const point& pt,
|
||||
const label excludePointI,
|
||||
const label excludePointi,
|
||||
|
||||
label& minVertI,
|
||||
scalar& minDist
|
||||
@ -651,21 +651,21 @@ void Foam::intersectedSurface::findNearestVisited
|
||||
|
||||
forAllConstIter(Map<label>, pointVisited, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
if (pointI != excludePointI)
|
||||
if (pointi != excludePointi)
|
||||
{
|
||||
label nVisits = iter();
|
||||
|
||||
if (nVisits == 2*facePointEdges[pointI].size())
|
||||
if (nVisits == 2*facePointEdges[pointi].size())
|
||||
{
|
||||
// Fully visited (i.e. both sides of all edges)
|
||||
scalar dist = mag(eSurf.points()[pointI] - pt);
|
||||
scalar dist = mag(eSurf.points()[pointi] - pt);
|
||||
|
||||
if (dist < minDist)
|
||||
{
|
||||
minDist = dist;
|
||||
minVertI = pointI;
|
||||
minVertI = pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -721,9 +721,9 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
OFstream str0("visitedNone.obj");
|
||||
OFstream str1("visitedOnce.obj");
|
||||
OFstream str2("visitedTwice.obj");
|
||||
forAll(eSurf.points(), pointI)
|
||||
forAll(eSurf.points(), pointi)
|
||||
{
|
||||
const point& pt = eSurf.points()[pointI];
|
||||
const point& pt = eSurf.points()[pointi];
|
||||
|
||||
str0 << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
str1 << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl;
|
||||
@ -767,12 +767,12 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
{
|
||||
forAllConstIter(Map<label>, pointVisited, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
label nVisits = iter();
|
||||
|
||||
Pout<< "point:" << pointI << " nVisited:" << nVisits
|
||||
<< " pointEdges:" << facePointEdges[pointI].size() << endl;
|
||||
Pout<< "point:" << pointi << " nVisited:" << nVisits
|
||||
<< " pointEdges:" << facePointEdges[pointi].size() << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -788,9 +788,9 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
|
||||
forAllConstIter(Map<DynamicList<label>>, facePointEdges, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
label nVisits = pointVisited[pointI];
|
||||
label nVisits = pointVisited[pointi];
|
||||
|
||||
const DynamicList<label>& pEdges = iter();
|
||||
|
||||
@ -807,7 +807,7 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
facei,
|
||||
facePointEdges,
|
||||
pointVisited,
|
||||
eSurf.points()[pointI],
|
||||
eSurf.points()[pointi],
|
||||
-1, // Do not exclude vertex
|
||||
nearVertI,
|
||||
nearDist
|
||||
@ -818,7 +818,7 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
{
|
||||
minDist = nearDist;
|
||||
visitedVert0 = nearVertI;
|
||||
unvisitedVert0 = pointI;
|
||||
unvisitedVert0 = pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -833,11 +833,11 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
|
||||
forAllConstIter(Map<DynamicList<label>>, facePointEdges, iter)
|
||||
{
|
||||
label pointI = iter.key();
|
||||
label pointi = iter.key();
|
||||
|
||||
if (pointI != unvisitedVert0)
|
||||
if (pointi != unvisitedVert0)
|
||||
{
|
||||
label nVisits = pointVisited[pointI];
|
||||
label nVisits = pointVisited[pointi];
|
||||
|
||||
const DynamicList<label>& pEdges = iter();
|
||||
|
||||
@ -854,7 +854,7 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
facei,
|
||||
facePointEdges,
|
||||
pointVisited,
|
||||
eSurf.points()[pointI],
|
||||
eSurf.points()[pointi],
|
||||
visitedVert0, // vertex to exclude
|
||||
nearVertI,
|
||||
nearDist
|
||||
@ -865,7 +865,7 @@ Foam::faceList Foam::intersectedSurface::resplitFace
|
||||
{
|
||||
minDist = nearDist;
|
||||
visitedVert1 = nearVertI;
|
||||
unvisitedVert1 = pointI;
|
||||
unvisitedVert1 = pointi;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -284,9 +284,9 @@ public:
|
||||
}
|
||||
|
||||
//- Is point coming from original surface?
|
||||
bool isSurfacePoint(const label pointI) const
|
||||
bool isSurfacePoint(const label pointi) const
|
||||
{
|
||||
return pointI < nSurfacePoints_;
|
||||
return pointi < nSurfacePoints_;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -328,8 +328,8 @@ bool Foam::edgeIntersections::rotatePerturb
|
||||
const edge& e = surf1.edges()[edgeI];
|
||||
|
||||
// Endpoint to modify. Choose either start or end.
|
||||
label pointI = e[rndGen.bit()];
|
||||
//label pointI = e[0];
|
||||
label pointi = e[rndGen.bit()];
|
||||
//label pointi = e[0];
|
||||
|
||||
// Generate random vector slightly larger than tolerance.
|
||||
vector rndVec = rndGen.vector01() - vector(0.5, 0.5, 0.5);
|
||||
@ -347,17 +347,17 @@ bool Foam::edgeIntersections::rotatePerturb
|
||||
// Scale to be moved by tolerance.
|
||||
rndVec *= 0.01*magN;
|
||||
|
||||
Pout<< "rotating: shifting endpoint " << meshPoints[pointI]
|
||||
Pout<< "rotating: shifting endpoint " << meshPoints[pointi]
|
||||
<< " of edge:" << edgeI << " verts:"
|
||||
<< points1[meshPoints[e[0]]] << ' '
|
||||
<< points1[meshPoints[e[1]]]
|
||||
<< " by " << rndVec
|
||||
<< " tol:" << surf1PointTol[pointI] << endl;
|
||||
<< " tol:" << surf1PointTol[pointi] << endl;
|
||||
|
||||
points1[meshPoints[pointI]] += rndVec;
|
||||
points1[meshPoints[pointi]] += rndVec;
|
||||
|
||||
// Mark edges affected by change to point
|
||||
const labelList& pEdges = surf1.pointEdges()[pointI];
|
||||
const labelList& pEdges = surf1.pointEdges()[pointi];
|
||||
|
||||
forAll(pEdges, i)
|
||||
{
|
||||
@ -519,9 +519,9 @@ Foam::scalarField Foam::edgeIntersections::minEdgeLength(const triSurface& surf)
|
||||
|
||||
scalarField minLen(localPoints.size());
|
||||
|
||||
forAll(minLen, pointI)
|
||||
forAll(minLen, pointi)
|
||||
{
|
||||
const labelList& pEdges = pointEdges[pointI];
|
||||
const labelList& pEdges = pointEdges[pointi];
|
||||
|
||||
scalar minDist = GREAT;
|
||||
|
||||
@ -530,7 +530,7 @@ Foam::scalarField Foam::edgeIntersections::minEdgeLength(const triSurface& surf)
|
||||
minDist = min(minDist, edges[pEdges[i]].mag(localPoints));
|
||||
}
|
||||
|
||||
minLen[pointI] = minDist;
|
||||
minLen[pointi] = minDist;
|
||||
}
|
||||
return minLen;
|
||||
}
|
||||
|
||||
@ -573,11 +573,11 @@ void Foam::surfaceIntersection::doCutEdges
|
||||
// Calculate local (to point) tolerance based on min edge length.
|
||||
scalarField surf1PointTol(surf1Pts.size());
|
||||
|
||||
forAll(surf1PointTol, pointI)
|
||||
forAll(surf1PointTol, pointi)
|
||||
{
|
||||
surf1PointTol[pointI] =
|
||||
surf1PointTol[pointi] =
|
||||
intersection::planarTol()
|
||||
* minEdgeLen(surf1, pointI);
|
||||
* minEdgeLen(surf1, pointi);
|
||||
}
|
||||
|
||||
const triSurface& surf2 = querySurf2.surface();
|
||||
@ -959,13 +959,13 @@ Foam::surfaceIntersection::surfaceIntersection
|
||||
|
||||
forAllConstIter(labelPairLookup, facePairToVertex_, iter)
|
||||
{
|
||||
label pointI = iter();
|
||||
label pointi = iter();
|
||||
|
||||
if (!usedPoints.found(pointI))
|
||||
if (!usedPoints.found(pointi))
|
||||
{
|
||||
WarningInFunction
|
||||
<< "Problem: cut point:" << pointI
|
||||
<< " coord:" << cutPoints_[pointI]
|
||||
<< "Problem: cut point:" << pointi
|
||||
<< " coord:" << cutPoints_[pointi]
|
||||
<< " not used by any edge" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ class surfaceIntersection
|
||||
static void transfer(List<DynamicList<T>>&, List<List<T>>&);
|
||||
|
||||
//- Get minimum length of all edges connected to point
|
||||
static scalar minEdgeLen(const triSurface& surf, const label pointI);
|
||||
static scalar minEdgeLen(const triSurface& surf, const label pointi);
|
||||
|
||||
//- Get edge label of edge between face vertices fp and fp+1
|
||||
static label getEdge
|
||||
|
||||
@ -64,10 +64,10 @@ void Foam::surfaceIntersection::writeOBJ
|
||||
Foam::scalar Foam::surfaceIntersection::minEdgeLen
|
||||
(
|
||||
const triSurface& surf,
|
||||
const label pointI
|
||||
const label pointi
|
||||
)
|
||||
{
|
||||
const labelList& pEdges = surf.pointEdges()[pointI];
|
||||
const labelList& pEdges = surf.pointEdges()[pointi];
|
||||
|
||||
scalar minLen = GREAT;
|
||||
|
||||
@ -265,13 +265,13 @@ void Foam::surfaceIntersection::writeIntersectedEdges
|
||||
// Dump all points (surface followed by cutPoints)
|
||||
const pointField& pts = surf.localPoints();
|
||||
|
||||
forAll(pts, pointI)
|
||||
forAll(pts, pointi)
|
||||
{
|
||||
writeOBJ(pts[pointI], os);
|
||||
writeOBJ(pts[pointi], os);
|
||||
}
|
||||
forAll(cutPoints(), cutPointI)
|
||||
forAll(cutPoints(), cutPointi)
|
||||
{
|
||||
writeOBJ(cutPoints()[cutPointI], os);
|
||||
writeOBJ(cutPoints()[cutPointi], os);
|
||||
}
|
||||
|
||||
forAll(edgeCutVerts, edgeI)
|
||||
|
||||
@ -192,9 +192,9 @@ void Foam::surfaceFeatures::calcFeatPoints
|
||||
const edgeList& edges = surf_.edges();
|
||||
const pointField& localPoints = surf_.localPoints();
|
||||
|
||||
forAll(pointEdges, pointI)
|
||||
forAll(pointEdges, pointi)
|
||||
{
|
||||
const labelList& pEdges = pointEdges[pointI];
|
||||
const labelList& pEdges = pointEdges[pointi];
|
||||
|
||||
label nFeatEdges = 0;
|
||||
|
||||
@ -208,7 +208,7 @@ void Foam::surfaceFeatures::calcFeatPoints
|
||||
|
||||
if (nFeatEdges > 2)
|
||||
{
|
||||
featurePoints.append(pointI);
|
||||
featurePoints.append(pointi);
|
||||
}
|
||||
else if (nFeatEdges == 2)
|
||||
{
|
||||
@ -228,7 +228,7 @@ void Foam::surfaceFeatures::calcFeatPoints
|
||||
|
||||
if (mag(edgeVecs[0] & edgeVecs[1]) < minCos)
|
||||
{
|
||||
featurePoints.append(pointI);
|
||||
featurePoints.append(pointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -299,7 +299,7 @@ void Foam::surfaceFeatures::classifyFeatureAngles
|
||||
}
|
||||
|
||||
|
||||
// Returns next feature edge connected to pointI with correct value.
|
||||
// Returns next feature edge connected to pointi with correct value.
|
||||
Foam::label Foam::surfaceFeatures::nextFeatEdge
|
||||
(
|
||||
const List<edgeStatus>& edgeStat,
|
||||
@ -341,7 +341,7 @@ Foam::label Foam::surfaceFeatures::nextFeatEdge
|
||||
|
||||
|
||||
// Finds connected feature edges by walking from prevEdgeI in direction of
|
||||
// prevPointI. Marks feature edges visited in featVisited by assigning them
|
||||
// prevPointi. Marks feature edges visited in featVisited by assigning them
|
||||
// the current feature line number. Returns cumulative length of edges walked.
|
||||
// Works in one of two modes:
|
||||
// - mark : step to edges with featVisited = -1.
|
||||
@ -353,20 +353,20 @@ Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment
|
||||
const bool mark,
|
||||
const List<edgeStatus>& edgeStat,
|
||||
const label startEdgeI,
|
||||
const label startPointI,
|
||||
const label startPointi,
|
||||
const label currentFeatI,
|
||||
labelList& featVisited
|
||||
)
|
||||
{
|
||||
label edgeI = startEdgeI;
|
||||
|
||||
label vertI = startPointI;
|
||||
label vertI = startPointi;
|
||||
|
||||
scalar visitedLength = 0.0;
|
||||
|
||||
label nVisited = 0;
|
||||
|
||||
if (findIndex(featurePoints_, startPointI) >= 0)
|
||||
if (findIndex(featurePoints_, startPointi) >= 0)
|
||||
{
|
||||
// Do not walk across feature points
|
||||
|
||||
@ -430,7 +430,7 @@ Foam::surfaceFeatures::labelScalar Foam::surfaceFeatures::walkSegment
|
||||
{
|
||||
Warning<< "walkSegment : reached iteration limit in walking "
|
||||
<< "feature edges on surface from edge:" << startEdgeI
|
||||
<< " vertex:" << startPointI << nl
|
||||
<< " vertex:" << startPointi << nl
|
||||
<< "Returning with large length" << endl;
|
||||
|
||||
return labelScalar(nVisited, GREAT);
|
||||
@ -897,9 +897,9 @@ void Foam::surfaceFeatures::writeObj(const fileName& prefix) const
|
||||
|
||||
forAll(featurePoints_, i)
|
||||
{
|
||||
label pointI = featurePoints_[i];
|
||||
label pointi = featurePoints_[i];
|
||||
|
||||
meshTools::writeOBJ(pointStr, surf_.localPoints()[pointI]);
|
||||
meshTools::writeOBJ(pointStr, surf_.localPoints()[pointi]);
|
||||
}
|
||||
}
|
||||
|
||||
@ -933,9 +933,9 @@ Foam::Map<Foam::label> Foam::surfaceFeatures::nearestSamples
|
||||
|
||||
forAll(pointLabels, i)
|
||||
{
|
||||
label surfPointI = pointLabels[i];
|
||||
label surfPointi = pointLabels[i];
|
||||
|
||||
const point& surfPt = surfPoints[surfPointI];
|
||||
const point& surfPt = surfPoints[surfPointi];
|
||||
|
||||
pointIndexHit info = ppTree.findNearest
|
||||
(
|
||||
@ -947,7 +947,7 @@ Foam::Map<Foam::label> Foam::surfaceFeatures::nearestSamples
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem for point "
|
||||
<< surfPointI << " in tree " << ppTree.bb()
|
||||
<< surfPointi << " in tree " << ppTree.bb()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -955,7 +955,7 @@ Foam::Map<Foam::label> Foam::surfaceFeatures::nearestSamples
|
||||
|
||||
if (magSqr(samples[sampleI] - surfPt) < maxDistSqr[sampleI])
|
||||
{
|
||||
nearest.insert(sampleI, surfPointI);
|
||||
nearest.insert(sampleI, surfPointi);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -164,7 +164,7 @@ private:
|
||||
const bool mark,
|
||||
const List<edgeStatus>& edgeStat,
|
||||
const label startEdgeI,
|
||||
const label startPointI,
|
||||
const label startPointi,
|
||||
const label currentFeatI,
|
||||
labelList& featVisited
|
||||
);
|
||||
|
||||
@ -55,10 +55,10 @@ bool Foam::triSurfaceSearch::checkUniqueHit
|
||||
{
|
||||
// near point
|
||||
|
||||
const label nearPointI = f[nearLabel];
|
||||
const label nearPointi = f[nearLabel];
|
||||
|
||||
const labelList& pointFaces =
|
||||
surface().pointFaces()[surface().meshPointMap()[nearPointI]];
|
||||
surface().pointFaces()[surface().meshPointMap()[nearPointi]];
|
||||
|
||||
forAll(pointFaces, pI)
|
||||
{
|
||||
@ -394,7 +394,7 @@ void Foam::triSurfaceSearch::findLineAll
|
||||
|
||||
treeDataTriSurface::findAllIntersectOp allIntersectOp(octree, shapeMask);
|
||||
|
||||
forAll(start, pointI)
|
||||
forAll(start, pointi)
|
||||
{
|
||||
hits.clear();
|
||||
shapeMask.clear();
|
||||
@ -404,14 +404,14 @@ void Foam::triSurfaceSearch::findLineAll
|
||||
// See if any intersection between pt and end
|
||||
pointIndexHit inter = octree.findLine
|
||||
(
|
||||
start[pointI],
|
||||
end[pointI],
|
||||
start[pointi],
|
||||
end[pointi],
|
||||
allIntersectOp
|
||||
);
|
||||
|
||||
if (inter.hit())
|
||||
{
|
||||
vector lineVec = end[pointI] - start[pointI];
|
||||
vector lineVec = end[pointi] - start[pointi];
|
||||
lineVec /= mag(lineVec) + VSMALL;
|
||||
|
||||
if
|
||||
@ -435,7 +435,7 @@ void Foam::triSurfaceSearch::findLineAll
|
||||
}
|
||||
}
|
||||
|
||||
info[pointI].transfer(hits);
|
||||
info[pointi].transfer(hits);
|
||||
}
|
||||
|
||||
indexedOctree<treeDataTriSurface>::perturbTol() = oldTol;
|
||||
|
||||
@ -86,13 +86,13 @@ void Foam::triSurfaceTools::calcRefineStatus
|
||||
}
|
||||
|
||||
|
||||
// Split facei along edgeI at position newPointI
|
||||
// Split facei along edgeI at position newPointi
|
||||
void Foam::triSurfaceTools::greenRefine
|
||||
(
|
||||
const triSurface& surf,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const label newPointI,
|
||||
const label newPointi,
|
||||
DynamicList<labelledTri>& newFaces
|
||||
)
|
||||
{
|
||||
@ -113,7 +113,7 @@ void Foam::triSurfaceTools::greenRefine
|
||||
labelledTri
|
||||
(
|
||||
f[fp0],
|
||||
newPointI,
|
||||
newPointi,
|
||||
f[fp2],
|
||||
f.region()
|
||||
)
|
||||
@ -122,7 +122,7 @@ void Foam::triSurfaceTools::greenRefine
|
||||
(
|
||||
labelledTri
|
||||
(
|
||||
newPointI,
|
||||
newPointi,
|
||||
f[fp1],
|
||||
f[fp2],
|
||||
f.region()
|
||||
@ -136,7 +136,7 @@ void Foam::triSurfaceTools::greenRefine
|
||||
labelledTri
|
||||
(
|
||||
f[fp2],
|
||||
newPointI,
|
||||
newPointi,
|
||||
f[fp1],
|
||||
f.region()
|
||||
)
|
||||
@ -145,7 +145,7 @@ void Foam::triSurfaceTools::greenRefine
|
||||
(
|
||||
labelledTri
|
||||
(
|
||||
newPointI,
|
||||
newPointi,
|
||||
f[fp0],
|
||||
f[fp1],
|
||||
f.region()
|
||||
@ -164,9 +164,9 @@ Foam::triSurface Foam::triSurfaceTools::doRefine
|
||||
{
|
||||
// Storage for new points. (start after old points)
|
||||
DynamicList<point> newPoints(surf.nPoints());
|
||||
forAll(surf.localPoints(), pointI)
|
||||
forAll(surf.localPoints(), pointi)
|
||||
{
|
||||
newPoints.append(surf.localPoints()[pointI]);
|
||||
newPoints.append(surf.localPoints()[pointi]);
|
||||
}
|
||||
label newVertI = surf.nPoints();
|
||||
|
||||
@ -842,7 +842,7 @@ Foam::surfaceLocation Foam::triSurfaceTools::cutEdge
|
||||
const triSurface& s,
|
||||
const label triI,
|
||||
const label excludeEdgeI,
|
||||
const label excludePointI,
|
||||
const label excludePointi,
|
||||
|
||||
const point& triPoint,
|
||||
const plane& cutPlane,
|
||||
@ -877,11 +877,11 @@ Foam::surfaceLocation Foam::triSurfaceTools::cutEdge
|
||||
// Return information
|
||||
surfaceLocation cut;
|
||||
|
||||
if (excludePointI != -1)
|
||||
if (excludePointi != -1)
|
||||
{
|
||||
// Excluded point. Test only opposite edge.
|
||||
|
||||
label fp0 = findIndex(s.localFaces()[triI], excludePointI);
|
||||
label fp0 = findIndex(s.localFaces()[triI], excludePointi);
|
||||
|
||||
if (fp0 == -1)
|
||||
{
|
||||
@ -1166,7 +1166,7 @@ Foam::surfaceLocation Foam::triSurfaceTools::visitFaces
|
||||
const labelList& eFaces,
|
||||
const surfaceLocation& start,
|
||||
const label excludeEdgeI,
|
||||
const label excludePointI,
|
||||
const label excludePointi,
|
||||
const surfaceLocation& end,
|
||||
const plane& cutPlane
|
||||
)
|
||||
@ -1199,7 +1199,7 @@ Foam::surfaceLocation Foam::triSurfaceTools::visitFaces
|
||||
s,
|
||||
triI,
|
||||
excludeEdgeI, // excludeEdgeI
|
||||
excludePointI, // excludePointI
|
||||
excludePointi, // excludePointi
|
||||
start.rawPoint(),
|
||||
cutPlane,
|
||||
end.rawPoint()
|
||||
@ -1255,9 +1255,9 @@ void Foam::triSurfaceTools::writeOBJ
|
||||
{
|
||||
OFstream outFile(fName);
|
||||
|
||||
forAll(pts, pointI)
|
||||
forAll(pts, pointi)
|
||||
{
|
||||
const point& pt = pts[pointI];
|
||||
const point& pt = pts[pointi];
|
||||
|
||||
outFile<< "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
@ -1716,9 +1716,9 @@ Foam::triSurface Foam::triSurfaceTools::collapseEdges
|
||||
|
||||
// Map for old to new points
|
||||
labelList pointMap(localPoints.size());
|
||||
forAll(localPoints, pointI)
|
||||
forAll(localPoints, pointi)
|
||||
{
|
||||
pointMap[pointI] = pointI;
|
||||
pointMap[pointi] = pointi;
|
||||
}
|
||||
|
||||
|
||||
@ -1894,7 +1894,7 @@ Foam::triSurface Foam::triSurfaceTools::greenRefine
|
||||
|
||||
pointField newPoints(surf.localPoints());
|
||||
newPoints.setSize(surf.nPoints() + surf.nEdges());
|
||||
label newPointI = surf.nPoints();
|
||||
label newPointi = surf.nPoints();
|
||||
|
||||
|
||||
// Refine edges
|
||||
@ -1927,7 +1927,7 @@ Foam::triSurface Foam::triSurfaceTools::greenRefine
|
||||
+ surf.localPoints()[e.end()]
|
||||
);
|
||||
|
||||
newPoints[newPointI] = mid;
|
||||
newPoints[newPointi] = mid;
|
||||
|
||||
// Refine faces using edge
|
||||
forAll(myFaces, myFacei)
|
||||
@ -1938,7 +1938,7 @@ Foam::triSurface Foam::triSurfaceTools::greenRefine
|
||||
surf,
|
||||
myFaces[myFacei],
|
||||
edgeI,
|
||||
newPointI,
|
||||
newPointi,
|
||||
newFaces
|
||||
);
|
||||
|
||||
@ -1946,7 +1946,7 @@ Foam::triSurface Foam::triSurfaceTools::greenRefine
|
||||
refineStatus[myFaces[myFacei]] = GREEN;
|
||||
}
|
||||
|
||||
newPointI++;
|
||||
newPointi++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1960,7 +1960,7 @@ Foam::triSurface Foam::triSurfaceTools::greenRefine
|
||||
}
|
||||
|
||||
newFaces.shrink();
|
||||
newPoints.setSize(newPointI);
|
||||
newPoints.setSize(newPointi);
|
||||
|
||||
return triSurface(newFaces, surf.patches(), newPoints, true);
|
||||
}
|
||||
@ -2276,13 +2276,13 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
|
||||
|
||||
|
||||
const triSurface::FaceType& localF = surf.localFaces()[nearestFacei];
|
||||
label nearPointI = localF[nearLabel];
|
||||
label nearPointi = localF[nearLabel];
|
||||
|
||||
const edgeList& edges = surf.edges();
|
||||
const pointField& localPoints = surf.localPoints();
|
||||
const point& base = localPoints[nearPointI];
|
||||
const point& base = localPoints[nearPointi];
|
||||
|
||||
const labelList& pEdges = surf.pointEdges()[nearPointI];
|
||||
const labelList& pEdges = surf.pointEdges()[nearPointi];
|
||||
|
||||
scalar minDistSqr = Foam::sqr(GREAT);
|
||||
label minEdgeI = -1;
|
||||
@ -2293,10 +2293,10 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
|
||||
|
||||
const edge& e = edges[edgeI];
|
||||
|
||||
label otherPointI = e.otherVertex(nearPointI);
|
||||
label otherPointi = e.otherVertex(nearPointi);
|
||||
|
||||
// Get edge normal.
|
||||
vector eVec(localPoints[otherPointI] - base);
|
||||
vector eVec(localPoints[otherPointi] - base);
|
||||
scalar magEVec = mag(eVec);
|
||||
|
||||
if (magEVec > VSMALL)
|
||||
@ -2431,15 +2431,15 @@ Foam::triSurface Foam::triSurfaceTools::triangulateFaceCentre
|
||||
|
||||
pointField newPoints(points.size() + faceCentres.size());
|
||||
|
||||
label newPointI = 0;
|
||||
label newPointi = 0;
|
||||
|
||||
forAll(points, pointI)
|
||||
forAll(points, pointi)
|
||||
{
|
||||
newPoints[newPointI++] = points[pointI];
|
||||
newPoints[newPointi++] = points[pointi];
|
||||
}
|
||||
forAll(faceCentres, facei)
|
||||
{
|
||||
newPoints[newPointI++] = faceCentres[facei];
|
||||
newPoints[newPointi++] = faceCentres[facei];
|
||||
}
|
||||
|
||||
|
||||
@ -2463,7 +2463,7 @@ Foam::triSurface Foam::triSurfaceTools::triangulateFaceCentre
|
||||
// Face in global coords.
|
||||
const face& f = patch[patchFacei];
|
||||
|
||||
// Index in newPointI of face centre.
|
||||
// Index in newPointi of face centre.
|
||||
label fc = points.size() + patchFacei + patch.start();
|
||||
|
||||
forAll(f, fp)
|
||||
@ -2843,7 +2843,7 @@ Foam::surfaceLocation Foam::triSurfaceTools::trackToEdge
|
||||
eFaces,
|
||||
start,
|
||||
start.index(), // excludeEdgeI
|
||||
-1, // excludePointI
|
||||
-1, // excludePointi
|
||||
end,
|
||||
cutPlane
|
||||
);
|
||||
@ -2858,7 +2858,7 @@ Foam::surfaceLocation Foam::triSurfaceTools::trackToEdge
|
||||
pFaces,
|
||||
start,
|
||||
-1, // excludeEdgeI
|
||||
start.index(), // excludePointI
|
||||
start.index(), // excludePointi
|
||||
end,
|
||||
cutPlane
|
||||
);
|
||||
|
||||
@ -83,7 +83,7 @@ class triSurfaceTools
|
||||
const triSurface& surf,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const label newPointI,
|
||||
const label newPointi,
|
||||
DynamicList<labelledTri>& newFaces
|
||||
);
|
||||
static triSurface doRefine
|
||||
@ -205,7 +205,7 @@ class triSurfaceTools
|
||||
const triSurface& s,
|
||||
const label triI,
|
||||
const label excludeEdgeI,
|
||||
const label excludePointI,
|
||||
const label excludePointi,
|
||||
const point& triPoint,
|
||||
const plane& cutPlane,
|
||||
const point& toPoint
|
||||
@ -234,7 +234,7 @@ class triSurfaceTools
|
||||
const labelList& eFaces,
|
||||
const surfaceLocation& start,
|
||||
const label excludeEdgeI,
|
||||
const label excludePointI,
|
||||
const label excludePointi,
|
||||
const surfaceLocation& end,
|
||||
const plane& cutPlane
|
||||
);
|
||||
|
||||
@ -330,11 +330,11 @@ void Foam::twoDPointCorrector::correctDisplacement
|
||||
{
|
||||
const edge& e = meshEdges[neIndices[edgeI]];
|
||||
|
||||
label startPointI = e.start();
|
||||
point pStart = p[startPointI] + disp[startPointI];
|
||||
label startPointi = e.start();
|
||||
point pStart = p[startPointi] + disp[startPointi];
|
||||
|
||||
label endPointI = e.end();
|
||||
point pEnd = p[endPointI] + disp[endPointI];
|
||||
label endPointi = e.end();
|
||||
point pEnd = p[endPointi] + disp[endPointi];
|
||||
|
||||
// calculate average point position
|
||||
point A = 0.5*(pStart + pEnd);
|
||||
@ -344,14 +344,14 @@ void Foam::twoDPointCorrector::correctDisplacement
|
||||
{
|
||||
snapToWedge(pn, A, pStart);
|
||||
snapToWedge(pn, A, pEnd);
|
||||
disp[startPointI] = pStart - p[startPointI];
|
||||
disp[endPointI] = pEnd - p[endPointI];
|
||||
disp[startPointi] = pStart - p[startPointi];
|
||||
disp[endPointi] = pEnd - p[endPointi];
|
||||
}
|
||||
else
|
||||
{
|
||||
// correct point locations
|
||||
disp[startPointI] = (A + pn*(pn & (pStart - A))) - p[startPointI];
|
||||
disp[endPointI] = (A + pn*(pn & (pEnd - A))) - p[endPointI];
|
||||
disp[startPointi] = (A + pn*(pn & (pStart - A))) - p[startPointi];
|
||||
disp[endPointi] = (A + pn*(pn & (pEnd - A))) - p[endPointi];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user