Skip to content

Commit

Permalink
remove PreallocationTools again
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLampert committed Jun 14, 2024
1 parent fd470ee commit 7f54a30
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 14 deletions.
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LoopVectorization = "bdcacae8-1622-11e9-2a5c-532679323890"
MuladdMacro = "46d2c3a1-f734-5fdb-9937-b9b9aeba4221"
PolynomialBases = "c74db56a-226d-5e98-8bb0-a6049094aeea"
PreallocationTools = "d236fae5-4411-538c-8e31-a6e3d9e00b46"
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Expand Down Expand Up @@ -51,7 +50,6 @@ LoopVectorization = "0.12.22"
MuladdMacro = "0.2"
Optim = "1"
PolynomialBases = "0.4.15"
PreallocationTools = "0.4"
PrecompileTools = "1.0.1"
RecursiveArrayTools = "2.11, 3"
Reexport = "0.2, 1.0"
Expand Down
13 changes: 2 additions & 11 deletions ext/SummationByPartsOperatorsOptimForwardDiffExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ using ForwardDiff: ForwardDiff

using SummationByPartsOperators: SummationByPartsOperators, GlaubitzNordströmÖffner2023, MatrixDerivativeOperator
using LinearAlgebra: Diagonal, LowerTriangular, dot, diag, norm, mul!
using PreallocationTools: DiffCache, get_tmp
using SparseArrays: spzeros

function SummationByPartsOperators.function_space_operator(basis_functions, nodes::Vector{T},
Expand Down Expand Up @@ -120,13 +119,9 @@ function construct_function_space_operator(basis_functions, nodes,
A = zeros(eltype(nodes), N, K)
SV = zeros(eltype(nodes), N, K)
PV_x = zeros(eltype(nodes), N, K)
S_cache = DiffCache(S)
A_cache = DiffCache(A)
SV_cache = DiffCache(SV)
PV_x_cache = DiffCache(PV_x)
daij_dsigmak = zeros(eltype(nodes), N, K, L)
daij_drhok = zeros(eltype(nodes), N, K, N)
p = (V, V_x, R, x_length, S_cache, A_cache, SV_cache, PV_x_cache, daij_dsigmak, daij_drhok)
p = (V, V_x, R, x_length, S, A, SV, PV_x, daij_dsigmak, daij_drhok)

x0 = zeros(L + N)
fg!(F, G, x) = optimization_function_and_grad!(F, G, x, p)
Expand All @@ -144,11 +139,7 @@ function construct_function_space_operator(basis_functions, nodes,
end

@views function optimization_function_and_grad!(F, G, x, p)
V, V_x, R, x_length, S_cache, A_cache, SV_cache, PV_x_cache, daij_dsigmak, daij_drhok = p
S = get_tmp(S_cache, x)
A = get_tmp(A_cache, x)
SV = get_tmp(SV_cache, x)
PV_x = get_tmp(PV_x_cache, x)
V, V_x, R, x_length, S, A, SV, PV_x, daij_dsigmak, daij_drhok = p
(N, _) = size(R)
L = div(N * (N - 1), 2)
sigma = x[1:L]
Expand Down
2 changes: 1 addition & 1 deletion test/aqua.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ using SummationByPartsOperators
Aqua.test_all(SummationByPartsOperators;
ambiguities = false, # a lot of false positives from dependencies
unbound_args = false, # TODO: a strange problem I do not understand right now
stale_deps = (; ignore = [:PrecompileTools, :PreallocationTools]),
stale_deps = (; ignore = [:PrecompileTools]),
)

0 comments on commit 7f54a30

Please sign in to comment.