Esempio n. 1
0
Foam::cellPointWeight::cellPointWeight
(
    const polyMesh& mesh,
    const vector& position,
    const label cellIndex,
    const label faceIndex
)
:
    cellIndex_(cellIndex)
{
    if (faceIndex < 0)
    {
        // Face data not supplied
        findTetrahedron(mesh, position, cellIndex);
    }
    else
    {
        // Face data supplied
        findTriangle(mesh, position, faceIndex);
    }
}
Esempio n. 2
0
Foam::cellPointWeight::cellPointWeight
(
    const polyMesh& mesh,
    const vector& position,
    const label cellI,
    const label faceI
)
:
    cellI_(cellI),
    weights_(4),
    faceVertices_(3)
{
    if (faceI < 0)
    {
        // Face data not supplied
        findTetrahedron(mesh, position, cellI);
    }
    else
    {
        // Face data supplied
        findTriangle(mesh, position, faceI);
    }
}
Foam::cellPointWeightWallModified::cellPointWeightWallModified
(
    const polyMesh& mesh,
    const vector& position,
    const label cellIndex,
    const label faceIndex
)
:
    cellPointWeight(mesh, position, cellIndex, faceIndex)
{
    if (faceIndex < 0)
    {
        findTetrahedron(mesh, position, cellIndex);
    }
    else
    {
        const polyBoundaryMesh& bm = mesh.boundaryMesh();
        label patchI = bm.whichPatch(faceIndex);
        if (patchI != -1)
        {
            if (bm[patchI].isWall())
            {
                // Apply cell centre value wall faces
                weights_[0] = 0.0;
                weights_[1] = 0.0;
                weights_[2] = 0.0;
                weights_[3] = 1.0;
            }
        }
        else
        {
            // Interpolate
            findTriangle(mesh, position, faceIndex);
        }
    }
}