Skip to content

Commit 3aa4c65

Browse files
committed
Add Phase 6: Domain applications (Finance, Darcy, CFD)
New Chapters: - Chapter 13: Computational Finance (Black-Scholes PDE) - Custom SpaceDimension for asset price grid - Greeks computation (Delta, Gamma, Theta, Vega, Rho) - Analytical Black-Scholes verification - Chapter 14: Porous Media Flow (Darcy's law) - Heterogeneous permeability fields (Gaussian random, layered) - Dual-buffer Jacobi iteration with SOR - Well source terms and transient flow - Chapter 15: CFD/Navier-Stokes (Lid-driven cavity) - Fractional step/projection method - Ghia et al. (1982) benchmark data for verification - Streamfunction and vorticity computation New Source Modules: - src/finance/black_scholes_devito.py (533 lines) - src/darcy/darcy_devito.py (1003 lines) - src/cfd/navier_stokes_devito.py (739 lines) Tests: 116 new tests (657 total)
1 parent 05db189 commit 3aa4c65

17 files changed

Lines changed: 8399 additions & 14 deletions

_quarto.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ book:
2626
- chapters/memory/index.qmd
2727
- chapters/distributed/index.qmd
2828
- chapters/performance/index.qmd
29+
- chapters/cfd/index.qmd
30+
- chapters/darcy/index.qmd
31+
- chapters/finance/index.qmd
2932
- part: "Appendices"
3033
chapters:
3134
- chapters/appendices/formulas/index.qmd
@@ -183,8 +186,11 @@ src_adjoint: "https://github.com/devitocodes/devito_book/tree/devito/src/adjoint
183186
src_memory: "https://github.com/devitocodes/devito_book/tree/devito/src/memory"
184187
src_distributed: "https://github.com/devitocodes/devito_book/tree/devito/src/distributed"
185188
src_performance: "https://github.com/devitocodes/devito_book/tree/devito/src/performance"
189+
src_cfd: "https://github.com/devitocodes/devito_book/tree/devito/src/cfd"
190+
src_darcy: "https://github.com/devitocodes/devito_book/tree/devito/src/darcy"
186191
src_formulas: "https://github.com/devitocodes/devito_book/tree/devito/src/formulas"
187192
src_softeng2: "https://github.com/devitocodes/devito_book/tree/devito/src/softeng2"
193+
src_finance: "https://github.com/devitocodes/devito_book/tree/devito/src/finance"
188194

189195
crossref:
190196
eq-prefix: ""

book-roadmap.md

Lines changed: 58 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ Extend *Finite Difference Computing with PDEs* with content from `devito_repo/ex
2121
| **Phase 2** | ✅ Complete | 73 | `b9e017b3` |
2222
| **Phase 3** | ✅ Complete | 91 | `04accab7` |
2323
| **Phase 4** | ✅ Complete | 90 | `b9dc387d` |
24-
| **Phase 5** | ✅ Complete | 40 | pending |
25-
| **Phase 6** | 🔲 Not started | - | - |
24+
| **Phase 5** | ✅ Complete | 40 | `05db189a` |
25+
| **Phase 6** | ✅ Complete | 116 | pending |
2626
| **Phase 7** | 🔲 Not started | - | - |
2727

28-
**Total tests: 541**
28+
**Total tests: 657**
2929

3030
---
3131

@@ -343,33 +343,45 @@ usave = TimeFunction(name='usave', grid=grid, save=nsnaps, time_dim=time_sub)
343343

344344
---
345345

346-
## Phase 6: Domain Applications
346+
## Phase 6: Domain Applications ✅ COMPLETE (6.1)
347347

348348
**Effort**: Variable | **Value**: Medium-High | **Source**: Mixed
349349

350-
### 6.1 Quick Additions (Existing Notebooks)
350+
### 6.1 Quick Additions (Existing Notebooks)
351351

352-
**Chapter 10: Computational Finance**
352+
**Chapter 13: Computational Finance**
353353
- Source: `finance/bs_ivbp.ipynb`
354354
- Black-Scholes PDE, non-standard SpaceDimension
355+
- **Deliverables**:
356+
- [x] `chapters/finance/finance.qmd` (1,125 lines)
357+
- [x] `src/finance/black_scholes_devito.py` (538 lines)
358+
- [x] `tests/test_finance_devito.py` (36 tests)
355359

356-
**Chapter 11: Porous Media Flow**
360+
**Chapter 14: Porous Media Flow**
357361
- Source: `cfd/09_Darcy_flow_equation.ipynb`
358362
- Darcy's law, permeability fields
363+
- **Deliverables**:
364+
- [x] `chapters/darcy/darcy.qmd` (1,635 lines)
365+
- [x] `src/darcy/darcy_devito.py` (1,004 lines)
366+
- [x] `tests/test_darcy_devito.py` (24 tests)
359367

360-
**Chapter 12: CFD (Navier-Stokes)**
368+
**Chapter 15: CFD (Navier-Stokes)**
361369
- Source: `cfd/07_cavity_flow.ipynb`
362370
- Lid-driven cavity, projection method
371+
- **Deliverables**:
372+
- [x] `chapters/cfd/cfd.qmd` (1,033 lines)
373+
- [x] `src/cfd/navier_stokes_devito.py` (739 lines)
374+
- [x] `tests/test_cfd_devito.py` (56 tests)
363375

364-
### 6.2 New Development Required
376+
### 6.2 New Development Required (Not Started)
365377

366-
**Chapter 13: Computational Electromagnetics (Maxwell)**
378+
**Chapter 16: Computational Electromagnetics (Maxwell)**
367379
- Develop from scratch
368380
- Yee grid / FDTD scheme
369381
- E and H field staggering
370382
- PML absorbing boundaries
371383

372-
**Chapter 14: Numerical Relativity**
384+
**Chapter 17: Numerical Relativity**
373385
- Develop from scratch
374386
- ADM/BSSN formulation
375387
- Gravitational wave extraction
@@ -403,9 +415,9 @@ usave = TimeFunction(name='usave', grid=grid, save=nsnaps, time_dim=time_sub)
403415
| **2.2** | Elastic Waves | Medium | High | ✅ Complete |
404416
| **3.1** | ADER/Staggered | Medium | High | ✅ Complete |
405417
| **3.2** | Attenuation | Medium | High | ✅ Complete |
406-
| **4** | Inverse Problems | High | Very High | 🔲 Not started |
407-
| **5** | Performance | Medium | High | 🔲 Not started |
408-
| **6.1** | Finance/Darcy/NS | Low-Medium | Medium | 🔲 Not started |
418+
| **4** | Inverse Problems | High | Very High | ✅ Complete |
419+
| **5** | Performance | Medium | High | ✅ Complete |
420+
| **6.1** | Finance/Darcy/NS | Low-Medium | Medium | ✅ Complete |
409421
| **6.2** | Maxwell/GR | High | Medium | 🔲 Not started |
410422
| **7** | Theory Appendix | Low | Medium | 🔲 Not started |
411423

@@ -464,3 +476,35 @@ Each solver must include:
464476
- 91 new tests (411 total)
465477
- Fixed damping field creation for small grids
466478
- Commit: `04accab7`
479+
480+
### 2026-01-30: Phase 4 Complete
481+
- Created Chapter 9: Inverse Problems and Optimization
482+
- Full explicit API implementations for RTM, FWI, LSRTM
483+
- SparseTimeFunction for sources and receivers
484+
- Memory-efficient snapshotting with ConditionalDimension
485+
- Barzilai-Borwein step size for LSRTM
486+
- 90 tests (501 total)
487+
- Commit: `b9dc387d`
488+
489+
### 2026-01-30: Phase 5 Complete
490+
- Created Chapter 10: Performance Optimization (roofline model, GPU computing)
491+
- Created Chapter 11: Memory Management (snapshotting, checkpointing)
492+
- Created Chapter 12: Distributed Computing (Dask shot-parallel FWI)
493+
- 40 new tests (541 total, 26 skip without dask/h5py)
494+
- Commit: `05db189a`
495+
496+
### 2026-01-30: Phase 6 Complete (6.1 Quick Additions)
497+
- Created Chapter 13: Computational Finance (Black-Scholes PDE)
498+
- Custom SpaceDimension for asset price grid
499+
- Greeks computation (Delta, Gamma, Theta)
500+
- Analytical solution verification
501+
- Created Chapter 14: Porous Media Flow (Darcy's law)
502+
- Heterogeneous permeability fields (Gaussian random, layered)
503+
- Dual-buffer Jacobi iteration
504+
- Well source terms
505+
- Created Chapter 15: CFD/Navier-Stokes (Lid-driven cavity)
506+
- Fractional step/projection method
507+
- Ghia benchmark data for verification
508+
- Streamfunction computation
509+
- 116 new tests (657 total)
510+
- Commit: pending

0 commit comments

Comments
 (0)