ENH: quaternion ROLL_PITCH_YAW and YAW_PITCH_ROLL aliases/lookups

COMP: define labelSphericalTensor::I

- remove spurious 'labelI' global constant (labelSphericalTensor::I)

STYLE: replace use of deprecated Tensor vectorComponent

STYLE: avoid bit-wise assignment of bool (VectorSpace compare ops)
This commit is contained in:
Mark Olesen
2022-06-02 09:13:20 +02:00
parent 8b63b8cdfe
commit eba7a485ba
21 changed files with 122 additions and 155 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2014 OpenFOAM Foundation
Copyright (C) 2019-2020 OpenCFD Ltd.
Copyright (C) 2019-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -74,13 +74,8 @@ tensor2D makeRandomContainer(Random& rnd)
// Do ++nFail_ if values of two objects are not equal within a given tolerance.
// The function is converted from PEP-485.
template<class Type>
typename std::enable_if
<
std::is_same<floatScalar, Type>::value ||
std::is_same<doubleScalar, Type>::value ||
std::is_same<complex, Type>::value,
void
>::type cmp
typename std::enable_if<pTraits<Type>::rank == 0, void>::type
cmp
(
const word& msg,
const Type& x,
@ -112,13 +107,8 @@ typename std::enable_if
// Do ++nFail_ if two components are not equal within a given tolerance.
// The function is converted from PEP-485
template<class Type>
typename std::enable_if
<
!std::is_same<floatScalar, Type>::value &&
!std::is_same<doubleScalar, Type>::value &&
!std::is_same<complex, Type>::value,
void
>::type cmp
typename std::enable_if<pTraits<Type>::rank != 0, void>::type
cmp
(
const word& msg,
const Type& x,
@ -131,7 +121,7 @@ typename std::enable_if
unsigned nFail = 0;
for (label i = 0; i < pTraits<Type>::nComponents; ++i)
for (direction i = 0; i < pTraits<Type>::nComponents; ++i)
{
if (max(absTol, relTol*max(mag(x[i]), mag(y[i]))) < mag(x[i] - y[i]))
{