Mercurial > repos > public > sbplib_julia
comparison docs/src/manifolds_charts_atlases.md @ 1951:6c1bb9bdb092 feature/grids/geometry_functions
Merge feature/grids/manifolds
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 07 Feb 2025 22:38:39 +0100 |
parents | 84e5ab97902d |
children | 3694f11075c5 |
comparison
equal
deleted
inserted
replaced
1916:6859089b361e | 1951:6c1bb9bdb092 |
---|---|
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 some parameter space | |
5 to the geometry that we are interested in. If there are more than one chart | |
6 for a given geometry this collection of charts and their connection is | |
7 described by and atlas. | |
8 | |
9 For the construction of differential and difference operators on a manifold | |
10 with a chart the library needs to know the Jacobian of the mapping as a | |
11 function of coordinates in the logical parameter space. Internally, | |
12 Diffinitive.jl uses a local Jacobian function, `Grids.jacobian(f, ΞΎ)`. For | |
13 geometry objects provided by the library this function should have fast and | |
14 efficient implementations. If you are creating your own mapping functions you | |
15 can implement `Grids.jacobian` for your function or type, for example | |
16 | |
17 ```julia | |
18 f(x) = 2x | |
19 Grids.jacobian(::typeof(f), x) = fill(2, length(x)) | |
20 ``` | |
21 | |
22 ```julia | |
23 struct F end | |
24 (::F)(x) = 2x | |
25 Grids.jacobian(::F, x) = fill(2,length(x)) | |
26 ``` | |
27 | |
28 You can also provide a fallback function using one of the many automatic | |
29 differentiation packages, for example | |
30 | |
31 ```julia | |
32 using ForwardDiff | |
33 Grids.jacobian(f,x) = ForwardDiff.jacobian(f,x) | |
34 ``` | |
35 | |
36 <!-- What more needs to be said here? --/> |