Possible upper/lower triangle storage inconsistency in rates() in multi-phase equilibrium solver
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- Medio día
- Aptitud para principiantes
- 50/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- C++
- Estrellas
- 145
- Forks
- 79
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de mutationpp/Mutationpp
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
mutationpp/Mutationpp#337 ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
mutationpp/Mutationpp#302 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 51/100
mutationpp/Mutationpp#335 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 42/100
mutationpp/Mutationpp#332 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 40/100
mutationpp/Mutationpp#330 · 1 asignado ·
Todos los issues de mutationpp/Mutationpp
Issues similares
-
Remove source files from packaging for deb, zip, etcPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
OpenSpace/OpenSpace#4353 · 1 comentario ·
Los mantenedores suelen responder en 5 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
justcallmekoko/ESP32Marauder#1656 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
macOS: a double-click on a notarized altairsim is refused, and the docs give only the offline casePosiblemente ocupada @anhaoXie la tomó hace 1 día. Abiertodocumentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Decompiler: convertCharRef() in xml.y overflows its int4 accumulator on long character referencesPosiblemente ocupada @kaayzouee la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
NationalSecurityAgency/ghidra#10009 ·
Los mantenedores suelen responder en 2 días