本文整理汇总了C++中labelList::fcIndex方法的典型用法代码示例。如果您正苦于以下问题:C++ labelList::fcIndex方法的具体用法?C++ labelList::fcIndex怎么用?C++ labelList::fcIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类labelList
的用法示例。
在下文中一共展示了labelList::fcIndex方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: faceEdges
// Get faceEdges in order of face points, i.e. faceEdges[0] is between
// f[0] and f[1]
labelList getSortedEdges
(
const edgeList& edges,
const labelList& f,
const labelList& edgeLabels
)
{
labelList faceEdges(edgeLabels.size(), -1);
// Find starting pos in f for every edgeLabels
forAll(edgeLabels, i)
{
label edgeI = edgeLabels[i];
const edge& e = edges[edgeI];
label fp = findIndex(f, e[0]);
label fp1 = f.fcIndex(fp);
if (f[fp1] == e[1])
{
// EdgeI between fp -> fp1
faceEdges[fp] = edgeI;
}
else
{
// EdgeI between fp-1 -> fp
faceEdges[f.rcIndex(fp)] = edgeI;
}
}
示例2: if
Foam::label Foam::isoCutFace::calcSubFace
(
const scalar isoValue,
const pointField& points,
const scalarField& f,
const labelList& pLabels
)
{
// Face status set to one of the values:
// -1: face is fully below the isosurface
// 0: face is cut, i.e. has values larger and smaller than isoValue
// +1: face is fully above the isosurface
label faceStatus;
scalar f1 = f[pLabels[0]];
// If vertex values are very close to isoValue lift them slightly to avoid
// dealing with the many special cases of a face being touched either at a
// single point, along an edge, or the entire face being on the surface.
if (mag(f1 - isoValue) < 10*SMALL)
{
f1 += sign(f1 - isoValue)*10*SMALL;
}
// Finding cut edges, the point along them where they are cut, and all fully
// submerged face points.
forAll(pLabels, pi)
{
label pl2 = pLabels[pLabels.fcIndex(pi)];
scalar f2 = f[pl2];
if (mag(f2 - isoValue) < 10*SMALL)
{
f2 += sign(f2 - isoValue)*10*SMALL;
}
if (f1 > isoValue)
{
nFullySubmergedPoints_ += 1;
if (f2 < isoValue)
{
lastEdgeCut_ = (isoValue - f1)/(f2 - f1);
}
}
else if (f1 < isoValue && f2 > isoValue)
{
if (firstFullySubmergedPoint_ == -1)
{
firstFullySubmergedPoint_ = pLabels.fcIndex(pi);
firstEdgeCut_ = (isoValue - f1)/(f2 - f1);
}
else
{
if (debug)
{
const face fl(pLabels);
WarningInFunction
<< "More than two face cuts for face " << fl
<< endl;
Pout<< "Face values: f-isoValue = " << endl;
forAll(fl, fpi)
{
Pout<< f[fl[fpi]] - isoValue << " ";
}
Pout<< " " << endl;
}
}
}