Beispiel #1
0
// Collect all topological information about a point on a patch.
// (this information is the patch faces using the point and the relative
// position of the point in the face)
void Foam::globalPoints::addToSend
(
    const primitivePatch& pp,
    const label patchPointI,
    const procPointList& knownInfo,

    DynamicList<label>& patchFaces,
    DynamicList<label>& indexInFace,
    DynamicList<procPointList>& allInfo
)
{
    label meshPointI = pp.meshPoints()[patchPointI];

    // Add all faces using the point so we are sure we find it on the
    // other side.
    const labelList& pFaces = pp.pointFaces()[patchPointI];

    forAll(pFaces, i)
    {
        label patchFaceI = pFaces[i];

        const face& f = pp[patchFaceI];

        patchFaces.append(patchFaceI);
        indexInFace.append(findIndex(f, meshPointI));
        allInfo.append(knownInfo);
    }
Beispiel #2
0
// Get point neighbours of faceI (including faceI). Returns number of faces.
// Note: does not allocate storage but does use linear search to determine
// uniqueness. For polygonal faces this might be quite inefficient.
Foam::label Foam::cellDistFuncs::getPointNeighbours
(
    const primitivePatch& patch,
    const label patchFaceI,
    labelList& neighbours
) const
{
    label nNeighbours = 0;

    // Add myself
    neighbours[nNeighbours++] = patchFaceI;

    // Add all face neighbours
    const labelList& faceNeighbours = patch.faceFaces()[patchFaceI];

    forAll(faceNeighbours, faceNeighbourI)
    {
        neighbours[nNeighbours++] = faceNeighbours[faceNeighbourI];
    }

    // Remember part of neighbours that contains edge-connected faces.
    label nEdgeNbs = nNeighbours;


    // Add all point-only neighbours by linear searching in edge neighbours.
    // Assumes that point-only neighbours are not using multiple points on
    // face.

    const face& f = patch.localFaces()[patchFaceI];

    forAll(f, fp)
    {
        label pointI = f[fp];

        const labelList& pointNbs = patch.pointFaces()[pointI];

        forAll(pointNbs, nbI)
        {
            label faceI = pointNbs[nbI];

            // Check for faceI in edge-neighbours part of neighbours
            if (findIndex(nEdgeNbs, neighbours, faceI) == -1)
            {
                neighbours[nNeighbours++] = faceI;
            }
        }