Different subdivisions for mesh segment
This commit is contained in:
parent
4f166f1ada
commit
13494df20b
|
|
@ -1,8 +1,8 @@
|
||||||
using Plots, LinearAlgebra
|
using Plots, LinearAlgebra
|
||||||
include("p_space.jl")
|
include("p_space.jl")
|
||||||
|
|
||||||
berggren_mesh = get_mesh((0, 0.4 - 0.15im, 0.8, 6), 128)
|
berggren_mesh = get_mesh([0, 0.4 - 0.15im, 0.8, 6], [128, 128, 128])
|
||||||
csm_mesh = get_mesh((0, 8 - 3im), 512)
|
csm_mesh = get_mesh([0, 8 - 3im], [512])
|
||||||
|
|
||||||
for mesh in (berggren_mesh, csm_mesh)
|
for mesh in (berggren_mesh, csm_mesh)
|
||||||
p, w = mesh
|
p, w = mesh
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"vertices = (0, 0.4 - 0.15im, 0.8, 6)\n",
|
"vertices = [0, 0.4 - 0.15im, 0.8, 6]\n",
|
||||||
"subdivisions = 128\n",
|
"subdivisions = [128, 128, 128]\n",
|
||||||
"p, w = get_mesh(vertices, subdivisions)\n",
|
"p, w = get_mesh(vertices, subdivisions)\n",
|
||||||
"mesh_E = p.*p ./ (2*0.5)\n",
|
"mesh_E = p.*p ./ (2*0.5)\n",
|
||||||
"\n",
|
"\n",
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,11 @@ function gausslegendre_shifted(a, b, n)
|
||||||
return (p, w)
|
return (p, w)
|
||||||
end
|
end
|
||||||
|
|
||||||
function get_mesh(vertices, subdivisions)
|
function get_mesh(vertices::Vector, subdivs::Vector)
|
||||||
p = Vector{ComplexF64}()
|
p = Vector{ComplexF64}()
|
||||||
w = Vector{ComplexF64}()
|
w = Vector{ComplexF64}()
|
||||||
for (a, b) in zip(vertices, vertices[2:end])
|
for (a, b, subdiv) in zip(vertices, vertices[2:end], subdivs)
|
||||||
p_new, w_new = gausslegendre_shifted(a, b, subdivisions)
|
p_new, w_new = gausslegendre_shifted(a, b, subdiv)
|
||||||
append!(p, p_new)
|
append!(p, p_new)
|
||||||
append!(w, w_new)
|
append!(w, w_new)
|
||||||
end
|
end
|
||||||
|
|
@ -46,7 +46,7 @@ function identify_pole_i(p, evals, μ=0.5)
|
||||||
end
|
end
|
||||||
|
|
||||||
function quick_pole_E(V_pq, μ=0.5; cs_angle=0.4, cutoff=8.0, meshpoints=256)
|
function quick_pole_E(V_pq, μ=0.5; cs_angle=0.4, cutoff=8.0, meshpoints=256)
|
||||||
p, w = get_mesh([0, cutoff * exp(-1im * cs_angle)], meshpoints)
|
p, w = get_mesh([0, cutoff * exp(-1im * cs_angle)], [meshpoints])
|
||||||
evals = eigvals(get_H_matrix(V_pq, p, w, μ))
|
evals = eigvals(get_H_matrix(V_pq, p, w, μ))
|
||||||
return evals[identify_pole_i(p, evals, μ)]
|
return evals[identify_pole_i(p, evals, μ)]
|
||||||
end
|
end
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"vertices = (0, 1 - 0.5im, 2, 6)\n",
|
"vertices = [0, 1 - 0.5im, 2, 6]\n",
|
||||||
"subdivisions = 64\n",
|
"subdivisions = [64, 64, 64]\n",
|
||||||
"p, w = get_mesh(vertices, subdivisions)\n",
|
"p, w = get_mesh(vertices, subdivisions)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"scatter(real.(p), imag.(p))"
|
"scatter(real.(p), imag.(p))"
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
"metadata": {},
|
"metadata": {},
|
||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"vertices = (0, 0.5 - 0.3im, 1, 6)\n",
|
"vertices = [0, 0.5 - 0.3im, 1, 6]\n",
|
||||||
"subdivisions = 64\n",
|
"subdivisions = [64, 64, 64]\n",
|
||||||
"p, w = get_mesh(vertices, subdivisions)\n",
|
"p, w = get_mesh(vertices, subdivisions)\n",
|
||||||
"\n",
|
"\n",
|
||||||
"# resonance example from my thesis\n",
|
"# resonance example from my thesis\n",
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue