Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 2052:a590dc4af7ea feature/sbp_operators/laplace_curvilinear tip
Merge feature/grids/geometry_functions
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Fri, 06 Feb 2026 17:35:25 +0100 |
| parents | 491887181b8c |
| children |
comparison
equal
deleted
inserted
replaced
| 2040:17efc56f1f45 | 2052:a590dc4af7ea |
|---|---|
| 72 CT = typeof(first(v)[component_index...]) | 72 CT = typeof(first(v)[component_index...]) |
| 73 return new{CT, eltype(v), ndims(v), typeof(v), typeof(component_index)}(v,component_index) | 73 return new{CT, eltype(v), ndims(v), typeof(v), typeof(component_index)}(v,component_index) |
| 74 end | 74 end |
| 75 end | 75 end |
| 76 | 76 |
| 77 _array_type(v::ArrayComponentView) = typeof(v) | 77 _array_type(v::ArrayComponentView) = _array_type(typeof(v)) |
| 78 _array_type(::Type{ArrayComponentView{CT,T,D,AT,IT}}) where {CT,T,D,AT,IT} = AT | 78 _array_type(::Type{ArrayComponentView{CT,T,D,AT,IT}}) where {CT,T,D,AT,IT} = AT |
| 79 | 79 |
| 80 Base.size(cv::ArrayComponentView) = size(cv.v) | 80 Base.size(cv::ArrayComponentView) = size(cv.v) |
| 81 Base.getindex(cv::ArrayComponentView, i::Int) = cv.v[i][cv.component_index...] | 81 Base.getindex(cv::ArrayComponentView, i::Int) = cv.v[i][cv.component_index...] |
| 82 Base.getindex(cv::ArrayComponentView, I::Vararg{Int}) = cv.v[I...][cv.component_index...] | 82 Base.getindex(cv::ArrayComponentView, I::Vararg{Int}) = cv.v[I...][cv.component_index...] |
| 83 IndexStyle(ACT::Type{ArrayComponentView}) = IndexStyle(_array_type(ACT)) | 83 Base.IndexStyle(ACT::Type{<:ArrayComponentView}) = IndexStyle(_array_type(ACT)) |
| 84 | 84 |
| 85 # TODO: Implement `setindex!`? | 85 # TODO: Implement `setindex!`? |
| 86 # TODO: Implement a more general ComponentView that can handle non-AbstractArrays. | 86 # TODO: Implement a more general ComponentView that can handle non-AbstractArrays. |
| 87 | 87 |
| 88 | 88 |
