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-------------------------------------------------------------------------------
10License
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
30template<class Cmpt>
32:
33 Barycentric::vsType(Zero)
34{}
35
36
37template<class Cmpt>
39(
40 const Cmpt& va,
41 const Cmpt& vb,
42 const Cmpt& vc,
43 const Cmpt& vd
44)
45{
46 this->v_[A] = va;
47 this->v_[B] = vb;
48 this->v_[C] = vc;
49 this->v_[D] = vd;
50}
51
52
53// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
54
55template<class Cmpt>
56inline const Cmpt& Foam::Barycentric<Cmpt>::a() const
57{
58 return this->v_[A];
59}
60
61
62template<class Cmpt>
63inline const Cmpt& Foam::Barycentric<Cmpt>::b() const
64{
65 return this->v_[B];
66}
67
68
69template<class Cmpt>
70inline const Cmpt& Foam::Barycentric<Cmpt>::c() const
71{
72 return this->v_[C];
73}
74
75
76template<class Cmpt>
77inline const Cmpt& Foam::Barycentric<Cmpt>::d() const
78{
79 return this->v_[D];
80}
81
82
83template<class Cmpt>
86 return this->v_[A];
87}
89
90template<class Cmpt>
92{
93 return this->v_[B];
94}
95
96
97template<class Cmpt>
99{
100 return this->v_[C];
104template<class Cmpt>
107 return this->v_[D];
110
111// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
112
113namespace Foam
114{
115
116// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
117
118template<class Cmpt>
119inline Cmpt operator&(const Barycentric<Cmpt>& b1, const Barycentric<Cmpt>& b2)
120{
121 return b1.a()*b2.a() + b1.b()*b2.b() + b1.c()*b2.c() + b1.d()*b2.d();
122}
123
124
125// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126
127} // End namespace Foam
128
129// ************************************************************************* //
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Templated 3D Barycentric derived from VectorSpace. Has 4 components, one of which is redundant.
Definition: Barycentric.H:57
const Cmpt & a() const
Definition: BarycentricI.H:56
Barycentric()=default
Default construct.
const Cmpt & b() const
Definition: BarycentricI.H:63
const Cmpt & c() const
Definition: BarycentricI.H:70
const Cmpt & d() const
Definition: BarycentricI.H:77
Graphite solid properties.
Definition: C.H:53
Templated vector space.
Definition: VectorSpace.H:79
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:63
Namespace for OpenFOAM.
tmp< GeometricField< Type, fvPatchField, volMesh > > operator&(const fvMatrix< Type > &, const DimensionedField< Type, volMesh > &)
const dimensionedScalar & D