don't need shrink before List::transfer(DynamicList&) anymore

This commit is contained in:
Mark Olesen
2008-12-12 14:20:56 +01:00
parent 8a5931f15a
commit c65a40d57d
39 changed files with 89 additions and 156 deletions

View File

@ -289,9 +289,7 @@ int main(int argc, char *argv[])
<< patchNames[patchI] << "\t\t" << patchNames[patchI] << "\t\t"
<< allPatchFaces[patchI].size() << endl; << allPatchFaces[patchI].size() << endl;
allPatchFaces[patchI].shrink();
patchFaces[patchI].transfer(allPatchFaces[patchI]); patchFaces[patchI].transfer(allPatchFaces[patchI]);
allPatchFaces[patchI].clear();
} }
Info<< endl; Info<< endl;

View File

@ -461,7 +461,7 @@ int main(int argc, char *argv[])
} }
} }
// Trim // Trim
boundaryFaces.setSize(faceI); boundaryFaces.setSize(faceI);
boundaryPatch.setSize(faceI); boundaryPatch.setSize(faceI);
@ -515,7 +515,7 @@ int main(int argc, char *argv[])
Info<< " " << patchNames[patchI] << " : " Info<< " " << patchNames[patchI] << " : "
<< allPatchFaces[patchI].size() << endl; << allPatchFaces[patchI].size() << endl;
patchFaces[patchI].transfer(allPatchFaces[patchI].shrink()); patchFaces[patchI].transfer(allPatchFaces[patchI]);
} }
Info<< endl; Info<< endl;
@ -548,7 +548,6 @@ int main(int argc, char *argv[])
meshPtr().write(); meshPtr().write();
Info<< "End\n" << endl; Info<< "End\n" << endl;
return 0; return 0;

View File

@ -74,10 +74,7 @@ void Foam::readerDatabase::getPolyHedra()
} }
} }
polys.shrink();
Info<< "Found " << polys.size() << " polyhedral cells " << endl; Info<< "Found " << polys.size() << " polyhedral cells " << endl;
polys_.transfer(polys); polys_.transfer(polys);
} }

View File

@ -51,7 +51,6 @@ Foam::scalarRanges::scalarRanges(Istream& is)
} }
} }
lst.shrink();
transfer(lst); transfer(lst);
} }

View File

@ -393,12 +393,11 @@ void Foam::globalMeshData::calcSharedEdges() const
} }
} }
} }
dynSharedEdgeLabels.shrink();
sharedEdgeLabelsPtr_ = new labelList(); sharedEdgeLabelsPtr_ = new labelList();
labelList& sharedEdgeLabels = *sharedEdgeLabelsPtr_; labelList& sharedEdgeLabels = *sharedEdgeLabelsPtr_;
sharedEdgeLabels.transfer(dynSharedEdgeLabels); sharedEdgeLabels.transfer(dynSharedEdgeLabels);
dynSharedEdgeAddr.shrink();
sharedEdgeAddrPtr_ = new labelList(); sharedEdgeAddrPtr_ = new labelList();
labelList& sharedEdgeAddr = *sharedEdgeAddrPtr_; labelList& sharedEdgeAddr = *sharedEdgeAddrPtr_;
sharedEdgeAddr.transfer(dynSharedEdgeAddr); sharedEdgeAddr.transfer(dynSharedEdgeAddr);

View File

