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

Commit 32811aa

Browse files
more symbolics removal
1 parent 8b2327e commit 32811aa

File tree

2 files changed

+0
-59
lines changed

2 files changed

+0
-59
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2222
SparseDiffTools = "47a9eef4-7e08-11e9-0b38-333d64bd3804"
2323
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
2424
SuiteSparse = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
25-
SymbolicUtils = "d1185830-fcd6-423d-90d6-eec64667417b"
2625

2726
[compat]
2827
BandedMatrices = "0.15.11, 0.16"
@@ -40,7 +39,6 @@ RuntimeGeneratedFunctions = "0.4, 0.5"
4039
SciMLBase = "1.11"
4140
SparseDiffTools = "1.17"
4241
StaticArrays = "0.10, 0.11, 0.12, 1.0"
43-
SymbolicUtils = "0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18"
4442
julia = "1.6"
4543

4644
[extras]

src/utils.jl

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
using SymbolicUtils
2-
31
"""
42
A function that creates a tuple of CartesianIndices of unit length and `N` dimensions, one pointing along each dimension.
53
"""
@@ -22,61 +20,6 @@ function cartesian_to_linear(I::CartesianIndex, s) #Not sure if there is a buil
2220
return out
2321
end
2422

25-
# Counts the Differential operators for given variable x. This is used to determine
26-
# the order of a PDE.
27-
function count_differentials(term, x::Symbolics.Symbolic)
28-
S = Symbolics
29-
SU = SymbolicUtils
30-
if !S.istree(term)
31-
return 0
32-
else
33-
op = SU.operation(term)
34-
count_children = sum(map(arg -> count_differentials(arg, x), SU.arguments(term)))
35-
if op isa Differential && op.x === x
36-
return 1 + count_children
37-
end
38-
return count_children
39-
end
40-
end
41-
42-
# return list of differential orders in the equation
43-
function differential_order(eq, x::Symbolics.Symbolic)
44-
S = Symbolics
45-
SU = SymbolicUtils
46-
orders = Set{Int}()
47-
if S.istree(eq)
48-
op = SU.operation(eq)
49-
if op isa Differential
50-
push!(orders, count_differentials(eq, x))
51-
else
52-
for o in map(ch -> differential_order(ch, x), SU.arguments(eq))
53-
union!(orders, o)
54-
end
55-
end
56-
end
57-
return filter(!iszero, orders)
58-
end
59-
60-
# find all the dependent variables given by depvar_ops in an expression
61-
function get_depvars(eq,depvar_ops)
62-
S = Symbolics
63-
SU = SymbolicUtils
64-
depvars = Set()
65-
if eq isa Num
66-
eq = eq.val
67-
end
68-
if S.istree(eq)
69-
if eq isa Term && any(u->isequal(operation(eq),u),depvar_ops)
70-
push!(depvars, eq)
71-
else
72-
for o in map(x->get_depvars(x,depvar_ops), SU.arguments(eq))
73-
union!(depvars, o)
74-
end
75-
end
76-
end
77-
depvars
78-
end
79-
8023
add_dims(A::AbstractArray, n::Int; dims::Int = 1) = cat(ndims(A) + n, A, dims = dims)
8124

8225
""

0 commit comments

Comments
 (0)