BarycentricTensor2D.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) 2021 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::BarycentricTensor2D
26 
27 Description
28  Templated 3x3 tensor derived from VectorSpace. Has 9 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  BarycentricTensor2DI.H
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef BarycentricTensor2D_H
39 #define BarycentricTensor2D_H
40 
41 #include "Barycentric2D.H"
42 #include "Tensor2D.H"
43 #include "Vector.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class BarycentricTensor2D Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Cmpt>
56 :
57  public MatrixSpace<BarycentricTensor2D<Cmpt>, Cmpt, 3, 3>
58 {
59 public:
60 
61  //- Equivalent type of labels used for valid component indexing
62  typedef Tensor2D<label> labelType;
63 
64 
65  // Member constants
66 
67  //- Rank of BarycentricTensor2D is 2
68  static const direction rank = 2;
69 
70 
71  //- Component labeling enumeration
72  enum components { XA, XB, XC, YA, YB, YC, ZA, ZB, ZC };
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 Barycentric2D<Cmpt>& x,
87  const Barycentric2D<Cmpt>& y,
88  const Barycentric2D<Cmpt>& z
89  );
90 
91  //- Construct given three vector components (columns)
93  (
94  const Vector<Cmpt>& a,
95  const Vector<Cmpt>& b,
96  const Vector<Cmpt>& c
97  );
98 
99 
100  // Member Functions
101 
102  // Row-barycentric access
103 
104  inline Barycentric2D<Cmpt> x() const;
105  inline Barycentric2D<Cmpt> y() const;
106  inline Barycentric2D<Cmpt> z() const;
107 
108  // Column-vector access
109 
110  inline Vector<Cmpt> a() const;
111  inline Vector<Cmpt> b() const;
112  inline Vector<Cmpt> c() const;
113 };
114 
115 
116 template<class Cmpt>
117 class typeOfTranspose<Cmpt, BarycentricTensor2D<Cmpt>>
118 {
119 public:
120 
121  typedef void type;
122 };
123 
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 } // End namespace Foam
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #include "BarycentricTensor2DI.H"
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant.
Definition: Barycentric2D.H:53
Templated 3x3 tensor derived from VectorSpace. Has 9 components. Can represent a barycentric transfor...
Tensor2D< label > labelType
Equivalent type of labels used for valid component indexing.
static const direction rank
Rank of BarycentricTensor2D is 2.
components
Component labeling enumeration.
Barycentric2D< Cmpt > z() const
Vector< Cmpt > b() const
Vector< Cmpt > c() const
Barycentric2D< Cmpt > y() const
Barycentric2D< Cmpt > x() const
BarycentricTensor2D()
Construct null.
Vector< Cmpt > a() const
Templated matrix space.
Definition: MatrixSpace.H:58
Templated 2D tensor derived from VectorSpace adding construction from 4 components,...
Definition: Tensor2D.H:59
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:60
Abstract template class to provide the transpose form of a form.
Definition: products.H:59
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:50
Namespace for OpenFOAM.
uint8_t direction
Definition: direction.H:45
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488