@ -467,10 +467,8 @@ void Foam::globalPoints::remove(const Map<label>& directNeighbours)
Map<label> oldMeshToProcPoint(meshToProcPoint_); Map<label> oldMeshToProcPoint(meshToProcPoint_);
meshToProcPoint_.clear(); meshToProcPoint_.clear();
procPoints_.shrink();
List<procPointList> oldProcPoints; List<procPointList> oldProcPoints;
oldProcPoints.transfer(procPoints_); oldProcPoints.transfer(procPoints_);
procPoints_.clear();
// Go through all equivalences // Go through all equivalences
for for
@ -535,7 +533,7 @@ void Foam::globalPoints::remove(const Map<label>& directNeighbours)
{ {
// This happens for 'wedge' like cyclics where the two halves // This happens for 'wedge' like cyclics where the two halves
// come together in the same point so share the same meshPoint. // come together in the same point so share the same meshPoint.
// So this meshPoint will have info of size one only. // So this meshPoint will have info of size one only.
if if
( (
pointInfo[0][0] != Pstream::myProcNo() pointInfo[0][0] != Pstream::myProcNo()
@ -968,7 +966,7 @@ Foam::globalPoints::globalPoints(const polyMesh& mesh)
// Pout<< " pointI:" << meshPointI << ' ' // Pout<< " pointI:" << meshPointI << ' '
// << mesh.points()[meshPointI] // << mesh.points()[meshPointI]
// << " connected to proc " << pointInfo[i][0] // << " connected to proc " << pointInfo[i][0]
// << " point:" << pointInfo[i][1] // << " point:" << pointInfo[i][1]
// << endl; // << endl;
// } // }
//} //}

View File

@ -64,7 +64,7 @@ Foam::labelListList Foam::polyMesh::cellShapePointCells
forAll (pc, pointI) forAll (pc, pointI)
{ {
pointCellAddr[pointI].transfer(pc[pointI].shrink()); pointCellAddr[pointI].transfer(pc[pointI]);
} }
return pointCellAddr; return pointCellAddr;

View File

@ -298,7 +298,7 @@ void PrimitivePatch<Face, FaceList, PointField, PointType>::calcAddressing()
forAll (faceFaces, faceI) forAll (faceFaces, faceI)
{ {
faceFaces[faceI].transfer(ff[faceI].shrink()); faceFaces[faceI].transfer(ff[faceI]);
} }

View File

@ -151,8 +151,6 @@ void PrimitivePatch<Face, FaceList, PointField, PointType>::calcEdgeLoops()
while (currentEdgeI != -1); while (currentEdgeI != -1);
// Done all for current loop. Transfer to edgeLoops. // Done all for current loop. Transfer to edgeLoops.
loop.shrink();
edgeLoops[loopI].transfer(loop); edgeLoops[loopI].transfer(loop);
loopI++; loopI++;

View File

@ -108,7 +108,7 @@ void Foam::primitiveMesh::calcCellEdges() const
// reset the size // reset the size
forAll (ce, cellI) forAll (ce, cellI)
{ {
cellEdgeAddr[cellI].transfer(ce[cellI].shrink()); cellEdgeAddr[cellI].transfer(ce[cellI]);
} }
} }
} }

View File

@ -546,7 +546,7 @@ void Foam::meshRefinement::calcLocalRegions
} }
} }
} }
localCc.shrink();
localPoints.transfer(localCc); localPoints.transfer(localCc);
if (localPoints.size() != globalToLocalRegion.size()) if (localPoints.size() != globalToLocalRegion.size())

View File

@ -412,11 +412,9 @@ void Foam::polyDualMesh::collectPatchInternalFace
} }
} }
dualFace2.transfer(dualFace.shrink()); dualFace2.transfer(dualFace);
dualFace.clear();
featEdgeIndices2.transfer(featEdgeIndices.shrink()); featEdgeIndices2.transfer(featEdgeIndices);
featEdgeIndices.clear();
if (reverseFace) if (reverseFace)
{ {
@ -1590,8 +1588,7 @@ void Foam::polyDualMesh::calcFeatures
allFeaturePoints.append(allBoundary.meshPoints()[pointI]); allFeaturePoints.append(allBoundary.meshPoints()[pointI]);
} }
} }
featurePoints.transfer(allFeaturePoints.shrink()); featurePoints.transfer(allFeaturePoints);
allFeaturePoints.clear();
if (debug) if (debug)
{ {
@ -1633,8 +1630,7 @@ void Foam::polyDualMesh::calcFeatures
allFeatureEdges.append(meshEdges[edgeI]); allFeatureEdges.append(meshEdges[edgeI]);
} }
} }
featureEdges.transfer(allFeatureEdges.shrink()); featureEdges.transfer(allFeatureEdges);
allFeatureEdges.clear();
} }

View File

@ -165,8 +165,7 @@ void Foam::decompositionMethod::calcCellCells
cellCells.setSize(dynCellCells.size()); cellCells.setSize(dynCellCells.size());
forAll(dynCellCells, coarseI) forAll(dynCellCells, coarseI)
{ {
cellCells[coarseI].transfer(dynCellCells[coarseI].shrink()); cellCells[coarseI].transfer(dynCellCells[coarseI]);
dynCellCells[coarseI].clear();
} }
} }

View File

