ENH: improve analytical eigendecompositions

- `tensor` and `tensor2D` returns complex eigenvalues/vectors
  - `symmTensor` and `symmTensor2D` returns real eigenvalues/vectors
  - adds new test routines for eigendecompositions
  - improves numerical stability by:
    - using new robust algorithms,
    - reordering the conditional branches in root-type selection
This commit is contained in:
Kutalmis Bercin
2020-02-11 16:22:09 +00:00
committed by Andrew Heather
parent 6a53794e0a
commit 55e7da670c
28 changed files with 1411 additions and 284 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -386,7 +386,7 @@ void Foam::edgeCollapser::faceCollapseAxisAndAspectRatio
{
const pointField& pts = mesh_.points();
tensor J = f.inertia(pts, fC);
symmTensor J(symm(f.inertia(pts, fC)));
// Find the dominant collapse direction by finding the eigenvector
// that corresponds to the normal direction, discarding it. The
@ -423,7 +423,7 @@ void Foam::edgeCollapser::faceCollapseAxisAndAspectRatio
}
else
{
vector eVals = eigenValues(J);
vector eVals(eigenValues(J));
if (mag(eVals.y() - eVals.x()) < 100*SMALL)
{