Example #1
0
        forAll(ngpp, i)
        {
            ngpp[i] = i;
        }
    }
    else
    {

        // Get reference to shared points
        const labelList& sharedPoints =
            boundaryMesh().mesh()().globalData().sharedPointLabels();

        nonGlobalPatchPointsPtr_ = new labelList(nPoints());
        labelList& ngpp = *nonGlobalPatchPointsPtr_;

        const labelList& faMeshPatchPoints = pointLabels();

        const labelList& meshPoints = 
            boundaryMesh().mesh().patch().meshPoints();

        label noFiltPoints = 0;

        forAll (faMeshPatchPoints, pointI)
        {
            label curP = meshPoints[faMeshPatchPoints[pointI]];

            bool found = false;

            forAll (sharedPoints, sharedI)
            {
                if (sharedPoints[sharedI] == curP)
Example #2
0
void writePointSet
(
    const bool binary,
    const primitiveMesh& mesh,
    const topoSet& set,
    const fileName& fileName
)
{
    std::ofstream pStream(fileName.c_str());

    pStream
        << "# vtk DataFile Version 2.0" << std::endl
        << set.name() << std::endl;
    if (binary)
    {
        pStream << "BINARY" << std::endl;
    }
    else
    {
        pStream << "ASCII" << std::endl;
    }
    pStream << "DATASET POLYDATA" << std::endl;


    //------------------------------------------------------------------
    //
    // Write topology
    //
    //------------------------------------------------------------------


    labelList pointLabels(set.toc());

    pointField setPoints(mesh.points(), pointLabels);

    // Write points

    pStream << "POINTS " << pointLabels.size() << " float" << std::endl;

    DynamicList<floatScalar> ptField(3*pointLabels.size());

    writeFuns::insert(setPoints, ptField);

    writeFuns::write(pStream, binary, ptField);


    //-----------------------------------------------------------------
    //
    // Write data
    //
    //-----------------------------------------------------------------

    // Write pointID

    pStream
        << "POINT_DATA " << pointLabels.size() << std::endl
        << "FIELD attributes 1" << std::endl;

    // Cell ids first
    pStream << "pointID 1 " << pointLabels.size() << " int" << std::endl;

    writeFuns::write(pStream, binary, pointLabels);
}