-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.qmd
More file actions
67 lines (45 loc) · 2.61 KB
/
index.qmd
File metadata and controls
67 lines (45 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# Welcome {.unnumbered}
This book teaches finite difference methods for solving partial differential equations, featuring [Devito](https://www.devitoproject.org/) for high-performance PDE solvers.
::: {.content-visible when-format="html"}
[**Download PDF version**](Finite-Difference-Computing-with-PDEs.pdf){.btn .btn-primary}
:::
## About this Edition {.unnumbered}
This edition is based on *[Finite Difference Computing with PDEs: A Modern Software Approach](https://doi.org/10.1007/978-3-319-55456-3)* by Hans Petter Langtangen and Svein Linge (Springer, 2017). This Devito edition features:
- **[Devito](https://www.devitoproject.org/)** - A domain-specific language for symbolic PDE specification and automatic code generation
- **[Quarto](https://quarto.org/)** - Modern scientific publishing for web and PDF output
- **Modern Python** - Type hints, testing, and CI/CD practices
## License {.unnumbered}
::: {.content-visible when-format="html"}
[](https://creativecommons.org/licenses/by/4.0/)
:::
This work is licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), the same license as the original work.
## What is Devito? {.unnumbered}
Devito allows you to write PDEs symbolically and automatically generates optimized finite difference code:
```python
from devito import Grid, TimeFunction, Eq, Operator, solve, Constant
grid = Grid(shape=(101,), extent=(1.0,))
u = TimeFunction(name='u', grid=grid, time_order=2, space_order=2)
c = Constant(name='c') # wave speed
# Write the wave equation symbolically: u_tt = c^2 * u_xx
pde = Eq(u.dt2, c**2 * u.dx2)
# Solve for u at the next time step
update = Eq(u.forward, solve(pde, u.forward))
# Devito generates optimized C code
op = Operator([update])
op.apply(time_M=100, dt=0.001, c=1.0)
```
## Book Structure {.unnumbered}
The book covers:
1. **Introduction to Devito** - Grid, Function, TimeFunction, Operator, and boundary conditions
2. **Wave Equations** - 1D/2D wave propagation, sources, absorbing boundaries
3. **Diffusion Equations** - Heat equation, stability analysis, 2D extension
4. **Advection Equations** - Upwind schemes, Lax-Wendroff, CFL condition
5. **Nonlinear Problems** - Operator splitting, Burgers' equation, Picard iteration
Plus appendices on finite difference formulas, truncation error analysis, and software engineering.
## Getting Started {.unnumbered}
```bash
git clone https://github.com/devitocodes/devito_book.git
cd devito_book
pip install -e ".[devito]"
```
See the [GitHub repository](https://github.com/devitocodes/devito_book) for full installation instructions.