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

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