Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/volume_operator.jl @ 773:86bb3606b215 refactor/sbp_operators_method_signatures
Make volume_operators() less restrictive in the type of collection of closure_stencils
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 15 Jul 2021 23:25:12 +0200 |
parents | 9f27f451d0a0 |
children | d8c0916853fc |
comparison
equal
deleted
inserted
replaced
761:d7d030f8f708 | 773:86bb3606b215 |
---|---|
6 When `Dim=1`, the corresponding `VolumeOperator` tensor mapping is returned. | 6 When `Dim=1`, the corresponding `VolumeOperator` tensor mapping is returned. |
7 When `Dim>1`, the `VolumeOperator` `op` is inflated by the outer product | 7 When `Dim>1`, the `VolumeOperator` `op` is inflated by the outer product |
8 of `IdentityMappings` in orthogonal coordinate directions, e.g for `Dim=3`, | 8 of `IdentityMappings` in orthogonal coordinate directions, e.g for `Dim=3`, |
9 the boundary restriction operator in the y-direction direction is `Ix⊗op⊗Iz`. | 9 the boundary restriction operator in the y-direction direction is `Ix⊗op⊗Iz`. |
10 """ | 10 """ |
11 function volume_operator(grid::EquidistantGrid{Dim,T}, inner_stencil::Stencil{T}, closure_stencils::NTuple{M,Stencil{T}}, parity, direction) where {Dim,T,M} | 11 function volume_operator(grid::EquidistantGrid{Dim,T}, inner_stencil, closure_stencils, parity, direction) where {Dim,T,M} |
12 #TODO: Check that direction <= Dim? | 12 #TODO: Check that direction <= Dim? |
13 | 13 |
14 # Create 1D volume operator in along coordinate direction | 14 # Create 1D volume operator in along coordinate direction |
15 op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity) | 15 op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity) |
16 # Create 1D IdentityMappings for each coordinate direction | 16 # Create 1D IdentityMappings for each coordinate direction |
32 size::NTuple{1,Int} | 32 size::NTuple{1,Int} |
33 parity::Parity | 33 parity::Parity |
34 end | 34 end |
35 | 35 |
36 function VolumeOperator(grid::EquidistantGrid{1}, inner_stencil, closure_stencils, parity) | 36 function VolumeOperator(grid::EquidistantGrid{1}, inner_stencil, closure_stencils, parity) |
37 return VolumeOperator(inner_stencil, closure_stencils, size(grid), parity) | 37 return VolumeOperator(inner_stencil, Tuple(closure_stencils), size(grid), parity) |
38 end | 38 end |
39 | 39 |
40 closure_size(::VolumeOperator{T,N,M}) where {T,N,M} = M | 40 closure_size(::VolumeOperator{T,N,M}) where {T,N,M} = M |
41 | 41 |
42 LazyTensors.range_size(op::VolumeOperator) = op.size | 42 LazyTensors.range_size(op::VolumeOperator) = op.size |