From 48d6cf9fb9ef81de7c189069c784a2fac15c6dd6 Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Sun, 18 Jun 2023 14:35:24 -0400 Subject: [PATCH 1/2] 3 arg default_update_func --- src/interface.jl | 11 +++++++---- src/matrix.jl | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/interface.jl b/src/interface.jl index a428ac43..3b2f3dcf 100644 --- a/src/interface.jl +++ b/src/interface.jl @@ -5,21 +5,24 @@ ### """ -$SIGNATURES + DEFAULT_UPDATE_FUNC(u, p, t) -> nothing + + DEFAULT_UPDATE_FUNC(A, u, p, t) -> A The default update function for `AbstractSciMLOperator`s, a no-op that leaves the operator state unchanged. """ +DEFAULT_UPDATE_FUNC(u, p, t) = nothing DEFAULT_UPDATE_FUNC(A, u, p, t) = A const UPDATE_COEFFS_WARNING = """ !!! warning - The user-provided `update_func[!]` must not use `u` in - its computation. Positional argument `(u, p, t)` to `update_func[!]` are + The user-provided `update_func` must not use `u` in + its computation. Positional argument `(u, p, t)` to `update_func` are passed down by `update_coefficients[!](L, u, p, t)`, where `u` is the input-vector to the composite `AbstractSciMLOperator`. For that reason, the values of `u`, or even shape, may not correspond to the input - expected by `update_func[!]`. If an operator's state depends on its + expected by `update_func`. If an operator's state depends on its input vector, then it is, by definition, a nonlinear operator. We recommend sticking such nonlinearities in `FunctionOperator.` This topic is further discussed in diff --git a/src/matrix.jl b/src/matrix.jl index 992e5cca..34cce8e6 100644 --- a/src/matrix.jl +++ b/src/matrix.jl @@ -9,6 +9,7 @@ to `update_coefficients[!](L, u, p, t)`. Both recursively call the `update_function`, `update_func` which is assumed to have the signature update_func(A::AbstractMatrix, u, p, t; ) -> newA + or update_func!(A::AbstractMatrix, u ,p , t; ) -> [modifies A] From d8527f08189d36967540c9c50a6c1296e90321a5 Mon Sep 17 00:00:00 2001 From: Vedant Puri Date: Sun, 18 Jun 2023 23:22:39 -0400 Subject: [PATCH 2/2] bump project.toml --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 627f4264..bcd4478e 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SciMLOperators" uuid = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" authors = ["Vedant Puri "] -version = "0.3.1" +version = "0.4.0" [deps] ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"