Mercurial > repos > public > sbplib_julia
comparison src/Grids/equidistant_grid.jl @ 1687:3ac94e8f28b3 feature/grids/curvilinear
Allow calling equidistant_grid with tuples of lenght 1
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 21 Aug 2024 19:23:42 +0200 |
parents | 51f0c5f895fb |
children | a4c52ae93b11 863385aae454 |
comparison
equal
deleted
inserted
replaced
1684:22a9992471be | 1687:3ac94e8f28b3 |
---|---|
119 """ | 119 """ |
120 equidistant_grid(limit_lower::T, limit_upper::T, size::Int) | 120 equidistant_grid(limit_lower::T, limit_upper::T, size::Int) |
121 | 121 |
122 Constructs a 1D equidistant grid. | 122 Constructs a 1D equidistant grid. |
123 """ | 123 """ |
124 function equidistant_grid(limit_lower::T, limit_upper::T, size::Int) where T | 124 function equidistant_grid(limit_lower::Number, limit_upper::Number, size::Int) |
125 if any(size .<= 0) | 125 if any(size .<= 0) |
126 throw(DomainError("size must be postive")) | 126 throw(DomainError("size must be postive")) |
127 end | 127 end |
128 | 128 |
129 if any(limit_upper.-limit_lower .<= 0) | 129 if any(limit_upper.-limit_lower .<= 0) |