ENH: add magType to pTraits and arithmetic primitives

This commit is contained in:
Mark Olesen
2019-06-04 19:30:35 +02:00
committed by Andrew Heather
parent 375fd3d9d3
commit dc32b20a5c
9 changed files with 38 additions and 4 deletions

View File

@ -52,10 +52,14 @@ public:
//- Component type
typedef Scalar cmptType;
//- Magnitude type
typedef Scalar magType;
//- Equivalent type of labels used for valid component indexing
typedef label labelType;
// Member constants
//- Dimensionality of space

View File

@ -88,6 +88,9 @@ public:
//- Component type
typedef Cmpt cmptType;
//- Magnitude type
typedef Cmpt magType;
// Static Constants

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -44,13 +44,13 @@ namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
//- Abstract template class to provide the form resulting from
// the inner-product of two forms
//- the inner-product of two forms
template<class Cmpt, class Form1, class Form2>
class typeOfInnerProduct
{};
//- Abstract template class to provide the form resulting from
// the outer-product of two forms
//- the outer-product of two forms
template<class Cmpt, class Form1, class Form2>
class typeOfOuterProduct
{};
@ -71,6 +71,16 @@ class symmTypeOfRank
{};
//- The magnitude type for given argument.
template<class arg1>
class typeOfMag
{
public:
typedef typename pTraits<typename pTraits<arg1>::cmptType>::magType type;
};
template<class arg1, class arg2>
class typeOfSum
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd | Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
@ -74,6 +74,10 @@ public:
//- Component type
typedef bool cmptType;
//- Magnitude type
typedef bool magType;
// Member constants
//- Dimensionality of space

View File

@ -252,6 +252,9 @@ public:
//- Component type
typedef complex cmptType;
//- Magnitude type
typedef scalar magType;
//- Equivalent type of labels used for valid component indexing
typedef label labelType;

View File

@ -138,6 +138,9 @@ public:
//- Component type
typedef int32_t cmptType;
//- Magnitude type
typedef int32_t magType;
// Member constants

View File

@ -139,6 +139,9 @@ public:
//- Component type
typedef int64_t cmptType;
//- Magnitude type
typedef int64_t magType;
// Member constants

View File

@ -96,6 +96,9 @@ public:
//- Component type
typedef scalar cmptType;
//- Magnitude type
typedef scalar magType;
//- Euler-angle rotation order
enum eulerOrder : unsigned char
{

View File

@ -132,6 +132,7 @@ public:
//- The value type the MinMax represents
typedef T value_type;
//- Component type
typedef typename pTraits<T>::cmptType cmptType;