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

Commit 99a2e70

Browse files
Merge pull request #362 from SciML/myb/p
Remove occursin piracy
2 parents 28d2930 + 0206de1 commit 99a2e70

1 file changed

Lines changed: 1 addition & 18 deletions

File tree

src/MOLFiniteDifference/MOL_discretization.jl

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function SciMLBase.symbolic_discretize(pdesys::ModelingToolkit.PDESystem,discret
8787
# Replace Differential terms in the bc lhs with the symbolic spatially discretized terms
8888
# TODO: Fix Neumann and Robin on higher dimension
8989
lhs = length(nottime) == 1 ? substitute(bc.lhs,depvarderivmaps[i]) : bc.lhs
90-
90+
9191
# Replace symbol in the bc lhs with the spatial discretized term
9292
lhs = substitute(lhs,depvarmaps[i])
9393
rhs = substitute.((bc.rhs,),edgemaps[i])
@@ -140,20 +140,3 @@ function SciMLBase.discretize(pdesys::ModelingToolkit.PDESystem,discretization::
140140
simpsys = structural_simplify(sys)
141141
prob = ODEProblem(simpsys,Pair[],tspan)
142142
end
143-
144-
# Piracy, to be deleted when https://github.com/JuliaSymbolics/SymbolicUtils.jl/pull/251
145-
# merges
146-
Base.occursin(needle::ModelingToolkit.SymbolicUtils.Symbolic, haystack::ModelingToolkit.SymbolicUtils.Symbolic) = _occursin(needle, haystack)
147-
Base.occursin(needle, haystack::ModelingToolkit.SymbolicUtils.Symbolic) = _occursin(needle, haystack)
148-
Base.occursin(needle::ModelingToolkit.SymbolicUtils.Symbolic, haystack) = _occursin(needle, haystack)
149-
function _occursin(needle, haystack)
150-
isequal(needle, haystack) && return true
151-
152-
if istree(haystack)
153-
args = arguments(haystack)
154-
for arg in args
155-
occursin(needle, arg) && return true
156-
end
157-
end
158-
return false
159-
end

0 commit comments

Comments
 (0)