view src/BoundaryConditions/sat.jl @ 1485:e96ee7d7ac9c feature/boundary_conditions

Test sat_tensors for Laplace w. Neumann conditions
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Mon, 25 Dec 2023 23:39:56 +0100
parents abc5cc0aec94
children 37b05221beda
line wrap: on
line source

"""
    sat_tensors(op, grid, bc::BoundaryCondition, params...)

The tensor and boundary operator used to construct a simultaneous-approximation-term
for imposing `bc` related to `op`.

For `sat_op, L  = sat_tensors(...)` then `SAT = sat_op*(L*u - g)`  where `g` 
is the boundary data.
"""
function sat_tensors end


"""
    sat(op, grid, bc::BoundaryCondition, params...)

Simultaneous-Approximation-Term for a general `bc` to `op`. 
Returns a function `SAT(u,g)` weakly imposing `bc` when added to `op*u`.

`op` must implement the function `sat_tensors`.
"""
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