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-------------------------------------------------------------------------------
11License
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
31template<class Cmpt>
33:
35{}
36
37
38template<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
54template<class Cmpt>
55inline const Cmpt& Foam::Barycentric2D<Cmpt>::a() const
56{
57 return this->v_[A];
58}
59
60
61template<class Cmpt>
62inline const Cmpt& Foam::Barycentric2D<Cmpt>::b() const
63{
64 return this->v_[B];
65}
66
67
68template<class Cmpt>
69inline const Cmpt& Foam::Barycentric2D<Cmpt>::c() const
70{
71 return this->v_[C];
72}
73
74
75template<class Cmpt>
77{
78 return this->v_[A];
79}
80
81
82template<class Cmpt>
84{
85 return this->v_[B];
86}
87
88
89template<class Cmpt>
91{
92 return this->v_[C];
93}
94
95
96template<class Cmpt>
98{
99 return ((this->v_[A] < 0) || (this->v_[B]) < 0 || (this->v_[C] < 0));
100}
101
102
103// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104
105namespace Foam
106{
107
108// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
109
110template<class Cmpt>
111inline 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// ************************************************************************* //
static const Foam::dimensionedScalar A("", Foam::dimPressure, 611.21)
static const Foam::dimensionedScalar B("", Foam::dimless, 18.678)
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant.
Definition: Barycentric2D.H:57
const Cmpt & a() const
Barycentric2D()=default
Default construct.
const Cmpt & b() const
bool outside() const
True if any coordinates are negative.
const Cmpt & c() const
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.