Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/constantstenciloperator.jl @ 556:37a81dad36b9
Merge refactor/tensor_index_coupling
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sun, 29 Nov 2020 21:18:45 +0100 |
parents | 1a53eb83ed24 |
children | d1929491180b |
line wrap: on
line diff
--- a/src/SbpOperators/constantstenciloperator.jl Thu Nov 26 17:53:40 2020 +0100 +++ b/src/SbpOperators/constantstenciloperator.jl Sun Nov 29 21:18:45 2020 +0100 @@ -14,7 +14,7 @@ return @inbounds h_inv*h_inv*Int(op.parity)*apply_stencil_backwards(op.closureStencils[N-Int(i)+1], v, Int(i)) end -@inline function apply_2nd_derivative(op::ConstantStencilOperator, h_inv::Real, v::AbstractVector, index::Index{Unknown}) +@inline function apply_2nd_derivative(op::ConstantStencilOperator, h_inv::Real, v::AbstractVector, i) N = length(v) r = getregion(Int(index), closuresize(op), N) i = Index(Int(index), r) @@ -26,9 +26,9 @@ apply_quadrature(op::ConstantStencilOperator, h::Real, v::T, i::Index{Upper}, N::Integer) where T = v*h*op.quadratureClosure[N-Int(i)+1] apply_quadrature(op::ConstantStencilOperator, h::Real, v::T, i::Index{Interior}, N::Integer) where T = v*h -function apply_quadrature(op::ConstantStencilOperator, h::Real, v::T, index::Index{Unknown}, N::Integer) where T - r = getregion(Int(index), closuresize(op), N) - i = Index(Int(index), r) +function apply_quadrature(op::ConstantStencilOperator, h::Real, v::T, i, N::Integer) where T + r = getregion(i, closuresize(op), N) + i = Index(i, r) return apply_quadrature(op, h, v, i, N) end export apply_quadrature @@ -38,9 +38,9 @@ apply_inverse_quadrature(op::ConstantStencilOperator, h_inv::Real, v::T, i::Index{Upper}, N::Integer) where T = h_inv*v/op.quadratureClosure[N-Int(i)+1] apply_inverse_quadrature(op::ConstantStencilOperator, h_inv::Real, v::T, i::Index{Interior}, N::Integer) where T = v*h_inv -function apply_inverse_quadrature(op::ConstantStencilOperator, h_inv::Real, v::T, index::Index{Unknown}, N::Integer) where T - r = getregion(Int(index), closuresize(op), N) - i = Index(Int(index), r) +function apply_inverse_quadrature(op::ConstantStencilOperator, h_inv::Real, v::T, i, N::Integer) where T + r = getregion(i, closuresize(op), N) + i = Index(i, r) return apply_inverse_quadrature(op, h_inv, v, i, N) end @@ -62,14 +62,14 @@ export apply_normal_derivative_transpose -function apply_normal_derivative(op::ConstantStencilOperator, h_inv::Real, v::Number, i::Index, N::Integer, ::Type{Lower}) +function apply_normal_derivative(op::ConstantStencilOperator, h_inv::Real, v::Number, i, N::Integer, ::Type{Lower}) @boundscheck if !(0<length(Int(i)) <= N) throw(BoundsError()) end h_inv*op.dClosure[Int(i)-1]*v end -function apply_normal_derivative(op::ConstantStencilOperator, h_inv::Real, v::Number, i::Index, N::Integer, ::Type{Upper}) +function apply_normal_derivative(op::ConstantStencilOperator, h_inv::Real, v::Number, i, N::Integer, ::Type{Upper}) @boundscheck if !(0<length(Int(i)) <= N) throw(BoundsError()) end