FreeFOAM The Cross-Platform CFD Toolkit
refinementData.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) 1991-2010 OpenCFD Ltd.
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::refinementData
26 
27 Description
28  Transfers refinement levels such that slow transition between levels is
29  maintained. Used in meshWave.
30 
31 SourceFiles
32  refinementDataI.H
33  refinementData.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef refinementData_H
38 #define refinementData_H
39 
40 #include <OpenFOAM/point.H>
41 #include <OpenFOAM/tensor.H>
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 class polyPatch;
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class refinementData Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57  // Private data
58 
59  //- Count which triggers refinement
60  label refinementCount_;
61 
62  //- Refinement level
63  label count_;
64 
65 public:
66 
67  // Constructors
68 
69  //- Construct null
70  inline refinementData();
71 
72  //- Construct from count
73  inline refinementData(const label refinementCount, const label count);
74 
75 
76  // Member Functions
77 
78  // Access
79 
80  inline label refinementCount() const
81  {
82  return refinementCount_;
83  }
84 
85  inline label& refinementCount()
86  {
87  return refinementCount_;
88  }
89 
90  inline label count() const
91  {
92  return count_;
93  }
94 
95  inline label& count()
96  {
97  return count_;
98  }
99 
100  inline bool isRefined() const
101  {
102  return count_ >= refinementCount_;
103  }
104 
105 
106 
107  // Needed by FaceCellWave
108 
109  //- Check whether origin has been changed at all or
110  // still contains original (invalid) value.
111  inline bool valid() const;
112 
113  //- Check for identical geometrical data. Used for cyclics checking.
114  inline bool sameGeometry
115  (
116  const polyMesh&,
117  const refinementData&,
118  const scalar
119  ) const;
120 
121  //- Convert any absolute coordinates into relative to (patch)face
122  // centre
123  inline void leaveDomain
124  (
125  const polyMesh&,
126  const polyPatch&,
127  const label patchFaceI,
128  const point& faceCentre
129  );
130 
131  //- Reverse of leaveDomain
132  inline void enterDomain
133  (
134  const polyMesh&,
135  const polyPatch&,
136  const label patchFaceI,
137  const point& faceCentre
138  );
139 
140  //- Apply rotation matrix to any coordinates
141  inline void transform
142  (
143  const polyMesh&,
144  const tensor&
145  );
146 
147  //- Influence of neighbouring face.
148  inline bool updateCell
149  (
150  const polyMesh&,
151  const label thisCellI,
152  const label neighbourFaceI,
153  const refinementData& neighbourInfo,
154  const scalar tol
155  );
156 
157  //- Influence of neighbouring cell.
158  inline bool updateFace
159  (
160  const polyMesh&,
161  const label thisFaceI,
162  const label neighbourCellI,
163  const refinementData& neighbourInfo,
164  const scalar tol
165  );
166 
167  //- Influence of different value on same face.
168  inline bool updateFace
169  (
170  const polyMesh&,
171  const label thisFaceI,
172  const refinementData& neighbourInfo,
173  const scalar tol
174  );
175 
176  // Member Operators
177 
178  // Needed for List IO
179  inline bool operator==(const refinementData&) const;
180 
181  inline bool operator!=(const refinementData&) const;
182 
183 
184  // IOstream Operators
185 
186  friend Ostream& operator<<(Ostream&, const refinementData&);
188 };
189 
190 
191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
192 
193 } // End namespace Foam
194 
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
196 
198 
199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 
201 #endif
202 
203 // ************************ vim: set sw=4 sts=4 et: ************************ //