BarycentricTensor.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::BarycentricTensor
26 
27 Description
28  Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can
29  represent a barycentric transformation as a matrix-barycentric inner-
30  product. Can alternatively represent an inverse barycentric transformation
31  as a vector-matrix inner-product.
32 
33 SourceFiles
34  BarycentricTensorI.H
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef BarycentricTensor_H
39 #define BarycentricTensor_H
40 
41 #include "Barycentric.H"
42 #include "Tensor.H"
43 #include "Vector.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class BarycentricTensor Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Cmpt>
56 :
57  public MatrixSpace<BarycentricTensor<Cmpt>, Cmpt, 4, 3>
58 {
59 public:
60 
61  //- Equivalent type of labels used for valid component indexing
62  typedef Tensor<label> labelType;
63 
64 
65  // Member constants
66 
67  //- Rank of BarycentricTensor is 2
68  static const direction rank = 2;
69 
70 
71  //- Component labeling enumeration
72  enum components { XA, XB, XC, XD, YA, YB, YC, YD, ZA, ZB, ZC, ZD };
73 
74 
75  // Constructors
76 
77  //- Construct null
79 
80  //- Construct initialised to zero
82 
83  //- Construct given three barycentric components (rows)
85  (
86  const Barycentric<Cmpt>& x,
87  const Barycentric<Cmpt>& y,
88  const Barycentric<Cmpt>& z
89  );
90 
91  //- Construct given four vector components (columns)
93  (
94  const Vector<Cmpt>& a,
95  const Vector<Cmpt>& b,
96  const Vector<Cmpt>& c,
97  const Vector<Cmpt>& d
98  );
99 
100 
101  // Member Functions
102 
103  // Row-barycentric access
104 
105  inline Barycentric<Cmpt> x() const;
106  inline Barycentric<Cmpt> y() const;
107  inline Barycentric<Cmpt> z() const;
108 
109  // Column-vector access
110 
111  inline Vector<Cmpt> a() const;
112  inline Vector<Cmpt> b() const;
113  inline Vector<Cmpt> c() const;
114  inline Vector<Cmpt> d() const;
115 };
116 
117 
118 template<class Cmpt>
119 class typeOfTranspose<Cmpt, BarycentricTensor<Cmpt>>
120 {
121 public:
123  typedef void type;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #include "BarycentricTensorI.H"
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Tensor< label > labelType
Equivalent type of labels used for valid component indexing.
Barycentric< Cmpt > x() const
Vector< Cmpt > b() const
uint8_t direction
Definition: direction.H:45
Barycentric< Cmpt > z() const
Templated matrix space.
Definition: MatrixSpace.H:55
components
Component labeling enumeration.
Barycentric< Cmpt > y() const
static const direction rank
Rank of BarycentricTensor is 2.
Vector< Cmpt > d() const
Abstract template class to provide the transpose form of a form.
Definition: products.H:58
Templated 3D Vector derived from VectorSpace adding construction from 3 components, element access using x(), y() and z() member functions and the inner-product (dot-product) and cross product operators.
Definition: Vector.H:57
Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant...
Definition: Barycentric.H:50
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
BarycentricTensor()
Construct null.
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:49
Vector< Cmpt > a() const
Templated 3D tensor derived from MatrixSpace adding construction from 9 components, element access using xx(), xy() etc. member functions and the inner-product (dot-product) and outer-product of two Vectors (tensor-product) operators.
Definition: complexI.H:215
Vector< Cmpt > c() const
Namespace for OpenFOAM.