Closed chiyahn closed 5 years ago
It turns out that there was a mistake in L_2
, not on L_2^B
; note that all the evidence I provided are based on the discrepancy between L_2
and L_2^B
solutions. In fact, I found that the unit tests still all pass for L_2^B
. Will make a fix rn
Here's what makes it different: We had been using
L_2[1,1] = -1 / Δ_1
L_2[end,end] = -1/Δ_M
where Δ_1
and Δ_M
are x̄[2] - x̄[1]
and x̄[end] - x̄[end-1]
respectively. The correct implementation should be
L_2[1,1] = - 1 / (Δ_1m*(Δ_1m+Δ_1p))
L_2[end,end] = -1 / (Δ_Mp*(Δ_Mm+Δ_Mp))
where
Δ_1m = x̄[2] - x̄[1]
Δ_1p = x̄[3] - x̄[2]
Δ_Mm = x̄[end-1] - x̄[end-2]
Δ_Mp = x̄[end] - x̄[end-1]
Relates to #114
There are two evidences:
L
based solution andL_bc
based solution fail on irregular grids only (added in 4884750f984516be3623605801cb87c3b75cf984)L_2
with irregular gridsOnce #114 is done,