Mercurial > repos > public > sbplib_julia
comparison sbpD2.jl @ 52:0236f8e90567
Merge changes
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Fri, 11 Jan 2019 11:55:48 +0100 |
parents | 8c4cfa680e5a |
children | 27a8d3021a1c 8a7a537f54e5 700a74c41b26 48079bd39969 |
comparison
equal
deleted
inserted
replaced
51:614b56a017b9 | 52:0236f8e90567 |
---|---|
13 for i ∈ range(innerStart, stop=innerEnd) | 13 for i ∈ range(innerStart, stop=innerEnd) |
14 u[i] = apply(op.innerStencil, v, i)/h^2 | 14 u[i] = apply(op.innerStencil, v, i)/h^2 |
15 end | 15 end |
16 | 16 |
17 for i ∈ range(innerEnd+1, length=cSize) | 17 for i ∈ range(innerEnd+1, length=cSize) |
18 u[i] = op.parity*apply(flip(op.closureStencils[N-i+1]), v, i)/h^2 | 18 u[i] = Int(op.parity)*apply(flip(op.closureStencils[N-i+1]), v, i)/h^2 |
19 end | 19 end |
20 | |
21 return nothing | |
20 end | 22 end |
21 | 23 |
22 odd = -1 | 24 @enum Parity begin |
23 even = 1 | 25 odd = -1 |
26 even = 1 | |
27 end | |
24 | 28 |
25 struct D2{T} <: ConstantStencilOperator | 29 struct D2{T} <: ConstantStencilOperator |
26 quadratureClosure::Vector{T} | 30 quadratureClosure::Vector{T} |
27 innerStencil::Stencil | 31 innerStencil::Stencil |
28 closureStencils::Vector{Stencil} # TBD: Should this be a tuple? | 32 closureStencils::Vector{Stencil} # TBD: Should this be a tuple? |
29 eClosure::Vector{T} | 33 eClosure::Vector{T} |
30 dClosure::Vector{T} | 34 dClosure::Vector{T} |
31 parity::Int | 35 parity::Parity |
32 end | 36 end |
33 | 37 |
34 function closureSize(D::D2)::Int | 38 function closureSize(D::D2)::Int |
35 return length(D.quadratureClosure) | 39 return length(D.quadratureClosure) |
36 end | 40 end |