View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002351 | OpenFOAM | Bug | public | 2016-11-25 06:30 | 2016-11-26 20:57 |
Reporter | handrake0724 | Assigned To | henry | ||
Priority | high | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
OS Version | 3.x, 4.x | ||||
Summary | 0002351: floating point exception error for eigenvalue calculation in applications/test/tensor | ||||
Description | 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. | ||||
Tags | No tags attached. | ||||
|
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? |
|
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. |
|
Resolved in OpenFOAM-4.x by commit 422f1770e08a2b442a0c168d7f29a2c46fb40335 Resolved in OpenFOAM-dev by commit 4eaa06a60f53448a9d97a81b3470f26661b075a7 |
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 |