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

wallPointData.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::wallPointData
00026 
00027 Description
00028     Holds information (coordinate and normal) regarding nearest wall point.
00029 
00030     Is like wallPoint but transfer extra (passive) data.
00031     Used e.g. in wall distance calculation with wall reflection vectors.
00032 
00033 SourceFiles
00034     wallPointDataI.H
00035     wallPointData.C
00036 
00037 \*---------------------------------------------------------------------------*/
00038 
00039 #ifndef wallPointData_H
00040 #define wallPointData_H
00041 
00042 #include <meshTools/wallPoint.H>
00043 
00044 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00045 
00046 namespace Foam
00047 {
00048 
00049 template<class Type> class wallPointData;
00050 
00051 // Forward declaration of friend functions and operators
00052 
00053 template<class Type> Istream& operator>>(Istream&, wallPointData<Type>&);
00054 template<class Type> Ostream& operator<<(Ostream&, const wallPointData<Type>&);
00055 
00056 
00057 /*---------------------------------------------------------------------------*\
00058                            Class wallPointData Declaration
00059 \*---------------------------------------------------------------------------*/
00060 
00061 template <class Type>
00062 class wallPointData
00063 :
00064     public wallPoint
00065 {
00066     // Private data
00067 
00068         //- data at nearest wall center
00069         Type data_;
00070 
00071 
00072     // Private Member Functions
00073 
00074         //- Evaluate distance to point. Update distSqr, origin from whomever
00075         //  is nearer pt. Return true if w2 is closer to point,
00076         //  false otherwise.
00077         inline bool update
00078         (
00079             const point&,
00080             const wallPointData<Type>& w2,
00081             const scalar tol
00082         );
00083 
00084 
00085 public:
00086 
00087     typedef Type dataType;
00088 
00089 
00090     // Constructors
00091 
00092         //- Construct null
00093         inline wallPointData();
00094 
00095         //- Construct from origin, normal, distance
00096         inline wallPointData
00097         (
00098             const point& origin,
00099             const Type& data,
00100             const scalar distSqr
00101         );
00102 
00103 
00104     // Member Functions
00105 
00106         // Access
00107 
00108             inline const Type& data() const;
00109             inline Type& data();
00110 
00111         // Needed by meshWave
00112 
00113             //- Influence of neighbouring face.
00114             //  Calls update(...) with cellCentre of cellI
00115             inline bool updateCell
00116             (
00117                 const polyMesh& mesh,
00118                 const label thisCellI,
00119                 const label neighbourFaceI,
00120                 const wallPointData<Type>& neighbourWallInfo,
00121                 const scalar tol
00122             );
00123 
00124             //- Influence of neighbouring cell.
00125             //  Calls update(...) with faceCentre of faceI
00126             inline bool updateFace
00127             (
00128                 const polyMesh& mesh,
00129                 const label thisFaceI,
00130                 const label neighbourCellI,
00131                 const wallPointData<Type>& neighbourWallInfo,
00132                 const scalar tol
00133             );
00134 
00135             //- Influence of different value on same face.
00136             //  Merge new and old info.
00137             //  Calls update(...) with faceCentre of faceI
00138             inline bool updateFace
00139             (
00140                 const polyMesh& mesh,
00141                 const label thisFaceI,
00142                 const wallPointData<Type>& neighbourWallInfo,
00143                 const scalar tol
00144             );
00145 
00146     // Member Operators
00147 
00148     // IOstream Operators
00149 
00150         friend Ostream& operator<< <Type>(Ostream&, const wallPointData<Type>&);
00151         friend Istream& operator>> <Type>(Istream&, wallPointData<Type>&);
00152 };
00153 
00154 
00155 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00156 
00157 
00158 } // End namespace Foam
00159 
00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00161 
00162 #ifdef NoRepository
00163 #   include <meshTools/wallPointData.C>
00164 #endif
00165 
00166 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00167 
00168 #include <meshTools/wallPointDataI.H>
00169 
00170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00171 
00172 #endif
00173 
00174 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines