Changeset 376


Ignore:
Timestamp:
Mar 25, 2006 9:15:15 AM (18 years ago)
Author:
mmc
Message:

Took out hacks added for the det=0 case. If det=0, it means that
the mesh is bad, and the problem should be fixed at another level.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src2/core/RpMeshTri2D.cc

    r372 r376  
    112112    double det = x2*y3-x3*y2;
    113113
    114     if (det != 0.0) {
    115         phi[1] = (xr*y3 - x3*yr)/det;
    116         phi[2] = (x2*yr - xr*y2)/det;
    117         phi[0] = 1.0-phi[1]-phi[2];
    118     } else {
    119         phi[1] = NAN;
    120         phi[2] = NAN;
    121         phi[0] = NAN;
    122     }
     114    phi[1] = (xr*y3 - x3*yr)/det;
     115    phi[2] = (x2*yr - xr*y2)/det;
     116    phi[0] = 1.0-phi[1]-phi[2];
    123117}
    124118
     
    347341    }
    348342
    349     int lastCellId = -1;
    350343    while (!cell.isNull()) {
    351344        double phi[3];
     
    354347        // if all are >= 0, then this tri contains node
    355348        cell.barycentrics(node, phi);
    356         if (isnan(phi[0])) {
    357             cell.clear();
    358             return cell;
    359         }
    360349        if (phi[0] >= 0.0 && phi[1] >= 0.0 && phi[2] >= 0.0) {
    361350            break;
     
    372361        Tri2D& tri = nonconst->_celllist[ cell.cellId() ];
    373362        int neighborId = tri.neighbors[dir];
    374         if (neighborId < 0 || neighborId == lastCellId) {
    375 if (neighborId == lastCellId) {
    376 std::cout << "loop at " << lastCellId << "->" << neighborId << std::endl;
    377 }
     363        if (neighborId < 0) {
    378364            cell.clear();
    379365            return cell;
    380366        }
    381367
    382         lastCellId = cell.cellId();
    383368        Tri2D& tri2 = nonconst->_celllist[neighborId];
    384369        Node2D *n1Ptr = &nonconst->_nodelist[tri2.nodes[0]];
Note: See TracChangeset for help on using the changeset viewer.