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())
评论列表
文章目录