コード例 #1
0
const triSurf* triSurfacePatchManipulator::surfaceWithPatches
(
    IOdictionary* meshDictPtr,
    const word prefix,
    const bool forceOverwrite
) const
{
    //- collect patch information
    VRWGraph facetsInPatch;
    detectedSurfaceRegions(facetsInPatch);

    //- create new list of boundary patches
    LongList<labelledTri> newTriangles(facetInPatch_.size());
    label counter(0);
    geometricSurfacePatchList newPatches(nPatches_);

    if( forceOverwrite )
    {
        forAll(newPatches, patchI)
        {
            newPatches[patchI].name() = prefix+help::scalarToText(patchI);
            newPatches[patchI].geometricType() = "patch";
            newPatches[patchI].index() = patchI;
        }
    }
コード例 #2
0
static triSurface pack
(
    const triSurface& surf,
    const pointField& localPoints,
    const labelList& pointMap
)
{
    List<labelledTri> newTriangles(surf.size());
    label newTriangleI = 0;

    forAll(surf, faceI)
    {
        const labelledTri& f = surf.localFaces()[faceI];

        label newA = pointMap[f[0]];
        label newB = pointMap[f[1]];
        label newC = pointMap[f[2]];

        if ((newA != newB) && (newA != newC) && (newB != newC))
        {
            newTriangles[newTriangleI++] =
                labelledTri(newA, newB, newC, f.region());
        }
    }
    newTriangles.setSize(newTriangleI);

    return triSurface(newTriangles, surf.patches(), localPoints);
}