@ -794,8 +794,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
globalRegionRegions.setSize(dynRegionRegions.size()); globalRegionRegions.setSize(dynRegionRegions.size());
forAll(dynRegionRegions, i) forAll(dynRegionRegions, i)
{ {
globalRegionRegions[i].transfer(dynRegionRegions[i].shrink()); globalRegionRegions[i].transfer(dynRegionRegions[i]);
dynRegionRegions[i].clear();
} }
} }
@ -859,7 +858,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
// Check for user supplied weights and decomp options // Check for user supplied weights and decomp options
if (decompositionDict_.found("metisCoeffs")) if (decompositionDict_.found("metisCoeffs"))
{ {
const dictionary& metisCoeffs = const dictionary& metisCoeffs =
decompositionDict_.subDict("metisCoeffs"); decompositionDict_.subDict("metisCoeffs");
word weightsFile; word weightsFile;

View File

@ -1503,17 +1503,13 @@ void Foam::boundaryMesh::setExtraEdges(const label edgeI)
{ {
labelList minDistance(mesh().nEdges(), -1); labelList minDistance(mesh().nEdges(), -1);
// All edge labels encountered // All edge labels encountered
DynamicList<label> visitedEdges; DynamicList<label> visitedEdges;
// Floodfill from edgeI starting from distance 0. Stop at distance. // Floodfill from edgeI starting from distance 0. Stop at distance.
markEdges(8, edgeI, 0, minDistance, visitedEdges); markEdges(8, edgeI, 0, minDistance, visitedEdges);
visitedEdges.shrink();
// Set edge labels to display // Set edge labels to display
//? Allowed to transfer from DynamicList to List
extraEdges_.transfer(visitedEdges); extraEdges_.transfer(visitedEdges);
} }

View File

@ -787,9 +787,6 @@ bool Foam::topoCellLooper::cut
} }
else else
{ {
localLoop.shrink();
localLoopWeights.shrink();
loop.transfer(localLoop); loop.transfer(localLoop);
loopWeights.transfer(localLoopWeights); loopWeights.transfer(localLoopWeights);
@ -799,17 +796,16 @@ bool Foam::topoCellLooper::cut
else else
{ {
// Let parent handle poly case. // Let parent handle poly case.
return return hexCellLooper::cut
hexCellLooper::cut (
( refDir,
refDir, cellI,
cellI, vertIsCut,
vertIsCut, edgeIsCut,
edgeIsCut, edgeWeight,
edgeWeight, loop,
loop, loopWeights
loopWeights );
);
} }
} }
} }

View File

@ -131,11 +131,8 @@ Foam::face Foam::boundaryCutter::addEdgeCutsToFace
} }
} }
newFace.shrink();
face returnFace; face returnFace;
returnFace.transfer(newFace); returnFace.transfer(newFace);
newFace.clear();
if (debug) if (debug)
{ {
@ -361,9 +358,7 @@ bool Foam::boundaryCutter::splitFace
{ {
// Enough vertices to create a face from. // Enough vertices to create a face from.
face tmpFace; face tmpFace;
newFace.shrink();
tmpFace.transfer(newFace); tmpFace.transfer(newFace);
newFace.clear();
// Add face tmpFace // Add face tmpFace
addFace(faceI, tmpFace, modifiedFace, meshMod); addFace(faceI, tmpFace, modifiedFace, meshMod);
@ -381,9 +376,7 @@ bool Foam::boundaryCutter::splitFace
{ {
// Enough vertices to create a face from. // Enough vertices to create a face from.
face tmpFace; face tmpFace;
newFace.shrink();
tmpFace.transfer(newFace); tmpFace.transfer(newFace);
newFace.clear();
// Add face tmpFace // Add face tmpFace
addFace(faceI, tmpFace, modifiedFace, meshMod); addFace(faceI, tmpFace, modifiedFace, meshMod);

View File

@ -222,8 +222,6 @@ Foam::wallLayerCells::wallLayerCells
} }
} }
refineCells.shrink();
// Transfer refineCells storage to this. // Transfer refineCells storage to this.
transfer(refineCells); transfer(refineCells);
} }

View File

@ -489,7 +489,6 @@ void Foam::polyMeshAdder::insertVertices
if (workFace.size() != allF.size()) if (workFace.size() != allF.size())
{ {
workFace.shrink();
allF.transfer(workFace); allF.transfer(workFace);
} }
} }

View File

