Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/volumeops/quadratures/quadrature.jl @ 695:fc755b29d418 refactor/operator_naming
Rename quadrature to inner_product
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sun, 14 Feb 2021 13:47:34 +0100 |
parents | 728fd5a2455a |
children |
comparison
equal
deleted
inserted
replaced
694:6ab473e0ea80 | 695:fc755b29d418 |
---|---|
1 """ | 1 """ |
2 quadrature(grid::EquidistantGrid, closure_stencils, inner_stencil) | 2 inner_product(grid::EquidistantGrid, closure_stencils, inner_stencil) |
3 quadrature(grid::EquidistantGrid, closure_stencils) | |
4 | 3 |
5 Creates the quadrature operator `H` as a `TensorMapping` | 4 Creates the discrete inner product operator `H` as a `TensorMapping` on an equidistant |
5 grid, defined as `(u,v) = u'Hv` for grid functions `u,v`. | |
6 | 6 |
7 `H` approximiates the integral operator on `grid` the using the stencil | 7 `inner_product(grid::EquidistantGrid, closure_stencils, inner_stencil)` creates |
8 `inner_stencil` in the interior and a set of stencils `closure_stencils` | 8 `H` on `grid` the using a set of stencils `closure_stencils` for the points in |
9 for the points in the closure regions. If `inner_stencil` is omitted a central | 9 the closure regions and the stencil and `inner_stencil` in the interior. If |
10 interior stencil with weight 1 is used. | 10 `inner_stencil` is omitted a central interior stencil with weight 1 is used. |
11 | 11 |
12 On a one-dimensional `grid`, `H` is a `VolumeOperator`. On a multi-dimensional | 12 On a 1-dimensional `grid`, `H` is a `VolumeOperator`. On a N-dimensional |
13 `grid`, `H` is the outer product of the 1-dimensional quadrature operators in | 13 `grid`, `H` is the outer product of the 1-dimensional inner product operators in |
14 each coordinate direction. Also see the documentation of | 14 each coordinate direction. Also see the documentation of |
15 `SbpOperators.volume_operator(...)` for more details. On a 0-dimensional `grid`, | 15 `SbpOperators.volume_operator(...)` for more details. On a 0-dimensional `grid`, |
16 `H` is a 0-dimensional `IdentityMapping`. | 16 `H` is a 0-dimensional `IdentityMapping`. |
17 """ | 17 """ |
18 function quadrature(grid::EquidistantGrid, closure_stencils, inner_stencil = CenteredStencil(one(eltype(grid)))) | 18 function inner_product(grid::EquidistantGrid, closure_stencils, inner_stencil = CenteredStencil(one(eltype(grid)))) |
19 h = spacing(grid) | 19 h = spacing(grid) |
20 H = SbpOperators.volume_operator(grid, scale(inner_stencil,h[1]), scale.(closure_stencils,h[1]), even, 1) | 20 H = SbpOperators.volume_operator(grid, scale(inner_stencil,h[1]), scale.(closure_stencils,h[1]), even, 1) |
21 for i ∈ 2:dimension(grid) | 21 for i ∈ 2:dimension(grid) |
22 Hᵢ = SbpOperators.volume_operator(grid, scale(inner_stencil,h[i]), scale.(closure_stencils,h[i]), even, i) | 22 Hᵢ = SbpOperators.volume_operator(grid, scale(inner_stencil,h[i]), scale.(closure_stencils,h[i]), even, i) |
23 H = H∘Hᵢ | 23 H = H∘Hᵢ |
24 end | 24 end |
25 return H | 25 return H |
26 end | 26 end |
27 export quadrature | 27 export inner_product |
28 | 28 |
29 quadrature(grid::EquidistantGrid{0}, closure_stencils, inner_stencil) = IdentityMapping{eltype(grid)}() | 29 inner_product(grid::EquidistantGrid{0}, closure_stencils, inner_stencil) = IdentityMapping{eltype(grid)}() |