Easy way to create a padded tensor mesh.

This commit is contained in:
rowanc1
2013-12-04 17:52:40 -08:00
parent ccb4d4052d
commit 8fb9f3683b
6 changed files with 73 additions and 46 deletions
-21
View File
@@ -1,21 +0,0 @@
import numpy as np
import matplotlib.pyplot as plt
from SimPEG.mesh import TensorMesh
pad = 7
padfactor = 1.4
xpad = (np.ones(pad)*padfactor)**np.arange(pad)
ypad = (np.ones(pad)*padfactor)**np.arange(pad)
core = 15
xcore = np.ones(core)
ycore = np.ones(core)
h1 = np.r_[xpad[::-1],xcore,xpad]
h2 = np.r_[ypad[::-1],ycore,ypad]
mesh = TensorMesh([h1, h2])
mesh.plotGrid()
plt.axis('tight')
plt.show()