OpenFOAM logo
Open Source CFD Toolkit

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-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 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 wallNormalInfo& w2,
00100     const scalar tol
00101 ) const
00102 {
00103     return true;
00104 }
00105 
00106 
00107 // No geometric data.
00108 inline void Foam::wallNormalInfo::leaveDomain
00109 (
00110     const polyPatch& patch,
00111     const label patchFaceI,
00112     const point& faceCentre
00113 )
00114 {}
00115 
00116 
00117 // No geometric data.
00118 inline void Foam::wallNormalInfo::transform
00119 (
00120     const tensor& rotTensor
00121 )
00122 {}
00123 
00124 
00125 // No geometric data.
00126 inline void Foam::wallNormalInfo::enterDomain
00127 (
00128     const polyPatch& patch,
00129     const label patchFaceI,
00130     const point& faceCentre
00131 )
00132 {}
00133 
00134 
00135 // Update this with w2 if w2 nearer to pt.
00136 inline bool Foam::wallNormalInfo::updateCell
00137 (
00138     const polyMesh& mesh,
00139     const label thisCellI,
00140     const label neighbourFaceI,
00141     const wallNormalInfo& neighbourWallInfo,
00142     const scalar tol
00143 )
00144 {
00145     return update(neighbourWallInfo);
00146 }
00147 
00148 
00149 // Update this with w2 if w2 nearer to pt.
00150 inline bool Foam::wallNormalInfo::updateFace
00151 (
00152     const polyMesh& mesh,
00153     const label thisFaceI,
00154     const label neighbourCellI,
00155     const wallNormalInfo& neighbourWallInfo,
00156     const scalar tol
00157 )
00158 {
00159     return update(neighbourWallInfo);
00160 }
00161 
00162 
00163 // Update this with w2 if w2 nearer to pt.
00164 inline bool Foam::wallNormalInfo::updateFace
00165 (
00166     const polyMesh& mesh,
00167     const label thisFaceI,
00168     const wallNormalInfo& neighbourWallInfo,
00169     const scalar tol
00170 )
00171 {
00172     return update(neighbourWallInfo);
00173 }    
00174 
00175 
00176 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
00177 
00178 inline bool Foam::wallNormalInfo::operator==(const Foam::wallNormalInfo& rhs)
00179  const
00180 {
00181     return normal() == rhs.normal();
00182 }
00183 
00184 
00185 inline bool Foam::wallNormalInfo::operator!=(const Foam::wallNormalInfo& rhs)
00186  const
00187 {
00188     return !(*this == rhs);
00189 }
00190 
00191 
00192 // ************************************************************************* //
For further information go to www.openfoam.org