You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 19, 2023. It is now read-only.
central_neighbor_idxs(i,j) = [i+CartesianIndex([ifelse(l==j,-1,0) for l in1:length(nottime)]...),i,i+CartesianIndex([ifelse(l==j,1,0) for l in1:length(nottime)]...)]
# Replace symbol in the bc lhs with the spatial discretized term
78
92
lhs =substitute(lhs,depvarmaps[i])
79
93
rhs =substitute.((bc.rhs,),edgemaps[i])
80
94
lhs = lhs isa Vector ? lhs : [lhs] # handle 1D
@@ -84,7 +98,7 @@ function SciMLBase.symbolic_discretize(pdesys::ModelingToolkit.PDESystem,discret
84
98
u0 =reduce(vcat,u0)
85
99
bceqs =reduce(vcat,bceqs)
86
100
87
-
# Generate PDE Equations
101
+
### PDE EQUATIONS ###
88
102
interior = indices[[2:length(s)-1for s in space]...]
89
103
eqs =vec(map(Base.product(interior,pdeeqs)) do p
90
104
i,eq = p
@@ -93,10 +107,11 @@ function SciMLBase.symbolic_discretize(pdesys::ModelingToolkit.PDESystem,discret
93
107
# on discretization.centered_order
94
108
#TODO: Generalize central difference handling to allow higher even order derivatives
95
109
central_neighbor_idxs(i,j) = [i+CartesianIndex([ifelse(l==j,-1,0) for l in1:length(nottime)]...),i,i+CartesianIndex([ifelse(l==j,1,0) for l in1:length(nottime)]...)]
central_deriv_rules = [(Differential(nottime[j])^2)(pdesys.depvars[k]) =>dot(central_weights(i,j),depvars[k][central_neighbor_idxs(i,j)]) for j in1:length(nottime), k in1:length(pdesys.depvars)]
0 commit comments