本文整理汇总了Python中fipy.tools.numerix.MA.average方法的典型用法代码示例。如果您正苦于以下问题:Python MA.average方法的具体用法?Python MA.average怎么用?Python MA.average使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fipy.tools.numerix.MA
的用法示例。
在下文中一共展示了MA.average方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _calcFaceCenters
# 需要导入模块: from fipy.tools.numerix import MA [as 别名]
# 或者: from fipy.tools.numerix.MA import average [as 别名]
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: _calcCellCenters
# 需要导入模块: from fipy.tools.numerix import MA [as 别名]
# 或者: from fipy.tools.numerix.MA import average [as 别名]
def _calcCellCenters(self):
tmp = numerix.take(self._faceCenters, self.cellFaceIDs, axis=1)
return MA.filled(MA.average(tmp, 1))