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