OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

refinementData.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2007 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     refinementData
00027 
00028 Description
00029     Transfers refinement levels such that slow transition between levels is
00030     maintained. Used in meshWave.
00031 
00032 SourceFiles
00033     refinementDataI.H
00034     refinementData.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef refinementData_H
00039 #define refinementData_H
00040 
00041 #include "point.H"
00042 #include "tensor.H"
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 class polyPatch;
00050 class polyMesh;
00051 
00052 /*---------------------------------------------------------------------------*\
00053                            Class refinementData Declaration
00054 \*---------------------------------------------------------------------------*/
00055 
00056 class refinementData
00057 {
00058     // Private data
00059 
00060         //- Count which triggers refinement
00061         label refinementCount_;
00062 
00063         //- Refinement level
00064         label count_;
00065 
00066 public:
00067 
00068     // Constructors
00069 
00070         //- Construct null
00071         inline refinementData();
00072 
00073         //- Construct from count
00074         inline refinementData(const label refinementCount, const label count);
00075 
00076 
00077     // Member Functions
00078 
00079         // Access
00080 
00081             inline label refinementCount() const
00082             {
00083                 return refinementCount_;
00084             }
00085 
00086             inline label& refinementCount()
00087             {
00088                 return refinementCount_;
00089             }
00090 
00091             inline label count() const
00092             {
00093                 return count_;
00094             }
00095 
00096             inline label& count()
00097             {
00098                 return count_;
00099             }
00100 
00101             inline bool isRefined() const
00102             {
00103                 return count_ >= refinementCount_;
00104             }
00105 
00106 
00107 
00108         // Needed by FaceCellWave
00109 
00110             //- Check whether origin has been changed at all or
00111             //  still contains original (invalid) value.
00112             inline bool valid() const;
00113 
00114             //- Check for identical geometrical data. Used for cyclics checking.
00115             inline bool sameGeometry
00116             (
00117                 const polyMesh&,
00118                 const refinementData&,
00119                 const scalar
00120             ) const;
00121 
00122             //- Convert any absolute coordinates into relative to (patch)face
00123             //  centre
00124             inline void leaveDomain
00125             (
00126                 const polyMesh&,
00127                 const polyPatch&,
00128                 const label patchFaceI,
00129                 const point& faceCentre
00130             );
00131 
00132             //- Reverse of leaveDomain
00133             inline void enterDomain
00134             (
00135                 const polyMesh&,
00136                 const polyPatch&,
00137                 const label patchFaceI,
00138                 const point& faceCentre
00139             );
00140 
00141             //- Apply rotation matrix to any coordinates
00142             inline void transform
00143             (
00144                 const polyMesh&,
00145                 const tensor&
00146             );
00147 
00148             //- Influence of neighbouring face.
00149             inline bool updateCell
00150             (
00151                 const polyMesh&,
00152                 const label thisCellI,
00153                 const label neighbourFaceI,
00154                 const refinementData& neighbourInfo,
00155                 const scalar tol
00156             );
00157 
00158             //- Influence of neighbouring cell.
00159             inline bool updateFace
00160             (
00161                 const polyMesh&,
00162                 const label thisFaceI,
00163                 const label neighbourCellI,
00164                 const refinementData& neighbourInfo,
00165                 const scalar tol
00166             );
00167 
00168             //- Influence of different value on same face.
00169             inline bool updateFace
00170             (
00171                 const polyMesh&,
00172                 const label thisFaceI,
00173                 const refinementData& neighbourInfo,
00174                 const scalar tol
00175             );
00176 
00177     // Member Operators
00178 
00179         // Needed for List IO
00180         inline bool operator==(const refinementData&) const;
00181 
00182         inline bool operator!=(const refinementData&) const;
00183 
00184 
00185     // IOstream Operators
00186 
00187         friend Ostream& operator<<(Ostream&, const refinementData&);
00188         friend Istream& operator>>(Istream&, refinementData&);
00189 };
00190 
00191 
00192 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00193 
00194 } // End namespace Foam
00195 
00196 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00197 
00198 #include "refinementDataI.H"
00199 
00200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00201 
00202 #endif
00203 
00204 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd