mirror of
https://github.com/wassname/simpeg.git
synced 2026-07-04 05:53:16 +08:00
Merge pull request #80 from simpeg/TreeMesh
Fix bug that updated mesh.x0 when it wrote out the mesh to UBC format. Thanks!!
This commit is contained in:
@@ -168,9 +168,9 @@ def writeUBCTensorMesh(mesh, fileName):
|
||||
assert mesh.dim == 3
|
||||
s = ''
|
||||
s += '%i %i %i\n' %tuple(mesh.vnC)
|
||||
origin = mesh.x0
|
||||
origin = mesh.x0 + np.array([0,0,mesh.hz.sum()]) # Have to it in the same operation or use mesh.x0.copy(), otherwise the mesh.x0 is updated.
|
||||
origin.dtype = float
|
||||
origin[2] = origin[2]+mesh.hz.sum()
|
||||
|
||||
s += '%.2f %.2f %.2f\n' %tuple(origin)
|
||||
s += ('%.2f '*mesh.nCx+'\n')%tuple(mesh.hx)
|
||||
s += ('%.2f '*mesh.nCy+'\n')%tuple(mesh.hy)
|
||||
|
||||
Reference in New Issue
Block a user