diff --git a/src/subgrid.jl b/src/subgrid.jl index 2cf7706f..de19dd3d 100644 --- a/src/subgrid.jl +++ b/src/subgrid.jl @@ -80,7 +80,7 @@ Base.isless(x::XIPair, y::XIPair) = (x.x < y.x) """ subgrid(parent, subregions::AbstractArray; - transform::T=function(a,b) @views a.=b[1:length(a)] end, + transform::T = (a, b) -> a .= b[1:length(a)], boundary=false, coordinatesystem=codim1_coordinatesystem(parent[CoordinateSystem]), project=true) where T @@ -105,9 +105,7 @@ A subgrid is of type `ExtendableGrid` and stores two additional components: function subgrid( parent, subregions::AbstractArray; - transform::T = function(a, b) - return @views a .= b[1:length(a)] - end, + transform::T = (a, b) -> a .= b[1:length(a)], boundary = false, support = ON_CELLS, project = true, diff --git a/test/test_gridstuff.jl b/test/test_gridstuff.jl index 373373b8..6d628dbb 100644 --- a/test/test_gridstuff.jl +++ b/test/test_gridstuff.jl @@ -154,9 +154,9 @@ function run_grid_tests() grid = simplexgrid(X, X) @test all(grid[CellVolumes] .> 0) sub = subgrid( - grid, [2], transform = function(a, b) - return a[1] = b[2] - end, boundary = true + grid, [2], + transform = (a, b) -> a[1] = b[2], + boundary = true ) @test check_cellfinder(sub)