Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • openfoam openfoam
  • Project information
    • Project information
    • Activity
    • Labels
    • Planning hierarchy
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 381
    • Issues 381
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 13
    • Merge requests 13
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • openfoamopenfoam
  • Issues
  • #1957

Closed
Open
Created Dec 14, 2020 by Robert Manson-Sawko@robertsawko

Incorrect eigenvalues for a symmetric positive-definite matrix

Summary

It appears I am getting incorrect eigenvalues for a symmetric positive-definite matrix. It results in incorrect eigenvectors which end up being linearly dependant (as if the matrix was defective). This impacts the turbulentInletDFSEM as eddy objects lose a dimension.

Steps to reproduce

Here's a minimal example, I concocted:

#include "fvCFD.H"

int main(int argc, char *argv[])
{
    Info<< "\nCalculating eigenvalues of a symmetric positive-definite matrix\n";

    symmTensor A = symmTensor(
        0.005,
        -0.0003,
        0.001,
        0.002,
        0.0001,
        0.002);
    vector lambda(eigenValues(A));
    Info<< "Eigenvalues (OpenFOAM): " << lambda << endl;
    Info<< "Eigenvalues (numpy.linalg): (0.00532289, 0.00160802, 0.0020691)" << endl;
    return 0;
}

What is the current bug behaviour?

Output I am getting:

Eigenvalues (OpenFOAM): (0.00183856 0.00183856 0.00532289)
Eigenvalues (numpy.linalg): (0.00532289, 0.00160802, 0.0020691)

What is the expected correct behaviour?

See above. I compared it with numpy.linalg.

Environment information

  • OpenFOAM version : v2006
  • Operating system : Arch Linux
  • Hardware info : Intel(R) Core(TM) i7-4810MQ CPU @ 2.80GHz
  • Compiler : gcc :

Possible fixes

Use alternatives eigensolvers. I currently went with Eigen but I am looking for another OpenFOAM native solution.

Edited Dec 14, 2020 by Robert Manson-Sawko
Assignee
Assign to
Time tracking