Berggren integral fixed (still not working)
This commit is contained in:
parent
267c6a1144
commit
b3934d6885
|
|
@ -4,10 +4,10 @@ include("math.jl")
|
||||||
"berg_bases1/2 are lists of (1+l_max) matrices containing the eigenbases corresponding to 1st and 2nd DOFs respectively,
|
"berg_bases1/2 are lists of (1+l_max) matrices containing the eigenbases corresponding to 1st and 2nd DOFs respectively,
|
||||||
js are a list of tuples (j1, j2) corresponding to 1st and 2nd DOFs respectively,
|
js are a list of tuples (j1, j2) corresponding to 1st and 2nd DOFs respectively,
|
||||||
and ws are the weights needed to evaluate the inner products"
|
and ws are the weights needed to evaluate the inner products"
|
||||||
function get_2p_p1p2_matrix(mesh_size, js, Λ, berg_bases1::Vector{Matrix{ComplexF64}}, berg_bases2::Vector{Matrix{ComplexF64}}, ws::Vector{ComplexF64})
|
function get_2p_p1p2_matrix(mesh_size, js, Λ, berg_bases1::Vector{Matrix{ComplexF64}}, berg_bases2::Vector{Matrix{ComplexF64}}, ks::Vector{ComplexF64}, ws::Vector{ComplexF64})
|
||||||
# TODO: Cache / precalculate
|
# TODO: Cache / precalculate
|
||||||
integral1(np, lp, n, l) = sum(berg_bases1[1 + lp][:, np] .* ws .* berg_bases1[1 + l][:, n])
|
integral1(np, lp, n, l) = sum(ks .* berg_bases1[1 + lp][:, np] .* ws .* berg_bases1[1 + l][:, n])
|
||||||
integral2(np, lp, n, l) = sum(berg_bases2[1 + lp][:, np] .* ws .* berg_bases2[1 + l][:, n])
|
integral2(np, lp, n, l) = sum(ks .* berg_bases2[1 + lp][:, np] .* ws .* berg_bases2[1 + l][:, n])
|
||||||
|
|
||||||
basis = iter_prod(js, 1:mesh_size, 1:mesh_size)
|
basis = iter_prod(js, 1:mesh_size, 1:mesh_size)
|
||||||
mat = zeros(ComplexF64, length(basis), length(basis))
|
mat = zeros(ComplexF64, length(basis), length(basis))
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@ end
|
||||||
Hb = blockdiag(sparse.(Hb_blocks)...)
|
Hb = blockdiag(sparse.(Hb_blocks)...)
|
||||||
end
|
end
|
||||||
|
|
||||||
@time "T_cross" T_cross = get_2p_p1p2_matrix(length(ks), js, Λ, berg_bases, berg_bases, ws) ./ (2*μ)
|
@time "T_cross" T_cross = get_2p_p1p2_matrix(length(ks), js, Λ, berg_bases, berg_bases, ks, ws) ./ (2*μ)
|
||||||
|
|
||||||
E_max = 30
|
E_max = 30
|
||||||
μω_global = 0.5
|
μω_global = 0.5
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue