本文整理汇总了C++中labelHashSet::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ labelHashSet::insert方法的具体用法?C++ labelHashSet::insert怎么用?C++ labelHashSet::insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类labelHashSet
的用法示例。
在下文中一共展示了labelHashSet::insert方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: queryMesh
void Foam::surfaceSets::getSurfaceSets
(
const polyMesh& mesh,
const fileName&,
const triSurface&,
const triSurfaceSearch& querySurf,
const pointField& outsidePts,
const label nCutLayers,
labelHashSet& inside,
labelHashSet& outside,
labelHashSet& cut
)
{
// Construct search engine on mesh
meshSearch queryMesh(mesh);
// Cut faces with surface and classify cells
cellClassification cellType
(
mesh,
queryMesh,
querySurf,
outsidePts
);
if (nCutLayers > 0)
{
// Trim cutCells so they are max nCutLayers away (as seen in point-cell
// walk) from outside cells.
cellType.trimCutCells
(
nCutLayers,
cellClassification::OUTSIDE,
cellClassification::INSIDE
);
}
forAll(cellType, celli)
{
label cType = cellType[celli];
if (cType == cellClassification::CUT)
{
cut.insert(celli);
}
else if (cType == cellClassification::INSIDE)
{
inside.insert(celli);
}
else if (cType == cellClassification::OUTSIDE)
{
outside.insert(celli);
}
}
示例2: forAll
forAll(bMesh, patchI)
{
const polyPatch& patch = bMesh[patchI];
if (patchNamesHash.found(patch.name()))
{
patchIDs.insert(patchI);
}
}
示例3: forAll
forAll(ptc, pointi)
{
const labelList& curFaces = pf[ptc[pointi]];
forAll(curFaces, facei)
{
if (!facesToRemoveMap.found(curFaces[facei]))
{
facesToModify.insert(curFaces[facei]);
}
}
}
示例4: forAllConstIter
// Find cells to refine
forAllConstIter(labelHashSet, patchSet, iter)
{
const polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, pointI)
{
label meshPointI = meshPoints[pointI];
const labelList& pCells = mesh.pointCells()[meshPointI];
forAll(pCells, pCellI)
{
cutCells.insert(pCells[pCellI]);
}
示例5: forAll
void bigParticleVoidFraction::buildLabelHashSet
(
const scalar radius,
const vector position,
const label cellID,
labelHashSet& hashSett
)const
{
hashSett.insert(cellID);
//Info<<"cell inserted"<<cellID<<endl;
const labelList& nc = particleCloud_.mesh().cellCells()[cellID];
forAll(nc,i){
label neighbor=nc[i];
if(!hashSett.found(neighbor) && mag(position-particleCloud_.mesh().C()[neighbor])<radius){
buildLabelHashSet(radius,position,neighbor,hashSett);
}
}
示例6: forAll
// Step from faceI (on side cellI) to connected face & cell without crossing
// fenceEdges.
void Foam::regionSide::visitConnectedFaces
(
const primitiveMesh& mesh,
const labelHashSet& region,
const labelHashSet& fenceEdges,
const label cellI,
const label faceI,
labelHashSet& visitedFace
)
{
if (!visitedFace.found(faceI))
{
if (debug)
{
Info<< "visitConnectedFaces : cellI:" << cellI << " faceI:"
<< faceI << " isOwner:" << (cellI == mesh.faceOwner()[faceI])
<< endl;
}
// Mark as visited
visitedFace.insert(faceI);
// Mark which side of face was visited.
if (cellI == mesh.faceOwner()[faceI])
{
sideOwner_.insert(faceI);
}
// Visit all neighbouring faces on faceSet. Stay on this 'side' of
// face by doing edge-face-cell walk.
const labelList& fEdges = mesh.faceEdges()[faceI];
forAll(fEdges, fEdgeI)
{
label edgeI = fEdges[fEdgeI];
if (!fenceEdges.found(edgeI))
{
// Step along faces on edge from cell to cell until
// we hit face on faceSet.
// Find face reachable from edge
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
if (mesh.isInternalFace(otherFaceI))
{
label otherCellI = cellI;
// Keep on crossing faces/cells until back on face on
// surface
while (!region.found(otherFaceI))
{
visitedFace.insert(otherFaceI);
if (debug)
{
Info<< "visitConnectedFaces : cellI:" << cellI
<< " found insideEdgeFace:" << otherFaceI
<< endl;
}
// Cross otherFaceI into neighbouring cell
otherCellI =
meshTools::otherCell
(
mesh,
otherCellI,
otherFaceI
);
otherFaceI =
otherFace
(
mesh,
otherCellI,
otherFaceI,
edgeI
);
}
visitConnectedFaces
(
mesh,
region,
fenceEdges,
otherCellI,
otherFaceI,
visitedFace
);
}
}
}
}
示例7: maxNonOrtho
// Same check as snapMesh
void checkSnapMesh
(
const Time& runTime,
const polyMesh& mesh,
labelHashSet& wrongFaces
)
{
IOdictionary snapDict
(
IOobject
(
"snapMeshDict",
runTime.system(),
mesh,
IOobject::MUST_READ,
IOobject::NO_WRITE
)
);
// Max nonorthogonality allowed
scalar maxNonOrtho(readScalar(snapDict.lookup("maxNonOrtho")));
primitiveMesh::nonOrthThreshold_ = maxNonOrtho;
// Max concaveness allowed.
scalar maxConcave(readScalar(snapDict.lookup("maxConcave")));
primitiveMesh::faceAngleThreshold_ = maxConcave;
// Min volume allowed (factor of minimum cellVolume)
scalar relMinVol(readScalar(snapDict.lookup("minVol")));
const scalar minCellVol = min(mesh.cellVolumes());
const scalar minPyrVol = relMinVol*minCellVol;
// Min area
scalar minArea(readScalar(snapDict.lookup("minArea")));
if (maxNonOrtho < 180.0 - SMALL)
{
Pout<< "Checking non orthogonality" << endl;
label nOldSize = wrongFaces.size();
mesh.checkFaceOrthogonality(false, &wrongFaces);
Pout<< "Detected " << wrongFaces.size() - nOldSize
<< " faces with non-orthogonality > " << maxNonOrtho << " degrees"
<< endl;
}
if (minPyrVol > -GREAT)
{
Pout<< "Checking face pyramids" << endl;
label nOldSize = wrongFaces.size();
mesh.checkFacePyramids(false, minPyrVol, &wrongFaces);
Pout<< "Detected additional " << wrongFaces.size() - nOldSize
<< " faces with illegal face pyramids" << endl;
}
if (maxConcave < 180.0 - SMALL)
{
Pout<< "Checking face angles" << endl;
label nOldSize = wrongFaces.size();
mesh.checkFaceAngles(false, &wrongFaces);
Pout<< "Detected additional " << wrongFaces.size() - nOldSize
<< " faces with concavity > " << maxConcave << " degrees"
<< endl;
}
if (minArea > -SMALL)
{
Pout<< "Checking face areas" << endl;
label nOldSize = wrongFaces.size();
const scalarField magFaceAreas = mag(mesh.faceAreas());
forAll(magFaceAreas, faceI)
{
if (magFaceAreas[faceI] < minArea)
{
wrongFaces.insert(faceI);
}
}
Pout<< "Detected additional " << wrongFaces.size() - nOldSize
<< " faces with area < " << minArea << " m^2" << endl;
}
示例8: queryMesh
void Foam::surfaceSets::getSurfaceSets
(
const polyMesh& mesh,
const fileName&,
const triSurface&,
const triSurfaceSearch& querySurf,
const pointField& outsidePts,
const label nCutLayers,
labelHashSet& inside,
labelHashSet& outside,
labelHashSet& cut
)
{
// Construct search engine on mesh
meshSearch queryMesh(mesh, true);
// Check all 'outside' points
forAll(outsidePts, outsideI)
{
const point& outsidePoint = outsidePts[outsideI];
// Find cell point is in. Linear search.
if (queryMesh.findCell(outsidePoint, -1, false) == -1)
{
FatalErrorIn
(
"surfaceSets::getSurfaceSets"
"(const polyMesh&, const fileName&, const triSurface&"
", const triSurfaceSearch&, const pointField&"
", labelHashSet&, labelHashSet&, labelHashSet&)"
) << "outsidePoint " << outsidePoint
<< " is not inside any cell"
<< exit(FatalError);
}
}
// Cut faces with surface and classify cells
cellClassification cellType
(
mesh,
queryMesh,
querySurf,
outsidePts
);
if (nCutLayers > 0)
{
// Trim cutCells so they are max nCutLayers away (as seen in point-cell
// walk) from outside cells.
cellType.trimCutCells
(
nCutLayers,
cellClassification::OUTSIDE,
cellClassification::INSIDE
);
}
forAll(cellType, cellI)
{
label cType = cellType[cellI];
if (cType == cellClassification::CUT)
{
cut.insert(cellI);
}
else if (cType == cellClassification::INSIDE)
{
inside.insert(cellI);
}
else if (cType == cellClassification::OUTSIDE)
{
outside.insert(cellI);
}
}