Changeset 2815 for trunk

Show
Ignore:
Timestamp:
11/12/2008 11:02:43 AM (8 weeks ago)
Author:
guyer
Message:

Fix for ticket:159.

Masked values returned from self.mesh._getCellFaceIDs() get converted to
-1 and the C code erroneously tries to use that to index into
faceVariable.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/fipy/variables/addOverFacesVariable.py

    r2781 r2815  
    7171          for(j = 0; j < numberOfCellFaces; j++) 
    7272            { 
    73               value[i] += orientations[i + j * numberOfCells] * faceVariable[ids[i + j * numberOfCells]]; 
     73              // _getCellFaceIDs() can be masked, which caused subtle and  
     74              // unreproduceable problems on OS X (who knows why not elsewhere) 
     75              long id = ids[i + j * numberOfCells]; 
     76              if (id >= 0) {  
     77                  value[i] += orientations[i + j * numberOfCells] * faceVariable[ids[i + j * numberOfCells]]; 
     78              } 
    7479            } 
    7580            value[i] = value[i] / cellVolume[i];