1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 option) any later version.
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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM; if not, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 Foam::refinementDistanceData
29 Transfers refinement levels such that slow transition between levels is
30 maintained. Used in FaceCellWave.
33 refinementDistanceDataI.H
34 refinementDistanceData.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef refinementDistanceData_H
39 #define refinementDistanceData_H
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 /*---------------------------------------------------------------------------*\
53 Class refinementDistanceData Declaration
54 \*---------------------------------------------------------------------------*/
56 class refinementDistanceData
61 //- unrefined (level0) buffer size (nBufferLayers*level0Size)
64 //- nearest point with highest level
69 // Private Member Functions
71 //- Updates with neighbouring data. Returns true if something changed.
75 const refinementDistanceData& neighbourInfo,
84 inline refinementDistanceData();
86 //- Construct from count
87 inline refinementDistanceData
89 const scalar level0Size,
99 inline scalar level0Size() const
104 inline scalar& level0Size()
109 inline const point& origin() const
114 inline point& origin()
119 inline label originLevel() const
124 inline label& originLevel()
132 //- Calculates the wanted level at a given point. Walks out from
134 inline label wantedLevel(const point& pt) const;
137 // Needed by FaceCellWave
139 //- Check whether origin has been changed at all or
140 // still contains original (invalid) value.
141 inline bool valid() const;
143 //- Check for identical geometrical data. Used for cyclics checking.
144 inline bool sameGeometry
147 const refinementDistanceData&,
151 //- Convert any absolute coordinates into relative to (patch)face
153 inline void leaveDomain
157 const label patchFaceI,
158 const point& faceCentre
161 //- Reverse of leaveDomain
162 inline void enterDomain
166 const label patchFaceI,
167 const point& faceCentre
170 //- Apply rotation matrix to any coordinates
171 inline void transform
177 //- Influence of neighbouring face.
178 inline bool updateCell
181 const label thisCellI,
182 const label neighbourFaceI,
183 const refinementDistanceData& neighbourInfo,
187 //- Influence of neighbouring cell.
188 inline bool updateFace
191 const label thisFaceI,
192 const label neighbourCellI,
193 const refinementDistanceData& neighbourInfo,
197 //- Influence of different value on same face.
198 inline bool updateFace
201 const label thisFaceI,
202 const refinementDistanceData& neighbourInfo,
208 // Needed for List IO
209 inline bool operator==(const refinementDistanceData&) const;
211 inline bool operator!=(const refinementDistanceData&) const;
214 // IOstream Operators
216 friend Ostream& operator<<(Ostream&, const refinementDistanceData&);
217 friend Istream& operator>>(Istream&, refinementDistanceData&);
221 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 } // End namespace Foam
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 #include "refinementDistanceDataI.H"
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 // ************************************************************************* //