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