labelledTri.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 | Copyright (C) 2011-2016 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::labelledTri
26 
27 Description
28  Triangle with additional region number.
29 
30 SourceFiles
31  labelledTriI.H
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef labelledTri_H
36 #define labelledTri_H
37 
38 #include "triFace.H"
39 #include "ListListOps.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 
48 class labelledTri;
49 
50 Istream& operator>>(Istream&, labelledTri&);
51 Ostream& operator<<(Ostream&, const labelledTri&);
52 
53 
54 /*---------------------------------------------------------------------------*\
55  Class labelledTri Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class labelledTri
59 :
60  public triFace
61 {
62  // Private data
63 
64  label region_;
65 
66 
67 public:
68 
69  // Constructors
70 
71  //- Construct null
72  inline labelledTri();
73 
74  //- Construct from triFace and a region label
75  inline labelledTri
76  (
77  const triFace&,
78  const label region
79  );
80 
81  //- Construct from three point labels and a region label
82  inline labelledTri
83  (
84  const label a,
85  const label b,
86  const label c,
87  const label region
88  );
89 
90  //- Construct from Istream
91  inline labelledTri(Istream&);
92 
93 
94  // Member Functions
95 
96  // Access
97 
98  //- Return region label
99  inline label region() const;
100 
101  //- Return region label
102  inline label& region();
103 
104 
105  // Check
106 
107  // Edit
108 
109  // Write
110 
111 
112  // Friend Functions
113 
114  // Friend Operators
115 
116  // IOstream Operators
117 
118  inline friend Istream& operator>>(Istream&, labelledTri&);
119  inline friend Ostream& operator<<(Ostream&, const labelledTri&);
120 };
121 
122 
123 template<>
124 inline bool contiguous<labelledTri>() {return true;}
125 
126 
127 //- Hash specialization to offset faces in ListListOps::combineOffset
128 template<>
129 class offsetOp<labelledTri>
130 {
131 
132 public:
133 
135  (
136  const labelledTri& x,
137  const label offset
138  ) const
139  {
140  labelledTri result(x);
141 
142  forAll(x, xI)
143  {
144  result[xI] = x[xI] + offset;
145  }
146  return result;
147  }
148 };
149 
150 
151 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152 
153 } // End namespace Foam
154 
155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 
157 #include "labelledTriI.H"
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 #endif
162 
163 // ************************************************************************* //
#define forAll(list, i)
Loop across all elements in list.
Definition: UList.H:428
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
label region() const
Return region label.
Definition: labelledTriI.H:68
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
Definition: Istream.H:57
friend Ostream & operator(Ostream &, const FixedList< label, Size > &)
labelledTri()
Construct null.
Definition: labelledTriI.H:30
friend Ostream & operator<<(Ostream &, const labelledTri &)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
bool contiguous< labelledTri >()
Definition: labelledTri.H:123
A triangular face using a FixedList of labels corresponding to mesh vertices.
Definition: triFace.H:68
Istream & operator>>(Istream &, directionInfo &)
friend Istream & operator>>(Istream &, labelledTri &)
Triangle with additional region number.
Definition: labelledTri.H:57
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:53
const dimensionedScalar c
Speed of light in a vacuum.
Ostream & operator<<(Ostream &, const ensightPart &)
Namespace for OpenFOAM.