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
# Create some rules to match which bundary/variable a bc concerns
40
+
# * Assume that the term of the condition is applied additively and has no multiplier/divisor/power etc.
40
41
# ? Is it nessecary to check whether all other args are present?
41
42
lower_boundary_rules =vec([@ruleoperation(u)(~~a, lowerboundary(x), ~~b) => IfElse.ifelse(all(y-> y invcat(~~a, ~~b), setdiff(x, arguments(u))), x, nothing) for x insetdiff(arguments(u), t), u in s.vars])
# depvarbcmaps will dictate what to replace the variable terms with in the bcs
105
105
# replace u(t,0) with u₁, etc
106
106
ufunc(v, I, x) = s.discvars[v][I]
107
-
107
+
# * Assume that the BC is in terms of an explicit expression, not containing references to variables other than u_ at the boundary
108
108
for u in s.vars
109
109
ifisequal(operation(u), operation(u_))
110
110
# What to replace derivatives at the boundary with
111
-
depvarderivbcmaps = [(Differential(x)^d)(u_) =>central_difference(derivweights.map[Differential(x_)^d], II, s, (s.x2i[x_],x_), u, ufunc) for d in derivweights.orders[x_]]
111
+
depvarderivbcmaps = [(Differential(x)^d)(u_) =>central_difference(derivweights.map[Differential(x_)^d], II, s, (s.x2i[x_],x_), u, ufunc) for d in derivweights.orders[x_]]
112
112
# ? Does this need to be done for all variables at the boundary?
# depvarbcmaps will dictate what to replace the variable terms with in the bcs
130
134
# replace u(t,0) with u₁, etc
135
+
# * Assume that the BC is in terms of an explicit expression, not containing references to variables other than u_ at the boundary
131
136
for u in s.vars
132
137
ifisequal(operation(u), operation(u_))
133
138
depvarderivbcmaps = [(Differential(x)^d)(u_) =>half_offset_centered_difference(derivweights.halfoffsetmap[Differential(x_)^d], II, s, offset(boundary), (s.x2i[x_],x_), u, ufunc) for d in derivweights.orders[x_]]
134
139
135
140
depvarbcmaps = [u_ =>half_offset_centered_difference(derivweights.interpmap[x_], II, s, offset(boundary), (s.x2i[x_],x_), u, ufunc)]
Copy file name to clipboardExpand all lines: src/discretization/discretize_vars.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,7 @@ params(s::DiscreteSpace{N,M}) where {N,M}= s.params
42
42
grid_idxs(s::DiscreteSpace) =CartesianIndices(((axes(g)[1] for g in s.grid)...,))
43
43
edge_idxs(s::DiscreteSpace{N}) where {N} =reduce(vcat, [[vcat([Colon() for j =1:i-1], 1, [Colon() for j = i+1:N]), vcat([Colon() for j =1:i-1], length(s.axies[i]), [Colon() for j = i+1:N])] for i =1:N])
44
44
45
-
axiesvals(s::DiscreteSpace{N}, I) where {N} = [x => s.axies[x][I[j]] for (j,x) inenumerate(s.nottime)]
Copy file name to clipboardExpand all lines: src/discretization/generate_finite_difference_rules.jl
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -148,7 +148,7 @@ There are of course more specific schemes that are used to improve stability/spe
148
148
##Planned special cases include:
149
149
- Up/Downwind schemes to be used for odd ordered derivatives multiplied by a coefficient, downwinding when the coefficient is positive, and upwinding when the coefficient is negative.
150
150
151
-
Please submit an issue if you know of any special cases that are not implemented, with links to papers and/or code that demonstrates the special case.
151
+
Please submit an issue if you know of any special cases which impact stability or accuracy that are not implemented, with links to papers and/or code that demonstrates the special case.
0 commit comments