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.
Copy file name to clipboardExpand all lines: src/derivative_operators/BC_operators.jl
+88Lines changed: 88 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -165,6 +165,94 @@ Neumann0BC(dx::Union{AbstractVector{T}, T}, order = 1) where T = NeumannBC([zero
165
165
# other acceptable argument signatures
166
166
#RobinBC(al::T, bl::T, cl::T, dx_l::T, ar::T, br::T, cr::T, dx_r::T, order = 1) where T = RobinBC([al,bl, cl], [ar, br, cr], dx_l, order)
167
167
168
+
169
+
"""
170
+
BridgeBC(u_low::AbstractArray{T,N}, u_up::AbstractArray{T,N}, indslow, indsup) # A different view in to 2 diffferent arrays on each end of the boundary, indslow is an iterable of indicies that index u_low, which extends the lower index end. Analogous for u_up and indsup with the upper boundary.
171
+
172
+
BridgeBC(u::AbstractArray{T,N}, inds) # The same view in to some array u at the index inds extends the boundary
Creates two BC operators that join array `u1` to `u2` at the `hilo1` end ("high" or "low" index end), and joins `u2` to `u1` with simalar settings given in `hilo2`.
200
+
The ends of `u1` and `u2` that are not connected will use the boundary conditions `bc1` and `bc2` respectively.
201
+
202
+
Use `Q1` to extend `u1` and `Q2` to extend `u2`.
203
+
204
+
When using these with a time/space stepping solve, please use elementwise equals on your u1 and u2 to avoid the need to create new BC operators each time, as follows:
Creates two BC operators that join array `u1` to `u2` at the `hilo1` end ("high" or "low" index end) of dimension `dim1`, and joins `u2` to `u1` with simalar settings given in `hilo2` and `dim2`.
212
+
The ends of `u1` and `u2` that are not connected will use the boundary conditions `bc1` and `bc2` respectively.
213
+
214
+
Drop `dim1` and `dim2` when your `u1` and `u2` are vectors.
215
+
216
+
Use `Q1` to extend `u1` and `Q2` to extend `u2`.
217
+
218
+
When using these with a time/space stepping solve, please use elementwise equals on your u1 and u2 to avoid the need to create new BC operators each time, as follows:
219
+
u_t1 .= L*Q*u_t0
220
+
"""
221
+
functionBridgeBCBridgeBC(bc1::AtomicBC, u1::AbstractArray{T,1}, hilo1::String, hilo2::String, u2::AbstractArray{T,1}, bc2::AtomicBC) where T
throw("hilo2 not recognized, please use \"high\" to connect u1 to u2 along the upper index of dim2 of u2 or \"low\" to connect along the lower index end")
throw("hilo2 not recognized, please use \"high\" to connect u1 to u2 along the upper index of dim2 of u2 or \"low\" to connect along the lower index end")
247
+
end
248
+
else
249
+
throw("hilo1 not recognized, please use \"high\" to connect u1 to u2 along the upper index of dim1 of u1 or \"low\" to connect along the lower index end")
250
+
end
251
+
return (BC1, BC2)
252
+
end
253
+
254
+
Base.:*(Q::BridgeBC{T,I,N}, u::AbstractVector{T}) where {T, I, N} =BoundaryPaddedVector{T, typeof(u)}(Q.b_l[1], Q.b_r[1], u)
0 commit comments