Mercurial > repos > public > sbplib_julia
comparison src/Grids/manifolds.jl @ 1564:35fe4375b35f feature/grids/manifolds
Export things and fix ConcreteChart and Simplex
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Thu, 25 Apr 2024 13:17:48 +0200 |
| parents | 81e97d3bec8c |
| children | 90af15f38c62 |
comparison
equal
deleted
inserted
replaced
| 1558:81e97d3bec8c | 1564:35fe4375b35f |
|---|---|
| 45 | 45 |
| 46 struct Simplex{T,D} <: ParameterSpace{D} | 46 struct Simplex{T,D} <: ParameterSpace{D} |
| 47 verticies::NTuple{D,SVector{D,T}} | 47 verticies::NTuple{D,SVector{D,T}} |
| 48 end | 48 end |
| 49 | 49 |
| 50 Simplex(verticies::Vararg{AbstractArray}) = Simplex(Tuple(SVector(v...) for v ∈ verticies)) | |
| 51 | |
| 50 Triangle{T} = Simplex{T,2} | 52 Triangle{T} = Simplex{T,2} |
| 51 Tetrahedron{T} = Simplex{T,3} | 53 Tetrahedron{T} = Simplex{T,3} |
| 52 | 54 |
| 53 unittriangle(T) = unitsimplex(T,2) | 55 unittriangle(T) = unitsimplex(T,2) |
| 54 unittetrahedron(T) = unitsimplex(T,3) | 56 unittetrahedron(T) = unitsimplex(T,3) |
| 82 function parameterspace end | 84 function parameterspace end |
| 83 | 85 |
| 84 (c::Chart{D})(x̄::SVector{D}) where D = c(x̄...) | 86 (c::Chart{D})(x̄::SVector{D}) where D = c(x̄...) |
| 85 | 87 |
| 86 | 88 |
| 87 struct ConcereteChart{PST<:ParameterSpace, MT} | 89 struct ConcreteChart{D, PST<:ParameterSpace{D}, MT} <: Chart{D} |
| 90 mapping::MT | |
| 88 parameterspace::PST | 91 parameterspace::PST |
| 89 mapping::MT | |
| 90 end | 92 end |
| 91 | 93 |
| 92 (c::Chart)(x̄) = c.mapping(x̄) | 94 (c::Chart)(x̄) = c.mapping(x̄) |
| 93 | 95 |
| 94 | 96 |
