From c3dac15b9c39449f84618d65da5be24b06622164 Mon Sep 17 00:00:00 2001 From: xtalax Date: Wed, 8 Feb 2023 17:18:57 +0000 Subject: [PATCH] update --- src/composite_operators.jl | 4 ++-- src/derivative_operators/derivative_operator_functions.jl | 4 ++-- src/derivative_operators/ghost_derivative_operator.jl | 2 +- src/docstrings.jl | 4 ++-- src/jacvec_operators.jl | 4 ++-- src/vecjac_operators.jl | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/composite_operators.jl b/src/composite_operators.jl index a9151917b..e1c0e54b6 100644 --- a/src/composite_operators.jl +++ b/src/composite_operators.jl @@ -14,7 +14,7 @@ sparse1(A::DiffEqScaledOperator) = A.coeff * sparse1(A.op) # Linear Combination struct DiffEqOperatorCombination{T, O <: Tuple{Vararg{AbstractDiffEqLinearOperator{T}}}, C <: AbstractVector{T}} <: - AbstractDiffEqCompositeOperator{T} + SciMLBase.AbstractDiffEqCompositeOperator{T} ops::O cache::C function DiffEqOperatorCombination(ops; cache = nothing) @@ -77,7 +77,7 @@ end # Composition (A ∘ B) struct DiffEqOperatorComposition{T, O <: Tuple{Vararg{AbstractDiffEqLinearOperator{T}}}, C <: Tuple{Vararg{AbstractVector{T}}}} <: - AbstractDiffEqCompositeOperator{T} + SciMLBase.AbstractDiffEqCompositeOperator{T} ops::O # stored in the order of application caches::C function DiffEqOperatorComposition(ops; caches = nothing) diff --git a/src/derivative_operators/derivative_operator_functions.jl b/src/derivative_operators/derivative_operator_functions.jl index d2906750b..3d856b81a 100644 --- a/src/derivative_operators/derivative_operator_functions.jl +++ b/src/derivative_operators/derivative_operator_functions.jl @@ -184,7 +184,7 @@ end # A more efficient mul! implementation for compositions of operators which may include regular-grid, centered difference, # scalar coefficient, non-winding, DerivativeOperator, operating on a 2-D or 3-D AbstractArray -function LinearAlgebra.mul!(x_temp::AbstractArray{T, 2}, A::AbstractDiffEqCompositeOperator, +function LinearAlgebra.mul!(x_temp::AbstractArray{T, 2}, A::SciMLBase.AbstractDiffEqCompositeOperator, M::AbstractArray{T, 2}) where {T} # opsA operators satisfy conditions for NNlib.conv! call, opsB operators do not @@ -447,7 +447,7 @@ end # A more efficient mul! implementation for compositions of operators which may include regular-grid, centered difference, # scalar coefficient, non-winding, DerivativeOperator, operating on a 2-D or 3-D AbstractArray -function LinearAlgebra.mul!(x_temp::AbstractArray{T, 3}, A::AbstractDiffEqCompositeOperator, +function LinearAlgebra.mul!(x_temp::AbstractArray{T, 3}, A::SciMLBase.AbstractDiffEqCompositeOperator, M::AbstractArray{T, 3}) where {T} # opsA operators satisfy conditions for NNlib.conv! call, opsB operators do not diff --git a/src/derivative_operators/ghost_derivative_operator.jl b/src/derivative_operators/ghost_derivative_operator.jl index 408f538ab..7298cccbd 100644 --- a/src/derivative_operators/ghost_derivative_operator.jl +++ b/src/derivative_operators/ghost_derivative_operator.jl @@ -8,7 +8,7 @@ function *(L::AbstractDiffEqLinearOperator{T}, Q::AbstractBC{T}) where {T} return GhostDerivativeOperator{T, typeof(L), typeof(Q)}(L, Q) end -function *(L::AbstractDiffEqCompositeOperator{T}, Q::AbstractBC{T}) where {T} +function *(L::SciMLBase.AbstractDiffEqCompositeOperator{T}, Q::AbstractBC{T}) where {T} return sum(map(op -> op * Q, L.ops)) end diff --git a/src/docstrings.jl b/src/docstrings.jl index e15ff9b53..e396f30f9 100644 --- a/src/docstrings.jl +++ b/src/docstrings.jl @@ -24,7 +24,7 @@ calculate_weights Represent a finite-difference derivative operator. -These operators implement the `DiffEqBase.AbstractDiffEqLinearOperator` interface. Therefore, `eltype` returns `T`. +These operators implement the `SciMLBase.AbstractDiffEqLinearOperator` interface. Therefore, `eltype` returns `T`. These operators can be contracted over an arbitrary dimension, given by the type parameter `N`. @@ -34,7 +34,7 @@ The finite-difference methods are defined for `DerivativeOperator`. In particula The key data are three stencils of coefficients, stored in `SVector`s. The interior stencil, stored in `stencil_coefs::S1`, is the normal one used in the interior of the grid. The others, `low_boundary_coefs::S2` and `high_boundary_coefs::S2`, are used where the normal stencil would jut out of the grid boundary. These can have a different length than the interior stencil, hence the two types. -When the operator is applied by `mul!`, these stencils are multiplied by the vector in the `coefficients` field. It is set to `coeff_func.(1:len)` in `UpwindDifference`, which seems odd, because `len` is not the stencil length. Scalar multiplication is absorbed into this vector, as required by the `DiffEqBase.AbstractDiffEqLinearOperator` interface. +When the operator is applied by `mul!`, these stencils are multiplied by the vector in the `coefficients` field. It is set to `coeff_func.(1:len)` in `UpwindDifference`, which seems odd, because `len` is not the stencil length. Scalar multiplication is absorbed into this vector, as required by the `SciMLBase.AbstractDiffEqLinearOperator` interface. The `coefficients` field appears to be a more general `DifferentialEquations` thing. There is an `update_coefficients!` method. diff --git a/src/jacvec_operators.jl b/src/jacvec_operators.jl index 3248ec213..c2980665a 100644 --- a/src/jacvec_operators.jl +++ b/src/jacvec_operators.jl @@ -1,6 +1,6 @@ ### Operator Implementation mutable struct JacVecOperator{T, F, T1, T2, uType, P, tType, O} <: - DiffEqBase.AbstractDiffEqLinearOperator{T} + SciMLBase.AbstractDiffEqLinearOperator{T} f::F cache1::T1 cache2::T2 @@ -151,7 +151,7 @@ end ### AnalyticalOperator Implementation mutable struct AnalyticalJacVecOperator{T, F, uType, P, tType, O} <: - DiffEqBase.AbstractDiffEqLinearOperator{T} + SciMLBase.AbstractDiffEqLinearOperator{T} f::F u::uType p::P diff --git a/src/vecjac_operators.jl b/src/vecjac_operators.jl index 7b87f02b1..759e40ef7 100644 --- a/src/vecjac_operators.jl +++ b/src/vecjac_operators.jl @@ -1,5 +1,5 @@ mutable struct VecJacOperator{T, F, T1, T2, uType, P, tType, O} <: - DiffEqBase.AbstractDiffEqLinearOperator{T} + SciMLBase.AbstractDiffEqLinearOperator{T} f::F cache1::T1 cache2::T2