Mercurial > repos > public > sbplib_julia
view src/BoundaryConditions/sat.jl @ 1479:b96858a50e35 feature/boundary_conditions
Add tests for SAT
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Sat, 23 Dec 2023 23:01:28 +0100 |
parents | 35840a0681d1 |
children | abc5cc0aec94 |
line wrap: on
line source
""" sat_tensors(op, grid, bc::BoundaryCondition, params...) Returns the functions `closure(u)` and `penalty(g)` used to construct a SAT for the `LazyTensor` operator `op` on `grid` associated with the boundary condition `bc`, where g is the discretized data of `bc`. """ function sat_tensors end """ sat(op, grid, bc::BoundaryCondition, params...) Simultaneous-Approximation-Term for a general `BoundaryCondition` `bc` to `LazyTensor` `op`. The function returns a function `f`, where f(t,u)` returns a `LazyTensorApplication` weakly imposing the boundary condition at time `t`, when added to `op*u`. `op` must implement the function `sat_tensors`. `f` is then constructed as `f(t,u) = closure(u) + `penalty(g(t))`. """ function sat(op, grid, bc::BoundaryCondition, params...) sat_op, L = sat_tensors(op, grid, bc, params...) return SAT(u, g) = sat_op*(L*u - g) end