comparison src/SbpOperators/boundaryops/boundary_operator.jl @ 834:a8d64785f51b operator_storage_array_of_table

Merge refactor/sbp_operators_method_signatures
author Jonatan Werpers <jonatan@werpers.com>
date Thu, 13 Jan 2022 08:51:26 +0100
parents 69700b0b1452 b4acd25943f4
children b41180efb6c2 469ed954b493
comparison
equal deleted inserted replaced
833:454ba1efa644 834:a8d64785f51b
7 When `Dim=1`, the corresponding `BoundaryOperator` tensor mapping is returned. 7 When `Dim=1`, the corresponding `BoundaryOperator` tensor mapping is returned.
8 When `Dim>1`, the `BoundaryOperator` `op` is inflated by the outer product 8 When `Dim>1`, the `BoundaryOperator` `op` is inflated by the outer product
9 of `IdentityMappings` in orthogonal coordinate directions, e.g for `Dim=3`, 9 of `IdentityMappings` in orthogonal coordinate directions, e.g for `Dim=3`,
10 the boundary restriction operator in the y-direction direction is `Ix⊗op⊗Iz`. 10 the boundary restriction operator in the y-direction direction is `Ix⊗op⊗Iz`.
11 """ 11 """
12 function boundary_operator(grid::EquidistantGrid{Dim,T}, closure_stencil, boundary::CartesianBoundary) where {Dim,T} 12 function boundary_operator(grid::EquidistantGrid, closure_stencil, boundary::CartesianBoundary)
13 #TODO:Check that dim(boundary) <= Dim? 13 #TODO:Check that dim(boundary) <= Dim?
14 14
15 # Create 1D boundary operator 15 # Create 1D boundary operator
16 r = region(boundary) 16 r = region(boundary)
17 d = dim(boundary) 17 d = dim(boundary)
18 op = BoundaryOperator(restrict(grid, d), closure_stencil, r) 18 op = BoundaryOperator(restrict(grid, d), closure_stencil, r)
19 19
20 # Create 1D IdentityMappings for each coordinate direction 20 # Create 1D IdentityMappings for each coordinate direction
21 one_d_grids = restrict.(Ref(grid), Tuple(1:Dim)) 21 one_d_grids = restrict.(Ref(grid), Tuple(1:dimension(grid)))
22 Is = IdentityMapping{T}.(size.(one_d_grids)) 22 Is = IdentityMapping{eltype(grid)}.(size.(one_d_grids))
23 23
24 # Formulate the correct outer product sequence of the identity mappings and 24 # Formulate the correct outer product sequence of the identity mappings and
25 # the boundary operator 25 # the boundary operator
26 parts = Base.setindex(Is, op, d) 26 parts = Base.setindex(Is, op, d)
27 return foldl(⊗, parts) 27 return foldl(⊗, parts)