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

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-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     wallNormalInfo
00027 
00028 Description
00029     Holds information regarding nearest wall point. 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 "point.H"
00041 #include "label.H"
00042 #include "scalar.H"
00043 #include "tensor.H"
00044 
00045 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00046 
00047 namespace Foam
00048 {
00049 
00050 // Class forward declarations
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 "wallNormalInfoI.H"
00186 
00187 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00188 
00189 #endif
00190 
00191 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd