Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/dissipation.jl @ 1034:ed19c549c506 feature/dissipation_operators
Implement undevided dissipation operators
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 22 Mar 2022 12:33:58 +0100 |
| parents | 0cb4c6b15d8e |
| children | ceda69b8f27a |
comparison
equal
deleted
inserted
replaced
| 1033:0cb4c6b15d8e | 1034:ed19c549c506 |
|---|---|
| 1 function dissipation(g::EquidistantGrid, p, direction) | 1 function undevided_dissipation(g::EquidistantGrid, p, direction) |
| 2 h_inv = inverse_spacing(g)[direction] | 2 T = eltype(g) |
| 3 interior_weights = T.(dissipation_interior_weights(p)) | |
| 3 | 4 |
| 4 # D = volume_operator(g,CenteredStencil(1),(CenteredStencil(1)), ) | 5 D = stencil_operator_distinct_closures( |
| 5 return nothing, nothing | 6 g, |
| 7 dissipation_interior_stencil(interior_weights), | |
| 8 dissipation_lower_closure_stencils(interior_weights), | |
| 9 dissipation_upper_closure_stencils(interior_weights), | |
| 10 direction, | |
| 11 ) | |
| 12 Dᵀ = stencil_operator_distinct_closures( | |
| 13 g, | |
| 14 dissipation_transpose_interior_stencil(interior_weights), | |
| 15 dissipation_transpose_lower_closure_stencils(interior_weights), | |
| 16 dissipation_transpose_upper_closure_stencils(interior_weights), | |
| 17 direction, | |
| 18 ) | |
| 19 | |
| 20 return D, Dᵀ | |
| 6 end | 21 end |
| 7 | 22 |
| 8 dissipation(g::EquidistantGrid{1}, p) = dissipation(g, p, 1) | 23 undevided_dissipation(g::EquidistantGrid{1}, p) = undevided_dissipation(g, p, 1) |
| 9 | 24 |
| 10 function dissipation_interior_weights(p) | 25 function dissipation_interior_weights(p) |
| 11 if p == 0 | 26 if p == 0 |
| 12 return (1,) | 27 return (1,) |
| 13 end | 28 end |
