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