All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BarycentricI.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) 2016-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  const Cmpt& vd
47 )
48 {
49  this->v_[A] = va;
50  this->v_[B] = vb;
51  this->v_[C] = vc;
52  this->v_[D] = vd;
53 }
54 
55 
56 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
57 
58 template<class Cmpt>
59 inline const Cmpt& Foam::Barycentric<Cmpt>::a() const
60 {
61  return this->v_[A];
62 }
63 
64 
65 template<class Cmpt>
66 inline const Cmpt& Foam::Barycentric<Cmpt>::b() const
67 {
68  return this->v_[B];
69 }
70 
71 
72 template<class Cmpt>
73 inline const Cmpt& Foam::Barycentric<Cmpt>::c() const
74 {
75  return this->v_[C];
76 }
77 
78 
79 template<class Cmpt>
80 inline const Cmpt& Foam::Barycentric<Cmpt>::d() const
81 {
82  return this->v_[D];
83 }
84 
85 
86 template<class Cmpt>
88 {
89  return this->v_[A];
90 }
91 
92 
93 template<class Cmpt>
95 {
96  return this->v_[B];
97 }
98 
99 
100 template<class Cmpt>
102 {
103  return this->v_[C];
104 }
105 
106 
107 template<class Cmpt>
109 {
110  return this->v_[D];
111 }
112 
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 namespace Foam
117 {
118 
119 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
120 
121 template<class Cmpt>
122 inline Cmpt operator&(const Barycentric<Cmpt>& b1, const Barycentric<Cmpt>& b2)
123 {
124  return b1.a()*b2.a() + b1.b()*b2.b() + b1.c()*b2.c() + b1.d()*b2.d();
125 }
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // ************************************************************************* //
Graphite solid properties.
Definition: C.H:48
const Cmpt & b() const
Definition: BarycentricI.H:66
Templated vector space.
Definition: VectorSpace.H:53
const Cmpt & d() const
Definition: BarycentricI.H:80
static const zero Zero
Definition: zero.H:97
const Cmpt & c() const
Definition: BarycentricI.H:73
Barycentric()
Construct null.
Definition: BarycentricI.H:29
const Cmpt & a() const
Definition: BarycentricI.H:59
Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant...
Definition: Barycentric.H:50
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:49
Namespace for OpenFOAM.
Cmpt operator &(const Barycentric< Cmpt > &b1, const Barycentric< Cmpt > &b2)
Definition: BarycentricI.H:122