示例#1
0
void createPointNeighbors ( MeshType const& mesh, neighborList_Type& neighborList )
{
    neighborList.resize ( mesh.numGlobalPoints() );
    // generate point neighbors by watching edges
    // note: this can be based also on faces or volumes
    for ( UInt ie = 0; ie < mesh.numEdges(); ie++ )
    {
        ID id0 = mesh.edge ( ie ).point ( 0 ).id();
        ID id1 = mesh.edge ( ie ).point ( 1 ).id();

        ASSERT ( mesh.point ( id0 ).id() == id0 && mesh.point ( id1 ).id() == id1,
                 "the mesh has been reordered, the point must be found" );

        neighborList[ id0 ].insert ( id1 );
        neighborList[ id1 ].insert ( id0 );
    }
}
示例#2
0
void createPointNeighbors ( MeshType& mesh )
{
    // TODO: ASSERT_COMPILE_TIME that MeshType::pointMarker == NeighborMarker
    // this guarantees that the pointNeighbors structure is available.

    // generate point neighbors by watching edges
    // note: this can be based also on faces or volumes
    for ( UInt ie = 0; ie < mesh.numEdges(); ie++ )
    {
        ID id0 = mesh.edge ( ie ).point ( 0 ).id();
        ID id1 = mesh.edge ( ie ).point ( 1 ).id();

        ASSERT ( mesh.point ( id0 ).id() == id0 , "the mesh has been reordered, the point must be found" );
        ASSERT ( mesh.point ( id1 ).id() == id1 , "the mesh has been reordered, the point must be found" );

        mesh.point ( id0 ).pointNeighbors().insert ( id1 );
        mesh.point ( id1 ).pointNeighbors().insert ( id0 );
    }
}