Mercurial > repos > public > sbplib_julia
comparison src/Grids/manifolds.jl @ 1998:6dd00ea0511a feature/grids/manifolds
Add check if the logical coordinates are in the parameter space when calling a chart
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 25 Apr 2025 08:28:34 +0200 |
parents | ebe883807b62 |
children | a1b2453c02c9 |
comparison
equal
deleted
inserted
replaced
1997:6dc6dfd11820 | 1998:6dd00ea0511a |
---|---|
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 |