Mercurial > repos > public > sbplib_julia
annotate src/SbpOperators/volumeops/laplace/laplace.jl @ 725:e5b51c82f83b feature/static_dict
Docstring for pair type functions
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Wed, 17 Mar 2021 20:16:20 +0100 |
parents | 1accc3e051d0 |
children | 3cd582257072 b4acd25943f4 |
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 """ |
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
|
14 function laplace(grid::EquidistantGrid{Dim}, inner_stencil, closure_stencils) where Dim |
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) |
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
|
16 for d = 2:Dim |
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 |