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-------------------------------------------------------------------------------
10License
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
30template<class Cmpt>
32:
34{}
35
36
37template<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
62template<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
90template<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
104template<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
118template<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
132template<class Cmpt>
134{
135 return Vector<Cmpt>(this->v_[XA], this->v_[YA], this->v_[ZA]);
136}
137
138
139template<class Cmpt>
141{
142 return Vector<Cmpt>(this->v_[XB], this->v_[YB], this->v_[ZB]);
143}
144
145
146template<class Cmpt>
148{
149 return Vector<Cmpt>(this->v_[XC], this->v_[YC], this->v_[ZC]);
150}
151
152
153template<class Cmpt>
155{
156 return Vector<Cmpt>(this->v_[XD], this->v_[YD], this->v_[ZD]);
157}
158
159
160// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161
162namespace Foam
163{
164
165// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
166
167template<class Cmpt>
168inline Vector<Cmpt> operator&
169(
171 const Barycentric<Cmpt>& b
172)
173{
174 return Vector<Cmpt>(T.x() & b, T.y() & b, T.z() & b);
175}
176
177
178template<class Cmpt>
179inline 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// ************************************************************************* //
scalar y
Templated 4x3 tensor derived from VectorSpace. Has 12 components. Can represent a barycentric transfo...
Barycentric< Cmpt > y() const
Vector< Cmpt > d() const
Vector< Cmpt > b() const
Vector< Cmpt > c() const
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
const Cmpt & a() const
Definition: BarycentricI.H:56
const Cmpt & b() const
Definition: BarycentricI.H:63
const Cmpt & c() const
Definition: BarycentricI.H:70
const Cmpt & d() const
Definition: BarycentricI.H:77
Templated matrix space.
Definition: MatrixSpace.H:61
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition: Vector.H:65
const Cmpt & z() const
Access to the vector z component.
Definition: VectorI.H:85
const Cmpt & y() const
Access to the vector y component.
Definition: VectorI.H:79
const Cmpt & x() const
Access to the vector x component.
Definition: VectorI.H:73
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
const volScalarField & T
Namespace for OpenFOAM.
volScalarField & b
Definition: createFields.H:27