Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit d7788ab

Browse files
Update BC_operators.jl
1 parent da8ee91 commit d7788ab

1 file changed

Lines changed: 0 additions & 27 deletions

File tree

src/derivative_operators/BC_operators.jl

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,9 @@ struct NeumannBC{N} end
1414
struct Neumann0BC{N} end
1515
struct DirichletBC{N} end
1616
struct Dirichlet0BC{N} end
17-
"""
18-
q = PeriodicBC{T}()
19-
20-
Qx, Qy, ... = PeriodicBC{T}(size(u)) #When all dimensions are to be extended with a periodic boundary condition.
21-
22-
-------------------------------------------------------------------------------------
23-
Creates a periodic boundary condition, where the lower index end of some u is extended with the upper index end and vice versa.
24-
It is not recommended to concretize this BC type in to a BandedMatrix, since the vast majority of bands will be all 0s. SpatseMatrix concretization is recommended.
25-
"""
2617
struct PeriodicBC{T} <: AtomicBC{T}
2718
PeriodicBC(T::Type) = new{T}()
2819
end
29-
30-
"""
31-
q = RobinBC(left_coefficients, right_coefficients, dx::T, approximation_order) where T # When this BC extends a dimension with a uniform step size
32-
33-
q = RobinBC(left_coefficients, right_coefficients, dx::Vector{T}, approximation_order) where T # When this BC extends a dimension with a non uniform step size. dx should be the vector of step sizes for the whole dimension
34-
35-
-------------------------------------------------------------------------------------
36-
37-
The variables in l are [αl, βl, γl], and correspond to a BC of the form αl*u(0) + βl*u'(0) = γl imposed on the lower index boundary.
38-
The variables in r are [αl, βl, γl], and correspond to an analogous boundary on the higher index end.
39-
Implements a robin boundary condition operator Q that acts on a vector to give an extended vector as a result
40-
Referring to (https://github.com/JuliaDiffEq/DiffEqOperators.jl/files/3267835/ghost_node.pdf)
41-
Write vector b̄₁ as a vertical concatenation with b0 and the rest of the elements of b̄ ₁, denoted b̄`₁, the same with ū into u0 and ū`. b̄`₁ = b̄`_2 = fill(β/Δx, length(stencil)-1)
42-
Pull out the product of u0 and b0 from the dot product. The stencil used to approximate u` is denoted s. b0 = α+(β/Δx)*s[1]
43-
Rearrange terms to find a general formula for u0:= -b̄`₁̇⋅ū`/b0 + γ/b0, which is dependent on ū` the robin coefficients and Δx.
44-
The non identity part of Qa is qa:= -b`₁/b0 = -β.*s[2:end]/(α+β*s[1]/Δx). The constant part is Qb = γ/(α+β*s[1]/Δx)
45-
do the same at the other boundary (amounts to a flip of s[2:end], with the other set of boundary coeffs)
46-
"""
4720
struct RobinBC{T, V<:AbstractVector{T}} <: AffineBC{T}
4821
a_l::V
4922
b_l::T

0 commit comments

Comments
 (0)