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

wallNormalInfo.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::wallNormalInfo
00026 
00027 Description
00028     Holds information regarding nearest wall point.
00029     Used in wall refinement.
00030 
00031 SourceFiles
00032     wallNormalInfoI.H
00033     wallNormalInfo.C
00034 
00035 \*---------------------------------------------------------------------------*/
00036 
00037 #ifndef wallNormalInfo_H
00038 #define wallNormalInfo_H
00039 
00040 #include <OpenFOAM/point.H>
00041 #include <OpenFOAM/label.H>
00042 #include <OpenFOAM/scalar.H>
00043 #include <OpenFOAM/tensor.H>
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 // Forward declaration of classes
00051 class polyPatch;
00052 class polyMesh;
00053 
00054 /*---------------------------------------------------------------------------*\
00055                            Class wallNormalInfo Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class wallNormalInfo
00059 {
00060     // Private data
00061 
00062         //- Normal at nearest wall point
00063         vector normal_;
00064 
00065     // Private Member Functions
00066 
00067         //- Evaluate distance to point. Update normal_
00068         inline bool update(const wallNormalInfo& w2);
00069 
00070 public:
00071 
00072     // Static data members
00073 
00074         //- initial point far away.
00075         static point greatVector;
00076 
00077     // Constructors
00078 
00079         //- Construct null
00080         inline wallNormalInfo();
00081 
00082         //- Construct from normal
00083         inline wallNormalInfo(const vector& normal);
00084 
00085         //- Construct as copy
00086         inline wallNormalInfo(const wallNormalInfo&);
00087 
00088     // Member Functions
00089 
00090         // Access
00091 
00092             inline const vector& normal() const;
00093 
00094 
00095         // Needed by FaceCellWave
00096 
00097             //- Check whether origin has been changed at all or
00098             //  still contains original (invalid) value.
00099             inline bool valid() const;
00100 
00101             //- Check for identical geometrical data. Used for cyclics checking.
00102             inline bool sameGeometry
00103             (
00104                 const polyMesh&,
00105                 const wallNormalInfo&,
00106                 const scalar
00107             ) const;
00108 
00109             //- Convert any absolute coordinates into relative to (patch)face
00110             //  centre
00111             inline void leaveDomain
00112             (
00113                 const polyMesh&,
00114                 const polyPatch&,
00115                 const label patchFaceI,
00116                 const point& faceCentre
00117             );
00118 
00119             //- Reverse of leaveDomain
00120             inline void enterDomain
00121             (
00122                 const polyMesh&,
00123                 const polyPatch&,
00124                 const label patchFaceI,
00125                 const point& faceCentre
00126             );
00127 
00128             //- Apply rotation matrix to any coordinates
00129             inline void transform
00130             (
00131                 const polyMesh&,
00132                 const tensor&
00133             );
00134 
00135             //- Influence of neighbouring face.
00136             inline bool updateCell
00137             (
00138                 const polyMesh&,
00139                 const label thisCellI,
00140                 const label neighbourFaceI,
00141                 const wallNormalInfo& neighbourInfo,
00142                 const scalar tol
00143             );
00144 
00145             //- Influence of neighbouring cell.
00146             inline bool updateFace
00147             (
00148                 const polyMesh&,
00149                 const label thisFaceI,
00150                 const label neighbourCellI,
00151                 const wallNormalInfo& neighbourInfo,
00152                 const scalar tol
00153             );
00154 
00155             //- Influence of different value on same face.
00156             inline bool updateFace
00157             (
00158                 const polyMesh&,
00159                 const label thisFaceI,
00160                 const wallNormalInfo& neighbourInfo,
00161                 const scalar tol
00162             );
00163 
00164     // Member Operators
00165 
00166         // Needed for List IO
00167         inline bool operator==(const wallNormalInfo&) const;
00168 
00169         inline bool operator!=(const wallNormalInfo&) const;
00170 
00171 
00172     // IOstream Operators
00173 
00174         friend Ostream& operator<<(Ostream&, const wallNormalInfo&);
00175         friend Istream& operator>>(Istream&, wallNormalInfo&);
00176 };
00177 
00178 
00179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00180 
00181 } // End namespace Foam
00182 
00183 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00184 
00185 #include <dynamicMesh/wallNormalInfoI.H>
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 #endif
00190 
00191 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines