products.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2019 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27InNamespace
28 Foam
29
30Description
31 Traits classes for inner and outer products of primitives.
32
33\*---------------------------------------------------------------------------*/
34
35#ifndef products_H
36#define products_H
37
38#include "direction.H"
39#include "pTraits.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47
48//- Abstract template class to provide the form resulting from
49//- the inner-product of two forms
50template<class Cmpt, class Form1, class Form2>
52{};
53
54//- Abstract template class to provide the form resulting from
55//- the outer-product of two forms
56template<class Cmpt, class Form1, class Form2>
58{};
59
60//- Abstract template class to provide the transpose form of a form
61template<class Cmpt, class Form>
63{};
64
65
66template<class Cmpt, direction rank>
68{};
69
70
71template<class Cmpt, direction rank>
73{};
74
75
76//- The extended precision type (solveScalar for float)
77template<class Type>
79{
80public:
81
82 typedef Type type;
83};
84
85
86//- The magnitude type for given argument.
87template<class arg1>
89{
90public:
91
93};
94
95
96template<class arg1, class arg2>
98{
99public:
100
101 typedef arg1 type;
102};
103
104
105template<class arg1, class arg2>
107{
108public:
109
110 typedef typename typeOfRank
111 <
115};
116
117
118//- Outer-product of identical types
119template<class arg1>
121:
122 public outerProduct<arg1, arg1>
123{
124public:
125};
126
127
128template<class arg1, class arg2>
130{
131public:
132
133 typedef typename typeOfRank
134 <
138};
139
140template<class arg1, class arg2>
142{
143public:
144
145 typedef typename typeOfRank
146 <
150};
151
152template<class arg1, class arg2>
154{
155public:
156
158};
159
160
161template<class arg1, direction arg2>
163{
164public:
165
166 typedef typename symmTypeOfRank
167 <
171};
172
173
174// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175
176// Partial Specializations for non-VectorSpace quantities
177
178template<class Cmpt>
179class typeOfRank<Cmpt, 0>
180{
181public:
182
183 typedef Cmpt type;
184};
185
186
187template<class Cmpt>
188class symmTypeOfRank<Cmpt, 0>
189{
190public:
191
192 typedef Cmpt type;
193};
194
195
196// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
197
198} // End namespace Foam
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202#endif
203
204// ************************************************************************* //
typeOfRank< typenamepTraits< arg2 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) -1 >::type type
Definition: products.H:137
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
Definition: edge.H:66
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) -2 >::type type
Definition: products.H:149
Outer-product of identical types.
Definition: products.H:123
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank)>::type type
Definition: products.H:114
A traits class, which is primarily used for primitives.
Definition: pTraits.H:59
symmTypeOfRank< typenamepTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank)>::type type
Definition: products.H:170
pTraits< arg1 >::cmptType type
Definition: products.H:157
The magnitude type for given argument.
Definition: products.H:89
pTraits< typenamepTraits< arg1 >::cmptType >::magType type
Definition: products.H:92
The extended precision type (solveScalar for float)
Definition: products.H:79
Abstract template class to provide the transpose form of a form.
Definition: products.H:63
Direction is an 8-bit unsigned integer type used to represent Cartesian directions,...
Namespace for OpenFOAM.
uint8_t direction
Definition: direction.H:56