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