本文整理汇总了Python中fipy.tools.numerix.MA.sum方法的典型用法代码示例。如果您正苦于以下问题:Python MA.sum方法的具体用法?Python MA.sum怎么用?Python MA.sum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fipy.tools.numerix.MA
的用法示例。
在下文中一共展示了MA.sum方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _calcCellDistAndVec
# 需要导入模块: from fipy.tools.numerix import MA [as 别名]
# 或者: from fipy.tools.numerix.MA import sum [as 别名]
def _calcCellDistAndVec(self):
tmp = numerix.take(self._cellCenters, self.faceCellIDs, axis=1)
tmp = tmp[...,1,:] - tmp[...,0,:]
tmp = MA.filled(MA.where(MA.getmaskarray(tmp), self._cellToFaceDistanceVectors[:,0], tmp))
cellDistanceVectors = tmp
cellDistances = MA.filled(MA.sqrt(MA.sum(tmp * tmp, 0)))
return cellDistances, cellDistanceVectors
示例2: _calcFaceToCellDistances
# 需要导入模块: from fipy.tools.numerix import MA [as 别名]
# 或者: from fipy.tools.numerix.MA import sum [as 别名]
def _calcFaceToCellDistances(self):
tmp = MA.repeat(self.faceCenters[...,numerix.NewAxis,:], 2, 1)
# array -= masked_array screws up masking for on numpy 1.1
tmp = tmp - numerix.take(self.cellCenters, self.faceCellIDs, axis=1)
self.cellToFaceDistanceVectors = tmp
self.faceToCellDistances = MA.sqrt(MA.sum(tmp * tmp,0))
示例3: _calcCellVolumes
# 需要导入模块: from fipy.tools.numerix import MA [as 别名]
# 或者: from fipy.tools.numerix.MA import sum [as 别名]
def _calcCellVolumes(self):
tmp = self._faceCenters[0] * self._faceAreas * self.faceNormals[0]
tmp = numerix.take(tmp, self.cellFaceIDs) * self._cellToFaceOrientations
return MA.filled(MA.sum(tmp, 0))