当前位置: 首页>>代码示例>>C++>>正文


C++ polyMesh::facesInstance方法代码示例

本文整理汇总了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;
}
开发者ID:OpenFOAM,项目名称:OpenFOAM-dev,代码行数:47,代码来源:manualDecomp.C

示例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);
        }
    }
开发者ID:ADGlassby,项目名称:OpenFOAM-2.2.x,代码行数:72,代码来源:manualRenumber.C


注:本文中的polyMesh::facesInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。