FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::refinementData
00026 
00027 Description
00028     Transfers refinement levels such that slow transition between levels is
00029     maintained. Used in meshWave.
00030 
00031 SourceFiles
00032     refinementDataI.H
00033     refinementData.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef refinementData_H
00038 #define refinementData_H
00039 
00040 #include <OpenFOAM/point.H>
00041 #include <OpenFOAM/tensor.H>
00042 
00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00044 
00045 namespace Foam
00046 {
00047 
00048 class polyPatch;
00049 class polyMesh;
00050 
00051 /*---------------------------------------------------------------------------*\
00052                            Class refinementData Declaration
00053 \*---------------------------------------------------------------------------*/
00054 
00055 class refinementData
00056 {
00057     // Private data
00058 
00059         //- Count which triggers refinement
00060         label refinementCount_;
00061 
00062         //- Refinement level
00063         label count_;
00064 
00065 public:
00066 
00067     // Constructors
00068 
00069         //- Construct null
00070         inline refinementData();
00071 
00072         //- Construct from count
00073         inline refinementData(const label refinementCount, const label count);
00074 
00075 
00076     // Member Functions
00077 
00078         // Access
00079 
00080             inline label refinementCount() const
00081             {
00082                 return refinementCount_;
00083             }
00084 
00085             inline label& refinementCount()
00086             {
00087                 return refinementCount_;
00088             }
00089 
00090             inline label count() const
00091             {
00092                 return count_;
00093             }
00094 
00095             inline label& count()
00096             {
00097                 return count_;
00098             }
00099 
00100             inline bool isRefined() const
00101             {
00102                 return count_ >= refinementCount_;
00103             }
00104 
00105 
00106 
00107         // Needed by FaceCellWave
00108 
00109             //- Check whether origin has been changed at all or
00110             //  still contains original (invalid) value.
00111             inline bool valid() const;
00112 
00113             //- Check for identical geometrical data. Used for cyclics checking.
00114             inline bool sameGeometry
00115             (
00116                 const polyMesh&,
00117                 const refinementData&,
00118                 const scalar
00119             ) const;
00120 
00121             //- Convert any absolute coordinates into relative to (patch)face
00122             //  centre
00123             inline void leaveDomain
00124             (
00125                 const polyMesh&,
00126                 const polyPatch&,
00127                 const label patchFaceI,
00128                 const point& faceCentre
00129             );
00130 
00131             //- Reverse of leaveDomain
00132             inline void enterDomain
00133             (
00134                 const polyMesh&,
00135                 const polyPatch&,
00136                 const label patchFaceI,
00137                 const point& faceCentre
00138             );
00139 
00140             //- Apply rotation matrix to any coordinates
00141             inline void transform
00142             (
00143                 const polyMesh&,
00144                 const tensor&
00145             );
00146 
00147             //- Influence of neighbouring face.
00148             inline bool updateCell
00149             (
00150                 const polyMesh&,
00151                 const label thisCellI,
00152                 const label neighbourFaceI,
00153                 const refinementData& neighbourInfo,
00154                 const scalar tol
00155             );
00156 
00157             //- Influence of neighbouring cell.
00158             inline bool updateFace
00159             (
00160                 const polyMesh&,
00161                 const label thisFaceI,
00162                 const label neighbourCellI,
00163                 const refinementData& neighbourInfo,
00164                 const scalar tol
00165             );
00166 
00167             //- Influence of different value on same face.
00168             inline bool updateFace
00169             (
00170                 const polyMesh&,
00171                 const label thisFaceI,
00172                 const refinementData& neighbourInfo,
00173                 const scalar tol
00174             );
00175 
00176     // Member Operators
00177 
00178         // Needed for List IO
00179         inline bool operator==(const refinementData&) const;
00180 
00181         inline bool operator!=(const refinementData&) const;
00182 
00183 
00184     // IOstream Operators
00185 
00186         friend Ostream& operator<<(Ostream&, const refinementData&);
00187         friend Istream& operator>>(Istream&, refinementData&);
00188 };
00189 
00190 
00191 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00192 
00193 } // End namespace Foam
00194 
00195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00196 
00197 #include <dynamicMesh/refinementDataI.H>
00198 
00199 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00200 
00201 #endif
00202 
00203 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines