Mercurial > repos > public > sbplib_julia
diff src/SbpOperators/stencil_set.jl @ 1596:84dc3b9b449b feature/boundary_conditions
Add positivity properties (the borrowing capacity) of the D2 operators to the operator toml as well as methods to parse them
author | Vidar Stiernström <vidar.stiernstrom@gmail.com> |
---|---|
date | Sun, 26 May 2024 18:13:58 -0700 |
parents | d7bc11053951 |
children | 8315c456e3b4 |
line wrap: on
line diff
--- a/src/SbpOperators/stencil_set.jl Sun May 26 17:35:52 2024 -0700 +++ b/src/SbpOperators/stencil_set.jl Sun May 26 18:13:58 2024 -0700 @@ -166,6 +166,17 @@ return Tuple(parse_scalar.(parsed_toml)) end +""" + parse_named_tuple(parsed_toml) + +Parse the keys (names) and values (scalars) into a named tuple of rationals. + +See also [`parse_scalar`](@ref). +""" +function parse_named_tuple(parsed_toml) + NamedTuple(Symbol(key) => parse_scalar(val) for (key, val) in parsed_toml) +end + """ parse_rational(parsed_toml)