annotate src/SbpOperators/volumeops/laplace/laplace.jl @ 877:dd2ab001a7b6 feature/equidistant_grid/refine

Implement refine function, move exports to the top of the file, change location of constuctors. The constructors were changed have only one inner constructor and simpler outer constructors.
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 14 Feb 2022 09:39:58 +0100
parents b4acd25943f4
children 1784b1c0af3e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
624
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
1 """
690
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
2 laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils)
624
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
3
648
d6edde60909b Fix typo in documentation and remove obsolete out-commented code.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 624
diff changeset
4 Creates the Laplace operator operator `Δ` as a `TensorMapping`
624
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
5
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
6 `Δ` approximates the Laplace operator ∑d²/xᵢ² , i = 1,...,`Dim` on `grid`, using
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
7 the stencil `inner_stencil` in the interior and a set of stencils `closure_stencils`
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
8 for the points in the closure regions.
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
9
690
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
10 On a one-dimensional `grid`, `Δ` is equivalent to `second_derivative`. On a
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
11 multi-dimensional `grid`, `Δ` is the sum of multi-dimensional `second_derivative`s
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
12 where the sum is carried out lazily.
624
a85db383484f Update documentation and remove some out-commented lines
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 618
diff changeset
13 """
820
b4acd25943f4 Remove some more types and type parameters
Jonatan Werpers <jonatan@werpers.com>
parents: 690
diff changeset
14 function laplace(grid::EquidistantGrid, inner_stencil, closure_stencils)
690
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
15 Δ = second_derivative(grid, inner_stencil, closure_stencils, 1)
820
b4acd25943f4 Remove some more types and type parameters
Jonatan Werpers <jonatan@werpers.com>
parents: 690
diff changeset
16 for d = 2:dimension(grid)
690
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
17 Δ += second_derivative(grid, inner_stencil, closure_stencils, d)
356
0844069ab5ff Reinclude SbpOperators and fix most of the code and tests there.
Jonatan Werpers <jonatan@werpers.com>
parents: 333
diff changeset
18 end
611
e71f2f81b5f8 NOT WORKING: Draft implementation of VolumeOperator and make SecondDerivative specialize it. Reformulate Laplace for the new SecondDerivative.
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 542
diff changeset
19 return Δ
356
0844069ab5ff Reinclude SbpOperators and fix most of the code and tests there.
Jonatan Werpers <jonatan@werpers.com>
parents: 333
diff changeset
20 end
690
1accc3e051d0 Start changing the name of functions creating operators that are not types to lower case. E.g SecondDerivative->second_derivative
Vidar Stiernström <vidar.stiernstrom@it.uu.se>
parents: 648
diff changeset
21 export laplace