Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/derivatives/dissipation.jl @ 1291:356ec6a72974 refactor/grids
Implement changes in SbpOperators
| author | Jonatan Werpers <jonatan@werpers.com> |
|---|---|
| date | Tue, 07 Mar 2023 09:48:00 +0100 |
| parents | d60a10ad6579 |
| children | e94ddef5e72f |
comparison
equal
deleted
inserted
replaced
| 1290:31d0b7638304 | 1291:356ec6a72974 |
|---|---|
| 8 The operators and how they are used to create accurate artifical dissipation | 8 The operators and how they are used to create accurate artifical dissipation |
| 9 is described in "K. Mattsson, M. Svärd, and J. Nordström, “Stable and Accurate | 9 is described in "K. Mattsson, M. Svärd, and J. Nordström, “Stable and Accurate |
| 10 Artificial Dissipation,” Journal of Scientific Computing, vol. 21, no. 1, pp. | 10 Artificial Dissipation,” Journal of Scientific Computing, vol. 21, no. 1, pp. |
| 11 57–79, Aug. 2004" | 11 57–79, Aug. 2004" |
| 12 """ | 12 """ |
| 13 function undivided_skewed04(g::EquidistantGrid, p, direction) | 13 function undivided_skewed04(g::TensorGrid, p, direction) |
| 14 op = undivided_skewed04(g.grids[direction], p) | |
| 15 return LazyTensors.inflate(op, size(g), direction) | |
| 16 end | |
| 17 | |
| 18 function undivided_skewed04(g::EquidistantGrid, p) | |
| 14 T = eltype(g) | 19 T = eltype(g) |
| 15 interior_weights = T.(dissipation_interior_weights(p)) | 20 interior_weights = T.(dissipation_interior_weights(p)) |
| 16 | 21 |
| 17 D = stencil_operator_distinct_closures( | 22 D = StencilOperatorDistinctClosures( |
| 18 g, | 23 g, |
| 19 dissipation_interior_stencil(interior_weights), | 24 dissipation_interior_stencil(interior_weights), |
| 20 dissipation_lower_closure_stencils(interior_weights), | 25 dissipation_lower_closure_stencils(interior_weights), |
| 21 dissipation_upper_closure_stencils(interior_weights), | 26 dissipation_upper_closure_stencils(interior_weights), |
| 22 direction, | |
| 23 ) | 27 ) |
| 24 Dᵀ = stencil_operator_distinct_closures( | 28 Dᵀ = StencilOperatorDistinctClosures( |
| 25 g, | 29 g, |
| 26 dissipation_transpose_interior_stencil(interior_weights), | 30 dissipation_transpose_interior_stencil(interior_weights), |
| 27 dissipation_transpose_lower_closure_stencils(interior_weights), | 31 dissipation_transpose_lower_closure_stencils(interior_weights), |
| 28 dissipation_transpose_upper_closure_stencils(interior_weights), | 32 dissipation_transpose_upper_closure_stencils(interior_weights), |
| 29 direction, | |
| 30 ) | 33 ) |
| 31 | 34 |
| 32 return D, Dᵀ | 35 return D, Dᵀ |
| 33 end | 36 end |
| 34 | |
| 35 undivided_skewed04(g::EquidistantGrid{1}, p) = undivided_skewed04(g, p, 1) | |
| 36 | 37 |
| 37 function dissipation_interior_weights(p) | 38 function dissipation_interior_weights(p) |
| 38 if p == 0 | 39 if p == 0 |
| 39 return (1,) | 40 return (1,) |
| 40 end | 41 end |
