initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / polyTopoChange / polyTopoChange / refinementData.H
blobd0794397d893b495a827846acd047804685c7f57
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::refinementData
28 Description
29     Transfers refinement levels such that slow transition between levels is
30     maintained. Used in meshWave.
32 SourceFiles
33     refinementDataI.H
34     refinementData.C
36 \*---------------------------------------------------------------------------*/
38 #ifndef refinementData_H
39 #define refinementData_H
41 #include "point.H"
42 #include "tensor.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 class polyPatch;
50 class polyMesh;
52 /*---------------------------------------------------------------------------*\
53                            Class refinementData Declaration
54 \*---------------------------------------------------------------------------*/
56 class refinementData
58     // Private data
60         //- Count which triggers refinement
61         label refinementCount_;
63         //- Refinement level
64         label count_;
66 public:
68     // Constructors
70         //- Construct null
71         inline refinementData();
73         //- Construct from count
74         inline refinementData(const label refinementCount, const label count);
77     // Member Functions
79         // Access
81             inline label refinementCount() const
82             {
83                 return refinementCount_;
84             }
86             inline label& refinementCount()
87             {
88                 return refinementCount_;
89             }
91             inline label count() const
92             {
93                 return count_;
94             }
96             inline label& count()
97             {
98                 return count_;
99             }
101             inline bool isRefined() const
102             {
103                 return count_ >= refinementCount_;
104             }
108         // Needed by FaceCellWave
110             //- Check whether origin has been changed at all or
111             //  still contains original (invalid) value.
112             inline bool valid() const;
114             //- Check for identical geometrical data. Used for cyclics checking.
115             inline bool sameGeometry
116             (
117                 const polyMesh&,
118                 const refinementData&,
119                 const scalar
120             ) const;
122             //- Convert any absolute coordinates into relative to (patch)face
123             //  centre
124             inline void leaveDomain
125             (
126                 const polyMesh&,
127                 const polyPatch&,
128                 const label patchFaceI,
129                 const point& faceCentre
130             );
132             //- Reverse of leaveDomain
133             inline void enterDomain
134             (
135                 const polyMesh&,
136                 const polyPatch&,
137                 const label patchFaceI,
138                 const point& faceCentre
139             );
141             //- Apply rotation matrix to any coordinates
142             inline void transform
143             (
144                 const polyMesh&,
145                 const tensor&
146             );
148             //- Influence of neighbouring face.
149             inline bool updateCell
150             (
151                 const polyMesh&,
152                 const label thisCellI,
153                 const label neighbourFaceI,
154                 const refinementData& neighbourInfo,
155                 const scalar tol
156             );
158             //- Influence of neighbouring cell.
159             inline bool updateFace
160             (
161                 const polyMesh&,
162                 const label thisFaceI,
163                 const label neighbourCellI,
164                 const refinementData& neighbourInfo,
165                 const scalar tol
166             );
168             //- Influence of different value on same face.
169             inline bool updateFace
170             (
171                 const polyMesh&,
172                 const label thisFaceI,
173                 const refinementData& neighbourInfo,
174                 const scalar tol
175             );
177     // Member Operators
179         // Needed for List IO
180         inline bool operator==(const refinementData&) const;
182         inline bool operator!=(const refinementData&) const;
185     // IOstream Operators
187         friend Ostream& operator<<(Ostream&, const refinementData&);
188         friend Istream& operator>>(Istream&, refinementData&);
192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
194 } // End namespace Foam
196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 #include "refinementDataI.H"
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 #endif
204 // ************************************************************************* //