Mercurial > repos > public > sbplib_julia
comparison src/Grids/tensor_grid.jl @ 1595:611ae2308aa1 feature/boundary_conditions
Add orthogonal_grid
author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
---|---|
date | Sun, 26 May 2024 17:35:52 -0700 |
parents | de4e15924d26 |
children | 37b05221beda |
comparison
equal
deleted
inserted
replaced
1594:d68d02dd882f | 1595:611ae2308aa1 |
---|---|
93 b_ind = Base.setindex(per_grid_ind, local_b_ind, grid_id(id)) | 93 b_ind = Base.setindex(per_grid_ind, local_b_ind, grid_id(id)) |
94 | 94 |
95 return LazyTensors.concatenate_tuples(b_ind...) | 95 return LazyTensors.concatenate_tuples(b_ind...) |
96 end | 96 end |
97 | 97 |
98 orthogonal_grid(g::TensorGrid, id::BoundaryIdentifier) = g.grids[grid_id(id)] | |
99 | |
100 | |
98 function combined_coordinate_vector_type(coordinate_types...) | 101 function combined_coordinate_vector_type(coordinate_types...) |
99 combined_coord_length = mapreduce(_ncomponents, +, coordinate_types) | 102 combined_coord_length = mapreduce(_ncomponents, +, coordinate_types) |
100 combined_coord_type = mapreduce(eltype, promote_type, coordinate_types) | 103 combined_coord_type = mapreduce(eltype, promote_type, coordinate_types) |
101 | 104 |
102 if combined_coord_length == 1 | 105 if combined_coord_length == 1 |
131 return (1, d) | 134 return (1, d) |
132 else | 135 else |
133 return (I, d-cumsum(nds)[I-1]) | 136 return (I, d-cumsum(nds)[I-1]) |
134 end | 137 end |
135 end | 138 end |
139 |