|
396 | 396 | " x, z = dimensions\n", |
397 | 397 | " # We want our lower layer to span the entire x-dimension and all\n", |
398 | 398 | " # but the top 121 (+boundary layer) cells in the z-direction.\n", |
399 | | - " return {x: x, z: ('right', 121+nbl)}\n", |
400 | | - "\n", |
401 | | - "# Create these subdomains:\n", |
402 | | - "ur = Upper()\n", |
403 | | - "lr = Lower()" |
| 399 | + " return {x: x, z: ('right', 121+nbl)}" |
404 | 400 | ] |
405 | 401 | }, |
406 | 402 | { |
407 | 403 | "cell_type": "markdown", |
408 | 404 | "metadata": {}, |
409 | 405 | "source": [ |
410 | | - "We now create our model incoporating these subdomains:" |
| 406 | + "We now create our `Model` and attach these `SubDomain`s:" |
411 | 407 | ] |
412 | 408 | }, |
413 | 409 | { |
|
432 | 428 | "\n", |
433 | 429 | "# Create our model passing it our 'upper' and 'lower' subdomains: \n", |
434 | 430 | "model = Model(vp=v, origin=origin, shape=shape, spacing=spacing,\n", |
435 | | - " space_order=order, nbl=nbl, subdomains=(ur,lr), bcs=\"damp\")" |
| 431 | + " space_order=order, nbl=nbl, bcs=\"damp\")\n", |
| 432 | + "\n", |
| 433 | + "# Create these subdomains:\n", |
| 434 | + "ur = Upper(grid=model.grid)\n", |
| 435 | + "lr = Lower(grid=model.grid)" |
436 | 436 | ] |
437 | 437 | }, |
438 | 438 | { |
|
504 | 504 | "\n", |
505 | 505 | "# Create a stencil for each subdomain:\n", |
506 | 506 | "stencil_u = Eq(u_DRP.forward, solve(pde_DRP, u_DRP.forward).subs({H: u_lap}),\n", |
507 | | - " subdomain = model.grid.subdomains['upper'])\n", |
| 507 | + " subdomain=ur)\n", |
508 | 508 | "stencil_l = Eq(u_DRP.forward, solve(pde_DRP, u_DRP.forward).subs({H: l_lap}),\n", |
509 | | - " subdomain = model.grid.subdomains['lower'])\n", |
| 509 | + " subdomain=lr)\n", |
510 | 510 | "\n", |
511 | 511 | "# Source term:\n", |
512 | 512 | "src_term = src.inject(field=u_DRP.forward, expr=src * dt**2 / model.m)\n", |
|
0 commit comments