refineCell.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) 2011-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::refineCell
26 
27 Description
28  Container with cells to refine. Refinement given as single direction.
29 
30 SourceFiles
31  refineCell.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef refineCell_H
36 #define refineCell_H
37 
38 #include "label.H"
39 #include "vector.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 // Forward declaration of friend functions and operators
47 
48 class refineCell;
49 
50 Ostream& operator<<(Ostream&, const refineCell&);
51 
52 
53 /*---------------------------------------------------------------------------*\
54  Class refineCell Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class refineCell
58 {
59  // Private Data
60 
61  //- Cell label
62  label cellNo_;
63 
64  //- Preferred refinement direction (always normalised).
65  vector direction_;
66 
67 public:
68 
69  // Constructors
70 
71  //- Null
72  refineCell();
73 
74  //- From components. Vector will be normalised upon construction.
75  refineCell(const label, const vector&);
76 
77  //- From Istream. Vector will be normalised upon construction.
78  refineCell(Istream& is);
79 
80 
81  // Member Functions
82 
83  label cellNo() const
84  {
85  return cellNo_;
86  }
87 
88  const vector& direction() const
89  {
90  return direction_;
91  }
92 
93 
94  // Friend Operators
95 
96  inline friend bool operator==
97  (
98  const refineCell& rc1,
99  const refineCell& rc2
100  )
101  {
102  return (rc1.cellNo() == rc2.cellNo());
103  }
104 
105  inline friend bool operator!=
106  (
107  const refineCell& rc1,
108  const refineCell& rc2
109  )
110  {
111  return !(rc1 == rc2);
112  }
113 
114 
115  // IOstream Operators
116 
117  friend Ostream& operator<<(Ostream&, const refineCell&);
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
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
refineCell()
Null.
Definition: refineCell.C:31
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 refineCell &)
const vector & direction() const
Definition: refineCell.H:87
Container with cells to refine. Refinement given as single direction.
Definition: refineCell.H:56
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
label cellNo() const
Definition: refineCell.H:82
Ostream & operator<<(Ostream &, const ensightPart &)
Namespace for OpenFOAM.