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.
(length(padded_arrays) == N) ||throw("The padded_arrays must cover every dimension - make sure that the number of padded_arrays is equal to ndims(u).")
60
+
(length(padded_arrays) == N) ||throw(ArgumentError("The padded_arrays must cover every dimension - make sure that the number of padded_arrays is equal to ndims(u)."))
61
61
for D in Ds
62
-
length(setdiff(Ds, D)) == (N-1) ||throw("There are multiple Arrays that extend along $D - make sure every dimension has a unique extension")
62
+
length(setdiff(Ds, D)) == (N-1) ||throw(ArgumentError("There are multiple Arrays that extend along dimension $D - make sure every dimension has a unique extension"))
63
63
end
64
-
reduce((|), fill(padded_arrays[1].u, (length(padded_arrays),)) .==getfield.(padded_arrays, :u)) ||throw("The padded_arrays do not all extend the same u!")
64
+
reduce((|), fill(padded_arrays[1].u, (length(padded_arrays),)) .==getfield.(padded_arrays, :u)) ||throw(ArgumentError("The padded_arrays do not all extend the same u!"))
65
65
padded_arrays = padded_arrays[sortperm([Ds...])]
66
66
lower = [padded_array.lower for padded_array in padded_arrays]
67
67
upper = [padded_array.upper for padded_array in padded_arrays]
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`.
220
220
The ends of `u1` and `u2` that are not connected will use the boundary conditions `bc1` and `bc2` respectively.
@@ -225,18 +225,20 @@ When using these with a time/space stepping solve, please use elementwise equals
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`.
232
232
The ends of `u1` and `u2` that are not connected will use the boundary conditions `bc1` and `bc2` respectively.
233
233
234
+
Drop `dim1` and `dim2` when your `u1` and `u2` are vectors.
235
+
234
236
Use `Q1` to extend `u1` and `Q2` to extend `u2`.
235
237
236
238
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:
237
239
u_t1 .= L*Q*u_t0
238
240
"""
239
-
functionBridgeBC(u1::AbstractVector{T}, hilo1::String, bc1::AtomicBC{T}, u2::AbstractVector{T}, hilo2::AbstractVector{T}, bc2::AtomicBC{T}) where T
241
+
functionBridgeBCBridgeBC(bc1::AtomicBC, u1::AbstractArray{T,1}, hilo1::String, hilo2::String, u2::AbstractArray{T,1}, bc2::AtomicBC) where T
There are also constructors for NeumannBC, DirichletBC, Neumann0BC and Dirichlet0BC. Simply replace dx with the tuple as above, and append size(u) to the argument signature.
74
+
There are also constructors for NeumannBC, DirichletBC, Neumann0BC and Dirichlet0BC. Simply replace `dx` in the call with the tuple dxyz... as above, and append `size(u)`` to the argument signature.
73
75
The order is a required argument in this case.
74
76
75
77
where dx, dy, and dz are vectors of grid steps.
@@ -99,114 +101,72 @@ GeneralBC(αl::AbstractVector{T}, αr::AbstractVector{T}, dxyz, order, s) where
99
101
perpsize(A::AbstractArray{T,N}, dim::Integer) where {T,N} =size(A)[setdiff(1:N, dim)] #the size of A perpendicular to dim
100
102
101
103
# Constructors for Bridge BC to make it easier to join domains together. See docs on BrigeBC in BC_operators.jl for info on usage
102
-
functionBridgeBC(u1::AbstractArray{T,2}, dim1::Int, hilo1::String, bc1::MultiDimDirectionalBC, u2::AbstractArray{T,2}, dim2::Int, hilo2::String, bc2::MultiDimDirectionalBC) where {T}
103
-
@assert1≤ dim1 ≤2"dim1 must be 1≤dim1≤2, got dim1 = $dim1"
104
-
@assert1≤ dim1 ≤2"dim2 must be 1≤dim1≤2, got dim1 = $dim1"
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")
131
+
throw(ArgumentError("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")
154
+
throw(ArgumentError("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"))
149
155
end
150
156
else
151
157
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")
BC1[i, j] =MixedBC(BridgeBC{T, N, eltype(s1)}(zeros(T, 1), view(view2, i, j), zeros(T, 1), view(view2, i, j)), bc1.BCs[i,j])
178
-
BC2[i, j] =MixedBC(bc2.BCs[i,j], BridgeBC{T, N, eltype(s1)}(zeros(T, 1), view(view1, i, j), zeros(T, 1), view(view1, i, j)))
179
-
end
180
-
else
181
-
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")
BC1[i, j] =MixedBC(bc1.BCs[i,j], BridgeBC{T, N, eltype(s1)}(zeros(T, 1), view(view2, i, j), zeros(T, 1), view(view2, i, j)))
200
-
BC2[i, j] =MixedBC(bc2.BCs[i,j], BridgeBC{T, N, eltype(s1)}(zeros(T, 1), view(view1, i, j), zeros(T, 1), view(view1, i, j)))
201
-
end
202
-
else
203
-
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")
204
-
end
205
-
else
206
-
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")
(length(BCs) == N) ||throw("There must be enough BCs to cover every dimension - check that the number of MultiDimBCs == N")
187
+
(length(BCs) == N) ||throw(ArgumentError("There must be enough BCs to cover every dimension - check that the number of MultiDimBCs == N"))
228
188
for D in Ds
229
-
length(setdiff(Ds, D)) == (N-1) ||throw("There are multiple boundary conditions that extend along $D - make sure every dimension has a unique extension")
189
+
length(setdiff(Ds, D)) == (N-1) ||throw(ArgumentError("There are multiple boundary conditions that extend along $D - make sure every dimension has a unique extension"))
0 commit comments