BarycentricTensorI.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 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 \*---------------------------------------------------------------------------*/
27 
28 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
29 
30 template<class Cmpt>
32 {}
33 
34 
35 template<class Cmpt>
37 :
39 {}
40 
41 
42 template<class Cmpt>
44 (
45  const Barycentric<Cmpt>& x,
46  const Barycentric<Cmpt>& y,
47  const Barycentric<Cmpt>& z
48 )
49 {
50  this->v_[XA] = x.a();
51  this->v_[XB] = x.b();
52  this->v_[XC] = x.c();
53  this->v_[XD] = x.d();
54 
55  this->v_[YA] = y.a();
56  this->v_[YB] = y.b();
57  this->v_[YC] = y.c();
58  this->v_[YD] = y.d();
59 
60  this->v_[ZA] = z.a();
61  this->v_[ZB] = z.b();
62  this->v_[ZC] = z.c();
63  this->v_[ZD] = z.d();
64 }
65 
66 
67 template<class Cmpt>
69 (
70  const Vector<Cmpt>& a,
71  const Vector<Cmpt>& b,
72  const Vector<Cmpt>& c,
73  const Vector<Cmpt>& d
74 )
75 {
76  this->v_[XA] = a.x();
77  this->v_[XB] = b.x();
78  this->v_[XC] = c.x();
79  this->v_[XD] = d.x();
80 
81  this->v_[YA] = a.y();
82  this->v_[YB] = b.y();
83  this->v_[YC] = c.y();
84  this->v_[YD] = d.y();
85 
86  this->v_[ZA] = a.z();
87  this->v_[ZB] = b.z();
88  this->v_[ZC] = c.z();
89  this->v_[ZD] = d.z();
90 }
91 
92 
93 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
94 
95 template<class Cmpt>
97 {
98  return
100  (
101  this->v_[XA],
102  this->v_[XB],
103  this->v_[XC],
104  this->v_[XD]
105  );
106 }
107 
108 
109 template<class Cmpt>
111 {
112  return
114  (
115  this->v_[YA],
116  this->v_[YB],
117  this->v_[YC],
118  this->v_[YD]
119  );
120 }
121 
122 
123 template<class Cmpt>
125 {
126  return
128  (
129  this->v_[ZA],
130  this->v_[ZB],
131  this->v_[ZC],
132  this->v_[ZD]
133  );
134 }
135 
136 
137 template<class Cmpt>
139 {
140  return Vector<Cmpt>(this->v_[XA], this->v_[YA], this->v_[ZA]);
141 }
142 
143 
144 template<class Cmpt>
146 {
147  return Vector<Cmpt>(this->v_[XB], this->v_[YB], this->v_[ZB]);
148 }
149 
150 
151 template<class Cmpt>
153 {
154  return Vector<Cmpt>(this->v_[XC], this->v_[YC], this->v_[ZC]);
155 }
156 
157 
158 template<class Cmpt>
160 {
161  return Vector<Cmpt>(this->v_[XD], this->v_[YD], this->v_[ZD]);
162 }
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 namespace Foam
168 {
169 
170 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
171 
172 template<class Cmpt>
173 inline Vector<Cmpt> operator&
174 (
175  const BarycentricTensor<Cmpt>& T,
176  const Barycentric<Cmpt>& b
177 )
178 {
179  return Vector<Cmpt>(T.x() & b, T.y() & b, T.z() & b);
180 }
181 
182 
183 template<class Cmpt>
184 inline Barycentric<Cmpt> operator&
185 (
186  const Vector<Cmpt>& v,
188 )
189 {
190  return Barycentric<Cmpt>(v & T.a(), v & T.b(), v & T.c(), v & T.d());
191 }
192 
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 } // End namespace Foam
197 
198 // ************************************************************************* //
Foam::Vector::x
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:78
Foam::BarycentricTensor::b
Vector< Cmpt > b() const
Definition: BarycentricTensorI.H:145
Foam::Barycentric::a
const Cmpt & a() const
Definition: BarycentricI.H:61
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::BarycentricTensor::x
Barycentric< Cmpt > x() const
Definition: BarycentricTensorI.H:96
Foam::BarycentricTensor::BarycentricTensor
BarycentricTensor()
Construct null.
Definition: BarycentricTensorI.H:31
Foam::BarycentricTensor::a
Vector< Cmpt > a() const
Definition: BarycentricTensorI.H:138
Foam::Barycentric::c
const Cmpt & c() const
Definition: BarycentricI.H:75
Foam::Vector::z
const Cmpt & z() const
Access to the vector z component.
Definition: VectorI.H:90
Foam::MatrixSpace
Templated matrix space.
Definition: MatrixSpace.H:58
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::T
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Definition: FieldFieldFunctions.C:58
Foam::Barycentric
Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant.
Definition: Barycentric.H:54
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector::y
const Cmpt & y() const
Access to the vector y component.
Definition: VectorI.H:84
Foam::Barycentric::d
const Cmpt & d() const
Definition: BarycentricI.H:82
Foam::Vector
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:62
Foam::BarycentricTensor::z
Barycentric< Cmpt > z() const
Definition: BarycentricTensorI.H:124
Foam::BarycentricTensor::c
Vector< Cmpt > c() const
Definition: BarycentricTensorI.H:152
Foam::BarycentricTensor
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
Definition: BarycentricTensor.H:57
x
x
Definition: LISASMDCalcMethod2.H:52
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::BarycentricTensor::d
Vector< Cmpt > d() const
Definition: BarycentricTensorI.H:159
Foam::Barycentric::b
const Cmpt & b() const
Definition: BarycentricI.H:68
Foam::BarycentricTensor::y
Barycentric< Cmpt > y() const
Definition: BarycentricTensorI.H:110
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61