Mercurial > repos > public > sbplib_julia
comparison src/Grids/manifolds.jl @ 2002:4300c59bbeff feature/grids/geometry_functions
Merge feature/grids/manifolds
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 29 Apr 2025 09:00:42 +0200 |
parents | a1b2453c02c9 |
children |
comparison
equal
deleted
inserted
replaced
1983:730c9848ad0b | 2002:4300c59bbeff |
---|---|
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, ξ) |
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 | |
34 | 45 |
35 boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c)) | 46 boundary_identifiers(c::Chart) = boundary_identifiers(parameterspace(c)) |
36 | 47 |
37 | 48 |
38 """ | 49 """ |
51 function charts end | 62 function charts end |
52 | 63 |
53 """ | 64 """ |
54 connections(::Atlas) | 65 connections(::Atlas) |
55 | 66 |
56 Collection of pairs of multiblock boundary identifiers. | 67 Collection of 2-tuples of multiblock boundary identifiers. |
57 """ | 68 """ |
58 function connections end | 69 function connections end |
59 | 70 |
60 | 71 |
61 """ | 72 """ |