discretize.utils.meshTensor

discretize.utils.meshTensor(value)[source]

meshTensor takes a list of numbers and tuples that have the form:

mT = [ float, (cellSize, numCell), (cellSize, numCell, factor) ]

For example, a time domain mesh code needs many time steps at one time:

[(1e-5, 30), (1e-4, 30), 1e-3]

Means take 30 steps at 1e-5 and then 30 more at 1e-4, and then one step of 1e-3.

Tensor meshes can also be created by increase factors:

[(10.0, 5, -1.3), (10.0, 50), (10.0, 5, 1.3)]

When there is a third number in the tuple, it refers to the increase factor, if this number is negative this section of the tensor is flipped right-to-left.

import discretize
tx = [(10.0, 10, -1.3), (10.0, 40), (10.0, 10, 1.3)]
ty = [(10.0, 10, -1.3), (10.0, 40)]
mesh = discretize.TensorMesh([tx, ty])
mesh.plotGrid(showIt=True)

(Source code, png, hires.png, pdf)

../../_images/discretize-utils-meshTensor-1.png