本文整理汇总了C++中labelList::append方法的典型用法代码示例。如果您正苦于以下问题:C++ labelList::append方法的具体用法?C++ labelList::append怎么用?C++ labelList::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类labelList
的用法示例。
在下文中一共展示了labelList::append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: faceToSet
void Foam::decompositionConstraints::singleProcessorFaceSetsConstraint::add
(
const polyMesh& mesh,
boolList& blockedFace,
PtrList<labelList>& specifiedProcessorFaces,
labelList& specifiedProcessor,
List<labelPair>& explicitConnections
) const
{
blockedFace.setSize(mesh.nFaces(), true);
// Mark faces already in set
labelList faceToSet(mesh.nFaces(), -1);
forAll(specifiedProcessorFaces, setI)
{
const labelList& faceLabels = specifiedProcessorFaces[setI];
forAll(faceLabels, i)
{
faceToSet[faceLabels[i]] = setI;
}
}
forAll(setNameAndProcs_, setI)
{
//Info<< "Keeping all cells connected to faceSet "
// << setNameAndProcs_[setI].first()
// << " on processor " << setNameAndProcs_[setI].second() << endl;
const label destProcI = setNameAndProcs_[setI].second();
// Read faceSet
const faceSet fz(mesh, setNameAndProcs_[setI].first());
// Check that it does not overlap with existing specifiedProcessorFaces
labelList nMatch(specifiedProcessorFaces.size(), 0);
forAllConstIter(faceSet, fz, iter)
{
label setI = faceToSet[iter.key()];
if (setI != -1)
{
nMatch[setI]++;
}
}
// Only store if all faces are not yet in specifiedProcessorFaces
// (on all processors)
bool store = true;
forAll(nMatch, setI)
{
if (nMatch[setI] == fz.size())
{
// full match
store = false;
break;
}
else if (nMatch[setI] > 0)
{
// partial match
store = false;
break;
}
}
reduce(store, andOp<bool>());
if (store)
{
specifiedProcessorFaces.append(new labelList(fz.sortedToc()));
specifiedProcessor.append(destProcI);
}
}