Mercurial > repos > public > sbplib_julia
comparison docs/src/manifolds_charts_atlases.md @ 2057:8a2a0d678d6f feature/lazy_tensors/pretty_printing
Merge default
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 10 Feb 2026 22:41:19 +0100 |
| parents | d89f7a1a6f37 |
| children |
comparison
equal
deleted
inserted
replaced
| 1110:c0bff9f6e0fb | 2057:8a2a0d678d6f |
|---|---|
| 1 # Manifolds, Charts, and Atlases | |
| 2 | |
| 3 To construct grids on more complicated geometries we use manifolds described | |
| 4 by one or more charts. The charts describe a mapping from a logical parameter | |
| 5 space to the geometry that we are interested in. If there are more than one | |
| 6 chart for a given geometry this collection of charts and how they are | |
| 7 connected is described by an atlas. | |
| 8 | |
| 9 We consider a mapping from the logical coordidinates ``\xi \in \Xi`` to the | |
| 10 physical coordinates ``x \in \Omega``. A `Chart` describes the mapping by a | |
| 11 `ParameterSpace` respresenting ``\Xi`` and some mapping object that takes | |
| 12 arguments ``\xi \in \Xi`` and returns coordinates ``x\in\Omega``. The mapping | |
| 13 object can either be a function or some other callable object. | |
| 14 | |
| 15 For the construction of differential and difference operators on a manifold | |
| 16 with a chart the library needs to know the Jacobian, | |
| 17 ``\frac{\partial x}{\partial \xi}``, of the mapping as a function of | |
| 18 coordinates in the logical parameter space. Internally, Diffinitive.jl uses a | |
| 19 local Jacobian function, `Grids.jacobian(f, ΞΎ)`. For geometry objects provided | |
| 20 by the library this function should have fast and efficient implementations. | |
| 21 If you are creating your own mapping functions you must implement | |
| 22 `Grids.jacobian` for your function or type, for example | |
| 23 | |
| 24 ```julia | |
| 25 f(x) = 2x | |
| 26 Grids.jacobian(::typeof(f), x) = fill(2, length(x)) | |
| 27 ``` | |
| 28 | |
| 29 ```julia | |
| 30 struct F end | |
| 31 (::F)(x) = 2x | |
| 32 Grids.jacobian(::F, x) = fill(2,length(x)) | |
| 33 ``` | |
| 34 | |
| 35 You can also provide a fallback function using one of the many automatic | |
| 36 differentiation packages, for example | |
| 37 | |
| 38 ```julia | |
| 39 using ForwardDiff | |
| 40 Grids.jacobian(f,x) = ForwardDiff.jacobian(f,x) | |
| 41 ``` |
