KineticForces - BUG - nutype="zero" crashes with BoundsError when the resonant integrand is non-finite and no pole was subtracted
Maintainer thường phản hồi trong vòng 3 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Read src/KineticForces/EnergyIntegration.jl, especially _resonant_integrand and the npole == 0 integration branch. Trace how non-finite values are handled when no poles were found, and clarify the intended physical value for that case before changing the fallback. Then add a regression case using a DIII-D-like equilibrium with nutype = "zero"; verify the run completes while the existing solovev_kinetic_nuzero case still passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Symptom
A DIII-D-like kinetic-calculated run with [KineticForces] nutype = "zero" (collisionless) at nominal rotation dies during kinetic matrix formation:
ERROR: TaskFailedException
nested task error: BoundsError: attempt to access 0-element Vector{ComplexF64} at index [1]
[3] ... src/KineticForces/EnergyIntegration.jl:227 [inlined]
[4] ... src/KineticForces/EnergyIntegration.jl:268
[5] QuadGK evalrule ...
Reproduced on both a plain run and a variant; the same deck with nutype = "harmonic" runs fine, and nutype = "zero" plus toroidal_rotation_factor = 0.2 also runs fine — so it needs the collisionless operator at nominal rotation.
Mechanism
_resonant_integrand (EnergyIntegration.jl:~215-234) has a non-finite-value fallback that substitutes the nearest pole's analytic regular part:
if !isfinite(val)
k = 1
for j in 2:npole
abs(x - real(x_poles[j])) < abs(x - real(x_poles[k])) && (k = j)
end
val = _real_pole_regular_part(real(x_poles[k]), ...) # x_poles[1] on an empty vector
The fallback assumes at least one pole was found. But the caller builds the same closure for the npole == 0 branch (:~268) and integrates it:
integrand = x -> _resonant_integrand(x, p, residues, x_poles, npole, leff, wb, n, wd)
if npole == 0
val, _ = quadgk(integrand, 0.0, X_ENERGY_MAX; ...)
With nutype = "zero" there is no collisional broadening, so Ω can round to exactly 0 at a quadrature node even when no pole was registered in [0, X_ENERGY_MAX] — val becomes non-finite, the fallback runs with npole = 0, and x_poles[1] throws.
Suggested fix
Guard the fallback on npole > 0, and decide what the physical value is when the integrand is non-finite with no subtracted pole (returning 0 for that node, or excluding it, is a modelling choice worth stating in the annotation rather than implying). A regression case exercising nutype = "zero" on a DIII-D-like equilibrium would cover this — the existing solovev_kinetic_nuzero case passes, so Solovev alone does not reach the branch.
Not introduced by the issue #376 kinetic stack: EnergyIntegration.jl has no commits on that branch relative to develop.
- Ngôn ngữ chính
- Julia
- Star
- 11
- Fork
- 7
- Merge trung bình
- 4 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 68
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của OpenFUSIONToolkit/GPEC
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 82/100
OpenFUSIONToolkit/GPEC#644 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
OpenFUSIONToolkit/GPEC#643 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
PerturbedEquilibrium - FEATURE - Complete the resistive perturbed-equilibrium workflow from Galerkin and matched resultsCó thể đã có người làm @matt-pharr đã nhận 1 ngày trước. Đang mởfeature
OpenFUSIONToolkit/GPEC#635 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
-
test
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
OpenFUSIONToolkit/GPEC#633 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Tearing - FEATURE - Add a general modified Rutherford equation for island evolutionCó thể đã có người làm @StuartBenjamin đã nhận 2 ngày trước. Đang mởfeature
OpenFUSIONToolkit/GPEC#630 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 3 ngày
Tất cả issue của OpenFUSIONToolkit/GPEC
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Sienna-Platform/InfrastructureSystems.jl#675 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
TargetEncoder reuses the first level's shrinkage factor for all levels when m > 0Có thể đã có người làm @parth-patel010 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
JuliaAI/MLJTransforms.jl#95 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
SciML/RecursiveArrayTools.jl#687 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
SciML/LinearSolve.jl#1412 ·
Maintainer thường phản hồi trong vòng 8 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
SciML/Corleone.jl#179 ·
Maintainer thường phản hồi trong vòng 1 ngày