@ -1079,8 +1079,7 @@ Foam::label Foam::hexRef8::storeMidPointInfo
} }
face newFace; face newFace;
newFace.transfer(newFaceVerts.shrink()); newFace.transfer(newFaceVerts);
newFaceVerts.clear();
label anchorCell0 = getAnchorCell label anchorCell0 = getAnchorCell
( (
@ -3687,8 +3686,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
); );
// Convert dynamiclist to face. // Convert dynamiclist to face.
newFace.transfer(faceVerts.shrink()); newFace.transfer(faceVerts);
faceVerts.clear();
//Pout<< "Split face:" << faceI << " verts:" << f //Pout<< "Split face:" << faceI << " verts:" << f
// << " into quad:" << newFace << endl; // << " into quad:" << newFace << endl;
@ -3811,8 +3809,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
} }
face newFace; face newFace;
newFace.transfer(newFaceVerts.shrink()); newFace.transfer(newFaceVerts);
// The point with the lowest level should be an anchor // The point with the lowest level should be an anchor
// point of the neighbouring cells. // point of the neighbouring cells.
@ -3993,10 +3990,8 @@ Foam::labelListList Foam::hexRef8::setRefinement
} }
} }
pointLevel_.transfer(newPointLevel.shrink()); pointLevel_.transfer(newPointLevel);
newPointLevel.clear(); cellLevel_.transfer(newCellLevel);
cellLevel_.transfer(newCellLevel.shrink());
newCellLevel.clear();
// Mark files as changed // Mark files as changed
setInstance(mesh_.facesInstance()); setInstance(mesh_.facesInstance());

View File

@ -365,8 +365,7 @@ void Foam::removeFaces::mergeFaces
} }
face mergedFace; face mergedFace;
mergedFace.transfer(faceVerts.shrink()); mergedFace.transfer(faceVerts);
faceVerts.clear();
if (reverseLoop) if (reverseLoop)
{ {
@ -574,7 +573,7 @@ Foam::removeFaces::removeFaces
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// Removing face connects cells. This function works out a consistent set of // Removing face connects cells. This function works out a consistent set of
// cell regions. // cell regions.
// - returns faces to remove. Can be extended with additional faces // - returns faces to remove. Can be extended with additional faces
// (if owner would become neighbour) // (if owner would become neighbour)
// - sets cellRegion to -1 or to region number // - sets cellRegion to -1 or to region number
@ -693,7 +692,7 @@ Foam::label Foam::removeFaces::compatibleRemoves
// Various checks // Various checks
// - master is lowest numbered in any region // - master is lowest numbered in any region
// - regions have more than 1 cell // - regions have more than 1 cell
{ {
labelList nCells(regionMaster.size(), 0); labelList nCells(regionMaster.size(), 0);
@ -763,8 +762,7 @@ Foam::label Foam::removeFaces::compatibleRemoves
} }
} }
newFacesToRemove.transfer(allFacesToRemove.shrink()); newFacesToRemove.transfer(allFacesToRemove);
allFacesToRemove.clear();
return nUsedRegions; return nUsedRegions;
} }
@ -1102,7 +1100,7 @@ void Foam::removeFaces::setRefinement
else if (nFacesPerEdge[edgeI] == 1) else if (nFacesPerEdge[edgeI] == 1)
{ {
// 1: illegal. Tested above. // 1: illegal. Tested above.
} }
else if (nFacesPerEdge[edgeI] == 2) else if (nFacesPerEdge[edgeI] == 2)
{ {
// 2: merge faces. // 2: merge faces.
@ -1219,7 +1217,7 @@ void Foam::removeFaces::setRefinement
<< "The other side has region:" << nbrRegion << "The other side has region:" << nbrRegion
<< endl << endl
<< "(region -1 means face is to be deleted)" << "(region -1 means face is to be deleted)"
<< abort(FatalError); << abort(FatalError);
} }
} }
else if (toNbrRegion[myRegion] == -1) else if (toNbrRegion[myRegion] == -1)
@ -1240,9 +1238,9 @@ void Foam::removeFaces::setRefinement
<< " with coupled neighbouring regions:" << " with coupled neighbouring regions:"
<< toNbrRegion[myRegion] << " and " << toNbrRegion[myRegion] << " and "
<< nbrRegion << nbrRegion
<< abort(FatalError); << abort(FatalError);
} }
} }
} }
} }
@ -1358,7 +1356,7 @@ void Foam::removeFaces::setRefinement
pointsToRemove pointsToRemove
) )
); );
// //
// Now we know // Now we know
// - faceLabels : faces to remove (sync since no boundary faces) // - faceLabels : faces to remove (sync since no boundary faces)
@ -1367,7 +1365,7 @@ void Foam::removeFaces::setRefinement
// - faceRegion : connected face region of faces to be merged (sync) // - faceRegion : connected face region of faces to be merged (sync)
// - affectedFace : faces with points removed and/or owner/neighbour // - affectedFace : faces with points removed and/or owner/neighbour
// changed (non sync) // changed (non sync)
// Start modifying mesh and keep track of faces changed. // Start modifying mesh and keep track of faces changed.

View File

