Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/dissipation.jl @ 1029:129262c8e897 feature/dissipation_operators
Change signatures for interior stencil methods
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 22 Mar 2022 09:26:05 +0100 |
| parents | ee5a641a8277 |
| children | 0cb4c6b15d8e |
comparison
equal
deleted
inserted
replaced
| 1028:62e80e8cc743 | 1029:129262c8e897 |
|---|---|
| 13 end | 13 end |
| 14 | 14 |
| 15 return (0, dissipation_interior_weights(p-1)...) .- (dissipation_interior_weights(p-1)..., 0) | 15 return (0, dissipation_interior_weights(p-1)...) .- (dissipation_interior_weights(p-1)..., 0) |
| 16 end | 16 end |
| 17 | 17 |
| 18 function dissipation_interior_stencil(p) | |
| 19 w = dissipation_interior_weights(p) | |
| 20 Stencil(w..., center=midpoint(w)) | |
| 21 end | |
| 22 | |
| 23 function dissipation_transpose_interior_stencil(p) | |
| 24 w = dissipation_interior_weights(p) | |
| 25 Stencil(w..., center=midpoint_transpose(w)) | |
| 26 end | |
| 27 | |
| 28 | |
| 29 midpoint(weights) = length(weights)÷2 + 1 | 18 midpoint(weights) = length(weights)÷2 + 1 |
| 30 midpoint_transpose(weights) = length(weights)+1 - midpoint(weights) | 19 midpoint_transpose(weights) = length(weights)+1 - midpoint(weights) |
| 20 | |
| 21 dissipation_interior_stencil(weights) = Stencil(weights..., center=midpoint(weights)) | |
| 22 dissipation_transpose_interior_stencil(weights) = Stencil(weights..., center=midpoint_transpose(weights)) | |
| 31 | 23 |
| 32 dissipation_lower_closure_size(weights) = midpoint(weights) - 1 | 24 dissipation_lower_closure_size(weights) = midpoint(weights) - 1 |
| 33 dissipation_upper_closure_size(weights) = length(weights) - midpoint(weights) | 25 dissipation_upper_closure_size(weights) = length(weights) - midpoint(weights) |
| 34 | 26 |
| 35 dissipation_lower_closure_stencils(interior_weights) = ntuple(i->Stencil(interior_weights..., center=i ), dissipation_lower_closure_size(interior_weights)) | 27 dissipation_lower_closure_stencils(interior_weights) = ntuple(i->Stencil(interior_weights..., center=i ), dissipation_lower_closure_size(interior_weights)) |
