BarycentricTensor.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) 2017 OpenFOAM Foundation
9 Copyright (C) 2019-2020 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
27Class
28 Foam::BarycentricTensor
29
30Description
31 Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can
32 represent a barycentric transformation as a matrix-barycentric inner-
33 product. Can alternatively represent an inverse barycentric transformation
34 as a vector-matrix inner-product.
35
36SourceFiles
37 BarycentricTensorI.H
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef BarycentricTensor_H
42#define BarycentricTensor_H
43
44#include "Barycentric.H"
45#include "Tensor.H"
46#include "Vector.H"
47
48// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49
50namespace Foam
51{
52
53/*---------------------------------------------------------------------------*\
54 Class BarycentricTensor Declaration
55\*---------------------------------------------------------------------------*/
56
57template<class Cmpt>
59:
60 public MatrixSpace<BarycentricTensor<Cmpt>, Cmpt, 4, 3>
61{
62public:
63
64 // Typedefs
65
66 //- Equivalent type of labels used for valid component indexing
68
69
70 // Member Constants
71
72 //- Rank of BarycentricTensor is 2
73 static constexpr direction rank = 2;
74
75
76 //- Component labeling enumeration
77 enum components { XA, XB, XC, XD, YA, YB, YC, YD, ZA, ZB, ZC, ZD };
78
79
80 // Generated Methods
81
82 //- Default construct
83 BarycentricTensor() = default;
84
85
86 // Constructors
87
88 //- Construct initialised to zero
89 inline BarycentricTensor(const Foam::zero);
90
91 //- Construct given three barycentric components (rows)
93 (
94 const Barycentric<Cmpt>& x,
95 const Barycentric<Cmpt>& y,
96 const Barycentric<Cmpt>& z
97 );
98
99 //- Construct given four vector components (columns)
100 inline BarycentricTensor
101 (
102 const Vector<Cmpt>& a,
103 const Vector<Cmpt>& b,
104 const Vector<Cmpt>& c,
105 const Vector<Cmpt>& d
106 );
107
108
109 // Member Functions
110
111 // Row-barycentric access
112
113 inline Barycentric<Cmpt> x() const;
114 inline Barycentric<Cmpt> y() const;
115 inline Barycentric<Cmpt> z() const;
116
117 // Column-vector access
118
119 inline Vector<Cmpt> a() const;
120 inline Vector<Cmpt> b() const;
121 inline Vector<Cmpt> c() const;
122 inline Vector<Cmpt> d() const;
123};
124
125
126// * * * * * * * * * * * * * * * * * Traits * * * * * * * * * * * * * * * * //
127
128//- Data are contiguous if component type is contiguous
129template<class Cmpt>
130struct is_contiguous<BarycentricTensor<Cmpt>> : is_contiguous<Cmpt> {};
131
132//- Data are contiguous label if component type is label
133template<class Cmpt>
135:
137{};
138
139//- Data are contiguous scalar if component type is scalar
140template<class Cmpt>
142:
144{};
145
146
147template<class Cmpt>
148class typeOfTranspose<Cmpt, BarycentricTensor<Cmpt>>
149{
150public:
152 typedef void type;
153};
154
155
156// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157
158} // End namespace Foam
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162#include "BarycentricTensorI.H"
163
164// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165
166#endif
167
168// ************************************************************************* //
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
Barycentric< Cmpt > y() const
components
Component labeling enumeration.
Tensor< label > labelType
Equivalent type of labels used for valid component indexing.
Vector< Cmpt > d() const
Vector< Cmpt > b() const
Vector< Cmpt > c() const
static constexpr direction rank
Rank of BarycentricTensor is 2.
Barycentric< Cmpt > z() const
BarycentricTensor()=default
Default construct.
Barycentric< Cmpt > x() const
Vector< Cmpt > a() const
Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant.
Definition: Barycentric.H:57
Templated matrix space.
Definition: MatrixSpace.H:61
A templated (3 x 3) tensor of objects of <T> derived from MatrixSpace.
Definition: Tensor.H:64
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
Abstract template class to provide the transpose form of a form.
Definition: products.H:63
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Namespace for OpenFOAM.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition: MSwindows.C:598
uint8_t direction
Definition: direction.H:56
A template class to specify if a data type is composed solely of Foam::label elements.
Definition: contiguous.H:86
A template class to specify if a data type is composed solely of Foam::scalar elements.
Definition: contiguous.H:94
A template class to specify that a data type can be considered as being contiguous in memory.
Definition: contiguous.H:78