@ -372,7 +372,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// sliding intergace coupling in order to allow the point // sliding intergace coupling in order to allow the point
// projection to be done separately from the actual cutting. // projection to be done separately from the actual cutting.
// Please change consistently with slidingInterfaceProjectPoints.C // Please change consistently with slidingInterfaceProjectPoints.C
// //
if (debug) if (debug)
{ {
Pout << "Processing slave edges " << endl; Pout << "Processing slave edges " << endl;
@ -543,7 +543,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
forAll (curFaces, faceI) forAll (curFaces, faceI)
{ {
// Pout<< "face: " << curFaces[faceI] << " " // Pout<< "face: " << curFaces[faceI] << " "
// << masterPatch[curFaces[faceI]] // << masterPatch[curFaces[faceI]]
// << " local: " // << " local: "
// << masterPatch.localFaces()[curFaces[faceI]] // << masterPatch.localFaces()[curFaces[faceI]]
// << endl; // << endl;
@ -566,7 +566,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// The edge cutting code is repeated in // The edge cutting code is repeated in
// slidingInterface::modifyMotionPoints. This is done for // slidingInterface::modifyMotionPoints. This is done for
// efficiency reasons and avoids multiple creation of cutting // efficiency reasons and avoids multiple creation of cutting
// planes. Please update both simultaneously. // planes. Please update both simultaneously.
const point& a = projectedSlavePoints[curEdge.start()]; const point& a = projectedSlavePoints[curEdge.start()];
const point& b = projectedSlavePoints[curEdge.end()]; const point& b = projectedSlavePoints[curEdge.end()];
@ -623,7 +623,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
if (slaveCut.hit()) if (slaveCut.hit())
{ {
// Strict checking of slave cut to avoid capturing // Strict checking of slave cut to avoid capturing
// end points. // end points.
scalar cutOnSlave = scalar cutOnSlave =
( (
( (
@ -747,14 +747,14 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
forAll (pointsIntoMasterEdges, i) forAll (pointsIntoMasterEdges, i)
{ {
pime[i].transfer(pointsIntoMasterEdges[i].shrink()); pime[i].transfer(pointsIntoMasterEdges[i]);
} }
labelListList pise(pointsIntoSlaveEdges.size()); labelListList pise(pointsIntoSlaveEdges.size());
forAll (pointsIntoSlaveEdges, i) forAll (pointsIntoSlaveEdges, i)
{ {
pise[i].transfer(pointsIntoSlaveEdges[i].shrink()); pise[i].transfer(pointsIntoSlaveEdges[i]);
} }
// Prepare the enriched faces // Prepare the enriched faces
@ -1398,7 +1398,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
} }
face newFace; face newFace;
newFace.transfer(newFaceLabels.shrink()); newFace.transfer(newFaceLabels);
// Pout << "Modifying master stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl; // Pout << "Modifying master stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;
@ -1683,7 +1683,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
} }
face newFace; face newFace;
newFace.transfer(newFaceLabels.shrink()); newFace.transfer(newFaceLabels);
// Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl; // Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;

View File

@ -227,7 +227,7 @@ void Foam::slidingInterface::decoupleInterface
} }
face newFace; face newFace;
newFace.transfer(newFaceLabels.shrink()); newFace.transfer(newFaceLabels);
// Pout << "Modifying master stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl; // Pout << "Modifying master stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;
@ -350,7 +350,7 @@ void Foam::slidingInterface::decoupleInterface
} }
face newFace; face newFace;
newFace.transfer(newFaceLabels.shrink()); newFace.transfer(newFaceLabels);
// Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl; // Pout << "Modifying slave stick-out face " << curFaceID << " old face: " << oldFace << " new face: " << newFace << endl;

View File

@ -133,7 +133,7 @@ void Foam::enrichedPatch::calcCutFaces() const
// The seed edges include all the edges of the original face + all edges // The seed edges include all the edges of the original face + all edges
// of other faces that have been used in the construction of the // of other faces that have been used in the construction of the
// facet. Edges from other faces can be considered as // facet. Edges from other faces can be considered as
// internal to the current face if used only once. // internal to the current face if used only once.
// Track the edge usage to avoid duplicate faces and reset it to unused // Track the edge usage to avoid duplicate faces and reset it to unused
boolList usedFaceEdges(curLocalFace.size(), false); boolList usedFaceEdges(curLocalFace.size(), false);
@ -304,12 +304,12 @@ void Foam::enrichedPatch::calcCutFaces() const
// Append the face // Append the face
face cutFaceGlobal; face cutFaceGlobal;
cutFaceGlobal.transfer(cutFaceGlobalPoints.shrink()); cutFaceGlobal.transfer(cutFaceGlobalPoints);
cf.append(cutFaceGlobal); cf.append(cutFaceGlobal);
face cutFaceLocal; face cutFaceLocal;
cutFaceLocal.transfer(cutFaceLocalPoints.shrink()); cutFaceLocal.transfer(cutFaceLocalPoints);
// Pout << "\ncutFaceLocal: " << cutFaceLocal.points(lp) << endl; // Pout << "\ncutFaceLocal: " << cutFaceLocal.points(lp) << endl;
// Go through all edges of the cut faces. // Go through all edges of the cut faces.
// If the edge corresponds to a starting face edge, // If the edge corresponds to a starting face edge,
@ -358,7 +358,7 @@ void Foam::enrichedPatch::calcCutFaces() const
edgeSeeds.append(curCutFaceEdge.reverseEdge()); edgeSeeds.append(curCutFaceEdge.reverseEdge());
} }
} }
// Find out what the other side is // Find out what the other side is
@ -596,20 +596,19 @@ void Foam::enrichedPatch::calcCutFaces() const
// Re-pack the list into compact storage // Re-pack the list into compact storage
cutFacesPtr_ = new faceList(); cutFacesPtr_ = new faceList();
cutFacesPtr_->transfer(cf.shrink()); cutFacesPtr_->transfer(cf);
cutFaceMasterPtr_ = new labelList(); cutFaceMasterPtr_ = new labelList();
cutFaceMasterPtr_->transfer(cfMaster.shrink()); cutFaceMasterPtr_->transfer(cfMaster);
cutFaceSlavePtr_ = new labelList(); cutFaceSlavePtr_ = new labelList();
cutFaceSlavePtr_->transfer(cfSlave.shrink()); cutFaceSlavePtr_->transfer(cfSlave);
} }
void Foam::enrichedPatch::clearCutFaces() void Foam::enrichedPatch::clearCutFaces()
{ {
deleteDemandDrivenData(cutFacesPtr_); deleteDemandDrivenData(cutFacesPtr_);
deleteDemandDrivenData(cutFaceMasterPtr_); deleteDemandDrivenData(cutFaceMasterPtr_);
deleteDemandDrivenData(cutFaceSlavePtr_); deleteDemandDrivenData(cutFaceSlavePtr_);
} }

