Mercurial > repos > public > sbplib_julia
comparison src/SbpOperators/boundary_conditions/sat.jl @ 1618:77f192b05b1d feature/boundary_conditions
REVIEW: Suggest changes to doc strings in sat.jl
author | Jonatan Werpers <jonatan@werpers.com> |
---|---|
date | Tue, 11 Jun 2024 00:12:06 +0200 |
parents | fca4a01d60c9 |
children |
comparison
equal
deleted
inserted
replaced
1617:a00fa58e9fb0 | 1618:77f192b05b1d |
---|---|
1 """ | 1 """ |
2 sat_tensors(op, grid, bc::BoundaryCondition, params...) | 2 sat_tensors(op, grid, bc::BoundaryCondition; kwargs...) |
3 | 3 |
4 The tensor and boundary operator used to construct a simultaneous-approximation-term | 4 The penalty tensor and boundary operator used to construct a |
5 for imposing `bc` related to `op`. | 5 simultaneous-approximation-term for imposing `bc` related to `op`. |
6 | 6 |
7 For `penalty_tensor, L = sat_tensors(...)` then `SAT = penalty_tensor*(L*u - g)` where `g` | 7 For `penalty_tensor, L = sat_tensors(...)` then `SAT(u,g) = |
8 is the boundary data. | 8 penalty_tensor*(L*u - g)` where `g` is the boundary data. |
9 """ | 9 """ |
10 function sat_tensors end | 10 function sat_tensors end |
11 | 11 |
12 | 12 |
13 """ | 13 """ |
14 sat(op, grid, bc::BoundaryCondition; kwargs...) | 14 sat(op, grid, bc::BoundaryCondition; kwargs...) |
15 | 15 |
16 Simultaneous-Approximation-Term for a general `bc` to `op`. | 16 Simultaneous-Approximation-Term for a general `bc` to `op`. Returns a function |
17 Returns a function `SAT(u,g)` weakly imposing `bc` when added to `op*u`. | 17 `SAT(u,g)` weakly imposing `bc` when added to `op*u`. |
18 | 18 |
19 `op` must implement the function `sat_tensors`. | 19 Internally `sat_tensors(op, grid, bc; ...)` is called to construct the |
20 necessary parts for the SAT. | |
20 """ | 21 """ |
21 function sat(op, grid, bc::BoundaryCondition; kwargs...) | 22 function sat(op, grid, bc::BoundaryCondition; kwargs...) |
22 penalty_tensor, L = sat_tensors(op, grid, bc; kwargs...) | 23 penalty_tensor, L = sat_tensors(op, grid, bc; kwargs...) |
23 return SAT(u, g) = penalty_tensor*(L*u - g) | 24 return SAT(u, g) = penalty_tensor*(L*u - g) |
24 end | 25 end |