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

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