Mercurial > repos > public > sbplib_julia
comparison src/Grids/manifolds.jl @ 2003:524a52f190d7 feature/sbp_operators/laplace_curvilinear
Merge feature/grids/geometry_functions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 29 Apr 2025 09:03:05 +0200 |
parents | a1b2453c02c9 |
children |
comparison
equal
deleted
inserted
replaced
1962:496b8d3903c6 | 2003:524a52f190d7 |
---|---|
7 mapping::MT | 7 mapping::MT |
8 parameterspace::PST | 8 parameterspace::PST |
9 end | 9 end |
10 | 10 |
11 Base.ndims(::Chart{D}) where D = D | 11 Base.ndims(::Chart{D}) where D = D |
12 (c::Chart)(ξ) = c.mapping(ξ) | |
13 parameterspace(c::Chart) = c.parameterspace | 12 parameterspace(c::Chart) = c.parameterspace |
13 | |
14 function (c::Chart)(ξ) | |
15 if ξ ∉ parameterspace(c) | |
16 throw(DomainError(ξ, "chart was called logical coordinates outside the parameterspace. If this was inteded, use the `mapping` field from the Chart struct instead.")) | |
17 end | |
18 return c.mapping(ξ) | |
19 end | |
14 | 20 |
15 """ | 21 """ |
16 jacobian(c::Chart, ξ) | 22 jacobian(c::Chart, ξ) |
17 | 23 |
18 The jacobian of the mapping evaluated at `ξ`. This defers to the | 24 The jacobian of the mapping evaluated at `ξ`. This defers to the |
28 c = Chart(f, ps) | 34 c = Chart(f, ps) |
29 jacobian(c::typeof(c),ξ) = f′(ξ) | 35 jacobian(c::typeof(c),ξ) = f′(ξ) |
30 ``` | 36 ``` |
31 which will both allow calling `jacobian(c,ξ)`. | 37 which will both allow calling `jacobian(c,ξ)`. |
32 """ | 38 """ |
33 jacobian(c::Chart, ξ) = jacobian(c.mapping, ξ) | 39 function jacobian(c::Chart, ξ) |
34 # TBD: Can we register a error hint for when jacobian is called with a function that doesn't have a registered jacobian? | 40 if ξ ∉ parameterspace(c) |
41 throw(DomainError(ξ, "jacobian was called with logical coordinates outside the parameterspace of the chart. If this was inteded, use the `mapping` field from the Chart struct instead.")) | |
42 end | |
43 return jacobian(c.mapping, ξ) | |
44 end | |
35 | 45 |
36 boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c)) | 46 boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c)) |
37 | 47 |
38 | 48 |
39 """ | 49 """ |
52 function charts end | 62 function charts end |
53 | 63 |
54 """ | 64 """ |
55 connections(::Atlas) | 65 connections(::Atlas) |
56 | 66 |
57 Collection of pairs of multiblock boundary identifiers. | 67 Collection of 2-tuples of multiblock boundary identifiers. |
58 """ | 68 """ |
59 function connections end | 69 function connections end |
60 | 70 |
61 | 71 |
62 """ | 72 """ |