Possible upper/lower triangle storage inconsistency in rates() in multi-phase equilibrium solver
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- Nửa ngày
- Mức phù hợp với người mới
- 50/100
Hướng nghiên cứu
The suspect code is in rates() in src/thermo/MultiPhaseEquilSolver.cpp: the loop assembling A(m,p) only fills the lower triangle, and the solve near line 1136 uses selfadjointView<Upper>(). Read the assembly loop and that solve to confirm whether the upper triangle is filled elsewhere before the solve. Done means either switching to selfadjointView<Lower>() or populating the upper triangle, with a maintainer confirming which one is intended and the solver results checked against a known equilibrium case.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I believe there may be an inconsistency in the rates() routine between the way the matrix A is assembled and the triangular part subsequently used by Eigen's self-adjoint solver.
A is populated with:
for (int p = 0; p < npr; ++p) {
for (int m = p; m < npr; ++m) {
for (int j = p_sizes[m]; j < p_sizes[m+1]; ++j) {
sum = 0.0;
for (int i = 0; i < ncr; ++i)
sum += H(j,i)*dlamy(i,p);
A(m,p) += y[j]*sum;
}
}
}
Since m >= p, this explicitly computes the lower triangular part of A, i.e. A(m,p) for m >= p. This appears intentional, since A is expected to be symmetric.
However, the resulting system is then solved with
https://github.com/mutationpp/Mutationpp/blob/7607ef4d67f4de115705f78f467b1ea48bf02c26/src/thermo/MultiPhaseEquilSolver.cpp#L1136
As I understand Eigen's SelfAdjointView, selfadjointView<Upper>() treats the upper triangular portion of the matrix as the stored representation of the self-adjoint matrix and does not use the corresponding entries in the lower triangle. I believe this is therefore causing the off-diagonal elements to be discarded in the calculation of dx.
In other words, since the assembly produces
[ a 0 0
b c 0
d e f ]
the intended symmetric matrix is presumably
[ a b d
b c e
d e f ]
However, since the upper-triangular off-diagonal elements remain zero, selfadjointView<Upper>() represents the matrix as
[ a 0 0
0 c 0
0 0 f ]
instead.
Should selfadjointView<Lower>() be used here instead? Alternatively, is there some reason the upper triangle is expected to be populated elsewhere before this solve?
- Ngôn ngữ chính
- C++
- Star
- 145
- Fork
- 79
- Merge trung bình
- 1 ngày 15 giờ
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọ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 mutationpp/Mutationpp
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
mutationpp/Mutationpp#337 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 74/100
mutationpp/Mutationpp#302 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 51/100
mutationpp/Mutationpp#335 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
mutationpp/Mutationpp#332 ·
-
Prevent Newton solver hangs in the multi-phase equilibrium solverCó thể đã có người làm @capriatim đã nhận 3 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 40/100
mutationpp/Mutationpp#330 · 1 người được giao ·
Tất cả issue của mutationpp/Mutationpp
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
sistemicorp/scripts#62 ·
-
Vim/NeoVim pluginĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
extended_stabilizer: `std::pow(2, p/2.)` in `scalar_t::to_complex()` takes ~40% of runtime on LinuxCó thể đã có người làm @mehmetniyazikayi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Qiskit/qiskit-aer#2502 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Test failure on FreeBSD: #26 unexpected system_clock sourceCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởlow priority rt_lib tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
RobLoach/raylib-cpp#440 · 2 bình luận ·