BarycentricI.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) 2016-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  ANB 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 Cmpt& va,
46  const Cmpt& vb,
47  const Cmpt& vc,
48  const Cmpt& vd
49 )
50 {
51  this->v_[A] = va;
52  this->v_[B] = vb;
53  this->v_[C] = vc;
54  this->v_[D] = vd;
55 }
56 
57 
58 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
59 
60 template<class Cmpt>
61 inline const Cmpt& Foam::Barycentric<Cmpt>::a() const
62 {
63  return this->v_[A];
64 }
65 
66 
67 template<class Cmpt>
68 inline const Cmpt& Foam::Barycentric<Cmpt>::b() const
69 {
70  return this->v_[B];
71 }
72 
73 
74 template<class Cmpt>
75 inline const Cmpt& Foam::Barycentric<Cmpt>::c() const
76 {
77  return this->v_[C];
78 }
79 
80 
81 template<class Cmpt>
82 inline const Cmpt& Foam::Barycentric<Cmpt>::d() const
83 {
84  return this->v_[D];
85 }
86 
87 
88 template<class Cmpt>
90 {
91  return this->v_[A];
92 }
93 
94 
95 template<class Cmpt>
97 {
98  return this->v_[B];
99 }
100 
101 
102 template<class Cmpt>
104 {
105  return this->v_[C];
106 }
107 
108 
109 template<class Cmpt>
111 {
112  return this->v_[D];
113 }
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 namespace Foam
119 {
120 
121 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
122 
123 template<class Cmpt>
124 inline Cmpt operator&(const Barycentric<Cmpt>& b1, const Barycentric<Cmpt>& b2)
125 {
126  return b1.a()*b2.a() + b1.b()*b2.b() + b1.c()*b2.c() + b1.d()*b2.d();
127 }
128 
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 } // End namespace Foam
133 
134 // ************************************************************************* //
Foam::Barycentric::Barycentric
Barycentric()
Construct null.
Definition: BarycentricI.H:31
Foam::operator&
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
Foam::Barycentric::a
const Cmpt & a() const
Definition: BarycentricI.H:61
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
B
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
A
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
Foam::Barycentric::c
const Cmpt & c() const
Definition: BarycentricI.H:75
C
volScalarField & C
Definition: readThermalProperties.H:102
Foam::VectorSpace
Templated vector space.
Definition: VectorSpace.H:56
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::Barycentric::d
const Cmpt & d() const
Definition: BarycentricI.H:82
D
const dimensionedScalar & D
Definition: solveBulkSurfactant.H:4
Foam::Barycentric::b
const Cmpt & b() const
Definition: BarycentricI.H:68
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61