Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1510:606975cdb1f3 refactor/component_type
Allow component_type to accept more types of inputs
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Thu, 21 Mar 2024 07:59:03 +0100 |
| parents | a863aef1f799 |
| children | 7476877c0b0e |
comparison
equal
deleted
inserted
replaced
| 1499:8ef207e4bc87 | 1510:606975cdb1f3 |
|---|---|
| 35 """ | 35 """ |
| 36 component_type(g) | 36 component_type(g) |
| 37 | 37 |
| 38 The type of the components of the coordinate vector of `Grid` `g`. | 38 The type of the components of the coordinate vector of `Grid` `g`. |
| 39 """ | 39 """ |
| 40 component_type(::Type{<:Grid{T}}) where T = eltype(T) | 40 component_type(T::Type) = eltype(eltype(T)) |
| 41 component_type(g::Grid) = component_type(typeof(g)) | 41 component_type(t) = component_type(typeof(t)) |
| 42 | 42 |
| 43 """ | 43 """ |
| 44 refine(g::Grid, r) | 44 refine(g::Grid, r) |
| 45 | 45 |
| 46 The grid where `g` is refined by the factor `r`. | 46 The grid where `g` is refined by the factor `r`. |
