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 :
35 {}
36 
37 
38 template<class Cmpt>
40 (
41  const Cmpt& va,
42  const Cmpt& vb,
43  const Cmpt& vc
44 )
45 {
46  this->v_[A] = va;
47  this->v_[B] = vb;
48  this->v_[C] = vc;
49 }
50 
51 
52 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
53 
54 template<class Cmpt>
55 inline const Cmpt& Foam::Barycentric2D<Cmpt>::a() const
56 {
57  return this->v_[A];
58 }
59 
60 
61 template<class Cmpt>
62 inline const Cmpt& Foam::Barycentric2D<Cmpt>::b() const
63 {
64  return this->v_[B];
65 }
66 
67 
68 template<class Cmpt>
69 inline const Cmpt& Foam::Barycentric2D<Cmpt>::c() const
70 {
71  return this->v_[C];
72 }
73 
74 
75 template<class Cmpt>
77 {
78  return this->v_[A];
79 }
80 
81 
82 template<class Cmpt>
84 {
85  return this->v_[B];
86 }
87 
88 
89 template<class Cmpt>
91 {
92  return this->v_[C];
93 }
94 
95 
96 template<class Cmpt>
98 {
99  return ((this->v_[A] < 0) || (this->v_[B]) < 0 || (this->v_[C] < 0));
100 }
101 
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 namespace Foam
106 {
107 
108 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
109 
110 template<class Cmpt>
111 inline Cmpt operator&
112 (
113  const Barycentric2D<Cmpt>& b1,
114  const Barycentric2D<Cmpt>& b2
115 )
116 {
117  return b1.a()*b2.a() + b1.b()*b2.b() + b1.c()*b2.c();
118 }
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // ************************************************************************* //
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::Barycentric2D::b
const Cmpt & b() const
Definition: Barycentric2DI.H:62
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)
C
volScalarField & C
Definition: readThermalProperties.H:102
Foam::Barycentric2D::c
const Cmpt & c() const
Definition: Barycentric2DI.H:69
Foam::VectorSpace
Templated vector space.
Definition: VectorSpace.H:56
Foam::Barycentric2D::Barycentric2D
Barycentric2D()=default
Default construct.
Foam::Barycentric2D::outside
bool outside() const
True if any coordinates are negative.
Definition: Barycentric2DI.H:97
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:55
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62