| name | devito |
| description | Symbolic PDE solver with automatic code generation for finite-difference
computations. Use when Claude needs to: (1) Perform seismic wave propagation
modeling, (2) Implement acoustic or elastic wave equations, (3) Run forward
modeling for shot gathers, (4) Set up Full Waveform Inversion (FWI) workflows,
(5) Implement Reverse Time Migration (RTM), (6) Create absorbing boundary
conditions, (7) Generate optimized stencil code for CPUs/GPUs, (8) Solve
custom PDEs with finite differences.
|
| version | 1.0.0 |
| author | Geoscience Skills |
| license | MIT |
| tags | ["PDE Solver","Wave Propagation","Seismic Modelling","FWI","RTM","Finite Difference"] |
| dependencies | ["devito>=4.8.0","numpy"] |
| complements | ["pylops","simpeg","segyio"] |
| workflow_role | modelling |
Devito - Symbolic PDE Solver
Quick Reference
from devito import Grid, Function, TimeFunction, Eq, solve, Operator
grid = Grid(shape=(101, 101), extent=(1000., 1000.))
v = Function(name='v', grid=grid, space_order=4)
v.data[:] = 1500.
p = TimeFunction(name='p', grid=grid, time_order=2, space_order=4)
stencil = Eq(p.forward, solve(p.dt2 - v**2 * p.laplace, p.forward))
op = Operator([stencil])
op(time_M=100, dt=0.5)
Key Classes
| Class | Purpose |
|---|
Grid | Computational domain definition |
Function | Spatial field on grid |
TimeFunction | Time-dependent field |
SparseTimeFunction | Point sources/receivers |
Operator | Compiled computation kernel |
Essential Operations
Grid and Fields
from devito import Grid, Function, TimeFunction
grid = Grid(shape=(nx, nz), extent=(x_size, z_size))
v = Function(name='v', grid=grid, space_order=4)
v.data[:] = 1500.
p = TimeFunction(name='p', grid=grid, time_order=, space_order=)