#### View Issue Details

ID Project Category View Status Date Submitted Last Update 0002351 OpenFOAM [All Projects] Bug public 2016-11-25 06:30 2016-11-26 20:57 handrake0724 henry high major always resolved fixed 3.x, 4.x 0002351: floating point exception error for eigenvalue calculation in applications/test/tensor applications/test/tensor makes a floating point exception error. in the below code, vector e = eigenValues(t6) makes the error Code:     tensor t6(1,0,-4,0,5,4,-4,4,3);     //tensor t6(1,2,0,2,5,0,0,0,0);     Info<< "tensor " << t6 << endl;     vector e = eigenValues(t6);     Info<< "eigenvalues " << e << endl; hot spot is in the member function eigenValues(const tensor& t) of src/OpenFOAM/primitives/Tensor/tensor/tensor.C in the code below, Q makes zero for the test matrix (1 0 -4 0 5 4 -4 4 3) which has eigen values (-3, 3, 9). So when checking mag(PPP/QQ -1), it leads to floating point exception error before going to the third conditional PPP > QQ. The same test code works for OpenFOAM 2.3.0 but not work for OpenFOAM 3.x and 4.x. No tags attached.

#### Activities

 2016-11-25 07:28 manager   ~0007325 The eigenvalue code has been substantially re-written for OpenFOAM-3.x to resolve several outstanding issues. Can you provide a patch to resolve this issue? 2016-11-26 20:37 manager   ~0007344 There are several ways to resolve this issue, the simplest being:         // Two identical roots and one distinct root         else if (mag(QQ) > SMALL && mag(PPP/QQ - 1) < SMALL) but this assumes that values of QQ and PPP less than SMALL are not significant. Another option would be to test either PPP/QQ or QQ/PPP depending on which of PPP and QQ is the larger or to compare (mag(PPP) - mag(QQ)) with SMALL*mag(QQ) but this is probably unwise. 2016-11-26 20:57 manager   ~0007346 Resolved in OpenFOAM-4.x by commit 422f1770e08a2b442a0c168d7f29a2c46fb40335 Resolved in OpenFOAM-dev by commit 4eaa06a60f53448a9d97a81b3470f26661b075a7