comparison src/Grids/grid.jl @ 1473:869a40cda18c

Merge feature/grids/boundary_indicies
author Jonatan Werpers <jonatan@werpers.com>
date Fri, 01 Dec 2023 11:48:04 +0100
parents a863aef1f799
children 276c38a48aac 606975cdb1f3 d7bc11053951
comparison
equal deleted inserted replaced
1443:f217c6167952 1473:869a40cda18c
72 """ 72 """
73 function boundary_grid end 73 function boundary_grid end
74 # TBD: Can we implement a version here that accepts multiple ids and grouped boundaries? Maybe we need multiblock stuff? 74 # TBD: Can we implement a version here that accepts multiple ids and grouped boundaries? Maybe we need multiblock stuff?
75 75
76 """ 76 """
77 boundary_indices(g::Grid, id::BoundaryIdentifier)
78
79 A collection of indices corresponding to the boundary with given id. For grids
80 with Cartesian indexing these collections will be tuples with elements of type
81 ``Union{Int,Colon}``.
82
83 When implementing this method it is expected that the returned collection can
84 be used to index grid functions to obtain grid functions on the boundary grid.
85 """
86 function boundary_indices end
87
88 """
77 eval_on(g::Grid, f) 89 eval_on(g::Grid, f)
78 90
79 Lazy evaluation of `f` on the grid. `f` can either be on the form `f(x,y,...)` 91 Lazy evaluation of `f` on the grid. `f` can either be on the form `f(x,y,...)`
80 with each coordinate as an argument, or on the form `f(x̄)` taking a 92 with each coordinate as an argument, or on the form `f(x̄)` taking a
81 coordinate vector. 93 coordinate vector.
98 """ 110 """
99 eval_on(g::Grid, f::Number) = return LazyTensors.LazyConstantArray(f, size(g)) 111 eval_on(g::Grid, f::Number) = return LazyTensors.LazyConstantArray(f, size(g))
100 112
101 _ncomponents(::Type{<:Number}) = 1 113 _ncomponents(::Type{<:Number}) = 1
102 _ncomponents(T::Type{<:SVector}) = length(T) 114 _ncomponents(T::Type{<:SVector}) = length(T)
115
116