View File

@ -80,7 +80,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
// For correct functioning of the enrichedPatch class, the slave // For correct functioning of the enrichedPatch class, the slave
// faces need to be inserted first. See comments in // faces need to be inserted first. See comments in
// enrichedPatch.H // enrichedPatch.H
// Get reference to the point merge map // Get reference to the point merge map
const Map<label>& pmm = pointMergeMap(); const Map<label>& pmm = pointMergeMap();
@ -233,10 +233,10 @@ void Foam::enrichedPatch::calcEnrichedFaces
} }
} }
} }
// Info << "New slave face " << faceI << ": " << newFace << endl; // Info<< "New slave face " << faceI << ": " << newFace << endl;
// Add the new face to the list // Add the new face to the list
enrichedFaces[nEnrichedFaces].transfer(newFace.shrink()); enrichedFaces[nEnrichedFaces].transfer(newFace);
nEnrichedFaces++; nEnrichedFaces++;
} }
@ -384,10 +384,10 @@ void Foam::enrichedPatch::calcEnrichedFaces
} }
} }
} }
// Info << "New master face: " << newFace << endl; // Info<< "New master face: " << newFace << endl;
// Add the new face to the list // Add the new face to the list
enrichedFaces[nEnrichedFaces].transfer(newFace.shrink()); enrichedFaces[nEnrichedFaces].transfer(newFace);
nEnrichedFaces++; nEnrichedFaces++;
} }

View File

@ -138,11 +138,11 @@ void Foam::enrichedPatch::calcMasterPointFaces() const
forAll (mpfToc, mpfTocI) forAll (mpfToc, mpfTocI)
{ {
labelList l; labelList l;
l.transfer(mpf.find(mpfToc[mpfTocI])().shrink()); l.transfer(mpf.find(mpfToc[mpfTocI])());
masterPointFaceAddr.insert(mpfToc[mpfTocI], l); masterPointFaceAddr.insert(mpfToc[mpfTocI], l);
} }
// Pout << "masterPointFaceAddr: " << masterPointFaceAddr << endl; // Pout<< "masterPointFaceAddr: " << masterPointFaceAddr << endl;
} }

View File

@ -110,7 +110,7 @@ void Foam::enrichedPatch::calcPointPoints() const
forAll (pp, pointI) forAll (pp, pointI)
{ {
ppAddr[pointI].transfer(pp[pointI].shrink()); ppAddr[pointI].transfer(pp[pointI]);
} }
} }

View File

