comparison Notes.md @ 1217:ea2e8254820a feature/boundary_conditions

Update docstrings and start implementing tests
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Tue, 07 Feb 2023 21:55:07 +0100
parents 6757cc9ba22e
children bdcdbd4ea9cd
comparison
equal deleted inserted replaced
1167:fd80e9a0ef99 1217:ea2e8254820a
2 2
3 ## Boundary Conditions and SATs 3 ## Boundary Conditions and SATs
4 4
5 Types for boundary conditions: 5 Types for boundary conditions:
6 6
7 * abstract type `BoundaryDataType` 7 * abstract type `BoundaryData`
8 * abstract type `BoundaryCondition{T<:BoundaryDataType}` 8 * abstract type `BoundaryCondition{T<:BoundaryData}`
9 * concrete types `ConstantBoundaryData <: BoundaryDataType` and similar 9 * concrete types `ConstantBoundaryData <: BoundaryData` and similar
10 * concrete types `NeumannCondition{BDT<:BoundaryDataType} <: BoundaryCondition{BDT}` and similar 10 * concrete types `NeumannCondition{BD<:BoundaryData} <: BoundaryCondition{BD}` and similar
11 The concrete `BoundaryDataType` subtypes are "thin types" wrapping the boundary data, and are used to indicate how the boundary data should be used in e.g. sat routines. The concrete `BoundaryCondition{BDT}` subtypes are used for assembling the tensors used to construct e.g. a SAT. 11 The concrete `BoundaryData` subtypes are "thin types" wrapping the boundary data, and are used to indicate how the boundary data should be used in e.g. sat routines. The concrete `BoundaryCondition{BD}` subtypes are used for assembling the tensors used to construct e.g. a SAT.
12 12
13 SAT methods: 13 SAT methods:
14 There are multiple options for what the SAT methods could return. 14 There are multiple options for what the SAT methods could return.
15 * (Current) a function which returns a `LazyTensorApplication`, e.g. `f = sat(grid,op,bc)`. The the resulting `LazyTensorApplication` can then be added to scheme i.e. `scheme = op*u + f(u)`. This is how one typically would write the SAT in the litterature. Depdending on the type of data in the BC, e.g. time-depdendent etc one can return f(u,t). 15 * (Current) a function which returns a `LazyTensorApplication`, e.g. `f = sat(grid,op,bc)`. The the resulting `LazyTensorApplication` can then be added to scheme i.e. `scheme = op*u + f(u)`. Depdending on the type of data in the BC, e.g. time-depdendent etc one can return f(u,t).
16 * `LazyTensor`s `closure, penalty = sat(grid,op,bc)` like in the matlab version. Probably the most general one. Up to the user to make use of the returned `LazyTensor`s. One can for example then easily include the closures to the operator and have eg. `D = (op + closure)*u`. 16 * `LazyTensor`s `closure, penalty = sat(grid,op,bc)` like in the matlab version. Probably the most general one. Up to the user to make use of the returned `LazyTensor`s. One can for example then easily include the closures to the operator and have eg. `D = (op + closure)*u`.
17 * A `LazyTensor` for closure, and a `LazyArray` for `penalty*data`. Mix of the above. 17 * A `LazyTensor` for closure, and a `LazyArray` for `penalty*data`. Mix of the above.
18 18 * Same as first but of the form sat = `sat_op*(L*u-g)`. This is how one typically would write the SAT in the litterature. The function `sat_tensors` would return `sat_op` and `L`. Need to get compositions working before we can implement this approach.
19 It is not clear if any of these are preferable as it currently stands. 19
20 20
21 ## Reading operators 21 ## Reading operators
22 22
23 Jonatan's suggestion is to add methods to `Laplace`, `SecondDerivative` and 23 Jonatan's suggestion is to add methods to `Laplace`, `SecondDerivative` and
24 similar functions that take in a filename from which to read stencils. These 24 similar functions that take in a filename from which to read stencils. These