From c883e97e1fa7e450645b1509b0843404f3f8ba04 Mon Sep 17 00:00:00 2001 From: Hrvoje Jasak Date: Wed, 25 Sep 2019 09:15:45 +0100 Subject: [PATCH] Consistent use of determinant check in hinv. Under constant review. HJ --- src/foam/primitives/Tensor/tensor/tensor.C | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/foam/primitives/Tensor/tensor/tensor.C b/src/foam/primitives/Tensor/tensor/tensor.C index 942da8d16..8c6d56ea3 100644 --- a/src/foam/primitives/Tensor/tensor/tensor.C +++ b/src/foam/primitives/Tensor/tensor/tensor.C @@ -617,9 +617,10 @@ tensor eigenVectors(const symmTensor& t) tensor hinv(const tensor& t) { static const scalar hinvLarge = 1e10; - static const scalar hinvSmall = 1e-10; - if (det(t) > hinvSmall) + // Consistent use of determinant check + // HJ, 13/Jun/2019 + if (det(t) > SMALL) { return inv(t); } @@ -672,9 +673,10 @@ tensor hinv(const tensor& t) symmTensor hinv(const symmTensor& t) { static const scalar hinvLarge = 1e10; - static const scalar hinvSmall = 1e-10; - if (det(t) > hinvSmall) + // Consistent use of determinant check + // HJ, 13/Jun/2019 + if (det(t) > SMALL) { return inv(t); }