refineCell.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) 2011-2016 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::refineCell
28 
29 Description
30  Container with cells to refine. Refinement given as single direction.
31 
32 SourceFiles
33  refineCell.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef refineCell_H
38 #define refineCell_H
39 
40 #include "label.H"
41 #include "vector.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of friend functions and operators
49 
50 class refineCell;
51 
52 Ostream& operator<<(Ostream&, const refineCell&);
53 
54 
55 /*---------------------------------------------------------------------------*\
56  Class refineCell Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class refineCell
60 {
61  // Private data
62 
63  //- Cell label
64  label cellNo_;
65 
66  //- Preferred refinement direction (always normalized).
67  vector direction_;
68 
69 public:
70 
71  // Constructors
72 
73  //- Null
74  refineCell();
75 
76  //- From components. Vector will be normalized upon construction.
77  refineCell(const label, const vector&);
78 
79  //- From Istream. Vector will be normalized upon construction.
80  refineCell(Istream& is);
81 
82 
83  // Member Functions
84 
85  label cellNo() const
86  {
87  return cellNo_;
88  }
89 
90  const vector& direction() const
91  {
92  return direction_;
93  }
94 
95 
96  // Friend Operators
97 
98  inline friend bool operator==
99  (
100  const refineCell& rc1,
101  const refineCell& rc2
102  )
103  {
104  return (rc1.cellNo() == rc2.cellNo());
105  }
106 
107  inline friend bool operator!=
108  (
109  const refineCell& rc1,
110  const refineCell& rc2
111  )
112  {
113  return !(rc1 == rc2);
114  }
115 
116 
117  // IOstream Operators
118 
119  friend Ostream& operator<<(Ostream&, const refineCell&);
120 };
121 
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 } // End namespace Foam
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 #endif
130 
131 // ************************************************************************* //
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:62
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::refineCell::direction
const vector & direction() const
Definition: refineCell.H:89
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::refineCell::operator<<
friend Ostream & operator<<(Ostream &, const refineCell &)
Foam::refineCell
Container with cells to refine. Refinement given as single direction.
Definition: refineCell.H:58
Foam::Vector< scalar >
label.H
vector.H
Foam::refineCell::cellNo
label cellNo() const
Definition: refineCell.H:84
Foam::refineCell::refineCell
refineCell()
Null.
Definition: refineCell.C:33
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &)
Definition: boundaryPatch.C:102