Пример #1
0
def test_3D_mesh():
    minX, maxX = 0.0, 1.0
    minY, maxY = 0.0, 1.0
    minZ, maxZ = 0.0, 1.0
    nx, ny, nz = 30, 30, 30

    mesh = ConductionND((minX, minY, minZ), (maxX, maxY, maxZ), (nx, ny, nz))
Пример #2
0
def load_3D_regular_mesh():
    minX, maxX = 0.0, 35e3
    minY, maxY = 0.0, 35e3
    minZ, maxZ = 0.0, 35e3
    nx, ny, nz = 21, 21, 21

    return ConductionND((minX, minY, minZ), (maxX, maxY, maxZ), (nx, ny, nz))
Пример #3
0
def load_inv_object():
    minX, maxX = 0.0, 1000.0
    minY, maxY = 0.0, 1000.0
    minZ, maxZ = -35e3, 1000.0
    nx, ny, nz = 10, 10, 10
    n = nx * ny * nz

    mesh = ConductionND((minX, minY, minZ), (maxX, maxY, maxZ), (nx, ny, nz))

    # BCs
    mesh.boundary_condition('maxZ', 298.0, flux=False)
    mesh.boundary_condition('minZ', 1e3, flux=True)

    # In[3]: Global lithology

    lithology = np.zeros((nz, ny, nx), dtype='int32')
    lithology[:, 3:7, :] = 1
    lithology[:, 7:, :] = 2

    # Need to slice this bad boy up: Local lithology

    (minI, maxI), (minJ, maxJ), (minK, maxK) = mesh.dm.getGhostRanges()
    lithology = lithology[minK:maxK, minJ:maxJ, minI:maxI]

    k = np.array([3.5, 2.0, 3.2])
    H = np.array([0.5e-6, 1e-6, 2e-6])
    a = np.array([0.3, 0.3, 0.3])
    q0 = 35e-3
    sigma_q0 = 5e-3

    # Inversion variables
    x = np.hstack([k, H, a, [q0]])
    dx = x * 0.01

    return InversionND(lithology.ravel(), mesh)
Пример #4
0
def test_1D_mesh():
    minX, maxX = 0.0, 1.0
    nx = 30

    mesh = ConductionND((minX,), (maxX,), (nx,))
Пример #5
0
def test_2D_mesh():
    minX, maxX = 0.0, 1.0
    minY, maxY = 0.0, 1.0
    nx, ny = 30, 30

    mesh = ConductionND((minX,minY), (maxX, maxY), (nx,ny))
Пример #6
0
def load_2D_regular_mesh():
    minX, maxX = 0.0, 35e3
    minY, maxY = 0.0, 35e3
    nx, ny = 21, 21

    return ConductionND((minX, minY), (maxX, maxY), (nx, ny))
Пример #7
0
def load_1D_regular_mesh():
    minX, maxX = 0.0, 35e3
    nx = 21

    return ConductionND((minX, ), (maxX, ), (nx, ))