示例#1
0
文件: mesh.py 项目: xinxinboss/fipy
    def _calcFaceCenters(self):
        maskedFaceVertexIDs = MA.filled(self.faceVertexIDs, 0)

        faceVertexCoords = numerix.take(self.vertexCoords, maskedFaceVertexIDs, axis=1)

        if MA.getmask(self.faceVertexIDs) is False:
            faceVertexCoordsMask = numerix.zeros(numerix.shape(faceVertexCoords), 'l')
        else:
            faceVertexCoordsMask = \
              numerix.repeat(MA.getmaskarray(self.faceVertexIDs)[numerix.newaxis,...], 
                             self.dim, axis=0)
            
        faceVertexCoords = MA.array(data=faceVertexCoords, mask=faceVertexCoordsMask)

        return MA.filled(MA.average(faceVertexCoords, axis=1))
示例#2
0
 def _calcCellCenters(
     self
 ):  #cell center from bot1 and top1 (ignore coordinates of eventual bot2 and top2)
     tmp = numerix.take(self._faceCenters, self.cellFaceIDs[:2, :], axis=1)
     return MA.filled(MA.average(tmp, 1))
示例#3
0
 def _calcCellCenters(self):
     tmp = numerix.take(self._faceCenters, self.cellFaceIDs, axis=1)
     return MA.filled(MA.average(tmp, 1))
示例#4
0
文件: mesh.py 项目: LWhitson2/fipy
 def _calcCellCenters(self):
     tmp = numerix.take(self._faceCenters, self.cellFaceIDs, axis=1)
     return MA.filled(MA.average(tmp, 1))