Mercurial > repos > public > sbplib_julia
comparison SbpOperators/src/d2.jl @ 253:396eadb652bd boundary_conditions
Rename function closureSize to closuresize
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Thu, 27 Jun 2019 16:05:26 +0200 |
parents | 7cb4492ccd60 |
children | 4ca3794fffef |
comparison
equal
deleted
inserted
replaced
252:9405c19b76bc | 253:396eadb652bd |
---|---|
1 export D2, closureSize, readOperator, apply_e, apply_d, apply_e_T, apply_d_T | 1 export D2, closuresize, readOperator, apply_e, apply_d, apply_e_T, apply_d_T |
2 | 2 |
3 @enum Parity begin | 3 @enum Parity begin |
4 odd = -1 | 4 odd = -1 |
5 even = 1 | 5 even = 1 |
6 end | 6 end |
12 eClosure::Stencil{T,M} | 12 eClosure::Stencil{T,M} |
13 dClosure::Stencil{T,M} | 13 dClosure::Stencil{T,M} |
14 parity::Parity | 14 parity::Parity |
15 end | 15 end |
16 | 16 |
17 function closureSize(D::D2)::Int | 17 function closuresize(D::D2)::Int |
18 return length(D.quadratureClosure) | 18 return length(D.quadratureClosure) |
19 end | 19 end |
20 | 20 |
21 function apply_e_T(op::D2, v::AbstractVector, ::Type{Lower}) | 21 function apply_e_T(op::D2, v::AbstractVector, ::Type{Lower}) |
22 @boundscheck if length(v) < closureSize(op) | 22 @boundscheck if length(v) < closuresize(op) |
23 throw(BoundsError()) | 23 throw(BoundsError()) |
24 end | 24 end |
25 apply(op.eClosure,v,1) | 25 apply(op.eClosure,v,1) |
26 end | 26 end |
27 | 27 |
28 function apply_e_T(op::D2, v::AbstractVector, ::Type{Upper}) | 28 function apply_e_T(op::D2, v::AbstractVector, ::Type{Upper}) |
29 @boundscheck if length(v) < closureSize(op) | 29 @boundscheck if length(v) < closuresize(op) |
30 throw(BoundsError()) | 30 throw(BoundsError()) |
31 end | 31 end |
32 apply(flip(op.eClosure),v,length(v)) | 32 apply(flip(op.eClosure),v,length(v)) |
33 end | 33 end |
34 | 34 |
46 end | 46 end |
47 op.eClosure[N-i]*v | 47 op.eClosure[N-i]*v |
48 end | 48 end |
49 | 49 |
50 function apply_d_T(op::D2, h_inv::Real, v::AbstractVector, ::Type{Lower}) | 50 function apply_d_T(op::D2, h_inv::Real, v::AbstractVector, ::Type{Lower}) |
51 @boundscheck if length(v) < closureSize(op) | 51 @boundscheck if length(v) < closuresize(op) |
52 throw(BoundsError()) | 52 throw(BoundsError()) |
53 end | 53 end |
54 h_inv*apply(op.dClosure,v,1) | 54 h_inv*apply(op.dClosure,v,1) |
55 end | 55 end |
56 | 56 |
57 function apply_d_T(op::D2, h_inv::Real, v::AbstractVector, ::Type{Upper}) | 57 function apply_d_T(op::D2, h_inv::Real, v::AbstractVector, ::Type{Upper}) |
58 @boundscheck if length(v) < closureSize(op) | 58 @boundscheck if length(v) < closuresize(op) |
59 throw(BoundsError()) | 59 throw(BoundsError()) |
60 end | 60 end |
61 -h_inv*apply(flip(op.dClosure),v,length(v)) | 61 -h_inv*apply(flip(op.dClosure),v,length(v)) |
62 end | 62 end |
63 | 63 |