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 :
34 {}
35 
36 
37 template<class Cmpt>
39 (
40  const Barycentric<Cmpt>& x,
41  const Barycentric<Cmpt>& y,
42  const Barycentric<Cmpt>& z
43 )
44 {
45  this->v_[XA] = x.a();
46  this->v_[XB] = x.b();
47  this->v_[XC] = x.c();
48  this->v_[XD] = x.d();
49 
50  this->v_[YA] = y.a();
51  this->v_[YB] = y.b();
52  this->v_[YC] = y.c();
53  this->v_[YD] = y.d();
54 
55  this->v_[ZA] = z.a();
56  this->v_[ZB] = z.b();
57  this->v_[ZC] = z.c();
58  this->v_[ZD] = z.d();
59 }
60 
61 
62 template<class Cmpt>
64 (
65  const Vector<Cmpt>& a,
66  const Vector<Cmpt>& b,
67  const Vector<Cmpt>& c,
68  const Vector<Cmpt>& d
69 )
70 {
71  this->v_[XA] = a.x();
72  this->v_[XB] = b.x();
73  this->v_[XC] = c.x();
74  this->v_[XD] = d.x();
75 
76  this->v_[YA] = a.y();
77  this->v_[YB] = b.y();
78  this->v_[YC] = c.y();
79  this->v_[YD] = d.y();
80 
81  this->v_[ZA] = a.z();
82  this->v_[ZB] = b.z();
83  this->v_[ZC] = c.z();
84  this->v_[ZD] = d.z();
85 }
86 
87 
88 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
89 
90 template<class Cmpt>
92 {
93  return
95  (
96  this->v_[XA],
97  this->v_[XB],
98  this->v_[XC],
99  this->v_[XD]
100  );
101 }
102 
103 
104 template<class Cmpt>
106 {
107  return
109  (
110  this->v_[YA],
111  this->v_[YB],
112  this->v_[YC],
113  this->v_[YD]
114  );
115 }
116 
117 
118 template<class Cmpt>
120 {
121  return
123  (
124  this->v_[ZA],
125  this->v_[ZB],
126  this->v_[ZC],
127  this->v_[ZD]
128  );
129 }
130 
131 
132 template<class Cmpt>
134 {
135  return Vector<Cmpt>(this->v_[XA], this->v_[YA], this->v_[ZA]);
136 }
137 
138 
139 template<class Cmpt>
141 {
142  return Vector<Cmpt>(this->v_[XB], this->v_[YB], this->v_[ZB]);
143 }
144 
145 
146 template<class Cmpt>
148 {
149  return Vector<Cmpt>(this->v_[XC], this->v_[YC], this->v_[ZC]);
150 }
151 
152 
153 template<class Cmpt>
155 {
156  return Vector<Cmpt>(this->v_[XD], this->v_[YD], this->v_[ZD]);
157 }
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 namespace Foam
163 {
164 
165 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
166 
167 template<class Cmpt>
168 inline Vector<Cmpt> operator&
169 (
170  const BarycentricTensor<Cmpt>& T,
171  const Barycentric<Cmpt>& b
172 )
173 {
174  return Vector<Cmpt>(T.x() & b, T.y() & b, T.z() & b);
175 }
176 
177 
178 template<class Cmpt>
179 inline Barycentric<Cmpt> operator&
180 (
181  const Vector<Cmpt>& v,
183 )
184 {
185  return Barycentric<Cmpt>(v & T.a(), v & T.b(), v & T.c(), v & T.d());
186 }
187 
188 
189 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
190 
191 } // End namespace Foam
192 
193 // ************************************************************************* //
Foam::Vector::x
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:73
Foam::BarycentricTensor::b
Vector< Cmpt > b() const
Definition: BarycentricTensorI.H:140
Foam::Barycentric::a
const Cmpt & a() const
Definition: BarycentricI.H:56
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::BarycentricTensor::x
Barycentric< Cmpt > x() const
Definition: BarycentricTensorI.H:91
Foam::BarycentricTensor::a
Vector< Cmpt > a() const
Definition: BarycentricTensorI.H:133
Foam::Barycentric::c
const Cmpt & c() const
Definition: BarycentricI.H:70
Foam::Vector::z
const Cmpt & z() const
Access to the vector z component.
Definition: VectorI.H:85
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::BarycentricTensor::BarycentricTensor
BarycentricTensor()=default
Default construct.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::Vector::y
const Cmpt & y() const
Access to the vector y component.
Definition: VectorI.H:79
Foam::Barycentric::d
const Cmpt & d() const
Definition: BarycentricI.H:77
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:119
Foam::BarycentricTensor::c
Vector< Cmpt > c() const
Definition: BarycentricTensorI.H:147
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:154
Foam::Barycentric::b
const Cmpt & b() const
Definition: BarycentricI.H:63
Foam::BarycentricTensor::y
Barycentric< Cmpt > y() const
Definition: BarycentricTensorI.H:105
y
scalar y
Definition: LISASMDCalcMethod1.H:14
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62