View Issue Details

IDProjectCategoryView StatusLast Update
0002351OpenFOAMBugpublic2016-11-26 20:57
Reporterhandrake0724 Assigned Tohenry  
PriorityhighSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
OS Version3.x, 4.x 
Summary0002351: floating point exception error for eigenvalue calculation in applications/test/tensor
Descriptionapplications/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.
TagsNo tags attached.

Activities

henry

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?

henry

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.

henry

2016-11-26 20:57

manager   ~0007346

Resolved in OpenFOAM-4.x by commit 422f1770e08a2b442a0c168d7f29a2c46fb40335

Resolved in OpenFOAM-dev by commit 4eaa06a60f53448a9d97a81b3470f26661b075a7

Issue History

Date Modified Username Field Change
2016-11-25 06:30 handrake0724 New Issue
2016-11-25 07:28 henry Note Added: 0007325
2016-11-26 20:37 henry Note Added: 0007344
2016-11-26 20:57 henry Assigned To => henry
2016-11-26 20:57 henry Status new => resolved
2016-11-26 20:57 henry Resolution open => fixed
2016-11-26 20:57 henry Fixed in Version => 4.x
2016-11-26 20:57 henry Note Added: 0007346