本文整理汇总了C++中polyMesh::facesInstance方法的典型用法代码示例。如果您正苦于以下问题:C++ polyMesh::facesInstance方法的具体用法?C++ polyMesh::facesInstance怎么用?C++ polyMesh::facesInstance使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类polyMesh
的用法示例。
在下文中一共展示了polyMesh::facesInstance方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: exit
Foam::labelList Foam::manualDecomp::decompose
(
const polyMesh& mesh,
const pointField& points,
const scalarField& pointWeights
)
{
labelIOList finalDecomp
(
IOobject
(
decompDataFile_,
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE,
false
)
);
// check if the final decomposition is OK
if (finalDecomp.size() != points.size())
{
FatalErrorInFunction
<< "Size of decomposition list does not correspond "
<< "to the number of points. Size: "
<< finalDecomp.size() << " Number of points: "
<< points.size()
<< ".\n" << "Manual decomposition data read from file "
<< decompDataFile_ << "." << endl
<< exit(FatalError);
}
if (min(finalDecomp) < 0 || max(finalDecomp) > nProcessors_ - 1)
{
FatalErrorInFunction
<< "According to the decomposition, cells assigned to "
<< "impossible processor numbers. Min processor = "
<< min(finalDecomp) << " Max processor = " << max(finalDecomp)
<< ".\n" << "Manual decomposition data read from file "
<< decompDataFile_ << "." << endl
<< exit(FatalError);
}
return finalDecomp;
}
示例2: oldToNew
Foam::labelList Foam::manualRenumber::renumber
(
const polyMesh& mesh,
const pointField& points
) const
{
labelIOList newToOld
(
IOobject
(
dataFile_,
mesh.facesInstance(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE,
false
)
);
// check if the final renumbering is OK
if (newToOld.size() != points.size())
{
FatalErrorIn
(
"manualRenumber::renumber(const pointField&, const scalarField&)"
) << "Size of renumber list does not correspond "
<< "to the number of points. Size: "
<< newToOld.size() << " Number of points: "
<< points.size()
<< ".\n" << "Manual renumbering data read from file "
<< dataFile_ << "." << endl
<< exit(FatalError);
}
// Invert to see if one to one
labelList oldToNew(points.size(), -1);
forAll(newToOld, i)
{
label origCellI = newToOld[i];
if (origCellI < 0 || origCellI >= points.size())
{
FatalErrorIn
(
"manualRenumber::renumber(const pointField&"
", const scalarField&)"
) << "Renumbering is not one-to-one. Index "
<< i << " maps onto original cell " << origCellI
<< ".\n" << "Manual renumbering data read from file "
<< dataFile_ << "." << endl
<< exit(FatalError);
}
if (oldToNew[origCellI] == -1)
{
oldToNew[origCellI] = i;
}
else
{
FatalErrorIn
(
"manualRenumber::renumber(const pointField&"
", const scalarField&)"
) << "Renumbering is not one-to-one. Both index "
<< oldToNew[origCellI]
<< " and " << i << " map onto " << origCellI
<< ".\n" << "Manual renumbering data read from file "
<< dataFile_ << "." << endl
<< exit(FatalError);
}
}