comparison src/SbpOperators/volumeops/volume_operator.jl @ 1114:fc57804c9bf4 feature/grids

Add function dims
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 15 Jul 2022 09:38:08 +0200
parents 2b6298905692
children 5ddf5ae48391
comparison
equal deleted inserted replaced
1113:4e4c5011140d 1114:fc57804c9bf4
13 #TODO: Check that direction <= Dim? 13 #TODO: Check that direction <= Dim?
14 14
15 # Create 1D volume operator in along coordinate direction 15 # Create 1D volume operator in along coordinate direction
16 op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity) 16 op = VolumeOperator(restrict(grid, direction), inner_stencil, closure_stencils, parity)
17 # Create 1D IdentityTensors for each coordinate direction 17 # Create 1D IdentityTensors for each coordinate direction
18 one_d_grids = restrict.(Ref(grid), Tuple(1:dimension(grid))) 18 one_d_grids = restrict.(Ref(grid), Tuple(dims(grid)))
19 Is = IdentityTensor{eltype(grid)}.(size.(one_d_grids)) 19 Is = IdentityTensor{eltype(grid)}.(size.(one_d_grids))
20 # Formulate the correct outer product sequence of the identity mappings and 20 # Formulate the correct outer product sequence of the identity mappings and
21 # the volume operator 21 # the volume operator
22 parts = Base.setindex(Is, op, direction) 22 parts = Base.setindex(Is, op, direction)
23 return foldl(⊗, parts) 23 return foldl(⊗, parts)