comparison src/SbpOperators/volumeops/volume_operator.jl @ 780:3b29b2ff1f0e operator_storage_array_of_table

Merge in refactor/sbp_operators_method_signatures
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 19 Jul 2021 08:47:33 +0200
parents b6c0963100cd
children a4d7ca5de3c6
comparison
equal deleted inserted replaced
772:bea2feebbeca 780:3b29b2ff1f0e
1 """ 1 """
2 volume_operator(grid,inner_stencil,closure_stencils,parity,direction) 2 volume_operator(grid, inner_stencil, closure_stencils, parity, direction)
3
3 Creates a volume operator on a `Dim`-dimensional grid acting along the 4 Creates a volume operator on a `Dim`-dimensional grid acting along the
4 specified coordinate `direction`. The action of the operator is determined by the 5 specified coordinate `direction`. The action of the operator is determined by
5 stencils `inner_stencil` and `closure_stencils`. 6 the stencils `inner_stencil` and `closure_stencils`. When `Dim=1`, the
6 When `Dim=1`, the corresponding `VolumeOperator` tensor mapping is returned. 7 corresponding `VolumeOperator` tensor mapping is returned. When `Dim>1`, the
7 When `Dim>1`, the `VolumeOperator` `op` is inflated by the outer product 8 returned operator is the appropriate outer product of a one-dimensional
8 of `IdentityMappings` in orthogonal coordinate directions, e.g for `Dim=3`, 9 operators and `IdentityMapping`s, e.g for `Dim=3` the volume operator in the
9 the boundary restriction operator in the y-direction direction is `Ix⊗op⊗Iz`. 10 y-direction is `I⊗op⊗I`.
10 """ 11 """
11 function volume_operator(grid::EquidistantGrid{Dim,T}, inner_stencil::Stencil{T}, closure_stencils::NTuple{M,Stencil{T}}, parity, direction) where {Dim,T,M} 12 function volume_operator(grid::EquidistantGrid{Dim,T}, inner_stencil, closure_stencils, parity, direction) where {Dim,T}
12 #TODO: Check that direction <= Dim? 13 #TODO: Check that direction <= Dim?
13 14
14 # Create 1D volume operator in along coordinate direction 15 # Create 1D volume operator in along coordinate direction
15 op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity) 16 op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity)
16 # Create 1D IdentityMappings for each coordinate direction 17 # Create 1D IdentityMappings for each coordinate direction
32 size::NTuple{1,Int} 33 size::NTuple{1,Int}
33 parity::Parity 34 parity::Parity
34 end 35 end
35 36
36 function VolumeOperator(grid::EquidistantGrid{1}, inner_stencil, closure_stencils, parity) 37 function VolumeOperator(grid::EquidistantGrid{1}, inner_stencil, closure_stencils, parity)
37 return VolumeOperator(inner_stencil, closure_stencils, size(grid), parity) 38 return VolumeOperator(inner_stencil, Tuple(closure_stencils), size(grid), parity)
38 end 39 end
39 40
40 closure_size(::VolumeOperator{T,N,M}) where {T,N,M} = M 41 closure_size(::VolumeOperator{T,N,M}) where {T,N,M} = M
41 42
42 LazyTensors.range_size(op::VolumeOperator) = op.size 43 LazyTensors.range_size(op::VolumeOperator) = op.size