本文整理汇总了C++中primitiveMesh::cellEdges方法的典型用法代码示例。如果您正苦于以下问题:C++ primitiveMesh::cellEdges方法的具体用法?C++ primitiveMesh::cellEdges怎么用?C++ primitiveMesh::cellEdges使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类primitiveMesh
的用法示例。
在下文中一共展示了primitiveMesh::cellEdges方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: cutcellI
void Foam::cuttingPlane::calcCutCells
(
const primitiveMesh& mesh,
const scalarField& dotProducts,
const labelUList& cellIdLabels
)
{
const labelListList& cellEdges = mesh.cellEdges();
const edgeList& edges = mesh.edges();
label listSize = cellEdges.size();
if (notNull(cellIdLabels))
{
listSize = cellIdLabels.size();
}
cutCells_.setSize(listSize);
label cutcellI(0);
// Find the cut cells by detecting any cell that uses points with
// opposing dotProducts.
for (label listI = 0; listI < listSize; ++listI)
{
label cellI = listI;
if (notNull(cellIdLabels))
{
cellI = cellIdLabels[listI];
}
const labelList& cEdges = cellEdges[cellI];
label nCutEdges = 0;
forAll(cEdges, i)
{
const edge& e = edges[cEdges[i]];
if
(
(dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|| (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
)
{
nCutEdges++;
if (nCutEdges > 2)
{
cutCells_[cutcellI++] = cellI;
break;
}
}
}
}
// Set correct list size
cutCells_.setSize(cutcellI);
}