本文整理汇总了C++中polyMesh::nEdges方法的典型用法代码示例。如果您正苦于以下问题:C++ polyMesh::nEdges方法的具体用法?C++ polyMesh::nEdges怎么用?C++ polyMesh::nEdges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类polyMesh
的用法示例。
在下文中一共展示了polyMesh::nEdges方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testPackedList
void testPackedList(const polyMesh& mesh, Random& rndGen)
{
Info<< nl << "Testing PackedList synchronisation." << endl;
{
PackedList<3> bits(mesh.nEdges());
forAll(bits, i)
{
bits.set(i, rndGen.integer(0,3));
}
labelList edgeValues(mesh.nEdges());
forAll(bits, i)
{
edgeValues[i] = bits.get(i);
}
示例2: globalEdgeFaces
// Calculate global faces per pp edge.
Foam::labelListList Foam::addPatchCellLayer::calcGlobalEdgeFaces
(
const polyMesh& mesh,
const globalIndex& globalFaces,
const indirectPrimitivePatch& pp,
const labelList& meshEdges
)
{
//// Determine coupled edges just so we don't have to have storage
//// for all non-coupled edges.
//
//PackedBoolList isCoupledEdge(mesh.nEdges());
//
//const polyBoundaryMesh& patches = mesh.boundaryMesh();
//
//forAll(patches, patchI)
//{
// const polyPatch& pp = patches[patchI];
//
// if (pp.coupled())
// {
// const labelList& meshEdges = pp.meshEdges();
//
// forAll(meshEdges, i)
// {
// isCoupledEdge.set(meshEdges[i], 1);
// }
// }
//}
// From mesh edge to global face labels. Sized only for pp edges.
labelListList globalEdgeFaces(mesh.nEdges());
const labelListList& edgeFaces = pp.edgeFaces();
forAll(edgeFaces, edgeI)
{
label meshEdgeI = meshEdges[edgeI];
//if (isCoupledEdge.get(meshEdgeI) == 1)
{
const labelList& eFaces = edgeFaces[edgeI];
// Store face and processor as unique tag.
labelList& globalEFaces = globalEdgeFaces[meshEdgeI];
globalEFaces.setSize(eFaces.size());
forAll(eFaces, i)
{
globalEFaces[i] =
globalFaces.toGlobal(pp.addressing()[eFaces[i]]);
}
}
示例3: printMeshStats
void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
{
Info<< "Mesh stats" << nl
<< " points: "
<< returnReduce(mesh.points().size(), sumOp<label>()) << nl;
label nInternalPoints = returnReduce
(
mesh.nInternalPoints(),
sumOp<label>()
);
if (nInternalPoints != -Pstream::nProcs())
{
Info<< " internal points: " << nInternalPoints << nl;
if (returnReduce(mesh.nInternalPoints(), minOp<label>()) == -1)
{
WarningIn("Foam::printMeshStats(const polyMesh&, const bool)")
<< "Some processors have their points sorted into internal"
<< " and external and some do not." << endl
<< "This can cause problems later on." << endl;
}
}
if (allTopology && nInternalPoints != -Pstream::nProcs())
{
label nEdges = returnReduce(mesh.nEdges(), sumOp<label>());
label nInternalEdges = returnReduce
(
mesh.nInternalEdges(),
sumOp<label>()
);
label nInternal1Edges = returnReduce
(
mesh.nInternal1Edges(),
sumOp<label>()
);
label nInternal0Edges = returnReduce
(
mesh.nInternal0Edges(),
sumOp<label>()
);
Info<< " edges: " << nEdges << nl
<< " internal edges: " << nInternalEdges << nl
<< " internal edges using one boundary point: "
<< nInternal1Edges-nInternal0Edges << nl
<< " internal edges using two boundary points: "
<< nInternalEdges-nInternal1Edges << nl;
}
label nFaces = returnReduce(mesh.faces().size(), sumOp<label>());
label nIntFaces = returnReduce(mesh.faceNeighbour().size(), sumOp<label>());
label nCells = returnReduce(mesh.cells().size(), sumOp<label>());
Info<< " faces: " << nFaces << nl
<< " internal faces: " << nIntFaces << nl
<< " cells: " << nCells << nl
<< " faces per cell: "
<< scalar(nFaces + nIntFaces)/max(1, nCells) << nl
<< " boundary patches: " << mesh.boundaryMesh().size() << nl
<< " point zones: " << mesh.pointZones().size() << nl
<< " face zones: " << mesh.faceZones().size() << nl
<< " cell zones: " << mesh.cellZones().size() << nl
<< endl;
// Construct shape recognizers
hexMatcher hex;
prismMatcher prism;
wedgeMatcher wedge;
pyrMatcher pyr;
tetWedgeMatcher tetWedge;
tetMatcher tet;
// Counters for different cell types
label nHex = 0;
label nWedge = 0;
label nPrism = 0;
label nPyr = 0;
label nTet = 0;
label nTetWedge = 0;
label nUnknown = 0;
Map<label> polyhedralFaces;
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
{
if (hex.isA(mesh, cellI))
{
nHex++;
}
else if (tet.isA(mesh, cellI))
{
nTet++;
}
else if (pyr.isA(mesh, cellI))
{
nPyr++;
}
//.........这里部分代码省略.........