Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

update for scimlops #541

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/composite_operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/derivative_operators/derivative_operator_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/derivative_operators/ghost_derivative_operator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/docstrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand All @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions src/jacvec_operators.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/vecjac_operators.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down