Mercurial > repos > public > sbplib_julia
changeset 818:ae28f1d7ef5e refactor/sbp_operators_method_signatures
Accept review comments
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 12 Jan 2022 15:48:29 +0100 |
parents | a4d7ca5de3c6 |
children | f378cc64bafd |
files | src/SbpOperators/volumeops/volume_operator.jl |
diffstat | 1 files changed, 3 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/src/SbpOperators/volumeops/volume_operator.jl Mon Sep 20 20:36:20 2021 +0200 +++ b/src/SbpOperators/volumeops/volume_operator.jl Wed Jan 12 15:48:29 2022 +0100 @@ -9,21 +9,14 @@ operators and `IdentityMapping`s, e.g for `Dim=3` the volume operator in the y-direction is `I⊗op⊗I`. """ -# Review: The type parameters Dim, T in the signature can be removed, -# by the following changes: -# one_d_grids = restrict.(Ref(grid), Tuple(1:Dim)) --> -# one_d_grids = restrict.(Ref(grid), Tuple(1:dimension(grid))) -# and -# Is = IdentityMapping{T}.(size.(one_d_grids)) --> -# Is = IdentityMapping{eltype(grid)}.(size.(one_d_grids)) -function volume_operator(grid::EquidistantGrid{Dim,T}, inner_stencil, closure_stencils, parity, direction) where {Dim,T} +function volume_operator(grid::EquidistantGrid, inner_stencil, closure_stencils, parity, direction) #TODO: Check that direction <= Dim? # Create 1D volume operator in along coordinate direction op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity) # Create 1D IdentityMappings for each coordinate direction - one_d_grids = restrict.(Ref(grid), Tuple(1:Dim)) - Is = IdentityMapping{T}.(size.(one_d_grids)) + one_d_grids = restrict.(Ref(grid), Tuple(1:dimension(grid))) + Is = IdentityMapping{eltype(grid)}.(size.(one_d_grids)) # Formulate the correct outer product sequence of the identity mappings and # the volume operator parts = Base.setindex(Is, op, direction)