Barycentric2D.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) 2017-2021 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 Class
25  Foam::Barycentric2D
26 
27 Description
28  Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of
29  which is redundant.
30 
31 SourceFiles
32  Barycentric2DI.H
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef Barycentric2D_H
37 #define Barycentric2D_H
38 
39 #include "VectorSpace.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class Barycentric2D Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 template<class Cmpt>
51 class Barycentric2D
52 :
53  public VectorSpace<Barycentric2D<Cmpt>, Cmpt, 3>
54 {
55 public:
56 
57  //- Equivalent type of labels used for valid component indexing
59 
60 
61  // Member constants
62 
63  //- Rank of Barycentric2D is 1
64  static const direction rank = 1;
65 
66 
67  //- Component labeling enumeration
68  enum components { A, B, C };
69 
70 
71  // Constructors
72 
73  //- Construct null
74  inline Barycentric2D();
75 
76  //- Construct initialised to zero
77  inline Barycentric2D(const Foam::zero);
78 
79  //- Construct given four components
80  inline Barycentric2D
81  (
82  const Cmpt& va,
83  const Cmpt& vb,
84  const Cmpt& vc
85  );
86 
87 
88  // Member Functions
89 
90  // Access
91 
92  inline const Cmpt& a() const;
93  inline const Cmpt& b() const;
94  inline const Cmpt& c() const;
95 
96  inline Cmpt& a();
97  inline Cmpt& b();
98  inline Cmpt& c();
99 };
100 
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 } // End namespace Foam
105 
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
107 
108 #include "Barycentric2DI.H"
109 
110 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 
112 #endif
113 
114 // ************************************************************************* //
Graphite solid properties.
Definition: C.H:48
uint8_t direction
Definition: direction.H:45
const Cmpt & c() const
Templated vector space.
Definition: VectorSpace.H:53
const Cmpt & a() const
Templated 2D Barycentric derived from VectorSpace. Has 3 components, one of which is redundant...
Definition: Barycentric2D.H:50
components
Component labeling enumeration.
Definition: Barycentric2D.H:67
Barycentric2D()
Construct null.
Barycentric2D< label > labelType
Equivalent type of labels used for valid component indexing.
Definition: Barycentric2D.H:57
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:49
const Cmpt & b() const
static const direction rank
Rank of Barycentric2D is 1.
Definition: Barycentric2D.H:63
Namespace for OpenFOAM.