mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: for-range, forAllIters() ... in applications/utilities
- reduced clutter when iterating over containers
This commit is contained in:
@ -72,7 +72,7 @@ public:
|
|||||||
|
|
||||||
void testCallbackFunction() const
|
void testCallbackFunction() const
|
||||||
{
|
{
|
||||||
forAllConstIter(callbackRegistry, *this, iter)
|
forAllConstIters(*this, iter)
|
||||||
{
|
{
|
||||||
iter().testCallbackFunction();
|
iter().testCallbackFunction();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,7 +55,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< fvc::div(U);
|
Info<< fvc::div(U);
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ int main()
|
|||||||
a = h + i + j;
|
a = h + i + j;
|
||||||
Info<< a << endl;
|
Info<< a << endl;
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -57,7 +57,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< (gradx4a - gradx4[i])/gradx4a << endl;
|
Info<< (gradx4a - gradx4[i])/gradx4a << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
|||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -65,7 +65,7 @@ int main()
|
|||||||
);
|
);
|
||||||
phi.write("phi", "xmgr");
|
phi.write("phi", "xmgr");
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ int main()
|
|||||||
"xmgr"
|
"xmgr"
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -57,7 +57,7 @@ int main()
|
|||||||
|
|
||||||
graph("r", "x", "r", x, r).write("r", "xmgr");
|
graph("r", "x", "r", x, r).write("r", "xmgr");
|
||||||
|
|
||||||
Info<< "end" << endl;
|
Info<< "End" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -59,11 +59,11 @@ int main(int argc, char *argv[])
|
|||||||
Pout<< "Adding a particle." << endl;
|
Pout<< "Adding a particle." << endl;
|
||||||
particles.addParticle(new passiveParticle(mesh, Zero, -1));
|
particles.addParticle(new passiveParticle(mesh, Zero, -1));
|
||||||
|
|
||||||
forAllConstIter(passiveParticleCloud, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
Pout<< " " << iter().position() << " cell:" << iter().cell()
|
Pout<< " " << p.position() << " cell:" << p.cell()
|
||||||
<< " origProc:" << iter().origProc()
|
<< " origProc:" << p.origProc()
|
||||||
<< " origId:" << iter().origId()
|
<< " origId:" << p.origId()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,11 +80,11 @@ int main(int argc, char *argv[])
|
|||||||
passiveParticleCloud particles(mesh, cloudName);
|
passiveParticleCloud particles(mesh, cloudName);
|
||||||
Pout<< "Reread particles:" << particles.size() << endl;
|
Pout<< "Reread particles:" << particles.size() << endl;
|
||||||
|
|
||||||
forAllConstIter(passiveParticleCloud, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
Pout<< " " << iter().position() << " cell:" << iter().cell()
|
Pout<< " " << p.position() << " cell:" << p.cell()
|
||||||
<< " origProc:" << iter().origProc()
|
<< " origProc:" << p.origProc()
|
||||||
<< " origId:" << iter().origId()
|
<< " origId:" << p.origId()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -261,10 +261,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 2. Does sparseData contain more?
|
// 2. Does sparseData contain more?
|
||||||
forAllConstIter(Map<point>, sparseData, iter)
|
forAllConstIters(sparseData, iter)
|
||||||
{
|
{
|
||||||
const point& sparsePt = iter();
|
const label meshPointi = iter.key();
|
||||||
label meshPointi = iter.key();
|
const point& sparsePt = iter.val();
|
||||||
const point& fullPt = fullData[meshPointi];
|
const point& fullPt = fullData[meshPointi];
|
||||||
|
|
||||||
if (fullPt != sparsePt)
|
if (fullPt != sparsePt)
|
||||||
@ -350,9 +350,9 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
|
|||||||
{
|
{
|
||||||
const edge& e = mesh.edges()[meshEdgeI];
|
const edge& e = mesh.edges()[meshEdgeI];
|
||||||
|
|
||||||
EdgeMap<point>::const_iterator iter = sparseData.find(e);
|
const auto iter = sparseData.cfind(e);
|
||||||
|
|
||||||
if (iter != sparseData.end())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
const point& sparsePt = iter();
|
const point& sparsePt = iter();
|
||||||
const point& fullPt = fullData[meshEdgeI];
|
const point& fullPt = fullData[meshEdgeI];
|
||||||
|
|||||||
@ -711,18 +711,18 @@ int main(int argc, char *argv[])
|
|||||||
setsAndPatches[setI][1]
|
setsAndPatches[setI][1]
|
||||||
);
|
);
|
||||||
|
|
||||||
forAllConstIter(faceSet, fSet, iter)
|
for (const label facei : fSet)
|
||||||
{
|
{
|
||||||
if (wantedPatch[iter.key()] != -1)
|
if (wantedPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << iter.key()
|
<< "Face " << facei
|
||||||
<< " is in faceSet " << setsAndPatches[setI][0]
|
<< " is in faceSet " << setsAndPatches[setI][0]
|
||||||
<< " destined for patch " << setsAndPatches[setI][1]
|
<< " destined for patch " << setsAndPatches[setI][1]
|
||||||
<< " but also in patch " << wantedPatch[iter.key()]
|
<< " but also in patch " << wantedPatch[facei]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
wantedPatch[iter.key()] = patchi;
|
wantedPatch[facei] = patchi;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -749,20 +749,21 @@ int main(int argc, char *argv[])
|
|||||||
faceSet fSet(mesh, coupledAndPatches[setI][0]);
|
faceSet fSet(mesh, coupledAndPatches[setI][0]);
|
||||||
label patchi = findPatch(patches, coupledAndPatches[setI][1]);
|
label patchi = findPatch(patches, coupledAndPatches[setI][1]);
|
||||||
|
|
||||||
forAllConstIter(faceSet, fSet, iter)
|
for (const label facei : fSet)
|
||||||
{
|
{
|
||||||
if (coupledWantedPatch[iter.key()] != -1)
|
if (coupledWantedPatch[facei] != -1)
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Face " << iter.key()
|
<< "Face " << facei
|
||||||
<< " is in faceSet " << coupledAndPatches[setI][0]
|
<< " is in faceSet " << coupledAndPatches[setI][0]
|
||||||
<< " destined for patch " << coupledAndPatches[setI][1]
|
<< " destined for patch " << coupledAndPatches[setI][1]
|
||||||
<< " but also in patch " << coupledWantedPatch[iter.key()]
|
<< " but also in patch " << coupledWantedPatch[facei]
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
coupledWantedPatch[iter.key()] = patchi;
|
|
||||||
cyclicWantedPatch_half0[iter.key()] = cyclicId;
|
coupledWantedPatch[facei] = patchi;
|
||||||
cyclicWantedPatch_half1[iter.key()] = cyclicSlaveId;
|
cyclicWantedPatch_half0[facei] = cyclicId;
|
||||||
|
cyclicWantedPatch_half1[facei] = cyclicSlaveId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -80,25 +80,24 @@ Foam::label Foam::cellSplitter::newOwner
|
|||||||
const Map<labelList>& cellToCells
|
const Map<labelList>& cellToCells
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label oldOwn = mesh_.faceOwner()[facei];
|
const label old = mesh_.faceOwner()[facei];
|
||||||
|
|
||||||
Map<labelList>::const_iterator fnd = cellToCells.find(oldOwn);
|
const auto iter = cellToCells.cfind(old);
|
||||||
|
|
||||||
if (fnd == cellToCells.end())
|
if (!iter.found())
|
||||||
{
|
{
|
||||||
// Unsplit cell
|
// Unsplit cell
|
||||||
return oldOwn;
|
return old;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Look up index of face in the cells' faces.
|
|
||||||
|
|
||||||
const labelList& newCells = fnd();
|
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[oldOwn];
|
// Look up index of face in the cells' faces.
|
||||||
|
|
||||||
return newCells[cFaces.find(facei)];
|
const labelList& newCells = *iter;
|
||||||
}
|
|
||||||
|
const cell& cFaces = mesh_.cells()[old];
|
||||||
|
|
||||||
|
return newCells[cFaces.find(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,31 +107,29 @@ Foam::label Foam::cellSplitter::newNeighbour
|
|||||||
const Map<labelList>& cellToCells
|
const Map<labelList>& cellToCells
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
label oldNbr = mesh_.faceNeighbour()[facei];
|
const label old = mesh_.faceNeighbour()[facei];
|
||||||
|
|
||||||
Map<labelList>::const_iterator fnd = cellToCells.find(oldNbr);
|
const auto iter = cellToCells.cfind(old);
|
||||||
|
|
||||||
if (fnd == cellToCells.end())
|
if (!iter.found())
|
||||||
{
|
{
|
||||||
// Unsplit cell
|
// Unsplit cell
|
||||||
return oldNbr;
|
return old;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Look up index of face in the cells' faces.
|
|
||||||
|
|
||||||
const labelList& newCells = fnd();
|
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[oldNbr];
|
// Look up index of face in the cells' faces.
|
||||||
|
|
||||||
return newCells[cFaces.find(facei)];
|
const labelList& newCells = *iter;
|
||||||
}
|
|
||||||
|
const cell& cFaces = mesh_.cells()[old];
|
||||||
|
|
||||||
|
return newCells[cFaces.find(facei)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
// Construct from components
|
|
||||||
Foam::cellSplitter::cellSplitter(const polyMesh& mesh)
|
Foam::cellSplitter::cellSplitter(const polyMesh& mesh)
|
||||||
:
|
:
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
@ -140,12 +137,6 @@ Foam::cellSplitter::cellSplitter(const polyMesh& mesh)
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Foam::cellSplitter::~cellSplitter()
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::cellSplitter::setRefinement
|
void Foam::cellSplitter::setRefinement
|
||||||
@ -162,9 +153,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
// Introduce cellToMidPoints.
|
// Introduce cellToMidPoints.
|
||||||
//
|
//
|
||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIters(cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label celli = iter.key();
|
const label celli = iter.key();
|
||||||
|
|
||||||
label anchorPoint = mesh_.cellPoints()[celli][0];
|
label anchorPoint = mesh_.cellPoints()[celli][0];
|
||||||
|
|
||||||
@ -173,7 +164,7 @@ void Foam::cellSplitter::setRefinement
|
|||||||
(
|
(
|
||||||
polyAddPoint
|
polyAddPoint
|
||||||
(
|
(
|
||||||
iter(), // point
|
iter.val(), // point
|
||||||
anchorPoint, // master point
|
anchorPoint, // master point
|
||||||
-1, // zone for point
|
-1, // zone for point
|
||||||
true // supports a cell
|
true // supports a cell
|
||||||
@ -193,9 +184,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
|
|
||||||
Map<labelList> cellToCells(cellToMidPoint.size());
|
Map<labelList> cellToCells(cellToMidPoint.size());
|
||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIters(cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label celli = iter.key();
|
const label celli = iter.key();
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[celli];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
@ -238,9 +229,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
// point.
|
// point.
|
||||||
//
|
//
|
||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIters(cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label celli = iter.key();
|
const label celli = iter.key();
|
||||||
|
|
||||||
label midPointi = addedPoints_[celli];
|
label midPointi = addedPoints_[celli];
|
||||||
|
|
||||||
@ -368,9 +359,9 @@ void Foam::cellSplitter::setRefinement
|
|||||||
// Mark off affected face.
|
// Mark off affected face.
|
||||||
bitSet faceUpToDate(mesh_.nFaces(), true);
|
bitSet faceUpToDate(mesh_.nFaces(), true);
|
||||||
|
|
||||||
forAllConstIter(Map<point>, cellToMidPoint, iter)
|
forAllConstIters(cellToMidPoint, iter)
|
||||||
{
|
{
|
||||||
label celli = iter.key();
|
const label celli = iter.key();
|
||||||
|
|
||||||
const cell& cFaces = mesh_.cells()[celli];
|
const cell& cFaces = mesh_.cells()[celli];
|
||||||
|
|
||||||
@ -462,15 +453,13 @@ void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
|
|||||||
// point get mapped do they get inserted.
|
// point get mapped do they get inserted.
|
||||||
Map<label> newAddedPoints(addedPoints_.size());
|
Map<label> newAddedPoints(addedPoints_.size());
|
||||||
|
|
||||||
forAllConstIter(Map<label>, addedPoints_, iter)
|
forAllConstIters(addedPoints_, iter)
|
||||||
{
|
{
|
||||||
label oldCelli = iter.key();
|
const label oldCelli = iter.key();
|
||||||
|
const label oldPointi = iter.val();
|
||||||
|
|
||||||
label newCelli = morphMap.reverseCellMap()[oldCelli];
|
const label newCelli = morphMap.reverseCellMap()[oldCelli];
|
||||||
|
const label newPointi = morphMap.reversePointMap()[oldPointi];
|
||||||
label oldPointi = iter();
|
|
||||||
|
|
||||||
label newPointi = morphMap.reversePointMap()[oldPointi];
|
|
||||||
|
|
||||||
if (newCelli >= 0 && newPointi >= 0)
|
if (newCelli >= 0 && newPointi >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -109,7 +109,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//- Destructor
|
//- Destructor
|
||||||
~cellSplitter();
|
~cellSplitter() = default;
|
||||||
|
|
||||||
|
|
||||||
// Member Functions
|
// Member Functions
|
||||||
|
|||||||
@ -83,10 +83,8 @@ label findPoint(const primitivePatch& pp, const point& nearPoint)
|
|||||||
scalar almostMinDistSqr = GREAT;
|
scalar almostMinDistSqr = GREAT;
|
||||||
label almostMinI = -1;
|
label almostMinI = -1;
|
||||||
|
|
||||||
forAll(meshPoints, i)
|
for (const label pointi : meshPoints)
|
||||||
{
|
{
|
||||||
label pointi = meshPoints[i];
|
|
||||||
|
|
||||||
scalar distSqr = magSqr(nearPoint - points[pointi]);
|
scalar distSqr = magSqr(nearPoint - points[pointi]);
|
||||||
|
|
||||||
if (distSqr < minDistSqr)
|
if (distSqr < minDistSqr)
|
||||||
@ -147,10 +145,8 @@ label findEdge
|
|||||||
scalar almostMinDist = GREAT;
|
scalar almostMinDist = GREAT;
|
||||||
label almostMinI = -1;
|
label almostMinI = -1;
|
||||||
|
|
||||||
forAll(edges, edgeI)
|
for (const edge& e : edges)
|
||||||
{
|
{
|
||||||
const edge& e = edges[edgeI];
|
|
||||||
|
|
||||||
pointHit pHit(e.line(localPoints).nearestDist(nearPoint));
|
pointHit pHit(e.line(localPoints).nearestDist(nearPoint));
|
||||||
|
|
||||||
if (pHit.hit())
|
if (pHit.hit())
|
||||||
@ -296,10 +292,8 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
|
|||||||
label minI = -1;
|
label minI = -1;
|
||||||
scalar minDistSqr = GREAT;
|
scalar minDistSqr = GREAT;
|
||||||
|
|
||||||
forAll(cPoints, i)
|
for (const label pointi : cPoints)
|
||||||
{
|
{
|
||||||
label pointi = cPoints[i];
|
|
||||||
|
|
||||||
scalar distSqr = magSqr(nearPoint - mesh.points()[pointi]);
|
scalar distSqr = magSqr(nearPoint - mesh.points()[pointi]);
|
||||||
|
|
||||||
if (distSqr < minDistSqr)
|
if (distSqr < minDistSqr)
|
||||||
@ -432,11 +426,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "Looking up points to move ..." << nl << endl;
|
Info<< nl << "Looking up points to move ..." << nl << endl;
|
||||||
Map<point> pointToPos(pointsToMove.size());
|
Map<point> pointToPos(pointsToMove.size());
|
||||||
forAll(pointsToMove, i)
|
for (const Pair<point>& pts : pointsToMove)
|
||||||
{
|
{
|
||||||
const Pair<point>& pts = pointsToMove[i];
|
const label pointi = findPoint(allBoundary, pts.first());
|
||||||
|
|
||||||
label pointi = findPoint(allBoundary, pts.first());
|
|
||||||
|
|
||||||
if (pointi == -1 || !pointToPos.insert(pointi, pts.second()))
|
if (pointi == -1 || !pointToPos.insert(pointi, pts.second()))
|
||||||
{
|
{
|
||||||
@ -450,10 +442,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "Looking up edges to split ..." << nl << endl;
|
Info<< nl << "Looking up edges to split ..." << nl << endl;
|
||||||
Map<List<point>> edgeToCuts(edgesToSplit.size());
|
Map<List<point>> edgeToCuts(edgesToSplit.size());
|
||||||
forAll(edgesToSplit, i)
|
for (const Pair<point>& pts : edgesToSplit)
|
||||||
{
|
{
|
||||||
const Pair<point>& pts = edgesToSplit[i];
|
|
||||||
|
|
||||||
label edgeI = findEdge(mesh, allBoundary, pts.first());
|
label edgeI = findEdge(mesh, allBoundary, pts.first());
|
||||||
|
|
||||||
if
|
if
|
||||||
@ -473,10 +463,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "Looking up faces to triangulate ..." << nl << endl;
|
Info<< nl << "Looking up faces to triangulate ..." << nl << endl;
|
||||||
Map<point> faceToDecompose(facesToTriangulate.size());
|
Map<point> faceToDecompose(facesToTriangulate.size());
|
||||||
forAll(facesToTriangulate, i)
|
for (const Pair<point>& pts : facesToTriangulate)
|
||||||
{
|
{
|
||||||
const Pair<point>& pts = facesToTriangulate[i];
|
|
||||||
|
|
||||||
label facei = findFace(mesh, allBoundary, pts.first());
|
label facei = findFace(mesh, allBoundary, pts.first());
|
||||||
|
|
||||||
if (facei == -1 || !faceToDecompose.insert(facei, pts.second()))
|
if (facei == -1 || !faceToDecompose.insert(facei, pts.second()))
|
||||||
@ -494,10 +482,8 @@ int main(int argc, char *argv[])
|
|||||||
Info<< nl << "Looking up cells to convert to pyramids around"
|
Info<< nl << "Looking up cells to convert to pyramids around"
|
||||||
<< " cell centre ..." << nl << endl;
|
<< " cell centre ..." << nl << endl;
|
||||||
Map<point> cellToPyrCentre(cellsToPyramidise.size());
|
Map<point> cellToPyrCentre(cellsToPyramidise.size());
|
||||||
forAll(cellsToPyramidise, i)
|
for (const Pair<point>& pts : cellsToPyramidise)
|
||||||
{
|
{
|
||||||
const Pair<point>& pts = cellsToPyramidise[i];
|
|
||||||
|
|
||||||
label celli = findCell(mesh, pts.first());
|
label celli = findCell(mesh, pts.first());
|
||||||
|
|
||||||
if (celli == -1 || !cellToPyrCentre.insert(celli, pts.second()))
|
if (celli == -1 || !cellToPyrCentre.insert(celli, pts.second()))
|
||||||
@ -513,10 +499,8 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "Looking up edges to collapse ..." << nl << endl;
|
Info<< nl << "Looking up edges to collapse ..." << nl << endl;
|
||||||
Map<point> edgeToPos(edgesToCollapse.size());
|
Map<point> edgeToPos(edgesToCollapse.size());
|
||||||
forAll(edgesToCollapse, i)
|
for (const Pair<point>& pts : edgesToCollapse)
|
||||||
{
|
{
|
||||||
const Pair<point>& pts = edgesToCollapse[i];
|
|
||||||
|
|
||||||
label edgeI = findEdge(mesh, allBoundary, pts.first());
|
label edgeI = findEdge(mesh, allBoundary, pts.first());
|
||||||
|
|
||||||
if (edgeI == -1 || !edgeToPos.insert(edgeI, pts.second()))
|
if (edgeI == -1 || !edgeToPos.insert(edgeI, pts.second()))
|
||||||
@ -590,7 +574,7 @@ int main(int argc, char *argv[])
|
|||||||
Map<point> collapsePointToLocation(mesh.nPoints());
|
Map<point> collapsePointToLocation(mesh.nPoints());
|
||||||
|
|
||||||
// Get new positions and construct collapse network
|
// Get new positions and construct collapse network
|
||||||
forAllConstIter(Map<point>, edgeToPos, iter)
|
forAllConstIters(edgeToPos, iter)
|
||||||
{
|
{
|
||||||
label edgeI = iter.key();
|
label edgeI = iter.key();
|
||||||
const edge& e = edges[edgeI];
|
const edge& e = edges[edgeI];
|
||||||
@ -598,7 +582,7 @@ int main(int argc, char *argv[])
|
|||||||
collapseEdge.set(edgeI);
|
collapseEdge.set(edgeI);
|
||||||
collapsePointToLocation.set(e[1], points[e[0]]);
|
collapsePointToLocation.set(e[1], points[e[0]]);
|
||||||
|
|
||||||
newPoints[e[0]] = iter();
|
newPoints[e[0]] = iter.val();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move master point to destination.
|
// Move master point to destination.
|
||||||
|
|||||||
@ -222,10 +222,8 @@ bool splitHex
|
|||||||
|
|
||||||
const cell& cFaces = mesh.cells()[celli];
|
const cell& cFaces = mesh.cells()[celli];
|
||||||
|
|
||||||
forAll(cFaces, i)
|
for (const label facei : cFaces)
|
||||||
{
|
{
|
||||||
label facei = cFaces[i];
|
|
||||||
|
|
||||||
const face& f = faces[facei];
|
const face& f = faces[facei];
|
||||||
|
|
||||||
label fp0 = f.find(e[0]);
|
label fp0 = f.find(e[0]);
|
||||||
@ -399,15 +397,12 @@ void collectCuts
|
|||||||
boolList edgeIsCut(mesh.nEdges(), false);
|
boolList edgeIsCut(mesh.nEdges(), false);
|
||||||
scalarField edgeWeight(mesh.nEdges(), -GREAT);
|
scalarField edgeWeight(mesh.nEdges(), -GREAT);
|
||||||
|
|
||||||
forAllConstIter(cellSet, cellsToCut, iter)
|
for (const label celli : cellsToCut)
|
||||||
{
|
{
|
||||||
const label celli = iter.key();
|
|
||||||
const labelList& cEdges = cellEdges[celli];
|
const labelList& cEdges = cellEdges[celli];
|
||||||
|
|
||||||
forAll(cEdges, i)
|
for (const label edgeI : cEdges)
|
||||||
{
|
{
|
||||||
label edgeI = cEdges[i];
|
|
||||||
|
|
||||||
label f0, f1;
|
label f0, f1;
|
||||||
meshTools::getEdgeFaces(mesh, celli, edgeI, f0, f1);
|
meshTools::getEdgeFaces(mesh, celli, edgeI, f0, f1);
|
||||||
|
|
||||||
|
|||||||
@ -197,7 +197,7 @@ elementType ^{space}"TYPE"{cspace}
|
|||||||
|
|
||||||
forAll(slPatchCells, i)
|
forAll(slPatchCells, i)
|
||||||
{
|
{
|
||||||
if (!slPatchCells(i))
|
if (!slPatchCells.set(i))
|
||||||
{
|
{
|
||||||
slPatchCells.set(i, new SLList<label>);
|
slPatchCells.set(i, new SLList<label>);
|
||||||
}
|
}
|
||||||
@ -210,7 +210,7 @@ elementType ^{space}"TYPE"{cspace}
|
|||||||
|
|
||||||
forAll(slPatchCells, i)
|
forAll(slPatchCells, i)
|
||||||
{
|
{
|
||||||
if (!slPatchCellFaces(i))
|
if (!slPatchCellFaces.set(i))
|
||||||
{
|
{
|
||||||
slPatchCellFaces.set(i, new SLList<label>);
|
slPatchCellFaces.set(i, new SLList<label>);
|
||||||
}
|
}
|
||||||
@ -344,19 +344,19 @@ int main(int argc, char *argv[])
|
|||||||
pointField points(slPoints.size());
|
pointField points(slPoints.size());
|
||||||
|
|
||||||
label i = 0;
|
label i = 0;
|
||||||
forAllConstIter(SLList<point>, slPoints, pointIter)
|
for (const point& pt : slPoints)
|
||||||
{
|
{
|
||||||
// Scale points for the given scale factor
|
// Scale points for the given scale factor
|
||||||
points[i++] = scaleFactor * pointIter();
|
points[i++] = scaleFactor * pt;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
labelList pointMap(maxNodei+1);
|
labelList pointMap(maxNodei+1);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
forAllConstIter(SLList<label>, slPointMap, pointMapIter)
|
for (const label pointi : slPointMap)
|
||||||
{
|
{
|
||||||
pointMap[pointMapIter()] = i++;
|
pointMap[pointi] = i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "Creating cells" << endl;
|
Info<< "Creating cells" << endl;
|
||||||
@ -364,9 +364,9 @@ int main(int argc, char *argv[])
|
|||||||
labelList cellMap(maxCelli+1);
|
labelList cellMap(maxCelli+1);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
forAllConstIter(SLList<label>, slCellMap, cellMapIter)
|
for (const label celli : slCellMap)
|
||||||
{
|
{
|
||||||
cellMap[cellMapIter()] = i++;
|
cellMap[celli] = i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -383,66 +383,66 @@ int main(int argc, char *argv[])
|
|||||||
cellShapeList cellShapes(slCellLabels.size());
|
cellShapeList cellShapes(slCellLabels.size());
|
||||||
label nCells = 0;
|
label nCells = 0;
|
||||||
|
|
||||||
forAllConstIter(SLPtrList<labelList>, slCellLabels, cellIter)
|
for (const labelList& labels : slCellLabels)
|
||||||
{
|
{
|
||||||
if // Tetrahedron
|
if // Tetrahedron
|
||||||
(
|
(
|
||||||
cellIter()[2] == cellIter()[3]
|
labels[2] == labels[3]
|
||||||
&& cellIter()[4] == cellIter()[5]
|
&& labels[4] == labels[5]
|
||||||
&& cellIter()[5] == cellIter()[6]
|
&& labels[5] == labels[6]
|
||||||
&& cellIter()[6] == cellIter()[7]
|
&& labels[6] == labels[7]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelsTet[0] = pointMap[cellIter()[0] ];
|
labelsTet[0] = pointMap[labels[0]];
|
||||||
labelsTet[1] = pointMap[cellIter()[1] ];
|
labelsTet[1] = pointMap[labels[1]];
|
||||||
labelsTet[2] = pointMap[cellIter()[2] ];
|
labelsTet[2] = pointMap[labels[2]];
|
||||||
labelsTet[3] = pointMap[cellIter()[4] ];
|
labelsTet[3] = pointMap[labels[4]];
|
||||||
|
|
||||||
cellShapes[nCells++] = cellShape(tet, labelsTet);
|
cellShapes[nCells++] = cellShape(tet, labelsTet);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if // Square-based pyramid
|
else if // Square-based pyramid
|
||||||
(
|
(
|
||||||
cellIter()[4] == cellIter()[5]
|
labels[4] == labels[5]
|
||||||
&& cellIter()[5] == cellIter()[6]
|
&& labels[5] == labels[6]
|
||||||
&& cellIter()[6] == cellIter()[7]
|
&& labels[6] == labels[7]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelsPyramid[0] = pointMap[cellIter()[0] ];
|
labelsPyramid[0] = pointMap[labels[0]];
|
||||||
labelsPyramid[1] = pointMap[cellIter()[1] ];
|
labelsPyramid[1] = pointMap[labels[1]];
|
||||||
labelsPyramid[2] = pointMap[cellIter()[2] ];
|
labelsPyramid[2] = pointMap[labels[2]];
|
||||||
labelsPyramid[3] = pointMap[cellIter()[3] ];
|
labelsPyramid[3] = pointMap[labels[3]];
|
||||||
labelsPyramid[4] = pointMap[cellIter()[4] ];
|
labelsPyramid[4] = pointMap[labels[4]];
|
||||||
|
|
||||||
cellShapes[nCells++] = cellShape(pyr, labelsPyramid);
|
cellShapes[nCells++] = cellShape(pyr, labelsPyramid);
|
||||||
}
|
}
|
||||||
|
|
||||||
else if // Triangular prism
|
else if // Triangular prism
|
||||||
(
|
(
|
||||||
cellIter()[2] == cellIter()[3]
|
labels[2] == labels[3]
|
||||||
&& cellIter()[6] == cellIter()[7]
|
&& labels[6] == labels[7]
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelsPrism[0] = pointMap[cellIter()[0] ];
|
labelsPrism[0] = pointMap[labels[0]];
|
||||||
labelsPrism[1] = pointMap[cellIter()[1] ];
|
labelsPrism[1] = pointMap[labels[1]];
|
||||||
labelsPrism[2] = pointMap[cellIter()[2] ];
|
labelsPrism[2] = pointMap[labels[2]];
|
||||||
labelsPrism[3] = pointMap[cellIter()[4] ];
|
labelsPrism[3] = pointMap[labels[4]];
|
||||||
labelsPrism[4] = pointMap[cellIter()[5] ];
|
labelsPrism[4] = pointMap[labels[5]];
|
||||||
labelsPrism[5] = pointMap[cellIter()[6] ];
|
labelsPrism[5] = pointMap[labels[6]];
|
||||||
|
|
||||||
cellShapes[nCells++] = cellShape(prism, labelsPrism);
|
cellShapes[nCells++] = cellShape(prism, labelsPrism);
|
||||||
}
|
}
|
||||||
|
|
||||||
else // Hex
|
else // Hex
|
||||||
{
|
{
|
||||||
labelsHex[0] = pointMap[cellIter()[0] ];
|
labelsHex[0] = pointMap[labels[0]];
|
||||||
labelsHex[1] = pointMap[cellIter()[1] ];
|
labelsHex[1] = pointMap[labels[1]];
|
||||||
labelsHex[2] = pointMap[cellIter()[2] ];
|
labelsHex[2] = pointMap[labels[2]];
|
||||||
labelsHex[3] = pointMap[cellIter()[3] ];
|
labelsHex[3] = pointMap[labels[3]];
|
||||||
labelsHex[4] = pointMap[cellIter()[4] ];
|
labelsHex[4] = pointMap[labels[4]];
|
||||||
labelsHex[5] = pointMap[cellIter()[5] ];
|
labelsHex[5] = pointMap[labels[5]];
|
||||||
labelsHex[6] = pointMap[cellIter()[6] ];
|
labelsHex[6] = pointMap[labels[6]];
|
||||||
labelsHex[7] = pointMap[cellIter()[7] ];
|
labelsHex[7] = pointMap[labels[7]];
|
||||||
|
|
||||||
cellShapes[nCells++] = cellShape(hex, labelsHex);
|
cellShapes[nCells++] = cellShape(hex, labelsHex);
|
||||||
}
|
}
|
||||||
@ -474,7 +474,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Warning: tet face order has changed between version 1.9.6 and 2.0
|
// Warning: tet face order has changed between version 1.9.6 and 2.0
|
||||||
//
|
//
|
||||||
label faceIndex[7][6] =
|
const label faceIndex[7][6] =
|
||||||
{
|
{
|
||||||
{-1, -1, -1, -1, -1, -1}, // 0
|
{-1, -1, -1, -1, -1, -1}, // 0
|
||||||
{-1, -1, -1, -1, -1, -1}, // 1
|
{-1, -1, -1, -1, -1, -1}, // 1
|
||||||
@ -494,14 +494,13 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
SLList<face> patchFaces;
|
SLList<face> patchFaces;
|
||||||
|
|
||||||
SLList<label>::iterator cellIter(slPatchCells[patchi].begin());
|
auto cellIter = slPatchCells[patchi].cbegin();
|
||||||
SLList<label>::iterator faceIter(slPatchCellFaces[patchi].begin());
|
auto faceIter = slPatchCellFaces[patchi].cbegin();
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
cellIter != slPatchCells[patchi].end()
|
cellIter.good() && faceIter.good();
|
||||||
&& faceIter != slPatchCellFaces[patchi].end();
|
|
||||||
++cellIter, ++faceIter
|
++cellIter, ++faceIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -519,7 +518,7 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
boundary[patchi] = patchFaces;
|
boundary[patchi] = patchFaces;
|
||||||
patchNames[patchi] = word("patch") + name(patchi + 1);
|
patchNames[patchi] = "patch" + Foam::name(patchi + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -660,20 +659,20 @@ int main(int argc, char *argv[])
|
|||||||
// CellZones
|
// CellZones
|
||||||
labelList types = cellTypes.sortedToc();
|
labelList types = cellTypes.sortedToc();
|
||||||
|
|
||||||
forAll(types, j)
|
forAll(types, typei)
|
||||||
{
|
{
|
||||||
label cellType = types[j];
|
const label cellType = types[typei];
|
||||||
|
|
||||||
// Pick up cells in zone
|
// Pick up cells in zone
|
||||||
DynamicList<label> addr;
|
DynamicList<label> addr;
|
||||||
|
|
||||||
SLList<label>::iterator cellMapIter = slCellMap.begin();
|
auto cellMapIter = slCellMap.cbegin();
|
||||||
SLList<label>::iterator typeIter = slCellType.begin();
|
auto typeIter = slCellType.cbegin();
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
typeIter != slCellType.end();
|
typeIter.good();
|
||||||
++typeIter, ++cellMapIter
|
++typeIter, ++cellMapIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -692,7 +691,7 @@ int main(int argc, char *argv[])
|
|||||||
(
|
(
|
||||||
cellTypes[cellType],
|
cellTypes[cellType],
|
||||||
addr,
|
addr,
|
||||||
j,
|
typei,
|
||||||
pShapeMesh.cellZones()
|
pShapeMesh.cellZones()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -709,7 +708,7 @@ int main(int argc, char *argv[])
|
|||||||
pShapeMesh.removeFiles();
|
pShapeMesh.removeFiles();
|
||||||
pShapeMesh.write();
|
pShapeMesh.write();
|
||||||
|
|
||||||
Info<< nl << "end" << endl;
|
Info<< nl << "End" << endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1057,9 +1057,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
uniquify(name, patchNames);
|
uniquify(name, patchNames);
|
||||||
|
|
||||||
HashTable<word>::const_iterator iter = fluentToFoamType.find(type);
|
const auto iter = fluentToFoamType.cfind(type);
|
||||||
|
|
||||||
if (iter != fluentToFoamType.end())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
// See if we have a periodic and can derive the other side.
|
// See if we have a periodic and can derive the other side.
|
||||||
word neighbPatchName;
|
word neighbPatchName;
|
||||||
|
|||||||
@ -1236,9 +1236,9 @@ int main(int argc, char *argv[])
|
|||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
faceGroupZoneIDIter != faceGroupZoneID.end()
|
faceGroupZoneIDIter.good()
|
||||||
&& faceGroupStartIndexIter != faceGroupStartIndex.end()
|
&& faceGroupStartIndexIter.good()
|
||||||
&& faceGroupEndIndexIter != faceGroupEndIndex.end();
|
&& faceGroupEndIndexIter.good();
|
||||||
++faceGroupZoneIDIter,
|
++faceGroupZoneIDIter,
|
||||||
++faceGroupStartIndexIter,
|
++faceGroupStartIndexIter,
|
||||||
++faceGroupEndIndexIter
|
++faceGroupEndIndexIter
|
||||||
@ -1613,7 +1613,7 @@ int main(int argc, char *argv[])
|
|||||||
SLList<label>::iterator start = cellGroupStartIndex.begin();
|
SLList<label>::iterator start = cellGroupStartIndex.begin();
|
||||||
SLList<label>::iterator end = cellGroupEndIndex.begin();
|
SLList<label>::iterator end = cellGroupEndIndex.begin();
|
||||||
|
|
||||||
for (; cg != cellGroupZoneID.end(); ++cg, ++start, ++end)
|
for (; cg.good(); ++cg, ++start, ++end)
|
||||||
{
|
{
|
||||||
const word& name = patchNameIDs[cg()];
|
const word& name = patchNameIDs[cg()];
|
||||||
const word& type = patchTypeIDs[cg()];
|
const word& type = patchTypeIDs[cg()];
|
||||||
@ -1736,7 +1736,7 @@ int main(int argc, char *argv[])
|
|||||||
// Note: cellGroupXXX are all Fluent indices (starting at 1)
|
// Note: cellGroupXXX are all Fluent indices (starting at 1)
|
||||||
// so offset before using.
|
// so offset before using.
|
||||||
|
|
||||||
for (; cg != cellGroupZoneID.end(); ++cg, ++start, ++end)
|
for (; cg.good(); ++cg, ++start, ++end)
|
||||||
{
|
{
|
||||||
const word& name=patchNameIDs[cg()];
|
const word& name=patchNameIDs[cg()];
|
||||||
const word& type=patchTypeIDs[cg()];
|
const word& type=patchTypeIDs[cg()];
|
||||||
|
|||||||
@ -219,27 +219,27 @@ void storeCellInZone
|
|||||||
List<DynamicList<label>>& zoneCells
|
List<DynamicList<label>>& zoneCells
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Map<label>::const_iterator zoneFnd = physToZone.find(regPhys);
|
const auto zoneFnd = physToZone.cfind(regPhys);
|
||||||
|
|
||||||
if (zoneFnd == physToZone.end())
|
if (zoneFnd.found())
|
||||||
{
|
|
||||||
// New region. Allocate zone for it.
|
|
||||||
label zoneI = zoneCells.size();
|
|
||||||
zoneCells.setSize(zoneI+1);
|
|
||||||
zoneToPhys.setSize(zoneI+1);
|
|
||||||
|
|
||||||
Info<< "Mapping region " << regPhys << " to Foam cellZone "
|
|
||||||
<< zoneI << endl;
|
|
||||||
physToZone.insert(regPhys, zoneI);
|
|
||||||
|
|
||||||
zoneToPhys[zoneI] = regPhys;
|
|
||||||
zoneCells[zoneI].append(celli);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Existing zone for region
|
// Existing zone for region
|
||||||
zoneCells[zoneFnd()].append(celli);
|
zoneCells[zoneFnd()].append(celli);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// New region. Allocate zone for it.
|
||||||
|
const label zonei = zoneCells.size();
|
||||||
|
zoneCells.setSize(zonei+1);
|
||||||
|
zoneToPhys.setSize(zonei+1);
|
||||||
|
|
||||||
|
Info<< "Mapping region " << regPhys << " to Foam cellZone "
|
||||||
|
<< zonei << endl;
|
||||||
|
physToZone.insert(regPhys, zonei);
|
||||||
|
|
||||||
|
zoneToPhys[zonei] = regPhys;
|
||||||
|
zoneCells[zonei].append(celli);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -516,10 +516,15 @@ void readCells
|
|||||||
|
|
||||||
renumber(mshToFoam, triPoints);
|
renumber(mshToFoam, triPoints);
|
||||||
|
|
||||||
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
const auto regFnd = physToPatch.cfind(regPhys);
|
||||||
|
|
||||||
label patchi = -1;
|
label patchi = -1;
|
||||||
if (regFnd == physToPatch.end())
|
if (regFnd.found())
|
||||||
|
{
|
||||||
|
// Existing patch for region
|
||||||
|
patchi = regFnd();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// New region. Allocate patch for it.
|
// New region. Allocate patch for it.
|
||||||
patchi = patchFaces.size();
|
patchi = patchFaces.size();
|
||||||
@ -532,11 +537,6 @@ void readCells
|
|||||||
physToPatch.insert(regPhys, patchi);
|
physToPatch.insert(regPhys, patchi);
|
||||||
patchToPhys[patchi] = regPhys;
|
patchToPhys[patchi] = regPhys;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Existing patch for region
|
|
||||||
patchi = regFnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add triangle to correct patchFaces.
|
// Add triangle to correct patchFaces.
|
||||||
patchFaces[patchi].append(triPoints);
|
patchFaces[patchi].append(triPoints);
|
||||||
@ -549,10 +549,15 @@ void readCells
|
|||||||
|
|
||||||
renumber(mshToFoam, quadPoints);
|
renumber(mshToFoam, quadPoints);
|
||||||
|
|
||||||
Map<label>::iterator regFnd = physToPatch.find(regPhys);
|
const auto regFnd = physToPatch.cfind(regPhys);
|
||||||
|
|
||||||
label patchi = -1;
|
label patchi = -1;
|
||||||
if (regFnd == physToPatch.end())
|
if (regFnd.found())
|
||||||
|
{
|
||||||
|
// Existing patch for region
|
||||||
|
patchi = regFnd();
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// New region. Allocate patch for it.
|
// New region. Allocate patch for it.
|
||||||
patchi = patchFaces.size();
|
patchi = patchFaces.size();
|
||||||
@ -565,11 +570,6 @@ void readCells
|
|||||||
physToPatch.insert(regPhys, patchi);
|
physToPatch.insert(regPhys, patchi);
|
||||||
patchToPhys[patchi] = regPhys;
|
patchToPhys[patchi] = regPhys;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
// Existing patch for region
|
|
||||||
patchi = regFnd();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add quad to correct patchFaces.
|
// Add quad to correct patchFaces.
|
||||||
patchFaces[patchi].append(quadPoints);
|
patchFaces[patchi].append(quadPoints);
|
||||||
@ -748,15 +748,15 @@ void readCells
|
|||||||
Info<< "CellZones:" << nl
|
Info<< "CellZones:" << nl
|
||||||
<< "Zone\tSize" << endl;
|
<< "Zone\tSize" << endl;
|
||||||
|
|
||||||
forAll(zoneCells, zoneI)
|
forAll(zoneCells, zonei)
|
||||||
{
|
{
|
||||||
zoneCells[zoneI].shrink();
|
zoneCells[zonei].shrink();
|
||||||
|
|
||||||
const labelList& zCells = zoneCells[zoneI];
|
const labelList& zCells = zoneCells[zonei];
|
||||||
|
|
||||||
if (zCells.size())
|
if (zCells.size())
|
||||||
{
|
{
|
||||||
Info<< " " << zoneI << '\t' << zCells.size() << endl;
|
Info<< " " << zonei << '\t' << zCells.size() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
@ -870,11 +870,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label nValidCellZones = 0;
|
label nValidCellZones = 0;
|
||||||
|
|
||||||
forAll(zoneCells, zoneI)
|
forAll(zoneCells, zonei)
|
||||||
{
|
{
|
||||||
if (zoneCells[zoneI].size())
|
if (zoneCells[zonei].size())
|
||||||
{
|
{
|
||||||
nValidCellZones++;
|
++nValidCellZones;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -895,18 +895,13 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(boundaryPatchNames, patchi)
|
forAll(boundaryPatchNames, patchi)
|
||||||
{
|
{
|
||||||
label physReg = patchToPhys[patchi];
|
boundaryPatchNames[patchi] =
|
||||||
|
physicalNames.lookup
|
||||||
|
(
|
||||||
|
patchToPhys[patchi],
|
||||||
|
"patch" + Foam::name(patchi) // default name
|
||||||
|
);
|
||||||
|
|
||||||
Map<word>::const_iterator iter = physicalNames.find(physReg);
|
|
||||||
|
|
||||||
if (iter != physicalNames.end())
|
|
||||||
{
|
|
||||||
boundaryPatchNames[patchi] = iter();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
boundaryPatchNames[patchi] = word("patch") + name(patchi);
|
|
||||||
}
|
|
||||||
Info<< "Patch " << patchi << " gets name "
|
Info<< "Patch " << patchi << " gets name "
|
||||||
<< boundaryPatchNames[patchi] << endl;
|
<< boundaryPatchNames[patchi] << endl;
|
||||||
}
|
}
|
||||||
@ -1001,17 +996,17 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "FaceZones:" << nl
|
Info<< "FaceZones:" << nl
|
||||||
<< "Zone\tSize" << endl;
|
<< "Zone\tSize" << endl;
|
||||||
|
|
||||||
forAll(zoneFaces, zoneI)
|
forAll(zoneFaces, zonei)
|
||||||
{
|
{
|
||||||
zoneFaces[zoneI].shrink();
|
zoneFaces[zonei].shrink();
|
||||||
|
|
||||||
const labelList& zFaces = zoneFaces[zoneI];
|
const labelList& zFaces = zoneFaces[zonei];
|
||||||
|
|
||||||
if (zFaces.size())
|
if (zFaces.size())
|
||||||
{
|
{
|
||||||
nValidFaceZones++;
|
++nValidFaceZones;
|
||||||
|
|
||||||
Info<< " " << zoneI << '\t' << zFaces.size() << endl;
|
Info<< " " << zonei << '\t' << zFaces.size() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
@ -1036,31 +1031,30 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
nValidCellZones = 0;
|
nValidCellZones = 0;
|
||||||
|
|
||||||
forAll(zoneCells, zoneI)
|
forAll(zoneCells, zonei)
|
||||||
{
|
{
|
||||||
if (zoneCells[zoneI].size())
|
if (zoneCells[zonei].size())
|
||||||
{
|
{
|
||||||
label physReg = zoneToPhys[zoneI];
|
const word zoneName
|
||||||
|
(
|
||||||
|
physicalNames.lookup
|
||||||
|
(
|
||||||
|
zoneToPhys[zonei],
|
||||||
|
"cellZone_" + Foam::name(zonei) // default name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
Map<word>::const_iterator iter = physicalNames.find(physReg);
|
Info<< "Writing zone " << zonei << " to cellZone "
|
||||||
|
|
||||||
word zoneName = "cellZone_" + name(zoneI);
|
|
||||||
if (iter != physicalNames.end())
|
|
||||||
{
|
|
||||||
zoneName = iter();
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Writing zone " << zoneI << " to cellZone "
|
|
||||||
<< zoneName << " and cellSet"
|
<< zoneName << " and cellSet"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
cellSet cset(mesh, zoneName, zoneCells[zoneI]);
|
cellSet cset(mesh, zoneName, zoneCells[zonei]);
|
||||||
cset.write();
|
cset.write();
|
||||||
|
|
||||||
cz[nValidCellZones] = new cellZone
|
cz[nValidCellZones] = new cellZone
|
||||||
(
|
(
|
||||||
zoneName,
|
zoneName,
|
||||||
zoneCells[zoneI],
|
zoneCells[zonei],
|
||||||
nValidCellZones,
|
nValidCellZones,
|
||||||
mesh.cellZones()
|
mesh.cellZones()
|
||||||
);
|
);
|
||||||
@ -1075,31 +1069,30 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
nValidFaceZones = 0;
|
nValidFaceZones = 0;
|
||||||
|
|
||||||
forAll(zoneFaces, zoneI)
|
forAll(zoneFaces, zonei)
|
||||||
{
|
{
|
||||||
if (zoneFaces[zoneI].size())
|
if (zoneFaces[zonei].size())
|
||||||
{
|
{
|
||||||
label physReg = patchToPhys[zoneI];
|
const word zoneName
|
||||||
|
(
|
||||||
|
physicalNames.lookup
|
||||||
|
(
|
||||||
|
patchToPhys[zonei],
|
||||||
|
"faceZone_" + Foam::name(zonei) // default name
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
Map<word>::const_iterator iter = physicalNames.find(physReg);
|
Info<< "Writing zone " << zonei << " to faceZone "
|
||||||
|
|
||||||
word zoneName = "faceZone_" + name(zoneI);
|
|
||||||
if (iter != physicalNames.end())
|
|
||||||
{
|
|
||||||
zoneName = iter();
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "Writing zone " << zoneI << " to faceZone "
|
|
||||||
<< zoneName << " and faceSet"
|
<< zoneName << " and faceSet"
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
faceSet fset(mesh, zoneName, zoneFaces[zoneI]);
|
faceSet fset(mesh, zoneName, zoneFaces[zonei]);
|
||||||
fset.write();
|
fset.write();
|
||||||
|
|
||||||
fz[nValidFaceZones] = new faceZone
|
fz[nValidFaceZones] = new faceZone
|
||||||
(
|
(
|
||||||
zoneName,
|
zoneName,
|
||||||
zoneFaces[zoneI],
|
zoneFaces[zonei],
|
||||||
true, // all are flipped
|
true, // all are flipped
|
||||||
nValidFaceZones,
|
nValidFaceZones,
|
||||||
mesh.faceZones()
|
mesh.faceZones()
|
||||||
|
|||||||
@ -327,10 +327,8 @@ if
|
|||||||
{
|
{
|
||||||
scalar minz = GREAT;
|
scalar minz = GREAT;
|
||||||
|
|
||||||
forAllConstIter(SLList<face>, pFaces[CYLINDERHEAD][0], iter)
|
for (const face& pf : pFaces[CYLINDERHEAD][0])
|
||||||
{
|
{
|
||||||
const face& pf = iter();
|
|
||||||
|
|
||||||
forAll(pf, pfi)
|
forAll(pf, pfi)
|
||||||
{
|
{
|
||||||
minz = min(minz, points[pf[pfi]].z());
|
minz = min(minz, points[pf[pfi]].z());
|
||||||
@ -341,10 +339,8 @@ if
|
|||||||
|
|
||||||
SLList<face> newLinerFaces;
|
SLList<face> newLinerFaces;
|
||||||
|
|
||||||
forAllConstIter(SLList<face>, pFaces[LINER][0], iter)
|
for (const face& pf : pFaces[LINER][0])
|
||||||
{
|
{
|
||||||
const face& pf = iter();
|
|
||||||
|
|
||||||
scalar minfz = GREAT;
|
scalar minfz = GREAT;
|
||||||
forAll(pf, pfi)
|
forAll(pf, pfi)
|
||||||
{
|
{
|
||||||
@ -370,10 +366,8 @@ if
|
|||||||
|
|
||||||
SLList<face> newCylinderHeadFaces;
|
SLList<face> newCylinderHeadFaces;
|
||||||
|
|
||||||
forAllConstIter(SLList<face>, pFaces[CYLINDERHEAD][0], iter)
|
for (const face& pf : pFaces[CYLINDERHEAD][0])
|
||||||
{
|
{
|
||||||
const face& pf = iter();
|
|
||||||
|
|
||||||
scalar minfz = GREAT;
|
scalar minfz = GREAT;
|
||||||
forAll(pf, pfi)
|
forAll(pf, pfi)
|
||||||
{
|
{
|
||||||
@ -421,12 +415,13 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size())
|
|||||||
|
|
||||||
const scalar tanTheta = Foam::tan(degToRad(2.5));
|
const scalar tanTheta = Foam::tan(degToRad(2.5));
|
||||||
|
|
||||||
SLList<face>::iterator iterf = pFaces[WEDGE][0].begin();
|
auto iterf = pFaces[WEDGE][0].begin();
|
||||||
SLList<face>::iterator iterb = pFaces[WEDGE][1].begin();
|
auto iterb = pFaces[WEDGE][1].begin();
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
iterf != pFaces[WEDGE][0].end() && iterb != pFaces[WEDGE][1].end();
|
iterf.good() && iterb.good();
|
||||||
++iterf, ++iterb
|
++iterf, ++iterb
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
@ -441,9 +436,9 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size())
|
|||||||
{
|
{
|
||||||
pFaces[CYCLIC].setSize(1);
|
pFaces[CYCLIC].setSize(1);
|
||||||
pFaces[CYCLIC][0] = pFaces[WEDGE][0];
|
pFaces[CYCLIC][0] = pFaces[WEDGE][0];
|
||||||
forAllIter(SLList<face>, pFaces[WEDGE][1], iterb)
|
for (const face& pf : pFaces[WEDGE][1])
|
||||||
{
|
{
|
||||||
pFaces[CYCLIC][0].append(iterb());
|
pFaces[CYCLIC][0].append(pf);
|
||||||
}
|
}
|
||||||
|
|
||||||
pFaces[WEDGE].clear();
|
pFaces[WEDGE].clear();
|
||||||
|
|||||||
@ -213,18 +213,16 @@ int main(int argc, char *argv[])
|
|||||||
// Get the four (outwards pointing) faces of the cell
|
// Get the four (outwards pointing) faces of the cell
|
||||||
faceList tris(cll.faces());
|
faceList tris(cll.faces());
|
||||||
|
|
||||||
forAll(tris, i)
|
for (const face& f : tris)
|
||||||
{
|
{
|
||||||
const face& f = tris[i];
|
|
||||||
|
|
||||||
// Is there any boundary face with same vertices?
|
// Is there any boundary face with same vertices?
|
||||||
// (uses commutative hash)
|
// (uses commutative hash)
|
||||||
auto iter = vertsToBoundary.find(triFace(f[0], f[1], f[2]));
|
auto iter = vertsToBoundary.find(triFace(f[0], f[1], f[2]));
|
||||||
|
|
||||||
if (iter.found())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
label facei = iter.object();
|
|
||||||
const triFace& tri = iter.key();
|
const triFace& tri = iter.key();
|
||||||
|
const label facei = iter.val();
|
||||||
|
|
||||||
// Determine orientation of tri v.s. cell centre.
|
// Determine orientation of tri v.s. cell centre.
|
||||||
point cc(cll.centre(points));
|
point cc(cll.centre(points));
|
||||||
|
|||||||
@ -438,23 +438,22 @@ int main(int argc, char *argv[])
|
|||||||
// Get Foam patchID and update region->patch table.
|
// Get Foam patchID and update region->patch table.
|
||||||
label patchi = 0;
|
label patchi = 0;
|
||||||
|
|
||||||
Map<label>::iterator patchFind =
|
const auto patchFind = regionToPatch.cfind(region);
|
||||||
regionToPatch.find(region);
|
|
||||||
|
|
||||||
if (patchFind == regionToPatch.end())
|
if (patchFind.found())
|
||||||
|
{
|
||||||
|
patchi = *patchFind;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
patchi = nPatches;
|
patchi = nPatches;
|
||||||
|
|
||||||
Info<< "Mapping tetgen region " << region
|
Info<< "Mapping tetgen region " << region
|
||||||
<< " to Foam patch "
|
<< " to patch "
|
||||||
<< patchi << endl;
|
<< patchi << endl;
|
||||||
|
|
||||||
regionToPatch.insert(region, nPatches++);
|
regionToPatch.insert(region, nPatches++);
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
patchi = patchFind();
|
|
||||||
}
|
|
||||||
|
|
||||||
boundaryPatch[facei] = patchi;
|
boundaryPatch[facei] = patchi;
|
||||||
|
|
||||||
@ -479,7 +478,7 @@ int main(int argc, char *argv[])
|
|||||||
// Print region to patch mapping
|
// Print region to patch mapping
|
||||||
Info<< "Regions:" << endl;
|
Info<< "Regions:" << endl;
|
||||||
|
|
||||||
forAllConstIter(Map<label>, regionToPatch, iter)
|
forAllConstIters(regionToPatch, iter)
|
||||||
{
|
{
|
||||||
Info<< " region:" << iter.key() << '\t' << "patch:"
|
Info<< " region:" << iter.key() << '\t' << "patch:"
|
||||||
<< iter() << endl;
|
<< iter() << endl;
|
||||||
@ -493,7 +492,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
forAll(patchNames, patchi)
|
forAll(patchNames, patchi)
|
||||||
{
|
{
|
||||||
patchNames[patchi] = word("patch") + name(patchi);
|
patchNames[patchi] = "patch" + Foam::name(patchi);
|
||||||
}
|
}
|
||||||
|
|
||||||
wordList patchTypes(nPatches, polyPatch::typeName);
|
wordList patchTypes(nPatches, polyPatch::typeName);
|
||||||
|
|||||||
@ -119,32 +119,32 @@ void writePoints
|
|||||||
|
|
||||||
label v0;
|
label v0;
|
||||||
|
|
||||||
Map<label>::iterator e0Fnd = pointToObj.find(e[0]);
|
const auto e0Fnd = pointToObj.cfind(e[0]);
|
||||||
|
|
||||||
if (e0Fnd == pointToObj.end())
|
if (e0Fnd.found())
|
||||||
{
|
{
|
||||||
meshTools::writeOBJ(str, mesh.points()[e[0]]);
|
v0 = *e0Fnd;
|
||||||
v0 = vertI++;
|
|
||||||
pointToObj.insert(e[0], v0);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
v0 = e0Fnd();
|
v0 = vertI++;
|
||||||
|
meshTools::writeOBJ(str, mesh.points()[e[0]]);
|
||||||
|
pointToObj.insert(e[0], v0);
|
||||||
}
|
}
|
||||||
|
|
||||||
label v1;
|
label v1;
|
||||||
|
|
||||||
Map<label>::iterator e1Fnd = pointToObj.find(e[1]);
|
const auto e1Fnd = pointToObj.cfind(e[1]);
|
||||||
|
|
||||||
if (e1Fnd == pointToObj.end())
|
if (e1Fnd.found())
|
||||||
{
|
{
|
||||||
meshTools::writeOBJ(str, mesh.points()[e[1]]);
|
v1 = *e1Fnd;
|
||||||
v1 = vertI++;
|
|
||||||
pointToObj.insert(e[1], v1);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
v1 = e1Fnd();
|
v1 = vertI++;
|
||||||
|
meshTools::writeOBJ(str, mesh.points()[e[1]]);
|
||||||
|
pointToObj.insert(e[1], v1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -68,7 +68,7 @@
|
|||||||
forAllConstIters(zoneMap, iter)
|
forAllConstIters(zoneMap, iter)
|
||||||
{
|
{
|
||||||
const word& zoneName = iter.key();
|
const word& zoneName = iter.key();
|
||||||
const label zonei = iter.object();
|
const label zonei = iter.val();
|
||||||
|
|
||||||
cz[zonei] = new cellZone
|
cz[zonei] = new cellZone
|
||||||
(
|
(
|
||||||
|
|||||||
@ -1796,9 +1796,8 @@ int main(int argc, char *argv[])
|
|||||||
forAll(zones, i)
|
forAll(zones, i)
|
||||||
{
|
{
|
||||||
const faceSet& fz = zones[i];
|
const faceSet& fz = zones[i];
|
||||||
forAllConstIter(faceSet, fz, iter)
|
for (const label facei : fz)
|
||||||
{
|
{
|
||||||
label facei = iter.key();
|
|
||||||
if (mesh.isInternalFace(facei))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
FatalIOErrorInFunction(dict)
|
||||||
@ -1834,9 +1833,9 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
label nShadowFaces = 0;
|
label nShadowFaces = 0;
|
||||||
forAll(shadowZones, i)
|
for (const faceSet& fz : shadowZones)
|
||||||
{
|
{
|
||||||
nShadowFaces += shadowZones[i].size();
|
nShadowFaces += fz.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nExtrudeFaces != nShadowFaces)
|
if (nExtrudeFaces != nShadowFaces)
|
||||||
@ -1856,9 +1855,8 @@ int main(int argc, char *argv[])
|
|||||||
forAll(shadowZones, i)
|
forAll(shadowZones, i)
|
||||||
{
|
{
|
||||||
const faceSet& fz = shadowZones[i];
|
const faceSet& fz = shadowZones[i];
|
||||||
forAllConstIter(faceSet, fz, iter)
|
for (const label facei : fz)
|
||||||
{
|
{
|
||||||
label facei = iter.key();
|
|
||||||
if (mesh.isInternalFace(facei))
|
if (mesh.isInternalFace(facei))
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
FatalIOErrorInFunction(dict)
|
||||||
@ -1885,7 +1883,6 @@ int main(int argc, char *argv[])
|
|||||||
checkZoneInside(mesh, zoneNames, zoneID, extrudeMeshFaces, isInternal);
|
checkZoneInside(mesh, zoneNames, zoneID, extrudeMeshFaces, isInternal);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const pointField& extrudePoints = extrudePatch.localPoints();
|
const pointField& extrudePoints = extrudePatch.localPoints();
|
||||||
const faceList& extrudeFaces = extrudePatch.localFaces();
|
const faceList& extrudeFaces = extrudePatch.localFaces();
|
||||||
const labelListList& edgeFaces = extrudePatch.edgeFaces();
|
const labelListList& edgeFaces = extrudePatch.edgeFaces();
|
||||||
|
|||||||
@ -154,7 +154,7 @@ void Foam::patchToPoly2DMesh::addPatchFacesToFaces()
|
|||||||
|
|
||||||
forAll(patchNames_, patchi)
|
forAll(patchNames_, patchi)
|
||||||
{
|
{
|
||||||
forAllConstIter(EdgeMap<label>, mapEdgesRegion_, eIter)
|
forAllConstIters(mapEdgesRegion_, eIter)
|
||||||
{
|
{
|
||||||
if (eIter() == patchi)
|
if (eIter() == patchi)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -409,18 +409,15 @@ void Foam::DistributedDelaunayMesh<Triangulation>::markVerticesToRefer
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<labelList>::const_iterator iter =
|
const auto iter = circumsphereOverlaps.cfind(cit->cellIndex());
|
||||||
circumsphereOverlaps.find(cit->cellIndex());
|
|
||||||
|
|
||||||
// Pre-tested circumsphere potential influence
|
// Pre-tested circumsphere potential influence
|
||||||
if (iter != circumsphereOverlaps.cend())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
const labelList& citOverlaps = iter();
|
const labelList& citOverlaps = iter();
|
||||||
|
|
||||||
forAll(citOverlaps, cOI)
|
for (const label proci : citOverlaps)
|
||||||
{
|
{
|
||||||
label proci = citOverlaps[cOI];
|
|
||||||
|
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
Vertex_handle v = cit->vertex(i);
|
Vertex_handle v = cit->vertex(i);
|
||||||
@ -1025,13 +1022,4 @@ Foam::DistributedDelaunayMesh<Triangulation>::rangeInsertReferredWithInfo
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -96,12 +96,12 @@ void Foam::PrintTable<KeyType, DataType>::print
|
|||||||
|
|
||||||
Map<DataType>& key = combinedTable[iter.key()];
|
Map<DataType>& key = combinedTable[iter.key()];
|
||||||
|
|
||||||
key.insert(proci, iter.object());
|
key.insert(proci, iter.val());
|
||||||
|
|
||||||
forAllConstIters(key, dataIter)
|
forAllConstIters(key, dataIter)
|
||||||
{
|
{
|
||||||
std::ostringstream buf;
|
std::ostringstream buf;
|
||||||
buf << dataIter.object();
|
buf << dataIter.val();
|
||||||
|
|
||||||
largestDataLength = max
|
largestDataLength = max
|
||||||
(
|
(
|
||||||
|
|||||||
@ -212,10 +212,8 @@ bool Foam::linearDistance::setCellSize(const pointField& pts)
|
|||||||
{
|
{
|
||||||
// labelHashSet surfaceAlreadyHit(surfaceCellSize_.size());
|
// labelHashSet surfaceAlreadyHit(surfaceCellSize_.size());
|
||||||
|
|
||||||
// forAll(pts, ptI)
|
// for (const Foam::point& pt : pts)
|
||||||
// {
|
// {
|
||||||
// const Foam::point& pt = pts[ptI];
|
|
||||||
|
|
||||||
// List<pointIndexHit> hits;
|
// List<pointIndexHit> hits;
|
||||||
|
|
||||||
// surface_.findNearest
|
// surface_.findNearest
|
||||||
|
|||||||
@ -192,10 +192,8 @@ bool Foam::uniformDistance::setCellSize
|
|||||||
{
|
{
|
||||||
// labelHashSet surfaceAlreadyHit(surface_.size());
|
// labelHashSet surfaceAlreadyHit(surface_.size());
|
||||||
//
|
//
|
||||||
// forAll(pts, ptI)
|
// for (const Foam::point& pt : pts)
|
||||||
// {
|
// {
|
||||||
// const Foam::point& pt = pts[ptI];
|
|
||||||
//
|
|
||||||
// List<pointIndexHit> hits;
|
// List<pointIndexHit> hits;
|
||||||
//
|
//
|
||||||
// surface_.findNearest
|
// surface_.findNearest
|
||||||
|
|||||||
@ -2278,11 +2278,11 @@ void Foam::conformalVoronoiMesh::reinsertSurfaceConformation()
|
|||||||
Vb& v = surfaceConformationVertices_[vI];
|
Vb& v = surfaceConformationVertices_[vI];
|
||||||
label& vIndex = v.index();
|
label& vIndex = v.index();
|
||||||
|
|
||||||
Map<label>::const_iterator iter = oldToNewIndices.find(vIndex);
|
const auto iter = oldToNewIndices.cfind(vIndex);
|
||||||
|
|
||||||
if (iter != oldToNewIndices.end())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
const label newIndex = iter();
|
const label newIndex = *iter;
|
||||||
|
|
||||||
if (newIndex != -1)
|
if (newIndex != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -411,7 +411,7 @@ void Foam::conformalVoronoiMesh::createEdgePointGroupByCirculating
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
forAllConstIter(Map<Foam::point>, masterPoints, iter)
|
forAllConstIters(masterPoints, iter)
|
||||||
{
|
{
|
||||||
const Foam::point& pt = masterPoints[iter.key()];
|
const Foam::point& pt = masterPoints[iter.key()];
|
||||||
const vertexType ptType = masterPointsTypes[iter.key()];
|
const vertexType ptType = masterPointsTypes[iter.key()];
|
||||||
|
|||||||
@ -618,12 +618,11 @@ void Foam::featurePointConformer::reIndexPointPairs
|
|||||||
{
|
{
|
||||||
const label currentIndex = featurePointVertices_[vI].index();
|
const label currentIndex = featurePointVertices_[vI].index();
|
||||||
|
|
||||||
Map<label>::const_iterator newIndexIter =
|
const auto newIndexIter = oldToNewIndices.cfind(currentIndex);
|
||||||
oldToNewIndices.find(currentIndex);
|
|
||||||
|
|
||||||
if (newIndexIter != oldToNewIndices.end())
|
if (newIndexIter.found())
|
||||||
{
|
{
|
||||||
featurePointVertices_[vI].index() = newIndexIter();
|
featurePointVertices_[vI].index() = *newIndexIter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -78,7 +78,7 @@ Foam::Ostream& Foam::operator<<
|
|||||||
os << " "
|
os << " "
|
||||||
<< extendedFeatureEdgeMesh::edgeStatusNames_[iter.key()]
|
<< extendedFeatureEdgeMesh::edgeStatusNames_[iter.key()]
|
||||||
<< " = "
|
<< " = "
|
||||||
<< iter.object()
|
<< iter.val()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -509,7 +509,7 @@ Foam::conformationSurfaces::conformationSurfaces
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
forAllConstIter(Map<sideVolumeType>, regionVolumeTypes[surfI], iter)
|
forAllConstIters(regionVolumeTypes[surfI], iter)
|
||||||
{
|
{
|
||||||
label globalRegionI = regionOffset_[surfI] + iter.key();
|
label globalRegionI = regionOffset_[surfI] + iter.key();
|
||||||
|
|
||||||
@ -518,7 +518,7 @@ Foam::conformationSurfaces::conformationSurfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Map<autoPtr<dictionary>>& localInfo = regionPatchInfo[surfI];
|
const Map<autoPtr<dictionary>>& localInfo = regionPatchInfo[surfI];
|
||||||
forAllConstIter(Map<autoPtr<dictionary>>, localInfo, iter)
|
forAllConstIters(localInfo, iter)
|
||||||
{
|
{
|
||||||
label globalRegionI = regionOffset_[surfI] + iter.key();
|
label globalRegionI = regionOffset_[surfI] + iter.key();
|
||||||
|
|
||||||
|
|||||||
@ -117,10 +117,8 @@ inline bool Foam::pointPairs<Triangulation>::addPointPair
|
|||||||
const DynamicList<labelPair>& slaves
|
const DynamicList<labelPair>& slaves
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(slaves, sI)
|
for (const labelPair& slave : slaves)
|
||||||
{
|
{
|
||||||
const labelPair& slave = slaves[sI];
|
|
||||||
|
|
||||||
addPointPair(master, slave);
|
addPointPair(master, slave);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -190,10 +188,9 @@ void Foam::pointPairs<Triangulation>::reIndex(const Map<label>& oldToNewIndices)
|
|||||||
|
|
||||||
if (start.second() == Pstream::myProcNo())
|
if (start.second() == Pstream::myProcNo())
|
||||||
{
|
{
|
||||||
Map<label>::const_iterator iter2 =
|
const auto iter2 = oldToNewIndices.cfind(start.first());
|
||||||
oldToNewIndices.find(start.first());
|
|
||||||
|
|
||||||
if (iter2 != oldToNewIndices.end())
|
if (iter2.found())
|
||||||
{
|
{
|
||||||
if (iter2() != -1)
|
if (iter2() != -1)
|
||||||
{
|
{
|
||||||
@ -208,10 +205,9 @@ void Foam::pointPairs<Triangulation>::reIndex(const Map<label>& oldToNewIndices)
|
|||||||
|
|
||||||
if (end.second() == Pstream::myProcNo())
|
if (end.second() == Pstream::myProcNo())
|
||||||
{
|
{
|
||||||
Map<label>::const_iterator iter2 =
|
const auto iter2 = oldToNewIndices.cfind(end.first());
|
||||||
oldToNewIndices.find(end.first());
|
|
||||||
|
|
||||||
if (iter2 != oldToNewIndices.end())
|
if (iter2.found())
|
||||||
{
|
{
|
||||||
if (iter2() != -1)
|
if (iter2() != -1)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -55,7 +55,7 @@ void Foam::shortEdgeFilter2D::assignBoundaryPointRegions
|
|||||||
List<DynamicList<label>>& boundaryPointRegions
|
List<DynamicList<label>>& boundaryPointRegions
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
forAllConstIter(EdgeMap<label>, mapEdgesRegion_, iter)
|
forAllConstIters(mapEdgesRegion_, iter)
|
||||||
{
|
{
|
||||||
const edge& e = iter.key();
|
const edge& e = iter.key();
|
||||||
const label& regionI = iter();
|
const label& regionI = iter();
|
||||||
@ -188,7 +188,7 @@ Foam::shortEdgeFilter2D::shortEdgeFilter2D
|
|||||||
|
|
||||||
Info<< "Writing indirectPatchEdges to " << str.name() << endl;
|
Info<< "Writing indirectPatchEdges to " << str.name() << endl;
|
||||||
|
|
||||||
forAllConstIter(EdgeMap<label>, indirectPatchEdge_, iter)
|
forAllConstIters(indirectPatchEdge_, iter)
|
||||||
{
|
{
|
||||||
const edge& e = iter.key();
|
const edge& e = iter.key();
|
||||||
|
|
||||||
|
|||||||
@ -293,7 +293,7 @@ autoPtr<refinementSurfaces> createRefinementSurfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Overwrite with region specific information
|
// Overwrite with region specific information
|
||||||
forAllConstIter(Map<label>, regionMinLevel[surfi], iter)
|
forAllConstIters(regionMinLevel[surfi], iter)
|
||||||
{
|
{
|
||||||
label globalRegioni = regionOffset[surfi] + iter.key();
|
label globalRegioni = regionOffset[surfi] + iter.key();
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ autoPtr<refinementSurfaces> createRefinementSurfaces
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Map<autoPtr<dictionary>>& localInfo = regionPatchInfo[surfi];
|
const Map<autoPtr<dictionary>>& localInfo = regionPatchInfo[surfi];
|
||||||
forAllConstIter(Map<autoPtr<dictionary>>, localInfo, iter)
|
forAllConstIters(localInfo, iter)
|
||||||
{
|
{
|
||||||
label globalRegioni = regionOffset[surfi] + iter.key();
|
label globalRegioni = regionOffset[surfi] + iter.key();
|
||||||
patchInfo.set(globalRegioni, iter()().clone());
|
patchInfo.set(globalRegioni, iter()().clone());
|
||||||
@ -403,7 +403,7 @@ void extractSurface
|
|||||||
|
|
||||||
// Allocate zone/patch for all patches
|
// Allocate zone/patch for all patches
|
||||||
HashTable<label> compactZoneID(1024);
|
HashTable<label> compactZoneID(1024);
|
||||||
forAllConstIter(HashTable<label>, patchSize, iter)
|
forAllConstIters(patchSize, iter)
|
||||||
{
|
{
|
||||||
label sz = compactZoneID.size();
|
label sz = compactZoneID.size();
|
||||||
compactZoneID.insert(iter.key(), sz);
|
compactZoneID.insert(iter.key(), sz);
|
||||||
@ -413,7 +413,7 @@ void extractSurface
|
|||||||
|
|
||||||
// Rework HashTable into labelList just for speed of conversion
|
// Rework HashTable into labelList just for speed of conversion
|
||||||
labelList patchToCompactZone(bMesh.size(), -1);
|
labelList patchToCompactZone(bMesh.size(), -1);
|
||||||
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
forAllConstIters(compactZoneID, iter)
|
||||||
{
|
{
|
||||||
label patchi = bMesh.findPatchID(iter.key());
|
label patchi = bMesh.findPatchID(iter.key());
|
||||||
if (patchi != -1)
|
if (patchi != -1)
|
||||||
@ -504,7 +504,7 @@ void extractSurface
|
|||||||
|
|
||||||
// Zones
|
// Zones
|
||||||
surfZoneIdentifierList surfZones(compactZoneID.size());
|
surfZoneIdentifierList surfZones(compactZoneID.size());
|
||||||
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
forAllConstIters(compactZoneID, iter)
|
||||||
{
|
{
|
||||||
surfZones[iter()] = surfZoneIdentifier(iter.key(), iter());
|
surfZones[iter()] = surfZoneIdentifier(iter.key(), iter());
|
||||||
Info<< "surfZone " << iter() << " : " << surfZones[iter()].name()
|
Info<< "surfZone " << iter() << " : " << surfZones[iter()].name()
|
||||||
|
|||||||
@ -241,7 +241,7 @@ bool Foam::checkWedges
|
|||||||
if (setPtr)
|
if (setPtr)
|
||||||
{
|
{
|
||||||
setPtr->resize(2*nEdgesInError);
|
setPtr->resize(2*nEdgesInError);
|
||||||
forAllConstIter(EdgeMap<label>, edgesInError, iter)
|
forAllConstIters(edgesInError, iter)
|
||||||
{
|
{
|
||||||
if (iter() >= 0)
|
if (iter() >= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -307,9 +307,9 @@ void Foam::mergeAndWrite
|
|||||||
|
|
||||||
// Determine faces on outside of cellSet
|
// Determine faces on outside of cellSet
|
||||||
bitSet isInSet(mesh.nCells());
|
bitSet isInSet(mesh.nCells());
|
||||||
forAllConstIter(cellSet, set, iter)
|
for (const label celli : set)
|
||||||
{
|
{
|
||||||
isInSet.set(iter.key());
|
isInSet.set(celli);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -157,9 +157,9 @@ void subsetVolFields
|
|||||||
(
|
(
|
||||||
mesh.objectRegistry::lookupClass<GeoField>()
|
mesh.objectRegistry::lookupClass<GeoField>()
|
||||||
);
|
);
|
||||||
forAllConstIter(typename HashTable<const GeoField*>, fields, iter)
|
forAllConstIters(fields, iter)
|
||||||
{
|
{
|
||||||
const GeoField& fld = *iter();
|
const GeoField& fld = *iter.val();
|
||||||
|
|
||||||
Info<< "Mapping field " << fld.name() << endl;
|
Info<< "Mapping field " << fld.name() << endl;
|
||||||
|
|
||||||
@ -211,9 +211,9 @@ void subsetSurfaceFields
|
|||||||
(
|
(
|
||||||
mesh.objectRegistry::lookupClass<GeoField>()
|
mesh.objectRegistry::lookupClass<GeoField>()
|
||||||
);
|
);
|
||||||
forAllConstIter(typename HashTable<const GeoField*>, fields, iter)
|
forAllConstIters(fields, iter)
|
||||||
{
|
{
|
||||||
const GeoField& fld = *iter();
|
const GeoField& fld = *iter.val();
|
||||||
|
|
||||||
Info<< "Mapping field " << fld.name() << endl;
|
Info<< "Mapping field " << fld.name() << endl;
|
||||||
|
|
||||||
@ -278,19 +278,16 @@ void addToInterface
|
|||||||
max(ownRegion, neiRegion)
|
max(ownRegion, neiRegion)
|
||||||
);
|
);
|
||||||
|
|
||||||
EdgeMap<Map<label>>::iterator iter = regionsToSize.find
|
auto iter = regionsToSize.find(interface);
|
||||||
(
|
|
||||||
interface
|
|
||||||
);
|
|
||||||
|
|
||||||
if (iter != regionsToSize.end())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
// Check if zone present
|
// Check if zone present
|
||||||
Map<label>::iterator zoneFnd = iter().find(zoneID);
|
auto zoneIter = iter().find(zoneID);
|
||||||
if (zoneFnd != iter().end())
|
if (zoneIter.found())
|
||||||
{
|
{
|
||||||
// Found zone. Increment count.
|
// Found zone. Increment count.
|
||||||
zoneFnd()++;
|
++(*zoneIter);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -398,29 +395,26 @@ void getInterfaceSizes
|
|||||||
|
|
||||||
EdgeMap<Map<label>> slaveSizes(fromSlave);
|
EdgeMap<Map<label>> slaveSizes(fromSlave);
|
||||||
|
|
||||||
forAllConstIter(EdgeMap<Map<label>>, slaveSizes, slaveIter)
|
forAllConstIters(slaveSizes, slaveIter)
|
||||||
{
|
{
|
||||||
EdgeMap<Map<label>>::iterator masterIter =
|
const Map<label>& slaveInfo = *slaveIter;
|
||||||
regionsToSize.find(slaveIter.key());
|
|
||||||
|
|
||||||
if (masterIter != regionsToSize.end())
|
auto masterIter = regionsToSize.find(slaveIter.key());
|
||||||
|
|
||||||
|
if (masterIter.found())
|
||||||
{
|
{
|
||||||
// Same inter-region
|
// Same inter-region
|
||||||
const Map<label>& slaveInfo = slaveIter();
|
Map<label>& masterInfo = *masterIter;
|
||||||
Map<label>& masterInfo = masterIter();
|
|
||||||
|
|
||||||
forAllConstIter(Map<label>, slaveInfo, iter)
|
forAllConstIters(slaveInfo, iter)
|
||||||
{
|
{
|
||||||
label zoneID = iter.key();
|
const label zoneID = iter.key();
|
||||||
label slaveSize = iter();
|
const label slaveSize = iter.val();
|
||||||
|
|
||||||
Map<label>::iterator zoneFnd = masterInfo.find
|
auto zoneIter = masterInfo.find(zoneID);
|
||||||
(
|
if (zoneIter.found())
|
||||||
zoneID
|
|
||||||
);
|
|
||||||
if (zoneFnd != masterInfo.end())
|
|
||||||
{
|
{
|
||||||
zoneFnd() += slaveSize;
|
*zoneIter += slaveSize;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -430,7 +424,7 @@ void getInterfaceSizes
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
regionsToSize.insert(slaveIter.key(), slaveIter());
|
regionsToSize.insert(slaveIter.key(), slaveInfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -458,9 +452,9 @@ void getInterfaceSizes
|
|||||||
// Now we have the global sizes of all inter-regions.
|
// Now we have the global sizes of all inter-regions.
|
||||||
// Invert this on master and distribute.
|
// Invert this on master and distribute.
|
||||||
label nInterfaces = 0;
|
label nInterfaces = 0;
|
||||||
forAllConstIter(EdgeMap<Map<label>>, regionsToSize, iter)
|
forAllConstIters(regionsToSize, iter)
|
||||||
{
|
{
|
||||||
const Map<label>& info = iter();
|
const Map<label>& info = iter.val();
|
||||||
nInterfaces += info.size();
|
nInterfaces += info.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,14 +464,15 @@ void getInterfaceSizes
|
|||||||
EdgeMap<Map<label>> regionsToInterface(nInterfaces);
|
EdgeMap<Map<label>> regionsToInterface(nInterfaces);
|
||||||
|
|
||||||
nInterfaces = 0;
|
nInterfaces = 0;
|
||||||
forAllConstIter(EdgeMap<Map<label>>, regionsToSize, iter)
|
forAllConstIters(regionsToSize, iter)
|
||||||
{
|
{
|
||||||
const edge& e = iter.key();
|
const edge& e = iter.key();
|
||||||
|
const Map<label>& info = iter.val();
|
||||||
|
|
||||||
const word& name0 = regionNames[e[0]];
|
const word& name0 = regionNames[e[0]];
|
||||||
const word& name1 = regionNames[e[1]];
|
const word& name1 = regionNames[e[1]];
|
||||||
|
|
||||||
const Map<label>& info = iter();
|
forAllConstIters(info, infoIter)
|
||||||
forAllConstIter(Map<label>, info, infoIter)
|
|
||||||
{
|
{
|
||||||
interfaces[nInterfaces] = iter.key();
|
interfaces[nInterfaces] = iter.key();
|
||||||
label zoneID = infoIter.key();
|
label zoneID = infoIter.key();
|
||||||
@ -1666,9 +1661,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
blockedFace.setSize(mesh.nFaces(), false);
|
blockedFace.setSize(mesh.nFaces(), false);
|
||||||
|
|
||||||
forAllConstIter(faceSet, blockedFaceSet, iter)
|
for (const label facei : blockedFaceSet)
|
||||||
{
|
{
|
||||||
blockedFace[iter.key()] = true;
|
blockedFace[facei] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -842,16 +842,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
label i = 0;
|
label i = 0;
|
||||||
|
|
||||||
forAllIter
|
for (indexedParticle& p : lagrangianPositions[cloudI])
|
||||||
(
|
|
||||||
Cloud<indexedParticle>,
|
|
||||||
lagrangianPositions[cloudI],
|
|
||||||
iter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
iter().index() = i++;
|
p.index() = i++;
|
||||||
|
|
||||||
label celli = iter().cell();
|
label celli = p.cell();
|
||||||
|
|
||||||
// Check
|
// Check
|
||||||
if (celli < 0 || celli >= mesh.nCells())
|
if (celli < 0 || celli >= mesh.nCells())
|
||||||
@ -859,14 +854,14 @@ int main(int argc, char *argv[])
|
|||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Illegal cell number " << celli
|
<< "Illegal cell number " << celli
|
||||||
<< " for particle with index "
|
<< " for particle with index "
|
||||||
<< iter().index()
|
<< p.index()
|
||||||
<< " at position "
|
<< " at position "
|
||||||
<< iter().position() << nl
|
<< p.position() << nl
|
||||||
<< "Cell number should be between 0 and "
|
<< "Cell number should be between 0 and "
|
||||||
<< mesh.nCells()-1 << nl
|
<< mesh.nCells()-1 << nl
|
||||||
<< "On this mesh the particle should"
|
<< "On this mesh the particle should"
|
||||||
<< " be in cell "
|
<< " be in cell "
|
||||||
<< mesh.findCell(iter().position())
|
<< mesh.findCell(p.position())
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -876,7 +871,7 @@ int main(int argc, char *argv[])
|
|||||||
new SLList<indexedParticle*>();
|
new SLList<indexedParticle*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
cellParticles[cloudI][celli]->append(&iter());
|
cellParticles[cloudI][celli]->append(&p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read fields
|
// Read fields
|
||||||
|
|||||||
@ -55,16 +55,16 @@ void Foam::domainDecomposition::addInterProcFace
|
|||||||
List<DynamicList<DynamicList<label>>>& interPatchFaces
|
List<DynamicList<DynamicList<label>>>& interPatchFaces
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
Map<label>::iterator patchiter = nbrToInterPatch[ownerProc].find(nbrProc);
|
|
||||||
|
|
||||||
// Introduce turning index only for internal faces (are duplicated).
|
// Introduce turning index only for internal faces (are duplicated).
|
||||||
label ownerIndex = facei+1;
|
const label ownerIndex = facei+1;
|
||||||
label nbrIndex = -(facei+1);
|
const label nbrIndex = -(facei+1);
|
||||||
|
|
||||||
if (patchiter != nbrToInterPatch[ownerProc].end())
|
const auto patchiter = nbrToInterPatch[ownerProc].cfind(nbrProc);
|
||||||
|
|
||||||
|
if (patchiter.found())
|
||||||
{
|
{
|
||||||
// Existing interproc patch. Add to both sides.
|
// Existing interproc patch. Add to both sides.
|
||||||
label toNbrProcPatchi = patchiter();
|
const label toNbrProcPatchi = *patchiter;
|
||||||
interPatchFaces[ownerProc][toNbrProcPatchi].append(ownerIndex);
|
interPatchFaces[ownerProc][toNbrProcPatchi].append(ownerIndex);
|
||||||
|
|
||||||
if (isInternalFace(facei))
|
if (isInternalFace(facei))
|
||||||
@ -76,8 +76,9 @@ void Foam::domainDecomposition::addInterProcFace
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Create new interproc patches.
|
// Create new interproc patches.
|
||||||
label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
|
const label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
|
||||||
nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
|
nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
|
||||||
|
|
||||||
DynamicList<label> oneFace;
|
DynamicList<label> oneFace;
|
||||||
oneFace.append(ownerIndex);
|
oneFace.append(ownerIndex);
|
||||||
interPatchFaces[ownerProc].append(oneFace);
|
interPatchFaces[ownerProc].append(oneFace);
|
||||||
|
|||||||
@ -435,59 +435,55 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
// inside boundaries for the owner processor and try to find
|
// inside boundaries for the owner processor and try to find
|
||||||
// this inter-processor patch.
|
// this inter-processor patch.
|
||||||
|
|
||||||
const label ownerProc = faceToProc_[owner[edgeI]];
|
|
||||||
const label neighbourProc = faceToProc_[neighbour[edgeI]];
|
|
||||||
|
|
||||||
SLList<label>::iterator curInterProcBdrsOwnIter =
|
|
||||||
interProcBoundaries[ownerProc].begin();
|
|
||||||
|
|
||||||
SLList<SLList<label>>::iterator curInterProcBEdgesOwnIter =
|
|
||||||
interProcBEdges[ownerProc].begin();
|
|
||||||
|
|
||||||
bool interProcBouFound = false;
|
bool interProcBouFound = false;
|
||||||
|
|
||||||
|
const label ownProc = faceToProc_[owner[edgeI]];
|
||||||
|
const label neiProc = faceToProc_[neighbour[edgeI]];
|
||||||
|
|
||||||
|
auto curInterProcBdrsOwnIter =
|
||||||
|
interProcBoundaries[ownProc].cbegin();
|
||||||
|
|
||||||
|
auto curInterProcBEdgesOwnIter =
|
||||||
|
interProcBEdges[ownProc].begin();
|
||||||
|
|
||||||
// WARNING: Synchronous SLList iterators
|
// WARNING: Synchronous SLList iterators
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
curInterProcBdrsOwnIter
|
curInterProcBdrsOwnIter.good()
|
||||||
!= interProcBoundaries[ownerProc].end()
|
&& curInterProcBEdgesOwnIter.good();
|
||||||
&& curInterProcBEdgesOwnIter
|
++curInterProcBdrsOwnIter,
|
||||||
!= interProcBEdges[ownerProc].end();
|
++curInterProcBEdgesOwnIter
|
||||||
++curInterProcBdrsOwnIter, ++curInterProcBEdgesOwnIter
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (curInterProcBdrsOwnIter() == neighbourProc)
|
if (curInterProcBdrsOwnIter() == neiProc)
|
||||||
{
|
{
|
||||||
// the inter - processor boundary exists. Add the face
|
// the inter - processor boundary exists. Add the face
|
||||||
interProcBouFound = true;
|
interProcBouFound = true;
|
||||||
|
|
||||||
|
bool neighbourFound = false;
|
||||||
|
|
||||||
curInterProcBEdgesOwnIter().append(edgeI);
|
curInterProcBEdgesOwnIter().append(edgeI);
|
||||||
|
|
||||||
SLList<label>::iterator curInterProcBdrsNeiIter =
|
auto curInterProcBdrsNeiIter =
|
||||||
interProcBoundaries[neighbourProc].begin();
|
interProcBoundaries[neiProc].cbegin();
|
||||||
|
|
||||||
SLList<SLList<label>>::iterator
|
auto curInterProcBEdgesNeiIter =
|
||||||
curInterProcBEdgesNeiIter =
|
interProcBEdges[neiProc].begin();
|
||||||
interProcBEdges[neighbourProc].begin();
|
|
||||||
|
|
||||||
bool neighbourFound = false;
|
|
||||||
|
|
||||||
// WARNING: Synchronous SLList iterators
|
// WARNING: Synchronous SLList iterators
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
curInterProcBdrsNeiIter !=
|
curInterProcBdrsNeiIter.good()
|
||||||
interProcBoundaries[neighbourProc].end()
|
&& curInterProcBEdgesNeiIter.good();
|
||||||
&& curInterProcBEdgesNeiIter !=
|
|
||||||
interProcBEdges[neighbourProc].end();
|
|
||||||
++curInterProcBdrsNeiIter,
|
++curInterProcBdrsNeiIter,
|
||||||
++curInterProcBEdgesNeiIter
|
++curInterProcBEdgesNeiIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (curInterProcBdrsNeiIter() == ownerProc)
|
if (curInterProcBdrsNeiIter() == ownProc)
|
||||||
{
|
{
|
||||||
// boundary found. Add the face
|
// boundary found. Add the face
|
||||||
neighbourFound = true;
|
neighbourFound = true;
|
||||||
@ -504,7 +500,7 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
("faDomainDecomposition::decomposeMesh()")
|
("faDomainDecomposition::decomposeMesh()")
|
||||||
<< "Inconsistency in inter - "
|
<< "Inconsistency in inter - "
|
||||||
<< "processor boundary lists for processors "
|
<< "processor boundary lists for processors "
|
||||||
<< ownerProc << " and " << neighbourProc
|
<< ownProc << " and " << neiProc
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -520,12 +516,13 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
// set the new addressing information
|
// set the new addressing information
|
||||||
|
|
||||||
// owner
|
// owner
|
||||||
interProcBoundaries[ownerProc].append(neighbourProc);
|
interProcBoundaries[ownProc].append(neiProc);
|
||||||
interProcBEdges[ownerProc].append(SLList<label>(edgeI));
|
interProcBEdges[ownProc].append(SLList<label>(edgeI));
|
||||||
|
|
||||||
// neighbour
|
// neighbour
|
||||||
interProcBoundaries[neighbourProc].append(ownerProc);
|
interProcBoundaries[neiProc].append(ownProc);
|
||||||
interProcBEdges[neighbourProc].append
|
interProcBEdges[neiProc]
|
||||||
|
.append
|
||||||
(
|
(
|
||||||
SLList<label>(edgeI)
|
SLList<label>(edgeI)
|
||||||
);
|
);
|
||||||
@ -624,64 +621,59 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
|
|
||||||
cyclicParallel_ = true;
|
cyclicParallel_ = true;
|
||||||
|
|
||||||
label ownerProc = faceToProc_[firstEdgeFaces[edgeI]];
|
bool interProcBouFound = false;
|
||||||
label neighbourProc =
|
|
||||||
|
const label ownProc =
|
||||||
|
faceToProc_[firstEdgeFaces[edgeI]];
|
||||||
|
const label neiProc =
|
||||||
faceToProc_[secondEdgeFaces[edgeI]];
|
faceToProc_[secondEdgeFaces[edgeI]];
|
||||||
|
|
||||||
SLList<label>::iterator curInterProcBdrsOwnIter =
|
auto curInterProcBdrsOwnIter =
|
||||||
interProcBoundaries[ownerProc].begin();
|
interProcBoundaries[ownProc].cbegin();
|
||||||
|
|
||||||
SLList<SLList<label>>::iterator
|
auto curInterProcBEdgesOwnIter =
|
||||||
curInterProcBEdgesOwnIter =
|
interProcBEdges[ownProc].begin();
|
||||||
interProcBEdges[ownerProc].begin();
|
|
||||||
|
|
||||||
bool interProcBouFound = false;
|
|
||||||
|
|
||||||
// WARNING: Synchronous SLList iterators
|
// WARNING: Synchronous SLList iterators
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
curInterProcBdrsOwnIter !=
|
curInterProcBdrsOwnIter.good()
|
||||||
interProcBoundaries[ownerProc].end()
|
&& curInterProcBEdgesOwnIter.good();
|
||||||
&& curInterProcBEdgesOwnIter !=
|
|
||||||
interProcBEdges[ownerProc].end();
|
|
||||||
++curInterProcBdrsOwnIter,
|
++curInterProcBdrsOwnIter,
|
||||||
++curInterProcBEdgesOwnIter
|
++curInterProcBEdgesOwnIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (curInterProcBdrsOwnIter() == neighbourProc)
|
if (curInterProcBdrsOwnIter() == neiProc)
|
||||||
{
|
{
|
||||||
// the inter - processor boundary exists.
|
// the inter - processor boundary exists.
|
||||||
// Add the face
|
// Add the face
|
||||||
interProcBouFound = true;
|
interProcBouFound = true;
|
||||||
|
|
||||||
curInterProcBEdgesOwnIter().append
|
|
||||||
(patchStart + edgeI);
|
|
||||||
|
|
||||||
SLList<label>::iterator curInterProcBdrsNeiIter
|
|
||||||
= interProcBoundaries[neighbourProc].begin();
|
|
||||||
|
|
||||||
SLList<SLList<label>>::iterator
|
|
||||||
curInterProcBEdgesNeiIter =
|
|
||||||
interProcBEdges[neighbourProc].begin();
|
|
||||||
|
|
||||||
bool neighbourFound = false;
|
bool neighbourFound = false;
|
||||||
|
|
||||||
|
curInterProcBEdgesOwnIter()
|
||||||
|
.append(patchStart + edgeI);
|
||||||
|
|
||||||
|
auto curInterProcBdrsNeiIter
|
||||||
|
= interProcBoundaries[neiProc].cbegin();
|
||||||
|
|
||||||
|
auto curInterProcBEdgesNeiIter =
|
||||||
|
interProcBEdges[neiProc].begin();
|
||||||
|
|
||||||
// WARNING: Synchronous SLList iterators
|
// WARNING: Synchronous SLList iterators
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
curInterProcBdrsNeiIter
|
curInterProcBdrsNeiIter.good()
|
||||||
!= interProcBoundaries[neighbourProc].end()
|
&& curInterProcBEdgesNeiIter.good();
|
||||||
&& curInterProcBEdgesNeiIter
|
|
||||||
!= interProcBEdges[neighbourProc].end();
|
|
||||||
++curInterProcBdrsNeiIter,
|
++curInterProcBdrsNeiIter,
|
||||||
++curInterProcBEdgesNeiIter
|
++curInterProcBEdgesNeiIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (curInterProcBdrsNeiIter() == ownerProc)
|
if (curInterProcBdrsNeiIter() == ownProc)
|
||||||
{
|
{
|
||||||
// boundary found. Add the face
|
// boundary found. Add the face
|
||||||
neighbourFound = true;
|
neighbourFound = true;
|
||||||
@ -705,7 +697,7 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
"faDomainDecomposition::decomposeMesh()"
|
"faDomainDecomposition::decomposeMesh()"
|
||||||
) << "Inconsistency in inter-processor "
|
) << "Inconsistency in inter-processor "
|
||||||
<< "boundary lists for processors "
|
<< "boundary lists for processors "
|
||||||
<< ownerProc << " and " << neighbourProc
|
<< ownProc << " and " << neiProc
|
||||||
<< " in cyclic boundary matching"
|
<< " in cyclic boundary matching"
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
@ -722,15 +714,13 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
// set the new addressing information
|
// set the new addressing information
|
||||||
|
|
||||||
// owner
|
// owner
|
||||||
interProcBoundaries[ownerProc]
|
interProcBoundaries[ownProc].append(neiProc);
|
||||||
.append(neighbourProc);
|
interProcBEdges[ownProc]
|
||||||
interProcBEdges[ownerProc]
|
|
||||||
.append(SLList<label>(patchStart + edgeI));
|
.append(SLList<label>(patchStart + edgeI));
|
||||||
|
|
||||||
// neighbour
|
// neighbour
|
||||||
interProcBoundaries[neighbourProc]
|
interProcBoundaries[neiProc].append(ownProc);
|
||||||
.append(ownerProc);
|
interProcBEdges[neiProc]
|
||||||
interProcBEdges[neighbourProc]
|
|
||||||
.append
|
.append
|
||||||
(
|
(
|
||||||
SLList<label>
|
SLList<label>
|
||||||
@ -745,13 +735,13 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
// This cyclic edge remains on the processor
|
// This cyclic edge remains on the processor
|
||||||
label ownerProc = faceToProc_[firstEdgeFaces[edgeI]];
|
label ownProc = faceToProc_[firstEdgeFaces[edgeI]];
|
||||||
|
|
||||||
// add the edge
|
// add the edge
|
||||||
procEdgeList[ownerProc].append(patchStart + edgeI);
|
procEdgeList[ownProc].append(patchStart + edgeI);
|
||||||
|
|
||||||
// increment the number of edges for this patch
|
// increment the number of edges for this patch
|
||||||
procPatchSize_[ownerProc][patchI]++;
|
procPatchSize_[ownProc][patchI]++;
|
||||||
|
|
||||||
// Note: I cannot add the other side of the cyclic
|
// Note: I cannot add the other side of the cyclic
|
||||||
// boundary here because this would violate the order.
|
// boundary here because this would violate the order.
|
||||||
@ -771,14 +761,14 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// This cyclic edge remains on the processor
|
// This cyclic edge remains on the processor
|
||||||
label ownerProc = faceToProc_[firstEdgeFaces[edgeI]];
|
label ownProc = faceToProc_[firstEdgeFaces[edgeI]];
|
||||||
|
|
||||||
// add the second edge
|
// add the second edge
|
||||||
procEdgeList[ownerProc].append
|
procEdgeList[ownProc].append
|
||||||
(patchStart + cycOffset + edgeI);
|
(patchStart + cycOffset + edgeI);
|
||||||
|
|
||||||
// increment the number of edges for this patch
|
// increment the number of edges for this patch
|
||||||
procPatchSize_[ownerProc][patchI]++;
|
procPatchSize_[ownProc][patchI]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -806,15 +796,9 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
// calculate the size
|
// calculate the size
|
||||||
label nEdgesOnProcessor = curProcEdges.size();
|
label nEdgesOnProcessor = curProcEdges.size();
|
||||||
|
|
||||||
for
|
for (const auto& bedges : interProcBEdges)
|
||||||
(
|
|
||||||
SLList<SLList<label>>::iterator curInterProcBEdgesIter =
|
|
||||||
interProcBEdges[procI].begin();
|
|
||||||
curInterProcBEdgesIter != interProcBEdges[procI].end();
|
|
||||||
++curInterProcBEdgesIter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
nEdgesOnProcessor += curInterProcBEdgesIter().size();
|
nEdgesOnProcessor += bedges.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
curProcEdgeAddressing.setSize(nEdgesOnProcessor);
|
curProcEdgeAddressing.setSize(nEdgesOnProcessor);
|
||||||
@ -830,16 +814,11 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
// Add internal and boundary edges
|
// Add internal and boundary edges
|
||||||
// Remember to increment the index by one such that the
|
// Remember to increment the index by one such that the
|
||||||
// turning index works properly.
|
// turning index works properly.
|
||||||
for
|
for (const label procEdgei : curProcEdges)
|
||||||
(
|
|
||||||
SLList<label>::iterator curProcEdgeIter = curProcEdges.begin();
|
|
||||||
curProcEdgeIter != curProcEdges.end();
|
|
||||||
++curProcEdgeIter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
curProcEdgeAddressing[nEdges] = curProcEdgeIter();
|
curProcEdgeAddressing[nEdges] = procEdgei;
|
||||||
// curProcEdgeAddressing[nEdges] = curProcEdgeIter() + 1;
|
// curProcEdgeAddressing[nEdges] = procEdgei + 1;
|
||||||
nEdges++;
|
++nEdges;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add inter-processor boundary edges. At the beginning of each
|
// Add inter-processor boundary edges. At the beginning of each
|
||||||
@ -862,18 +841,19 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
|
|
||||||
label nProcPatches = 0;
|
label nProcPatches = 0;
|
||||||
|
|
||||||
SLList<label>::iterator curInterProcBdrsIter =
|
auto curInterProcBdrsIter =
|
||||||
interProcBoundaries[procI].begin();
|
interProcBoundaries[procI].cbegin();
|
||||||
|
|
||||||
SLList<SLList<label>>::iterator curInterProcBEdgesIter =
|
auto curInterProcBEdgesIter =
|
||||||
interProcBEdges[procI].begin();
|
interProcBEdges[procI].cbegin();
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
;
|
;
|
||||||
curInterProcBdrsIter != interProcBoundaries[procI].end()
|
curInterProcBdrsIter.good()
|
||||||
&& curInterProcBEdgesIter != interProcBEdges[procI].end();
|
&& curInterProcBEdgesIter.good();
|
||||||
++curInterProcBdrsIter, ++curInterProcBEdgesIter
|
++curInterProcBdrsIter,
|
||||||
|
++curInterProcBEdgesIter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
curProcNeighbourProcessors[nProcPatches] =
|
curProcNeighbourProcessors[nProcPatches] =
|
||||||
@ -889,37 +869,31 @@ void Foam::faMeshDecomposition::decomposeMesh()
|
|||||||
|
|
||||||
// add faces for this processor boundary
|
// add faces for this processor boundary
|
||||||
|
|
||||||
for
|
for (const label edgei : *curInterProcBEdgesIter)
|
||||||
(
|
|
||||||
SLList<label>::iterator curEdgesIter =
|
|
||||||
curInterProcBEdgesIter().begin();
|
|
||||||
curEdgesIter != curInterProcBEdgesIter().end();
|
|
||||||
++curEdgesIter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
// add the edges
|
// add the edges
|
||||||
|
|
||||||
// Remember to increment the index by one such that the
|
// Remember to increment the index by one such that the
|
||||||
// turning index works properly.
|
// turning index works properly.
|
||||||
if (faceToProc_[owner[curEdgesIter()]] == procI)
|
if (faceToProc_[owner[edgei]] == procI)
|
||||||
{
|
{
|
||||||
curProcEdgeAddressing[nEdges] = curEdgesIter();
|
curProcEdgeAddressing[nEdges] = edgei;
|
||||||
// curProcEdgeAddressing[nEdges] = curEdgesIter() + 1;
|
// curProcEdgeAddressing[nEdges] = edgei + 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// turning edge
|
// turning edge
|
||||||
curProcEdgeAddressing[nEdges] = curEdgesIter();
|
curProcEdgeAddressing[nEdges] = edgei;
|
||||||
// curProcEdgeAddressing[nEdges] = -(curEdgesIter() + 1);
|
// curProcEdgeAddressing[nEdges] = -(edgei + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// increment the size
|
// increment the size
|
||||||
curSize++;
|
++curSize;
|
||||||
|
|
||||||
nEdges++;
|
++nEdges;
|
||||||
}
|
}
|
||||||
|
|
||||||
nProcPatches++;
|
++nProcPatches;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -62,7 +62,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer
|
|||||||
{
|
{
|
||||||
SLList<indexedParticle*>& particlePtrs = *cellParticles[celli];
|
SLList<indexedParticle*>& particlePtrs = *cellParticles[celli];
|
||||||
|
|
||||||
forAllConstIter(SLList<indexedParticle*>, particlePtrs, iter)
|
forAllConstIters(particlePtrs, iter)
|
||||||
{
|
{
|
||||||
const indexedParticle& ppi = *iter();
|
const indexedParticle& ppi = *iter();
|
||||||
particleIndices_[pi++] = ppi.index();
|
particleIndices_[pi++] = ppi.index();
|
||||||
|
|||||||
@ -592,7 +592,7 @@ int main(int argc, char *argv[])
|
|||||||
const word cloudName = word::validate(iter.key());
|
const word cloudName = word::validate(iter.key());
|
||||||
|
|
||||||
// Objects (on arbitrary processor)
|
// Objects (on arbitrary processor)
|
||||||
const IOobjectList& cloudObjs = iter.object();
|
const IOobjectList& cloudObjs = iter.val();
|
||||||
|
|
||||||
Info<< "Reconstructing lagrangian fields for cloud "
|
Info<< "Reconstructing lagrangian fields for cloud "
|
||||||
<< cloudName << nl << endl;
|
<< cloudName << nl << endl;
|
||||||
@ -831,15 +831,15 @@ int main(int argc, char *argv[])
|
|||||||
cellSet& cSet = cellSets[setI];
|
cellSet& cSet = cellSets[setI];
|
||||||
cSet.instance() = runTime.timeName();
|
cSet.instance() = runTime.timeName();
|
||||||
|
|
||||||
forAllConstIter(cellSet, procSet, iter)
|
for (const label celli : procSet)
|
||||||
{
|
{
|
||||||
cSet.insert(cellMap[iter.key()]);
|
cSet.insert(cellMap[celli]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// faceSets
|
// faceSets
|
||||||
const labelList& faceMap =
|
const labelList& faceMap =
|
||||||
procMeshes.faceProcAddressing()[proci];
|
procMeshes.faceProcAddressing()[proci];
|
||||||
|
|
||||||
IOobjectList fSets
|
IOobjectList fSets
|
||||||
(
|
(
|
||||||
@ -867,9 +867,9 @@ int main(int argc, char *argv[])
|
|||||||
faceSet& fSet = faceSets[setI];
|
faceSet& fSet = faceSets[setI];
|
||||||
fSet.instance() = runTime.timeName();
|
fSet.instance() = runTime.timeName();
|
||||||
|
|
||||||
forAllConstIter(faceSet, procSet, iter)
|
for (const label facei : procSet)
|
||||||
{
|
{
|
||||||
fSet.insert(mag(faceMap[iter.key()])-1);
|
fSet.insert(mag(faceMap[facei])-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// pointSets
|
// pointSets
|
||||||
@ -901,25 +901,26 @@ int main(int argc, char *argv[])
|
|||||||
pointSet& pSet = pointSets[setI];
|
pointSet& pSet = pointSets[setI];
|
||||||
pSet.instance() = runTime.timeName();
|
pSet.instance() = runTime.timeName();
|
||||||
|
|
||||||
forAllConstIter(pointSet, propSet, iter)
|
for (const label pointi : propSet)
|
||||||
{
|
{
|
||||||
pSet.insert(pointMap[iter.key()]);
|
pSet.insert(pointMap[pointi]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write sets
|
// Write sets
|
||||||
forAll(cellSets, i)
|
|
||||||
|
for (const auto& set : cellSets)
|
||||||
{
|
{
|
||||||
cellSets[i].write();
|
set.write();
|
||||||
}
|
}
|
||||||
forAll(faceSets, i)
|
for (const auto& set : faceSets)
|
||||||
{
|
{
|
||||||
faceSets[i].write();
|
set.write();
|
||||||
}
|
}
|
||||||
forAll(pointSets, i)
|
for (const auto& set : pointSets)
|
||||||
{
|
{
|
||||||
pointSets[i].write();
|
set.write();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -151,10 +151,8 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
|
|||||||
labelList destProc(lpi.size());
|
labelList destProc(lpi.size());
|
||||||
|
|
||||||
label particleI = 0;
|
label particleI = 0;
|
||||||
forAllIter(passivePositionParticleCloud, lpi, iter)
|
for (passivePositionParticle& ppi : lpi)
|
||||||
{
|
{
|
||||||
passivePositionParticle& ppi = iter();
|
|
||||||
|
|
||||||
const label destProcI = destinationProcID_[ppi.cell()];
|
const label destProcI = destinationProcID_[ppi.cell()];
|
||||||
const label destCellI = destinationCell_[ppi.cell()];
|
const label destCellI = destinationCell_[ppi.cell()];
|
||||||
|
|
||||||
@ -222,14 +220,8 @@ Foam::parLagrangianRedistributor::redistributeLagrangianPositions
|
|||||||
passivePositionParticle::iNew(tgtMesh_)
|
passivePositionParticle::iNew(tgtMesh_)
|
||||||
);
|
);
|
||||||
|
|
||||||
forAllIter
|
for (passivePositionParticle& newp : newParticles)
|
||||||
(
|
|
||||||
IDLList<passivePositionParticle>,
|
|
||||||
newParticles,
|
|
||||||
newpIter
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
passivePositionParticle& newp = newpIter();
|
|
||||||
lagrangianPositions.addParticle(newParticles.remove(&newp));
|
lagrangianPositions.addParticle(newParticles.remove(&newp));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -284,7 +284,7 @@ Foam::label Foam::parLagrangianRedistributor::redistributeStoredFields
|
|||||||
label nFields = 0;
|
label nFields = 0;
|
||||||
forAllIters(fields, iter)
|
forAllIters(fields, iter)
|
||||||
{
|
{
|
||||||
Container& field = *(iter.object());
|
Container& field = *(iter.val());
|
||||||
|
|
||||||
if (!nFields++)
|
if (!nFields++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -746,7 +746,7 @@ void correctCoupledBoundaryConditions(fvMesh& mesh)
|
|||||||
mesh.objectRegistry::lookupClass<GeoField>()
|
mesh.objectRegistry::lookupClass<GeoField>()
|
||||||
);
|
);
|
||||||
|
|
||||||
forAllIter(typename HashTable<GeoField*>, flds, iter)
|
forAllIters(flds, iter)
|
||||||
{
|
{
|
||||||
GeoField& fld = *iter();
|
GeoField& fld = *iter();
|
||||||
|
|
||||||
@ -1944,16 +1944,11 @@ void readLagrangian
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
//forAllConstIter
|
//for (passivePositionParticle& p : clouds[i]))
|
||||||
//(
|
|
||||||
// unmappedPassivePositionParticleCloud,
|
|
||||||
// clouds[i],
|
|
||||||
// iter
|
|
||||||
//)
|
|
||||||
//{
|
//{
|
||||||
// Pout<< "Particle position:" << iter().position()
|
// Pout<< "Particle position:" << p.position()
|
||||||
// << " cell:" << iter().cell()
|
// << " cell:" << p.cell()
|
||||||
// << " with cc:" << mesh.cellCentres()[iter().cell()]
|
// << " with cc:" << mesh.cellCentres()[p.cell()]
|
||||||
// << endl;
|
// << endl;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if (doLagrangian)
|
|||||||
forAllConstIters(theseCloudFields, fieldIter)
|
forAllConstIters(theseCloudFields, fieldIter)
|
||||||
{
|
{
|
||||||
const word& fieldName = fieldIter.key();
|
const word& fieldName = fieldIter.key();
|
||||||
const word& fieldType = fieldIter.object();
|
const word& fieldType = fieldIter.val();
|
||||||
|
|
||||||
IOobject fieldObject
|
IOobject fieldObject
|
||||||
(
|
(
|
||||||
|
|||||||
@ -73,7 +73,7 @@ if (doLagrangian)
|
|||||||
forAllConstIters(theseCloudFields, fieldIter)
|
forAllConstIters(theseCloudFields, fieldIter)
|
||||||
{
|
{
|
||||||
const word& fieldName = fieldIter.key();
|
const word& fieldName = fieldIter.key();
|
||||||
const word& fieldType = fieldIter.object();
|
const word& fieldType = fieldIter.val();
|
||||||
|
|
||||||
IOobject fieldObject
|
IOobject fieldObject
|
||||||
(
|
(
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
gmvFile << "tracers " << particles.size() << nl;
|
gmvFile << "tracers " << particles.size() << nl;
|
||||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().x() << ' ';
|
gmvFile << p.position().x() << ' ';
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().y() << ' ';
|
gmvFile << p.position().y() << ' ';
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().z() << ' ';
|
gmvFile << p.position().z() << ' ';
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
@ -36,9 +36,9 @@ for (const word& name : lagrangianScalarNames)
|
|||||||
{
|
{
|
||||||
gmvFile << name << nl;
|
gmvFile << name << nl;
|
||||||
|
|
||||||
forAll(fld, n)
|
for (const scalar& val : fld)
|
||||||
{
|
{
|
||||||
gmvFile << fld[n] << token::SPACE;
|
gmvFile << val << token::SPACE;
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,48 +1,48 @@
|
|||||||
gmvFile << "tracers " << particles.size() << nl;
|
gmvFile << "tracers " << particles.size() << nl;
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().x() << " ";
|
gmvFile << p.position().x() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().y() << " ";
|
gmvFile << p.position().y() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().z() << " ";
|
gmvFile << p.position().z() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
gmvFile << "U" << nl;
|
gmvFile << "U" << nl;
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().velocity().x() << " ";
|
gmvFile << p.velocity().x() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
gmvFile << "V" << nl;
|
gmvFile << "V" << nl;
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().velocity().y() << " ";
|
gmvFile << p.velocity().y() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
gmvFile << "W" << nl;
|
gmvFile << "W" << nl;
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
gmvFile << iter().velocity().z() << " ";
|
gmvFile << p.velocity().z() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
gmvFile << "Diam" << nl;
|
gmvFile << "Diam" << nl;
|
||||||
forAllConstIter(discretePhase, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().d() << " ";
|
gmvFile << p.d() << " ";
|
||||||
}
|
}
|
||||||
|
|
||||||
gmvFile << "endtrace"<< nl;
|
gmvFile << "endtrace"<< nl;
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
gmvFile << "tracers " << particles.size() << nl;
|
gmvFile << "tracers " << particles.size() << nl;
|
||||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().x() << " ";
|
gmvFile << p.position().x() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().y() << " ";
|
gmvFile << p.position().y() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, particles, iter)
|
for (const passiveParticle& p : particles)
|
||||||
{
|
{
|
||||||
gmvFile << iter().position().z() << " ";
|
gmvFile << p.position().z() << " ";
|
||||||
}
|
}
|
||||||
gmvFile << nl;
|
gmvFile << nl;
|
||||||
|
|
||||||
|
|||||||
@ -118,7 +118,7 @@ Foam::label Foam::foamPvCore::addToSelection
|
|||||||
|
|
||||||
if (iter.found())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
return addToArray(select, prefix, iter.object().sortedToc());
|
return addToArray(select, prefix, iter.val().sortedToc());
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@ -137,7 +137,7 @@ Foam::label Foam::foamPvCore::addToSelection
|
|||||||
|
|
||||||
if (iter.found())
|
if (iter.found())
|
||||||
{
|
{
|
||||||
return addToArray(select, iter.object().sortedToc(), suffix);
|
return addToArray(select, iter.val().sortedToc(), suffix);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@ -144,9 +144,9 @@ bool Foam::vtkPVFoam::addOutputBlock
|
|||||||
const word shortName = getFoamName(longName);
|
const word shortName = getFoamName(longName);
|
||||||
|
|
||||||
auto iter = cache.find(longName);
|
auto iter = cache.find(longName);
|
||||||
if (iter.found() && iter.object().dataset)
|
if (iter.found() && iter.val().dataset)
|
||||||
{
|
{
|
||||||
auto dataset = iter.object().dataset;
|
auto dataset = iter.val().dataset;
|
||||||
|
|
||||||
if (singleDataset)
|
if (singleDataset)
|
||||||
{
|
{
|
||||||
@ -540,13 +540,13 @@ void Foam::vtkPVFoam::Update
|
|||||||
// Eliminate cached values that would be unreliable
|
// Eliminate cached values that would be unreliable
|
||||||
forAllIters(cachedVtp_, iter)
|
forAllIters(cachedVtp_, iter)
|
||||||
{
|
{
|
||||||
iter.object().clearGeom();
|
iter.val().clearGeom();
|
||||||
iter.object().clear();
|
iter.val().clear();
|
||||||
}
|
}
|
||||||
forAllIters(cachedVtu_, iter)
|
forAllIters(cachedVtu_, iter)
|
||||||
{
|
{
|
||||||
iter.object().clearGeom();
|
iter.val().clearGeom();
|
||||||
iter.object().clear();
|
iter.val().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (oldDecomp != decomposePoly_)
|
else if (oldDecomp != decomposePoly_)
|
||||||
@ -554,8 +554,8 @@ void Foam::vtkPVFoam::Update
|
|||||||
// poly-decompose changed - dispose of cached values
|
// poly-decompose changed - dispose of cached values
|
||||||
forAllIters(cachedVtu_, iter)
|
forAllIters(cachedVtu_, iter)
|
||||||
{
|
{
|
||||||
iter.object().clearGeom();
|
iter.val().clearGeom();
|
||||||
iter.object().clear();
|
iter.val().clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -91,13 +91,13 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
const auto& longName = selectedPartIds_[partId];
|
const auto& longName = selectedPartIds_[partId];
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtpData& vtpData = iter.object();
|
foamVtpData& vtpData = iter.val();
|
||||||
auto dataset = vtpData.dataset;
|
auto dataset = vtpData.dataset;
|
||||||
|
|
||||||
const labelUList& patchIds = vtpData.additionalIds();
|
const labelUList& patchIds = vtpData.additionalIds();
|
||||||
@ -195,13 +195,13 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
const word zoneName = getFoamName(longName);
|
const word zoneName = getFoamName(longName);
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtpData& vtpData = iter.object();
|
foamVtpData& vtpData = iter.val();
|
||||||
auto dataset = vtpData.dataset;
|
auto dataset = vtpData.dataset;
|
||||||
|
|
||||||
const faceZoneMesh& zMesh = mesh.faceZones();
|
const faceZoneMesh& zMesh = mesh.faceZones();
|
||||||
@ -236,12 +236,12 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
const word selectName = getFoamName(longName);
|
const word selectName = getFoamName(longName);
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
foamVtpData& vtpData = iter.object();
|
foamVtpData& vtpData = iter.val();
|
||||||
auto dataset = vtpData.dataset;
|
auto dataset = vtpData.dataset;
|
||||||
|
|
||||||
vtkSmartPointer<vtkFloatArray> cdata = convertFaceFieldToVTK
|
vtkSmartPointer<vtkFloatArray> cdata = convertFaceFieldToVTK
|
||||||
@ -270,7 +270,7 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
forAllConstIters(objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// Restrict to GeometricField<Type, ...>
|
// Restrict to GeometricField<Type, ...>
|
||||||
const auto& ioobj = *(iter.object());
|
const auto& ioobj = *(iter.val());
|
||||||
|
|
||||||
if (ioobj.headerClassName() == FieldType::typeName)
|
if (ioobj.headerClassName() == FieldType::typeName)
|
||||||
{
|
{
|
||||||
@ -320,7 +320,7 @@ void Foam::vtkPVFoam::convertDimFields
|
|||||||
forAllConstIters(objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// Restrict to DimensionedField<Type, ...>
|
// Restrict to DimensionedField<Type, ...>
|
||||||
const auto& ioobj = *(iter.object());
|
const auto& ioobj = *(iter.val());
|
||||||
|
|
||||||
if (ioobj.headerClassName() != FieldType::typeName)
|
if (ioobj.headerClassName() != FieldType::typeName)
|
||||||
{
|
{
|
||||||
@ -404,13 +404,13 @@ void Foam::vtkPVFoam::convertVolFieldBlock
|
|||||||
const auto& longName = selectedPartIds_[partId];
|
const auto& longName = selectedPartIds_[partId];
|
||||||
|
|
||||||
auto iter = cachedVtu_.find(longName);
|
auto iter = cachedVtu_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtuData& vtuData = iter.object();
|
foamVtuData& vtuData = iter.val();
|
||||||
auto dataset = vtuData.dataset;
|
auto dataset = vtuData.dataset;
|
||||||
|
|
||||||
vtkSmartPointer<vtkFloatArray> cdata = convertVolFieldToVTK
|
vtkSmartPointer<vtkFloatArray> cdata = convertVolFieldToVTK
|
||||||
@ -459,7 +459,7 @@ void Foam::vtkPVFoam::convertAreaFields
|
|||||||
forAllConstIters(objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// Restrict to GeometricField<Type, ...>
|
// Restrict to GeometricField<Type, ...>
|
||||||
const auto& ioobj = *(iter.object());
|
const auto& ioobj = *(iter.val());
|
||||||
|
|
||||||
if (ioobj.headerClassName() == FieldType::typeName)
|
if (ioobj.headerClassName() == FieldType::typeName)
|
||||||
{
|
{
|
||||||
@ -478,14 +478,14 @@ void Foam::vtkPVFoam::convertAreaFields
|
|||||||
const auto& longName = selectedPartIds_[partId];
|
const auto& longName = selectedPartIds_[partId];
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk
|
// Should not happen, but for safety require a vtk
|
||||||
// geometry
|
// geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtpData& vtpData = iter.object();
|
foamVtpData& vtpData = iter.val();
|
||||||
auto dataset = vtpData.dataset;
|
auto dataset = vtpData.dataset;
|
||||||
|
|
||||||
vtkSmartPointer<vtkFloatArray> cdata = convertFieldToVTK
|
vtkSmartPointer<vtkFloatArray> cdata = convertFieldToVTK
|
||||||
@ -535,7 +535,7 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
forAllConstIters(objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// Restrict to this GeometricField<Type, ...>
|
// Restrict to this GeometricField<Type, ...>
|
||||||
const auto& ioobj = *(iter.object());
|
const auto& ioobj = *(iter.val());
|
||||||
|
|
||||||
const word& fieldName = ioobj.name();
|
const word& fieldName = ioobj.name();
|
||||||
if (ioobj.headerClassName() != FieldType::typeName)
|
if (ioobj.headerClassName() != FieldType::typeName)
|
||||||
@ -568,13 +568,13 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
const auto& longName = selectedPartIds_[partId];
|
const auto& longName = selectedPartIds_[partId];
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtpData& vtpData = iter.object();
|
foamVtpData& vtpData = iter.val();
|
||||||
auto dataset = vtpData.dataset;
|
auto dataset = vtpData.dataset;
|
||||||
|
|
||||||
const labelUList& patchIds = vtpData.additionalIds();
|
const labelUList& patchIds = vtpData.additionalIds();
|
||||||
@ -605,13 +605,13 @@ void Foam::vtkPVFoam::convertPointFields
|
|||||||
const word zoneName = getFoamName(longName);
|
const word zoneName = getFoamName(longName);
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtpData& vtpData = iter.object();
|
foamVtpData& vtpData = iter.val();
|
||||||
auto dataset = vtpData.dataset;
|
auto dataset = vtpData.dataset;
|
||||||
|
|
||||||
const label zoneId = mesh.faceZones().findZoneID(zoneName);
|
const label zoneId = mesh.faceZones().findZoneID(zoneName);
|
||||||
@ -673,13 +673,13 @@ void Foam::vtkPVFoam::convertPointFieldBlock
|
|||||||
const auto& longName = selectedPartIds_[partId];
|
const auto& longName = selectedPartIds_[partId];
|
||||||
|
|
||||||
auto iter = cachedVtu_.find(longName);
|
auto iter = cachedVtu_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
foamVtuData& vtuData = iter.object();
|
foamVtuData& vtuData = iter.val();
|
||||||
auto dataset = vtuData.dataset;
|
auto dataset = vtuData.dataset;
|
||||||
|
|
||||||
vtkSmartPointer<vtkFloatArray> pdata = convertPointField
|
vtkSmartPointer<vtkFloatArray> pdata = convertPointField
|
||||||
@ -794,7 +794,7 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
forAllConstIters(objects, iter)
|
forAllConstIters(objects, iter)
|
||||||
{
|
{
|
||||||
// Restrict to IOField<Type>
|
// Restrict to IOField<Type>
|
||||||
const auto& ioobj = *(iter.object());
|
const auto& ioobj = *(iter.val());
|
||||||
|
|
||||||
if (ioobj.headerClassName() == IOField<Type>::typeName)
|
if (ioobj.headerClassName() == IOField<Type>::typeName)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -255,12 +255,12 @@ void Foam::vtkPVFoam::convertLagrangianFields()
|
|||||||
const word cloudName = getFoamName(longName);
|
const word cloudName = getFoamName(longName);
|
||||||
|
|
||||||
auto iter = cachedVtp_.find(longName);
|
auto iter = cachedVtp_.find(longName);
|
||||||
if (!iter.found() || !iter.object().dataset)
|
if (!iter.found() || !iter.val().dataset)
|
||||||
{
|
{
|
||||||
// Should not happen, but for safety require a vtk geometry
|
// Should not happen, but for safety require a vtk geometry
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto dataset = iter.object().dataset;
|
auto dataset = iter.val().dataset;
|
||||||
|
|
||||||
// Get the Lagrangian fields for this time and this cloud
|
// Get the Lagrangian fields for this time and this cloud
|
||||||
// but only keep selected fields
|
// but only keep selected fields
|
||||||
|
|||||||
@ -80,9 +80,9 @@ vtkSmartPointer<vtkPolyData> Foam::vtkPVFoam::lagrangianVTKMesh
|
|||||||
vtkpoints->SetNumberOfPoints(parcels.size());
|
vtkpoints->SetNumberOfPoints(parcels.size());
|
||||||
|
|
||||||
vtkIdType particleId = 0;
|
vtkIdType particleId = 0;
|
||||||
forAllConstIters(parcels, iter)
|
for (const passiveParticle& p : parcels)
|
||||||
{
|
{
|
||||||
vtkpoints->SetPoint(particleId, iter().position().v_);
|
vtkpoints->SetPoint(particleId, p.position().v_);
|
||||||
++particleId;
|
++particleId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -276,7 +276,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
forAllConstIters(groups, iter)
|
forAllConstIters(groups, iter)
|
||||||
{
|
{
|
||||||
const auto& groupName = iter.key();
|
const auto& groupName = iter.key();
|
||||||
const auto& patchIDs = iter.object();
|
const auto& patchIDs = iter.val();
|
||||||
|
|
||||||
label nFaces = 0;
|
label nFaces = 0;
|
||||||
for (auto patchId : patchIDs)
|
for (auto patchId : patchIDs)
|
||||||
@ -392,7 +392,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
forAllConstIters(groups, iter)
|
forAllConstIters(groups, iter)
|
||||||
{
|
{
|
||||||
const auto& groupName = iter.key();
|
const auto& groupName = iter.key();
|
||||||
const auto& patchIDs = iter.object();
|
const auto& patchIDs = iter.val();
|
||||||
|
|
||||||
const string dpyName = "group/" + groupName;
|
const string dpyName = "group/" + groupName;
|
||||||
displayNames.append(dpyName);
|
displayNames.append(dpyName);
|
||||||
@ -715,7 +715,7 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields
|
|||||||
|
|
||||||
forAllConstIters(localFields, iter)
|
forAllConstIters(localFields, iter)
|
||||||
{
|
{
|
||||||
fields(iter.key()) |= iter.object();
|
fields(iter.key()) |= iter.val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,12 +42,12 @@ int USERD_get_part_coords
|
|||||||
{
|
{
|
||||||
label indx = 1;
|
label indx = 1;
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
|
forAllConstIters(*sprayPtr, iter)
|
||||||
{
|
{
|
||||||
coord_array[0][indx] = float(iter().position().x());
|
coord_array[0][indx] = float(iter().position().x());
|
||||||
coord_array[1][indx] = float(iter().position().y());
|
coord_array[1][indx] = float(iter().position().y());
|
||||||
coord_array[2][indx] = float(iter().position().z());
|
coord_array[2][indx] = float(iter().position().z());
|
||||||
indx++;
|
++indx;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ int USERD_get_part_node_ids
|
|||||||
{
|
{
|
||||||
label indx = 0;
|
label indx = 0;
|
||||||
|
|
||||||
forAllConstIter(Cloud<passiveParticle>, *sprayPtr, iter)
|
forAllConstIters(*sprayPtr, iter)
|
||||||
{
|
{
|
||||||
nodeid_array[indx] = indx + 1;
|
nodeid_array[indx] = indx + 1;
|
||||||
indx++;
|
indx++;
|
||||||
|
|||||||
@ -85,10 +85,10 @@ int main(int argc, char *argv[])
|
|||||||
Info<< " Read " << returnReduce(myCloud.size(), sumOp<label>())
|
Info<< " Read " << returnReduce(myCloud.size(), sumOp<label>())
|
||||||
<< " particles" << endl;
|
<< " particles" << endl;
|
||||||
|
|
||||||
forAllConstIter(passiveParticleCloud, myCloud, iter)
|
for (const passiveParticle& p : myCloud)
|
||||||
{
|
{
|
||||||
label origId = iter().origId();
|
const label origId = p.origId();
|
||||||
label origProc = iter().origProc();
|
const label origProc = p.origProc();
|
||||||
|
|
||||||
if (origProc >= maxIds.size())
|
if (origProc >= maxIds.size())
|
||||||
{
|
{
|
||||||
@ -157,16 +157,16 @@ int main(int argc, char *argv[])
|
|||||||
myCloud.size(),
|
myCloud.size(),
|
||||||
point::zero
|
point::zero
|
||||||
);
|
);
|
||||||
allOrigIds[Pstream::myProcNo()].setSize(myCloud.size(), 0);
|
allOrigIds[Pstream::myProcNo()].setSize(myCloud.size(), Zero);
|
||||||
allOrigProcs[Pstream::myProcNo()].setSize(myCloud.size(), 0);
|
allOrigProcs[Pstream::myProcNo()].setSize(myCloud.size(), Zero);
|
||||||
|
|
||||||
label i = 0;
|
label i = 0;
|
||||||
forAllConstIter(passiveParticleCloud, myCloud, iter)
|
for (const passiveParticle& p : myCloud)
|
||||||
{
|
{
|
||||||
allPositions[Pstream::myProcNo()][i] = iter().position();
|
allPositions[Pstream::myProcNo()][i] = p.position();
|
||||||
allOrigIds[Pstream::myProcNo()][i] = iter().origId();
|
allOrigIds[Pstream::myProcNo()][i] = p.origId();
|
||||||
allOrigProcs[Pstream::myProcNo()][i] = iter().origProc();
|
allOrigProcs[Pstream::myProcNo()][i] = p.origProc();
|
||||||
i++;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Collect the track data on the master processor
|
// Collect the track data on the master processor
|
||||||
|
|||||||
@ -159,7 +159,7 @@ int main(int argc, char *argv[])
|
|||||||
particles.setSize(ppc.size());
|
particles.setSize(ppc.size());
|
||||||
|
|
||||||
label i = 0;
|
label i = 0;
|
||||||
forAllIter(passiveParticleCloud, ppc, iter)
|
forAllIters(ppc, iter)
|
||||||
{
|
{
|
||||||
particles.set(i++, ppc.remove(&iter()));
|
particles.set(i++, ppc.remove(&iter()));
|
||||||
}
|
}
|
||||||
@ -178,18 +178,19 @@ int main(int argc, char *argv[])
|
|||||||
const label origProc = particles[i].origProc();
|
const label origProc = particles[i].origProc();
|
||||||
const label origId = particles[i].origId();
|
const label origId = particles[i].origId();
|
||||||
|
|
||||||
labelPairLookup::const_iterator iter =
|
const labelPair key(origProc, origId);
|
||||||
trackTable.find(labelPair(origProc, origId));
|
|
||||||
|
|
||||||
if (iter == trackTable.end())
|
const auto iter = trackTable.cfind(key);
|
||||||
|
|
||||||
|
if (iter.found())
|
||||||
{
|
{
|
||||||
particleToTrack[i] = nTracks;
|
particleToTrack[i] = *iter;
|
||||||
trackTable.insert(labelPair(origProc, origId), nTracks);
|
|
||||||
nTracks++;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
particleToTrack[i] = iter();
|
particleToTrack[i] = nTracks;
|
||||||
|
trackTable.insert(key, nTracks);
|
||||||
|
++nTracks;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -205,10 +206,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Determine length of each track
|
// Determine length of each track
|
||||||
labelList trackLengths(nTracks, Zero);
|
labelList trackLengths(nTracks, Zero);
|
||||||
forAll(particleToTrack, i)
|
for (const label tracki : particleToTrack)
|
||||||
{
|
{
|
||||||
const label trackI = particleToTrack[i];
|
++trackLengths[tracki];
|
||||||
trackLengths[trackI]++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Particle "age" property used to sort the tracks
|
// Particle "age" property used to sort the tracks
|
||||||
|
|||||||
@ -107,23 +107,23 @@ HashTable<wordList> extractPatchGroups(const dictionary& boundaryDict)
|
|||||||
const word& patchName = dEntry.keyword();
|
const word& patchName = dEntry.keyword();
|
||||||
const dictionary& patchDict = dEntry.dict();
|
const dictionary& patchDict = dEntry.dict();
|
||||||
|
|
||||||
wordList groups;
|
wordList groupNames;
|
||||||
if (patchDict.readIfPresent("inGroups", groups))
|
patchDict.readIfPresent("inGroups", groupNames);
|
||||||
|
|
||||||
|
for (const word& groupName : groupNames)
|
||||||
{
|
{
|
||||||
forAll(groups, i)
|
auto groupIter = groupToPatch.find(groupName);
|
||||||
|
if (groupIter.found())
|
||||||
{
|
{
|
||||||
auto fndGroup = groupToPatch.find(groups[i]);
|
(*groupIter).append(patchName);
|
||||||
if (!fndGroup.found())
|
}
|
||||||
{
|
else
|
||||||
groupToPatch.insert(groups[i], wordList(1, patchName));
|
{
|
||||||
}
|
groupToPatch.insert(groupName, wordList(one(), patchName));
|
||||||
else
|
|
||||||
{
|
|
||||||
fndGroup().append(patchName);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return groupToPatch;
|
return groupToPatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -301,7 +301,7 @@ void rewriteField
|
|||||||
forAllConstIters(thisNames, iter)
|
forAllConstIters(thisNames, iter)
|
||||||
{
|
{
|
||||||
const word& patchName = iter.key();
|
const word& patchName = iter.key();
|
||||||
const word& newName = iter.object();
|
const word& newName = iter.val();
|
||||||
|
|
||||||
Info<< "Looking for entry for patch " << patchName << endl;
|
Info<< "Looking for entry for patch " << patchName << endl;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -157,15 +157,15 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
|
|||||||
// This requires there to be no boundary in the way.
|
// This requires there to be no boundary in the way.
|
||||||
|
|
||||||
|
|
||||||
forAllConstIters(sourceParcels, iter)
|
for (const passiveParticle& p : sourceParcels)
|
||||||
{
|
{
|
||||||
bool foundCell = false;
|
bool foundCell = false;
|
||||||
|
|
||||||
// Assume that cell from read parcel is the correct one...
|
// Assume that cell from read parcel is the correct one...
|
||||||
if (iter().cell() >= 0)
|
if (p.cell() >= 0)
|
||||||
{
|
{
|
||||||
const labelList& targetCells =
|
const labelList& targetCells =
|
||||||
sourceToTargets[iter().cell()];
|
sourceToTargets[p.cell()];
|
||||||
|
|
||||||
// Particle probably in one of the targetcells. Try
|
// Particle probably in one of the targetcells. Try
|
||||||
// all by tracking from their cell centre to the parcel
|
// all by tracking from their cell centre to the parcel
|
||||||
@ -187,7 +187,7 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
|
|||||||
);
|
);
|
||||||
passiveParticle& newP = newPtr();
|
passiveParticle& newP = newPtr();
|
||||||
|
|
||||||
newP.track(iter().position() - newP.position(), 0);
|
newP.track(p.position() - newP.position(), 0);
|
||||||
|
|
||||||
if (!newP.onFace())
|
if (!newP.onFace())
|
||||||
{
|
{
|
||||||
@ -221,12 +221,12 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
|
|||||||
{
|
{
|
||||||
sourceParticleI = 0;
|
sourceParticleI = 0;
|
||||||
|
|
||||||
forAllIters(sourceParcels, iter)
|
for (passiveParticle& p : sourceParcels)
|
||||||
{
|
{
|
||||||
if (unmappedSource.found(sourceParticleI))
|
if (unmappedSource.found(sourceParticleI))
|
||||||
{
|
{
|
||||||
const label targetCell =
|
const label targetCell =
|
||||||
findCell(targetParcels, iter().position());
|
findCell(targetParcels, p.position());
|
||||||
|
|
||||||
if (targetCell >= 0)
|
if (targetCell >= 0)
|
||||||
{
|
{
|
||||||
@ -237,11 +237,11 @@ void mapLagrangian(const meshToMesh0& meshToMesh0Interp)
|
|||||||
new passiveParticle
|
new passiveParticle
|
||||||
(
|
(
|
||||||
meshTarget,
|
meshTarget,
|
||||||
iter().position(),
|
p.position(),
|
||||||
targetCell
|
targetCell
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
sourceParcels.remove(&iter());
|
sourceParcels.remove(&p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceParticleI++;
|
sourceParticleI++;
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2018 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -154,15 +154,15 @@ void mapLagrangian(const meshToMesh& interp)
|
|||||||
// This requires there to be no boundary in the way.
|
// This requires there to be no boundary in the way.
|
||||||
|
|
||||||
|
|
||||||
forAllConstIters(sourceParcels, iter)
|
for (const passiveParticle& p : sourceParcels)
|
||||||
{
|
{
|
||||||
bool foundCell = false;
|
bool foundCell = false;
|
||||||
|
|
||||||
// Assume that cell from read parcel is the correct one...
|
// Assume that cell from read parcel is the correct one...
|
||||||
if (iter().cell() >= 0)
|
if (p.cell() >= 0)
|
||||||
{
|
{
|
||||||
const labelList& targetCells =
|
const labelList& targetCells =
|
||||||
sourceToTarget[iter().cell()];
|
sourceToTarget[p.cell()];
|
||||||
|
|
||||||
// Particle probably in one of the targetcells. Try
|
// Particle probably in one of the targetcells. Try
|
||||||
// all by tracking from their cell centre to the parcel
|
// all by tracking from their cell centre to the parcel
|
||||||
@ -184,7 +184,7 @@ void mapLagrangian(const meshToMesh& interp)
|
|||||||
);
|
);
|
||||||
passiveParticle& newP = newPtr();
|
passiveParticle& newP = newPtr();
|
||||||
|
|
||||||
newP.track(iter().position() - newP.position(), 0);
|
newP.track(p.position() - newP.position(), 0);
|
||||||
|
|
||||||
if (!newP.onFace())
|
if (!newP.onFace())
|
||||||
{
|
{
|
||||||
@ -218,12 +218,12 @@ void mapLagrangian(const meshToMesh& interp)
|
|||||||
{
|
{
|
||||||
sourceParticleI = 0;
|
sourceParticleI = 0;
|
||||||
|
|
||||||
forAllIters(sourceParcels, iter)
|
for (passiveParticle& p : sourceParcels)
|
||||||
{
|
{
|
||||||
if (unmappedSource.found(sourceParticleI))
|
if (unmappedSource.found(sourceParticleI))
|
||||||
{
|
{
|
||||||
const label targetCell =
|
const label targetCell =
|
||||||
findCell(targetParcels, iter().position());
|
findCell(targetParcels, p.position());
|
||||||
|
|
||||||
if (targetCell >= 0)
|
if (targetCell >= 0)
|
||||||
{
|
{
|
||||||
@ -234,11 +234,11 @@ void mapLagrangian(const meshToMesh& interp)
|
|||||||
new passiveParticle
|
new passiveParticle
|
||||||
(
|
(
|
||||||
meshTarget,
|
meshTarget,
|
||||||
iter().position(),
|
p.position(),
|
||||||
targetCell
|
targetCell
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
sourceParcels.remove(&iter());
|
sourceParcels.remove(&p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sourceParticleI++;
|
sourceParticleI++;
|
||||||
|
|||||||
@ -201,18 +201,10 @@ int main(int argc, char *argv[])
|
|||||||
forAll(surface1.patches(), i)
|
forAll(surface1.patches(), i)
|
||||||
{
|
{
|
||||||
const word& name = surface1.patches()[i].name();
|
const word& name = surface1.patches()[i].name();
|
||||||
auto iter = nameToPatch.find(name);
|
|
||||||
|
|
||||||
label combinedi;
|
// Lookup or insert
|
||||||
if (iter.found())
|
const label combinedi = nameToPatch(name, nameToPatch.size());
|
||||||
{
|
|
||||||
combinedi = iter.object();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
combinedi = nameToPatch.size();
|
|
||||||
nameToPatch.insert(name, combinedi);
|
|
||||||
}
|
|
||||||
patch1Map[i] = combinedi;
|
patch1Map[i] = combinedi;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -221,18 +213,10 @@ int main(int argc, char *argv[])
|
|||||||
forAll(surface2.patches(), i)
|
forAll(surface2.patches(), i)
|
||||||
{
|
{
|
||||||
const word& name = surface2.patches()[i].name();
|
const word& name = surface2.patches()[i].name();
|
||||||
auto iter = nameToPatch.find(name);
|
|
||||||
|
|
||||||
label combinedi;
|
// Lookup or insert
|
||||||
if (iter.found())
|
const label combinedi = nameToPatch(name, nameToPatch.size());
|
||||||
{
|
|
||||||
combinedi = iter.object();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
combinedi = nameToPatch.size();
|
|
||||||
nameToPatch.insert(name, combinedi);
|
|
||||||
}
|
|
||||||
patch2Map[i] = combinedi;
|
patch2Map[i] = combinedi;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1257,7 +1257,7 @@ autoPtr<extendedFeatureEdgeMesh> createEdgeMesh
|
|||||||
forAllConstIters(inter.facePairToEdgeId(), iter)
|
forAllConstIters(inter.facePairToEdgeId(), iter)
|
||||||
{
|
{
|
||||||
const labelPair& facePair = iter.key();
|
const labelPair& facePair = iter.key();
|
||||||
const label cutEdgeI = iter.object();
|
const label cutEdgeI = iter.val();
|
||||||
|
|
||||||
const edge& fE = inter.cutEdges()[cutEdgeI];
|
const edge& fE = inter.cutEdges()[cutEdgeI];
|
||||||
|
|
||||||
|
|||||||
@ -81,7 +81,7 @@ Foam::surfaceFeaturesExtraction::method::New
|
|||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
return autoPtr<method>(cstrIter.object()(dict));
|
return autoPtr<method>(cstrIter.val()(dict));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -273,12 +273,12 @@ int main(int argc, char *argv[])
|
|||||||
label patchi = bMesh.findPatchID(iter.key());
|
label patchi = bMesh.findPatchID(iter.key());
|
||||||
if (patchi != -1)
|
if (patchi != -1)
|
||||||
{
|
{
|
||||||
patchToCompactZone[patchi] = iter();
|
patchToCompactZone[patchi] = iter.val();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label zoneI = fzm.findZoneID(iter.key());
|
label zoneI = fzm.findZoneID(iter.key());
|
||||||
faceZoneToCompactZone[zoneI] = iter();
|
faceZoneToCompactZone[zoneI] = iter.val();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,11 +382,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// Zones
|
// Zones
|
||||||
surfZoneIdentifierList surfZones(compactZoneID.size());
|
surfZoneIdentifierList surfZones(compactZoneID.size());
|
||||||
forAllConstIter(HashTable<label>, compactZoneID, iter)
|
forAllConstIters(compactZoneID, iter)
|
||||||
{
|
{
|
||||||
surfZones[iter()] = surfZoneIdentifier(iter.key(), iter());
|
surfZones[*iter] = surfZoneIdentifier(iter.key(), *iter);
|
||||||
Info<< "surfZone " << iter()
|
Info<< "surfZone " << *iter
|
||||||
<< " : " << surfZones[iter()].name()
|
<< " : " << surfZones[*iter].name()
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -131,7 +131,7 @@ void dumpFaces
|
|||||||
|
|
||||||
OFstream os(fName);
|
OFstream os(fName);
|
||||||
|
|
||||||
forAllConstIter(Map<label>, connectedFaces, iter)
|
forAllConstIters(connectedFaces, iter)
|
||||||
{
|
{
|
||||||
point ctr = surf.localFaces()[iter.key()].centre(surf.localPoints());
|
point ctr = surf.localFaces()[iter.key()].centre(surf.localPoints());
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ label sharedFace
|
|||||||
label startIndex = f.find(e.start());
|
label startIndex = f.find(e.start());
|
||||||
|
|
||||||
// points in face in same order as edge
|
// points in face in same order as edge
|
||||||
bool edgeOrder = (f[f.fcIndex(startIndex)] == e.end());
|
const bool edgeOrder = (f[f.fcIndex(startIndex)] == e.end());
|
||||||
|
|
||||||
// Get faces using edge in sorted order. (sorted such that walking
|
// Get faces using edge in sorted order. (sorted such that walking
|
||||||
// around them in anti-clockwise order corresponds to edge vector
|
// around them in anti-clockwise order corresponds to edge vector
|
||||||
@ -469,7 +469,7 @@ label sharedFace
|
|||||||
const labelList& eFaces = surf.sortedEdgeFaces()[sharedEdgeI];
|
const labelList& eFaces = surf.sortedEdgeFaces()[sharedEdgeI];
|
||||||
|
|
||||||
// Get position of face in sorted edge faces
|
// Get position of face in sorted edge faces
|
||||||
label faceIndex = eFaces.find(firstFacei);
|
const label faceIndex = eFaces.find(firstFacei);
|
||||||
|
|
||||||
if (edgeOrder)
|
if (edgeOrder)
|
||||||
{
|
{
|
||||||
@ -500,9 +500,9 @@ void calcPointVecs
|
|||||||
|
|
||||||
boolList edgeDone(surf.nEdges(), false);
|
boolList edgeDone(surf.nEdges(), false);
|
||||||
|
|
||||||
forAllConstIter(Map<label>, faceToEdge, iter)
|
forAllConstIters(faceToEdge, iter)
|
||||||
{
|
{
|
||||||
const label edgeI = iter();
|
const label edgeI = iter.val();
|
||||||
|
|
||||||
if (!edgeDone[edgeI])
|
if (!edgeDone[edgeI])
|
||||||
{
|
{
|
||||||
@ -611,7 +611,7 @@ void renumberFaces
|
|||||||
List<triSurface::FaceType>& newTris
|
List<triSurface::FaceType>& newTris
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAllConstIter(Map<label>, faceToEdge, iter)
|
forAllConstIters(faceToEdge, iter)
|
||||||
{
|
{
|
||||||
const label facei = iter.key();
|
const label facei = iter.key();
|
||||||
const triSurface::FaceType& f = surf.localFaces()[facei];
|
const triSurface::FaceType& f = surf.localFaces()[facei];
|
||||||
|
|||||||
@ -284,10 +284,8 @@ int main(int argc, char *argv[])
|
|||||||
faceSet faceLabels(mesh, setName);
|
faceSet faceLabels(mesh, setName);
|
||||||
Info<< "Read " << faceLabels.size() << " faces to repatch ..." << endl;
|
Info<< "Read " << faceLabels.size() << " faces to repatch ..." << endl;
|
||||||
|
|
||||||
forAllConstIter(faceSet, faceLabels, iter)
|
for (const label facei : faceLabels)
|
||||||
{
|
{
|
||||||
label facei = iter.key();
|
|
||||||
|
|
||||||
if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod))
|
if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod))
|
||||||
{
|
{
|
||||||
nChanged++;
|
nChanged++;
|
||||||
@ -298,11 +296,11 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
forAll(nearest, bFacei)
|
forAll(nearest, bFacei)
|
||||||
{
|
{
|
||||||
label facei = mesh.nInternalFaces() + bFacei;
|
const label facei = mesh.nInternalFaces() + bFacei;
|
||||||
|
|
||||||
if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod))
|
if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod))
|
||||||
{
|
{
|
||||||
nChanged++;
|
++nChanged;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -214,7 +214,7 @@ int main(int argc, char *argv[])
|
|||||||
Info<< "Tad = " << Tad << nl << endl;
|
Info<< "Tad = " << Tad << nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< nl << "end" << endl;
|
Info<< nl << "End" << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -126,9 +126,9 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
forAllConstIter(SLPtrList<thermo>, EQreactions, iter)
|
for (const thermo& react : EQreactions)
|
||||||
{
|
{
|
||||||
Info<< "Kc(EQreactions) = " << iter().Kc(P, T) << endl;
|
Info<< "Kc(EQreactions) = " << react.Kc(P, T) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< nl << "End" << nl << endl;
|
Info<< nl << "End" << nl << endl;
|
||||||
|
|||||||
Reference in New Issue
Block a user