Skip to content

Commit

Permalink
fixed varyquad bug
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewGibbs committed Mar 5, 2024
1 parent 1720baf commit e919c61
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/Galerkin_quadrature.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,16 @@ function get_quad_scales(k::Real, spat_dim::Int64,mesh::Vector{<:SubInvariantMea
# compute upper and lower bounds for the F in my notes, which is stated above.
N = length(mesh)
F_upper = ones(Float16,N,N)
F_lower = ones(Float16,N,N)
# F_lower = ones(Float16,N,N)
F_lower = zeros(Float16,N,N)
for m_count = 1:N
Γₘ = mesh[m_count]
for n_count = m_count:N
Γₙ = mesh[n_count]
if n_count!=m_count
dist_upper = norm(Γₙ.barycentre-Γₘ.barycentre)
dist_upper = norm(Γₙ.barycentre - Γₘ.barycentre)
dist_lower = max(dist_upper - Γₙ.diameter - Γₘ.diameter,0)
measure_weight = Γₙ.measure*Γₘ.measure
measure_weight = 1.0#Γₙ.measure*Γₘ.measure
# noting that F_nomeasure is monotonic decreasing in r, can bound as follows:
if dist_lower>0
F_upper[m_count,n_count] = measure_weight*F_nomeasure(dist_lower, k, spat_dim)
Expand Down Expand Up @@ -44,15 +45,16 @@ function get_quad_scales(k::Real, spat_dim::Int64,
N = length(mesh2)
M = length(mesh1)
F_upper = ones(Float16,M,N)
F_lower = ones(Float16,M,N)
# F_lower = ones(Float16,N,N)
F_lower = zeros(Float16,N,N)

for m = 1:M
Γₘ = mesh1[m]
for n = 1:N
Γₙ = mesh2[n]
dist_upper = norm(Γₙ.barycentre-Γₘ.barycentre)
dist_lower = max(dist_upper - Γₙ.diameter - Γₘ.diameter, 0)
measure_weight = Γₙ.measure*Γₘ.measure
measure_weight = 1.0#Γₙ.measure*Γₘ.measure
# noting that F_nomeasure is monotonic decreasing in r, can bound as follows:
if dist_lower>0
F_upper[m,n] = measure_weight*F_nomeasure(dist_lower, k, spat_dim)
Expand Down

0 comments on commit e919c61

Please sign in to comment.