Mercurial > repos > public > sbplib_julia
changeset 170:6ba2238a9687 boundary_conditions
Avoid division in apply_d
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 21 May 2019 14:40:07 +0200 |
parents | 24ee4def7ffb |
children | d407611ed71a |
files | sbpD2.jl |
diffstat | 1 files changed, 4 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/sbpD2.jl Tue May 21 14:24:28 2019 +0200 +++ b/sbpD2.jl Tue May 21 14:40:07 2019 +0200 @@ -103,12 +103,12 @@ end -function apply_d(op::D2, h::Real, v::AbstractVector, ::Type{Lower}) - -apply(op.dClosure,v,1)/h +function apply_d(op::D2, h_inv::Real, v::AbstractVector, ::Type{Lower}) + -h_inv*apply(op.dClosure,v,1) end -function apply_d(op::D2, h::Real, v::AbstractVector, ::Type{Upper}) - -apply(flip(op.dClosure),v,length(v))/h +function apply_d(op::D2, h_inv::Real, v::AbstractVector, ::Type{Upper}) + -h_inv*apply(flip(op.dClosure),v,length(v)) end function readSectionedFile(filename)::Dict{String, Vector{String}}