Mercurial > repos > public > sbplib_julia
comparison src/Grids/grid.jl @ 1528:d641798539c2
Update notes on changes to `eval_on` and multiblock grids
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 10 Apr 2024 09:01:54 +0200 |
parents | 2fa325f08b66 |
children | 9113f437431d 611ae2308aa1 |
comparison
equal
deleted
inserted
replaced
1525:2cee20ecc0bc | 1528:d641798539c2 |
---|---|
139 eval_on(g::Grid, f) = eval_on(g, f, Base.IteratorSize(g)) | 139 eval_on(g::Grid, f) = eval_on(g, f, Base.IteratorSize(g)) |
140 function eval_on(g::Grid, f, ::Base.HasShape) | 140 function eval_on(g::Grid, f, ::Base.HasShape) |
141 if hasmethod(f, (Any,)) | 141 if hasmethod(f, (Any,)) |
142 return LazyTensors.LazyFunctionArray((I...)->f(g[I...]), size(g)) | 142 return LazyTensors.LazyFunctionArray((I...)->f(g[I...]), size(g)) |
143 else | 143 else |
144 # TBD This branch can be removed if we accept the trade off that we define f with the syntax f((x,y)) instead if we don't want to handle the vector in the body of f. (Add an example in the docs) | |
145 # Also see Notes.md | |
144 return LazyTensors.LazyFunctionArray((I...)->f(g[I...]...), size(g)) | 146 return LazyTensors.LazyFunctionArray((I...)->f(g[I...]...), size(g)) |
145 end | 147 end |
146 end | 148 end |
147 | 149 |
148 """ | 150 """ |