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

wallNormalInfoI.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 Description
00026 
00027 \*---------------------------------------------------------------------------*/
00028 
00029 #include "polyMesh.H"
00030 
00031 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00032 
00033 // Update this with w2 if not yet set.
00034 inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2)
00035 {
00036     if (!w2.valid())
00037     {
00038         FatalErrorIn
00039         (
00040             "wallNormalInfo::update(const wallNormalInfo&)"
00041         ) << "Problem: w2 is not valid" << abort(FatalError);
00042 
00043         return false;
00044     }
00045     else if (valid())
00046     {
00047         // our already set. Stop any transfer
00048         return false;
00049     }
00050     else
00051     {
00052         normal_ = w2.normal();
00053 
00054         return true;
00055     }
00056 }
00057     
00058 
00059 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00060 
00061 // Null constructor
00062 inline Foam::wallNormalInfo::wallNormalInfo()
00063 :
00064     normal_(greatVector)
00065 {}
00066 
00067 
00068 // Construct from normal
00069 inline Foam::wallNormalInfo::wallNormalInfo(const vector& normal)
00070 :
00071     normal_(normal)
00072 {}
00073 
00074 
00075 // Construct as copy
00076 inline Foam::wallNormalInfo::wallNormalInfo(const wallNormalInfo& wpt)
00077 :
00078     normal_(wpt.normal())
00079 {}
00080 
00081 
00082 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00083 
00084 inline const Foam::vector& Foam::wallNormalInfo::normal() const
00085 {
00086     return normal_;
00087 }
00088 
00089 
00090 inline bool Foam::wallNormalInfo::valid() const
00091 {
00092     return normal_ != greatVector;
00093 }
00094 
00095 
00096 // No geometric data so never any problem on cyclics
00097 inline bool Foam::wallNormalInfo::sameGeometry
00098 (
00099     const polyMesh&,
00100     const wallNormalInfo& w2,
00101     const scalar tol
00102 ) const
00103 {
00104     return true;
00105 }
00106 
00107 
00108 // No geometric data.
00109 inline void Foam::wallNormalInfo::leaveDomain
00110 (
00111     const polyMesh&,
00112     const polyPatch& patch,
00113     const label patchFaceI,
00114     const point& faceCentre
00115 )
00116 {}
00117 
00118 
00119 // No geometric data.
00120 inline void Foam::wallNormalInfo::transform
00121 (
00122     const polyMesh&,
00123     const tensor& rotTensor
00124 )
00125 {}
00126 
00127 
00128 // No geometric data.
00129 inline void Foam::wallNormalInfo::enterDomain
00130 (
00131     const polyMesh&,
00132     const polyPatch& patch,
00133     const label patchFaceI,
00134     const point& faceCentre
00135 )
00136 {}
00137 
00138 
00139 // Update this with w2 if w2 nearer to pt.
00140 inline bool Foam::wallNormalInfo::updateCell
00141 (
00142     const polyMesh&,
00143     const label thisCellI,
00144     const label neighbourFaceI,
00145     const wallNormalInfo& neighbourWallInfo,
00146     const scalar tol
00147 )
00148 {
00149     return update(neighbourWallInfo);
00150 }
00151 
00152 
00153 // Update this with w2 if w2 nearer to pt.
00154 inline bool Foam::wallNormalInfo::updateFace
00155 (
00156     const polyMesh&,
00157     const label thisFaceI,
00158     const label neighbourCellI,
00159     const wallNormalInfo& neighbourWallInfo,
00160     const scalar tol
00161 )
00162 {
00163     return update(neighbourWallInfo);
00164 }
00165 
00166 
00167 // Update this with w2 if w2 nearer to pt.
00168 inline bool Foam::wallNormalInfo::updateFace
00169 (
00170     const polyMesh&,
00171     const label thisFaceI,
00172     const wallNormalInfo& neighbourWallInfo,
00173     const scalar tol
00174 )
00175 {
00176     return update(neighbourWallInfo);
00177 }    
00178 
00179 
00180 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00181 
00182 inline bool Foam::wallNormalInfo::operator==(const Foam::wallNormalInfo& rhs)
00183  const
00184 {
00185     return normal() == rhs.normal();
00186 }
00187 
00188 
00189 inline bool Foam::wallNormalInfo::operator!=(const Foam::wallNormalInfo& rhs)
00190  const
00191 {
00192     return !(*this == rhs);
00193 }
00194 
00195 
00196 // ************************************************************************* //
Copyright © 2000-2007 OpenCFD Ltd