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