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

wallPoint.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     wallPoint
00027 
00028 Description
00029     Holds information regarding nearest wall point. Used in wall distance
00030     calculation.
00031 
00032 SourceFiles
00033     wallPointI.H
00034     wallPoint.C
00035 
00036 \*---------------------------------------------------------------------------*/
00037 
00038 #ifndef wallPoint_H
00039 #define wallPoint_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 // Class forward declarations
00052 class polyPatch;
00053 class polyMesh;
00054 
00055 /*---------------------------------------------------------------------------*\
00056                            Class wallPoint Declaration
00057 \*---------------------------------------------------------------------------*/
00058 
00059 class wallPoint
00060 {
00061     // Private data
00062 
00063         //- position of nearest wall center
00064         point origin_;
00065 
00066         //- normal distance (squared) from cellcenter to origin
00067         scalar distSqr_;
00068 
00069     // Private Member Functions
00070 
00071         //- Evaluate distance to point. Update distSqr, origin from whomever
00072         //  is nearer pt. Return true if w2 is closer to point,
00073         //  false otherwise.
00074         inline bool update
00075         (
00076             const point&,
00077             const wallPoint& w2,
00078             const scalar tol
00079         );
00080 
00081 public:
00082     // Static data members
00083 
00084         //- initial point far away.
00085         static point greatPoint;
00086 
00087     // Constructors
00088 
00089         //- Construct null
00090         inline wallPoint();
00091 
00092         //- Construct from origin, distance
00093         inline wallPoint
00094         (
00095             const point& origin,
00096             const scalar distSqr
00097         );
00098 
00099         //- Construct as copy
00100         inline wallPoint
00101         (
00102             const wallPoint&
00103         );
00104 
00105     // Member Functions
00106 
00107         // Access
00108 
00109             inline const point& origin() const;
00110 
00111             inline point& origin();
00112 
00113             inline scalar distSqr() const;
00114 
00115             inline scalar& distSqr();
00116 
00117 
00118         // Needed by FaceCellWave
00119 
00120             //- Check whether origin has been changed at all or
00121             //  still contains original (invalid) value.
00122             inline bool valid() const;
00123 
00124             //- Check for identical geometrical data. Used for cyclics checking.
00125             inline bool sameGeometry
00126             (
00127                 const polyMesh&,
00128                 const wallPoint&,
00129                 const scalar
00130             ) const;
00131 
00132             //- Convert any absolute coordinates into relative to (patch)face
00133             //  centre
00134             inline void leaveDomain
00135             (
00136                 const polyMesh&,
00137                 const polyPatch&,
00138                 const label patchFaceI,
00139                 const point& faceCentre
00140             );
00141 
00142             //- Reverse of leaveDomain
00143             inline void enterDomain
00144             (
00145                 const polyMesh&,
00146                 const polyPatch&,
00147                 const label patchFaceI,
00148                 const point& faceCentre
00149             );
00150 
00151             //- Apply rotation matrix to any coordinates
00152             inline void transform
00153             (
00154                 const polyMesh&,
00155                 const tensor&
00156             );
00157 
00158             //- Influence of neighbouring face.
00159             inline bool updateCell
00160             (
00161                 const polyMesh&,
00162                 const label thisCellI,
00163                 const label neighbourFaceI,
00164                 const wallPoint& neighbourInfo,
00165                 const scalar tol
00166             );
00167 
00168             //- Influence of neighbouring cell.
00169             inline bool updateFace
00170             (
00171                 const polyMesh&,
00172                 const label thisFaceI,
00173                 const label neighbourCellI,
00174                 const wallPoint& neighbourInfo,
00175                 const scalar tol
00176             );
00177 
00178             //- Influence of different value on same face.
00179             inline bool updateFace
00180             (
00181                 const polyMesh&,
00182                 const label thisFaceI,
00183                 const wallPoint& neighbourInfo,
00184                 const scalar tol
00185             );
00186 
00187     // Member Operators
00188 
00189         // Needed for List IO
00190         inline bool operator==(const wallPoint&) const;
00191 
00192         inline bool operator!=(const wallPoint&) const;
00193 
00194 
00195     // IOstream Operators
00196 
00197         friend Ostream& operator<<(Ostream&, const wallPoint&);
00198         friend Istream& operator>>(Istream&, wallPoint&);
00199 };
00200 
00201 
00202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00203 
00204 } // End namespace Foam
00205 
00206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00207 
00208 #include "wallPointI.H"
00209 
00210 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00211 
00212 #endif
00213 
00214 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd