Commit dc32b20a authored by Mark Olesen's avatar Mark Olesen Committed by Andrew Heather
Browse files

ENH: add magType to pTraits and arithmetic primitives

parent 375fd3d9
......@@ -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
......
......@@ -88,6 +88,9 @@ public:
//- Component type
typedef Cmpt cmptType;
//- Magnitude type
typedef Cmpt magType;
// Static Constants
......
......@@ -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
{
......
......@@ -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
......
......@@ -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;
......
......@@ -138,6 +138,9 @@ public:
//- Component type
typedef int32_t cmptType;
//- Magnitude type
typedef int32_t magType;
// Member constants
......
......@@ -139,6 +139,9 @@ public:
//- Component type
typedef int64_t cmptType;
//- Magnitude type
typedef int64_t magType;
// Member constants
......
......@@ -96,6 +96,9 @@ public:
//- Component type
typedef scalar cmptType;
//- Magnitude type
typedef scalar magType;
//- Euler-angle rotation order
enum eulerOrder : unsigned char
{
......
......@@ -132,6 +132,7 @@ public:
//- The value type the MinMax represents
typedef T value_type;
//- Component type
typedef typename pTraits<T>::cmptType cmptType;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment