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

Commit 8b2327e

Browse files
Make dual types concrete and strip out the rest of MOL
1 parent 6bbe541 commit 8b2327e

File tree

8 files changed

+14
-93
lines changed

8 files changed

+14
-93
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ LazyArrays = "5078a376-72f3-5289-bfd5-ec5146d43c02"
1313
LazyBandedMatrices = "d7e5e226-e90b-4449-9968-0f923699bf6f"
1414
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1515
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
16-
ModelingToolkit = "961ee093-0014-501f-94e3-6117800e7a78"
1716
NNlib = "872c559c-99b0-510c-b3b7-b6c96a88d5cd"
1817
NonlinearSolve = "8913a72c-1f9b-4ce2-8d82-65094dcecaec"
1918
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
@@ -34,7 +33,6 @@ ForwardDiff = "0.10"
3433
LazyArrays = "0.17, 0.18, 0.19, 0.20, 0.21, 0.22"
3534
LazyBandedMatrices = "0.5, 0.6, 0.7"
3635
LoopVectorization = "0.12"
37-
ModelingToolkit = "7, 8"
3836
NNlib = "0.6, 0.7"
3937
NonlinearSolve = "0.3.7"
4038
Requires = "1"

docs/src/index.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
# DiffEqOperators.jl
22

33
DiffEqOperators.jl is a package for finite difference discretization of partial
4-
differential equations. It serves two purposes:
4+
differential equations. It is for building fast lazy operators for high order
5+
non-uniform finite differences.
56

6-
1. Building fast lazy operators for high order non-uniform finite differences.
7-
2. Automated finite difference discretization of symbolically-defined PDEs.
7+
!!! note
8+
9+
For automated finite difference discretization of symbolically-defined PDEs,
10+
see [MethodOfLines.jl](https://github.com/SciML/MethodOfLines.jl).
811

9-
#### Note: (2) is still a work in progress!
1012

1113
For the operators, both centered and
1214
[upwind](https://en.wikipedia.org/wiki/Upwind_scheme) operators are provided,

docs/src/symbolic/molfinitedifference.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

src/DiffEqOperators.jl

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using SciMLBase: AbstractDiffEqLinearOperator, AbstractDiffEqCompositeOperator,
99
import SciMLBase: getops
1010
using SparseDiffTools
1111
using SparseArrays, ForwardDiff, BandedMatrices, NNlib, LazyArrays, BlockBandedMatrices, LoopVectorization
12-
using LazyBandedMatrices, ModelingToolkit
12+
using LazyBandedMatrices
1313
using RuntimeGeneratedFunctions
1414
using Requires
1515
RuntimeGeneratedFunctions.init(@__MODULE__)
@@ -56,9 +56,6 @@ include("docstrings.jl")
5656
### Concretizations
5757
include("derivative_operators/concretization.jl")
5858

59-
### MOL
60-
include("MOLFiniteDifference/MOL_discretization.jl")
61-
6259
# The (u,p,t) and (du,u,p,t) interface
6360
for T in [DiffEqScaledOperator, DiffEqOperatorCombination, DiffEqOperatorComposition, GhostDerivativeOperator]
6461
(L::T)(u,p,t) = (update_coefficients!(L,u,p,t); L * u)
@@ -82,9 +79,7 @@ export DirichletBC, Dirichlet0BC, NeumannBC, Neumann0BC, RobinBC, GeneralBC, Mul
8279
MultiDimDirectionalBC, ComposedMultiDimBC
8380
export compose, decompose, perpsize, square_norm, square_norm!, dot_product, dot_product!, cross_product,
8481
cross_product!
85-
export discretize, symbolic_discretize
8682

8783
export GhostDerivativeOperator
88-
export MOLFiniteDifference, center_align, edge_align
8984
export BoundaryConditionError
9085
end # module

src/MOLFiniteDifference/MOL_discretization.jl

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/jacvec_operators.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ mutable struct JacVecOperator{T,F,T1,T2,uType,P,tType,O} <:
4242
opnorm = true,
4343
) where {T}
4444
if autodiff
45-
cache1 = ForwardDiff.Dual{SparseDiffTools.DeivVecTag}.(u, u)
46-
cache2 = ForwardDiff.Dual{SparseDiffTools.DeivVecTag}.(u, u)
45+
cache1 = ForwardDiff.Dual{typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(),eltype(x))),eltype(x),1}.(u, u)
46+
cache2 = ForwardDiff.Dual{typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(),eltype(x))),eltype(x),1}.(u, u)
4747
else
4848
cache1 = similar(u)
4949
cache2 = similar(u)

test/Misc/jacvec_integration_test.jl

Lines changed: 0 additions & 48 deletions
This file was deleted.

test/Misc/jacvec_operators.jl

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ x = rand(300)
77
v = rand(300)
88
du = similar(x)
99

10-
cache1 = ForwardDiff.Dual{SparseDiffTools.DeivVecTag}.(x, v)
11-
cache2 = ForwardDiff.Dual{SparseDiffTools.DeivVecTag}.(x, v)
10+
cache1 = ForwardDiff.Dual{typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(),eltype(x))),eltype(x),1}.(x, v)
11+
cache2 = ForwardDiff.Dual{typeof(ForwardDiff.Tag(SparseDiffTools.DeivVecTag(),eltype(x))),eltype(x),1}.(x, v)
1212
@test num_jacvec!(du, f, x, v) ForwardDiff.jacobian(f, similar(x), x) * v rtol =
1313
1e-6
1414
@test num_jacvec!(du, f, x, v, similar(v), similar(v))
@@ -81,13 +81,11 @@ ff2 = ODEFunction(
8181
jac_prototype = JacVecOperator{Float64}(lorenz, u0, autodiff = false),
8282
)
8383

84-
8584
for ff in [ff1, ff2]
8685
prob = ODEProblem(ff, u0, tspan)
8786
@test solve(prob, TRBDF2()).retcode == :Success
88-
@test solve(prob, TRBDF2(linsolve = LinSolveGMRES())).retcode == :Success
87+
@test solve(prob, TRBDF2(linsolve = KrylovJL_GMRES())).retcode == :Success
8988
@test solve(prob, Exprb32()).retcode == :Success
90-
@test_broken sol = solve(prob, Rosenbrock23())
91-
@test_broken sol =
92-
solve(prob, Rosenbrock23(linsolve = LinSolveGMRES(tol = 1e-10)))
89+
@test sol = solve(prob, Rosenbrock23()).retcode == :Success
90+
@test sol = solve(prob, Rosenbrock23(linsolve = KrylovJL_GMRES())).retcode == :Success
9391
end

0 commit comments

Comments
 (0)