Changeset 376
- Timestamp:
- Mar 25, 2006 9:15:15 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src2/core/RpMeshTri2D.cc
r372 r376 112 112 double det = x2*y3-x3*y2; 113 113 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]; 123 117 } 124 118 … … 347 341 } 348 342 349 int lastCellId = -1;350 343 while (!cell.isNull()) { 351 344 double phi[3]; … … 354 347 // if all are >= 0, then this tri contains node 355 348 cell.barycentrics(node, phi); 356 if (isnan(phi[0])) {357 cell.clear();358 return cell;359 }360 349 if (phi[0] >= 0.0 && phi[1] >= 0.0 && phi[2] >= 0.0) { 361 350 break; … … 372 361 Tri2D& tri = nonconst->_celllist[ cell.cellId() ]; 373 362 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) { 378 364 cell.clear(); 379 365 return cell; 380 366 } 381 367 382 lastCellId = cell.cellId();383 368 Tri2D& tri2 = nonconst->_celllist[neighborId]; 384 369 Node2D *n1Ptr = &nonconst->_nodelist[tri2.nodes[0]];
Note: See TracChangeset
for help on using the changeset viewer.