Barycentric2DI.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  Copyright (C) 2019 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANB WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30 
31 template<class Cmpt>
33 {}
34 
35 
36 template<class Cmpt>
38 :
40 {}
41 
42 
43 template<class Cmpt>
45 (
46  const Cmpt& va,
47  const Cmpt& vb,
48  const Cmpt& vc
49 )
50 {
51  this->v_[A] = va;
52  this->v_[B] = vb;
53  this->v_[C] = vc;
54 }
55 
56 
57 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
58 
59 template<class Cmpt>
60 inline const Cmpt& Foam::Barycentric2D<Cmpt>::a() const
61 {
62  return this->v_[A];
63 }
64 
65 
66 template<class Cmpt>
67 inline const Cmpt& Foam::Barycentric2D<Cmpt>::b() const
68 {
69  return this->v_[B];
70 }
71 
72 
73 template<class Cmpt>
74 inline const Cmpt& Foam::Barycentric2D<Cmpt>::c() const
75 {
76  return this->v_[C];
77 }
78 
79 
80 template<class Cmpt>
82 {
83  return this->v_[A];
84 }
85 
86 
87 template<class Cmpt>
89 {
90  return this->v_[B];
91 }
92 
93 
94 template<class Cmpt>
96 {
97  return this->v_[C];
98 }
99 
100 
101 template<class Cmpt>
103 {
104  return ((this->v_[A] < 0) || (this->v_[B]) < 0 || (this->v_[C] < 0));
105 }
106 
107 
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
109 
110 namespace Foam
111 {
112 
113 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
114 
115 template<class Cmpt>
116 inline Cmpt operator&
117 (
118  const Barycentric2D<Cmpt>& b1,
119  const Barycentric2D<Cmpt>& b2
120 )
121 {
122  return b1.a()*b2.a() + b1.b()*b2.b() + b1.c()*b2.c();
123 }
124 
125 
126 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
127 
128 } // End namespace Foam
129 
130 // ************************************************************************* //
Foam::Zero
static constexpr const zero Zero
Global zero.
Definition: zero.H:128
Foam::Barycentric2D::b
const Cmpt & b() const
Definition: Barycentric2DI.H:67
B
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Foam::Barycentric2D
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant.
Definition: Barycentric2D.H:54
A
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
Foam::Barycentric2D::Barycentric2D
Barycentric2D()
Construct null.
Definition: Barycentric2DI.H:32
C
volScalarField & C
Definition: readThermalProperties.H:102
Foam::Barycentric2D::c
const Cmpt & c() const
Definition: Barycentric2DI.H:74
Foam::VectorSpace
Templated vector space.
Definition: VectorSpace.H:56
Foam::Barycentric2D::outside
bool outside() const
True if any coordinates are negative.
Definition: Barycentric2DI.H:102
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::C
Graphite solid properties.
Definition: C.H:50
Foam::Barycentric2D::a
const Cmpt & a() const
Definition: Barycentric2DI.H:60
Foam::zero
A class representing the concept of 0 (zero), which can be used to avoid manipulating objects that ar...
Definition: zero.H:61