@ -369,8 +369,6 @@ void Foam::cellFeatures::calcSuperFaces() const
} }
else else
{ {
superFace.shrink();
faces[superFaceI].transfer(superFace); faces[superFaceI].transfer(superFace);
} }
} }

View File

@ -183,9 +183,7 @@ void indexedOctree<Type>::divide
result.setSize(8); result.setSize(8);
for (direction octant = 0; octant < subIndices.size(); octant++) for (direction octant = 0; octant < subIndices.size(); octant++)
{ {
subIndices[octant].shrink();
result[octant].transfer(subIndices[octant]); result[octant].transfer(subIndices[octant]);
subIndices[octant].clear();
} }
} }

View File

@ -250,8 +250,7 @@ void Foam::regionSplit::fillSeedMask
// << newChangedFaces.size() << endl; // << newChangedFaces.size() << endl;
//} //}
changedFaces.transfer(newChangedFaces.shrink()); changedFaces.transfer(newChangedFaces);
newChangedFaces.clear();
} }
} }

View File

@ -239,12 +239,11 @@ Foam::distributedTriSurfaceMesh::constructSegments
sendMap.setSize(Pstream::nProcs()); sendMap.setSize(Pstream::nProcs());
forAll(sendMap, procI) forAll(sendMap, procI)
{ {
dynSendMap[procI].shrink();
sendMap[procI].transfer(dynSendMap[procI]); sendMap[procI].transfer(dynSendMap[procI]);
} }
allSegments.transfer(dynAllSegments.shrink()); allSegments.transfer(dynAllSegments);
allSegmentMap.transfer(dynAllSegmentMap.shrink()); allSegmentMap.transfer(dynAllSegmentMap);
} }
@ -704,13 +703,12 @@ Foam::distributedTriSurfaceMesh::calcLocalQueries
sendMap.setSize(Pstream::nProcs()); sendMap.setSize(Pstream::nProcs());
forAll(sendMap, procI) forAll(sendMap, procI)
{ {
dynSendMap[procI].shrink();
sendMap[procI].transfer(dynSendMap[procI]); sendMap[procI].transfer(dynSendMap[procI]);
} }
allCentres.transfer(dynAllCentres.shrink()); allCentres.transfer(dynAllCentres);
allRadiusSqr.transfer(dynAllRadiusSqr.shrink()); allRadiusSqr.transfer(dynAllRadiusSqr);
allSegmentMap.transfer(dynAllSegmentMap.shrink()); allSegmentMap.transfer(dynAllSegmentMap);
} }

View File

@ -482,7 +482,6 @@ void Foam::searchableBox::findLineAll
pt = inter.hitPoint() + smallVec[pointI]; pt = inter.hitPoint() + smallVec[pointI];
} }
hits.shrink();
info[pointI].transfer(hits); info[pointI].transfer(hits);
} }
else else

View File

@ -449,7 +449,6 @@ void Foam::triSurfaceMesh::findLineAll
pt = inter.hitPoint() + smallVec[pointI]; pt = inter.hitPoint() + smallVec[pointI];
} }
hits.shrink();
info[pointI].transfer(hits); info[pointI].transfer(hits);
} }
else else

View File

@ -287,18 +287,12 @@ Foam::edgeSurface::edgeSurface
} }
// Transfer. // Transfer.
allEdges.shrink();
edges_.transfer(allEdges); edges_.transfer(allEdges);
allParentEdges.shrink();
parentEdges_.transfer(allParentEdges); parentEdges_.transfer(allParentEdges);
forAll(allFaceEdges, faceI) forAll(allFaceEdges, faceI)
{ {
DynamicList<label>& allFEdges = allFaceEdges[faceI]; faceEdges_[faceI].transfer(allFaceEdges[faceI]);
allFEdges.shrink();
faceEdges_[faceI].transfer(allFEdges);
} }

View File

@ -218,14 +218,8 @@ void Foam::edgeIntersections::intersectEdges
// Done current edge. Transfer all data into *this // Done current edge. Transfer all data into *this
currentIntersections.shrink();
currentIntersectionTypes.shrink();
operator[](edgeI).transfer(currentIntersections); operator[](edgeI).transfer(currentIntersections);
classification_[edgeI].transfer(currentIntersectionTypes); classification_[edgeI].transfer(currentIntersectionTypes);
currentIntersections.clear();
currentIntersectionTypes.clear();
} }
if (debug) if (debug)
@ -651,7 +645,7 @@ Foam::label Foam::edgeIntersections::removeDegenerates
offsetPerturb offsetPerturb
( (
surf1, surf1,
surf2, surf2,
edgeI, edgeI,
rndGen, rndGen,
points1, points1,

View File

@ -38,7 +38,6 @@ void Foam::surfaceIntersection::transfer
List<T>& lList List<T>& lList
) )
{ {
dList.shrink();
lList.transfer(dList); lList.transfer(dList);
} }

