Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/dissipation.jl @ 1203:254934aac3f8 feature/dissipation_operators
Change name and clarify docs
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Fri, 03 Feb 2023 10:05:52 +0100 |
parents | 9f0121e465a5 |
children | 99df343c7f61 |
comparison
equal
deleted
inserted
replaced
1162:62aaed9cf76b | 1203:254934aac3f8 |
---|---|
1 # REVIEW: Would it be more correct to | |
2 # call these undivided_differences instead of dissipation? | |
3 # If I understand it correctly, this method simply provides | |
4 # the operators required in order to compose a dissipation operator | |
5 # and the dissipation operator are formed by a linear combination | |
6 # of the products of Dᵀ and D for different orders. | |
7 """ | 1 """ |
8 undivided_dissipation(g::EquidistantGrid, p, direction) | 2 undivided_skewed04(g::EquidistantGrid, p, direction) |
9 | 3 |
10 Create undivided difference operators approximating the `p`th derivative for | 4 Create undivided difference operators approximating the `p`th derivative. The operator do not satisfy any SBP-property and are meant to be used for |
11 building artificial dissipation. The operators and how they are used to create accurate artifical dissipation is described in | 5 building artificial dissipation terms. |
6 | |
7 The operators and how they are used to create accurate artifical dissipation is described in | |
12 "K. Mattsson, M. Svärd, and J. Nordström, “Stable and Accurate Artificial Dissipation,” Journal of Scientific Computing, vol. 21, no. 1, pp. 57–79, Aug. 2004" | 8 "K. Mattsson, M. Svärd, and J. Nordström, “Stable and Accurate Artificial Dissipation,” Journal of Scientific Computing, vol. 21, no. 1, pp. 57–79, Aug. 2004" |
13 """ | 9 """ |
14 function undivided_dissipation(g::EquidistantGrid, p, direction) | 10 function undivided_skewed04(g::EquidistantGrid, p, direction) |
15 T = eltype(g) | 11 T = eltype(g) |
16 interior_weights = T.(dissipation_interior_weights(p)) | 12 interior_weights = T.(dissipation_interior_weights(p)) |
17 | 13 |
18 D = stencil_operator_distinct_closures( | 14 D = stencil_operator_distinct_closures( |
19 g, | 15 g, |
31 ) | 27 ) |
32 | 28 |
33 return D, Dᵀ | 29 return D, Dᵀ |
34 end | 30 end |
35 | 31 |
36 undivided_dissipation(g::EquidistantGrid{1}, p) = undivided_dissipation(g, p, 1) | 32 undivided_skewed04(g::EquidistantGrid{1}, p) = undivided_skewed04(g, p, 1) |
37 | 33 |
38 function dissipation_interior_weights(p) | 34 function dissipation_interior_weights(p) |
39 if p == 0 | 35 if p == 0 |
40 return (1,) | 36 return (1,) |
41 end | 37 end |