Barycentric2DI.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-2018 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 \*---------------------------------------------------------------------------*/
25 
26 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
27 
28 template<class Cmpt>
30 {}
31 
32 
33 template<class Cmpt>
35 :
37 {}
38 
39 
40 template<class Cmpt>
42 (
43  const Cmpt& va,
44  const Cmpt& vb,
45  const Cmpt& vc
46 )
47 {
48  this->v_[A] = va;
49  this->v_[B] = vb;
50  this->v_[C] = vc;
51 }
52 
53 
54 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
55 
56 template<class Cmpt>
57 inline const Cmpt& Foam::Barycentric2D<Cmpt>::a() const
58 {
59  return this->v_[A];
60 }
61 
62 
63 template<class Cmpt>
64 inline const Cmpt& Foam::Barycentric2D<Cmpt>::b() const
65 {
66  return this->v_[B];
67 }
68 
69 
70 template<class Cmpt>
71 inline const Cmpt& Foam::Barycentric2D<Cmpt>::c() const
72 {
73  return this->v_[C];
74 }
75 
76 
77 template<class Cmpt>
79 {
80  return this->v_[A];
81 }
82 
83 
84 template<class Cmpt>
86 {
87  return this->v_[B];
88 }
89 
90 
91 template<class Cmpt>
93 {
94  return this->v_[C];
95 }
96 
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 namespace Foam
101 {
102 
103 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
104 
105 template<class Cmpt>
106 inline Cmpt operator&
107 (
108  const Barycentric2D<Cmpt>& b1,
109  const Barycentric2D<Cmpt>& b2
110 )
111 {
112  return b1.a()*b2.a() + b1.b()*b2.b() + b1.c()*b2.c();
113 }
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace Foam
119 
120 // ************************************************************************* //
static const Foam::dimensionedScalar A("A", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("B", Foam::dimless, 18.678)
static const Foam::dimensionedScalar C("C", Foam::dimTemperature, 234.5)
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant.
Definition: Barycentric2D.H:53
const Cmpt & a() const
Barycentric2D()
Construct null.
const Cmpt & b() const
const Cmpt & c() const
Templated vector space.
Definition: VectorSpace.H:85
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:50
Namespace for OpenFOAM.
static const zero Zero
Definition: zero.H:97