View File

@ -197,7 +197,7 @@ void Foam::surfaceFeatures::calcFeatPoints(const List<edgeStatus>& edgeStat)
featurePoints.append(pointI); featurePoints.append(pointI);
} }
} }
featurePoints.shrink();
featurePoints_.transfer(featurePoints); featurePoints_.transfer(featurePoints);
} }

View File

@ -815,8 +815,8 @@ Foam::triSurface Foam::isoSurface::stitchTriPoints
} }
} }
triMap.transfer(newToOldTri.shrink()); triMap.transfer(newToOldTri);
tris.transfer(dynTris.shrink()); tris.transfer(dynTris);
} }
@ -875,7 +875,7 @@ Foam::triSurface Foam::isoSurface::stitchTriPoints
} }
} }
triMap.transfer(newToOldTri.shrink()); triMap.transfer(newToOldTri);
tris.setSize(newTriI); tris.setSize(newTriI);
} }
} }

View File

@ -434,7 +434,7 @@ void Foam::isoSurfaceCell::calcSnappedCc
} }
else else
{ {
// Need to analyse // Need to analyse
forAll(cFaces, cFaceI) forAll(cFaces, cFaceI)
{ {
const face& f = mesh_.faces()[cFaces[cFaceI]]; const face& f = mesh_.faces()[cFaces[cFaceI]];
@ -747,7 +747,7 @@ void Foam::isoSurfaceCell::calcSnappedPoint
( (
false, // do not check for duplicate tris false, // do not check for duplicate tris
localTriPoints, localTriPoints,
triPointReverseMap, triPointReverseMap,
triMap triMap
) )
); );
@ -871,8 +871,8 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
} }
} }
triMap.transfer(newToOldTri.shrink()); triMap.transfer(newToOldTri);
tris.transfer(dynTris.shrink()); tris.transfer(dynTris);
} }
@ -930,7 +930,7 @@ Foam::triSurface Foam::isoSurfaceCell::stitchTriPoints
} }
} }
triMap.transfer(newToOldTri.shrink()); triMap.transfer(newToOldTri);
tris.setSize(newTriI); tris.setSize(newTriI);
} }
} }
@ -1062,7 +1062,7 @@ void Foam::isoSurfaceCell::calcAddressing
faceEdges[triI][1] = oldToMerged[edgeI++]; faceEdges[triI][1] = oldToMerged[edgeI++];
faceEdges[triI][2] = oldToMerged[edgeI++]; faceEdges[triI][2] = oldToMerged[edgeI++];
} }
// Determine edgeFaces // Determine edgeFaces
edgeFace0.setSize(mergedCentres.size()); edgeFace0.setSize(mergedCentres.size());
@ -1137,7 +1137,7 @@ void Foam::isoSurfaceCell::walkOrientation
forAll(fEdges, fp) forAll(fEdges, fp)
{ {
label edgeI = fEdges[fp]; label edgeI = fEdges[fp];
// my points: // my points:
label p0 = tri[fp]; label p0 = tri[fp];
label p1 = tri[tri.fcIndex(fp)]; label p1 = tri[tri.fcIndex(fp)];
@ -1174,7 +1174,7 @@ void Foam::isoSurfaceCell::walkOrientation
changedFaces.transfer(newChangedFaces); changedFaces.transfer(newChangedFaces);
} }
} }
void Foam::isoSurfaceCell::orientSurface void Foam::isoSurfaceCell::orientSurface
@ -1199,7 +1199,7 @@ void Foam::isoSurfaceCell::orientSurface
for for
( (
; ;
seedTriI < surf.size() && flipState[seedTriI] != -1; seedTriI < surf.size() && flipState[seedTriI] != -1;
seedTriI++ seedTriI++
) )
{} {}
@ -1473,14 +1473,13 @@ Foam::isoSurfaceCell::isoSurfaceCell
snappedCc = -1; snappedCc = -1;
} }
snappedPoints.shrink();
if (debug) if (debug)
{ {
Pout<< "isoSurfaceCell : shifted " << snappedPoints.size() Pout<< "isoSurfaceCell : shifted " << snappedPoints.size()
<< " cell centres to intersection." << endl; << " cell centres to intersection." << endl;
} }
snappedPoints.shrink();
label nCellSnaps = snappedPoints.size(); label nCellSnaps = snappedPoints.size();
// Per point -1 or a point inside snappedPoints. // Per point -1 or a point inside snappedPoints.