{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Adaptive grid discretizations\n", "## A set of tools for discretizing anisotropic PDEs on cartesian grids\n", "# Volume : Divergence form PDEs" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "This collection of notebooks presents a series of general principles and reference implementations for *anisotropic Partial Differential Equations (PDEs) in divergence form*, using *adaptive finite difference schemes on cartesian grids*. \n", "* *Anisotropy* means that some directions in the domain play a preferred role, locally, preferred. A typical instance of an anisotropic PDE is anisotropic diffusion\n", "$$\n", " \\partial_t u = \\mathrm{div}(D \\nabla u)\n", "$$\n", "* *Finite difference schemes* are a numerical approach to the discretization of PDEs, based on the approximation of the first and second derivatives of a given function $u$. For instance, in this series of notebooks, you will encounter finite difference approximations of elliptic energies in the following sum of squares form\n", "$$\n", " E_h(u) := h^{d-2}\\sum_{x \\in \\Omega_h} \\sum_{1 \\leq i \\leq I} \\lambda_i(x) (u(x+h e_i) - u(x))^2\n", "$$\n", "where $h$ is a gridscale, $\\lambda_i(x)$ is a non-negative weight, and $u(x+h e_i) - u(x)$ is the *finite difference* of $u$ at positition $x\\inĀ \\Omega_h$ and in the direction $e_i$. In our implementation, $\\Omega_h\\subset Z^d$ is a Cartesian grid, and $e_i \\in Z^d$ is an offset with integer coordinates, so that $x+h e_i$ is a well defined grid point." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Domain dimension.** Unless otherwise specified, the numerical experiments presented in the notebooks involve two dimensional PDEs.\n", "\n", "**Sobolev spaces.**\n", "Recall that $H^1(\\Omega)$ denotes the set of functions with a square integrable gradient, $H^1_0(\\Omega)$ the subspace of functions with null boundary conditions." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "**Github repository** to run and modify the examples on your computer.\n", "[AdaptiveGridDiscretizations](https://github.com/Mirebeau/AdaptiveGridDiscretizations)\n", "\n", "\n", "# Table of contents\n", "[**Main summary**](../Summary.ipynb), including the other volumes of this work. \n", "### A. One space dimension\n", "\n", " * I. [Heat and wave equations](Time1D_Div.ipynb)\n", " 1. Quadratic forms and their discretization\n", " 2. The heat equation, explicit scheme\n", " 3. The heat equation, implicit scheme\n", " 4. Wave equation\n", "\n", "\n", "### B. Static problems\n", "\n", " * I. [Elliptic equations](Elliptic.ipynb)\n", " 1. Isotropic scheme\n", " 2. Naive anisotropic scheme\n", " 3. Anisotropic scheme\n", " 4. Neuman boundary conditions\n", "\n", "\n", " * II. [Elliptic equations with a first order term](EllipticAsymmetric.ipynb)\n", " 1. The numerical scheme\n", " 2. One dimensional study\n", " 3. Two dimensional examples\n", "\n", "\n", "### C. Linear elasticity\n", "\n", " * I. [Elastic energy](ElasticEnergy.ipynb)\n", " 1. Decomposition of a hooke tensor\n", " 2. Finite difference energy\n", " 3. Three dimensions\n", "\n", "\n", " * II. [The wave equation](ElasticWave.ipynb)\n", " 1. Model analysis\n", " 2. Constant material in space\n", " 3. Varying material over the domain\n", "\n", "\n", " * III. [Fourth order schemes for anisotropic acoustic and elastic waves](HighOrderWaves.ipynb)\n", " 1. One dimension\n", " 2. Two dimensional acoustic waves\n", " 3. Two dimensional elastic waves\n", " 4. GPU accelerated kernels\n", "\n", "\n", " * IV. [Gradient backpropagation in anisotropic acoustic and elastic waves](WaveExamples.ipynb)\n", " 1. Models construction\n", " 2. Acoustic wave equation\n", " 3 Automatic differentiation of seismograms\n", " 4. Elasticity\n", "\n", "\n", "### D. Acoustic and elastic waves\n", "\n", " * I. [Staggered grid schemes](ElasticComparisons.ipynb)\n", " 1. Staggered grids\n", " 2. The Virieux scheme\n", " 3. The Lebedev scheme\n", " 4. Dispersion relations\n", " 5. Numerical dispersion\n", " 6. Correlated Selling scheme\n", " 7. Staggered Selling scheme\n", " 8. Energy conservation\n", " 9. Grid decoupling in the Lebedev scheme\n", " 10. Acoustic scheme\n", " 11. Image and animation exports\n", "\n", "\n", "### E. Primal-Dual optimization\n", "\n", " * I. [The mincut problem](Prox_MinCut.ipynb)\n", " 1. Implementation of the proximal operators\n", " 2. Staggered grid\n", " 3. One dimension\n", " 4. Two dimensions\n", " 5. Choice of metric\n", "\n", "\n", "### F. Applications\n", "\n", " * I. [Extracting geodesics from the heat kernel](VaradhanGeodesics.ipynb)\n", " 1. Isotropic metrics\n", " 2. Anisotropic Riemannian metrics\n", " 3. Randers metrics\n", "\n", "\n", " * II. [Non-linear anisotropic Diffusion](AnisotropicDiffusion.ipynb)\n", " 1. Anisotropic diffusion\n", " 2. Choice of diffusion tensor\n", " 3. Application to image processing\n", " 4. Efficient implementation using a custom GPU kernel" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-04-30T09:00:09.192359Z", "iopub.status.busy": "2024-04-30T09:00:09.191670Z", "iopub.status.idle": "2024-04-30T09:00:09.202141Z", "shell.execute_reply": "2024-04-30T09:00:09.201444Z" } }, "outputs": [], "source": [ "#import sys; sys.path.append(\"..\") # Allow imports from parent directory\n", "#from Miscellaneous import TocTools; print(TocTools.displayTOCs('Div'))" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.10.8" } }, "nbformat": 4, "nbformat_minor": 2 }