annotate src/SbpOperators/volumeops/quadratures/quadrature.jl @ 689:728fd5a2455a feature/boundary_quads

Change order of arguments for quadrature, and make inner_stencil have a default argument
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 12 Feb 2021 16:43:29 +0100
parents 43cf58c69f91
children fc755b29d418
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
328
9cc5d1498b2d Refactor 1D diagonal inner product in quadrature.jl to separate file. Write tests for quadratures. Clean up laplace and secondderivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
1 """
689
728fd5a2455a Change order of arguments for quadrature, and make inner_stencil have a default argument
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 681
diff changeset
2 quadrature(grid::EquidistantGrid, closure_stencils, inner_stencil)
669
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
3 quadrature(grid::EquidistantGrid, closure_stencils)
638
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
4
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
5 Creates the quadrature operator `H` as a `TensorMapping`
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
6
669
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
7 `H` approximiates the integral operator on `grid` the using the stencil
638
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
8 `inner_stencil` in the interior and a set of stencils `closure_stencils`
669
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
9 for the points in the closure regions. If `inner_stencil` is omitted a central
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
10 interior stencil with weight 1 is used.
328
9cc5d1498b2d Refactor 1D diagonal inner product in quadrature.jl to separate file. Write tests for quadratures. Clean up laplace and secondderivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
11
638
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
12 On a one-dimensional `grid`, `H` is a `VolumeOperator`. On a multi-dimensional
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
13 `grid`, `H` is the outer product of the 1-dimensional quadrature operators in
640
0e20bfef5cee remove extra space
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 638
diff changeset
14 each coordinate direction. Also see the documentation of
689
728fd5a2455a Change order of arguments for quadrature, and make inner_stencil have a default argument
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 681
diff changeset
15 `SbpOperators.volume_operator(...)` for more details. On a 0-dimensional `grid`,
681
43cf58c69f91 Remove methods boundary_quadrature, and instead specialize quadrature on a zero-dimensional grid to return the IdentityMapping
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 675
diff changeset
16 `H` is a 0-dimensional `IdentityMapping`.
328
9cc5d1498b2d Refactor 1D diagonal inner product in quadrature.jl to separate file. Write tests for quadratures. Clean up laplace and secondderivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents:
diff changeset
17 """
689
728fd5a2455a Change order of arguments for quadrature, and make inner_stencil have a default argument
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 681
diff changeset
18 function quadrature(grid::EquidistantGrid, closure_stencils, inner_stencil = CenteredStencil(one(eltype(grid))))
638
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
19 h = spacing(grid)
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
20 H = SbpOperators.volume_operator(grid, scale(inner_stencil,h[1]), scale.(closure_stencils,h[1]), even, 1)
669
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
21 for i ∈ 2:dimension(grid)
638
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
22 Hᵢ = SbpOperators.volume_operator(grid, scale(inner_stencil,h[i]), scale.(closure_stencils,h[i]), even, i)
08b2c7a2d063 Implement the Quadrature operator as a VolumeOperator. Make DiagonalQuadrature a special case of the general Quadrature operator. Update tests.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 636
diff changeset
23 H = H∘Hᵢ
504
21fba50cb5b0 Use LazyOuterProduct to construct multi-dimensional quadratures. This change allwed to:
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 362
diff changeset
24 end
21fba50cb5b0 Use LazyOuterProduct to construct multi-dimensional quadratures. This change allwed to:
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 362
diff changeset
25 return H
21fba50cb5b0 Use LazyOuterProduct to construct multi-dimensional quadratures. This change allwed to:
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 362
diff changeset
26 end
669
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
27 export quadrature
2a95beb9ef1d Add methods for getting boundary quadratures of a grid. Align naming of quadrature operators.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 640
diff changeset
28
689
728fd5a2455a Change order of arguments for quadrature, and make inner_stencil have a default argument
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 681
diff changeset
29 quadrature(grid::EquidistantGrid{0}, closure_stencils, inner_stencil) = IdentityMapping{eltype(grid)}()