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