MeshIO.py 文件源码

python
阅读 32 收藏 0 点赞 0 评论 0

项目:discretize 作者: simpeg 项目源码 文件源码
def writeModelUBC(mesh, fileName, model):
        """Writes a model associated with a TensorMesh
        to a UBC-GIF format model file.

        :param string fileName: File to write to
        :param numpy.ndarray model: The model
        """

        # Reshape model to a matrix
        modelMat = mesh.r(model, 'CC', 'CC', 'M')
        # Transpose the axes
        modelMatT = modelMat.transpose((2, 0, 1))
        # Flip z to positive down
        modelMatTR = utils.mkvc(modelMatT[::-1, :, :])

        np.savetxt(fileName, modelMatTR.ravel())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号