Berggren integral fixed (still not working)

This commit is contained in:
Nuwan Yapa 2024-12-13 03:27:46 -05:00
parent 267c6a1144
commit b3934d6885
2 changed files with 4 additions and 4 deletions

View File

@ -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,
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"
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
integral1(np, lp, n, l) = sum(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])
integral1(np, lp, n, l) = sum(ks .* berg_bases1[1 + lp][:, np] .* ws .* berg_bases1[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)
mat = zeros(ComplexF64, length(basis), length(basis))

View File

@ -52,7 +52,7 @@ end
Hb = blockdiag(sparse.(Hb_blocks)...)
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
μω_global = 0.5