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.
functionRobinBC(l::NTuple{3,T}, r::NTuple{3,T}, dx::T, order =1) where {T}
25
+
functionRobinBC(l::NTuple{3,T}, r::NTuple{3,T}, dx::U, order =1) where {T<:Number,U<:Real}
26
26
αl, βl, γl = l
27
27
αr, βr, γr = r
28
28
29
-
s =calculate_weights(1, one(T), Array(one(T):convert(T,order+1))) #generate derivative coefficients about the boundary of required approximation order
29
+
s =calculate_weights(1, one(U), Array(one(U):convert(U,order+1))) #generate derivative coefficients about the boundary of required approximation order
30
30
31
-
a_l =-s[2:end]./(αl*dx/βl+ s[1])
32
-
a_r = s[end:-1:2]./(αr*dx/βr- s[1]) # for other boundary stencil is flippedlr with *opposite sign*
31
+
a_l =-βl*s[2:end]./(αl*dx +βl*s[1])
32
+
a_r =βr*s[end:-1:2]./(αr*dx -βr*s[1]) # for other boundary stencil is flippedlr with *opposite sign*
33
33
34
34
b_l = γl/(αl+βl*s[1]/dx)
35
35
b_r = γr/(αr-βr*s[1]/dx)
36
36
37
37
returnnew{T, typeof(a_l)}(a_l, b_l, a_r, b_r)
38
38
end
39
-
functionRobinBC(l::Union{NTuple{3,T},AbstractVector{T}}, r::Union{NTuple{3,T},AbstractVector{T}}, dx::AbstractVector{T}, order =1) where {T}
39
+
functionRobinBC(l::Union{NTuple{3,T},AbstractVector{T}}, r::Union{NTuple{3,T},AbstractVector{T}}, dx::AbstractVector{U}, order =1) where {T<:Number,U<:Real}
functionGeneralBC(αl::AbstractVector{T}, αr::AbstractVector{T}, dx::T, order =1) where {T}
79
+
functionGeneralBC(αl::AbstractVector{T}, αr::AbstractVector{T}, dx::U, order =1) where {T<:Number,U<:Real}
80
80
nl =length(αl)
81
81
nr =length(αr)
82
82
S_l =zeros(T, (nl-2, order+nl-2))
83
83
S_r =zeros(T, (nr-2, order+nr-2))
84
84
85
85
for i in1:(nl-2)
86
-
S_l[i,:] = [transpose(calculate_weights(i, one(T), Array(one(T):convert(T, order+i)))) transpose(zeros(T, Int(nl-2-i)))]./(dx^i) #am unsure if the length of the dummy_x is correct here
86
+
S_l[i,:] = [transpose(calculate_weights(i, one(U), Array(one(U):convert(U, order+i)))) transpose(zeros(U, Int(nl-2-i)))]./(dx^i) #am unsure if the length of the dummy_x is correct here
0 commit comments