initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / meshCut / wallLayerCells / wallNormalInfo / wallNormalInfoI.H
blob1b11fb6624f95fffba41a6ff13c9ea534b1b056d
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 \*---------------------------------------------------------------------------*/
27 #include "polyMesh.H"
29 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
31 // Update this with w2 if not yet set.
32 inline bool Foam::wallNormalInfo::update(const wallNormalInfo& w2)
34     if (!w2.valid())
35     {
36         FatalErrorIn
37         (
38             "wallNormalInfo::update(const wallNormalInfo&)"
39         ) << "Problem: w2 is not valid" << abort(FatalError);
41         return false;
42     }
43     else if (valid())
44     {
45         // our already set. Stop any transfer
46         return false;
47     }
48     else
49     {
50         normal_ = w2.normal();
52         return true;
53     }
55     
57 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
59 // Null constructor
60 inline Foam::wallNormalInfo::wallNormalInfo()
62     normal_(greatVector)
66 // Construct from normal
67 inline Foam::wallNormalInfo::wallNormalInfo(const vector& normal)
69     normal_(normal)
73 // Construct as copy
74 inline Foam::wallNormalInfo::wallNormalInfo(const wallNormalInfo& wpt)
76     normal_(wpt.normal())
80 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
82 inline const Foam::vector& Foam::wallNormalInfo::normal() const
84     return normal_;
88 inline bool Foam::wallNormalInfo::valid() const
90     return normal_ != greatVector;
94 // No geometric data so never any problem on cyclics
95 inline bool Foam::wallNormalInfo::sameGeometry
97     const polyMesh&,
98     const wallNormalInfo& w2,
99     const scalar tol
100 ) const
102     return true;
106 // No geometric data.
107 inline void Foam::wallNormalInfo::leaveDomain
109     const polyMesh&,
110     const polyPatch& patch,
111     const label patchFaceI,
112     const point& faceCentre
117 // No geometric data.
118 inline void Foam::wallNormalInfo::transform
120     const polyMesh&,
121     const tensor& rotTensor
126 // No geometric data.
127 inline void Foam::wallNormalInfo::enterDomain
129     const polyMesh&,
130     const polyPatch& patch,
131     const label patchFaceI,
132     const point& faceCentre
137 // Update this with w2 if w2 nearer to pt.
138 inline bool Foam::wallNormalInfo::updateCell
140     const polyMesh&,
141     const label thisCellI,
142     const label neighbourFaceI,
143     const wallNormalInfo& neighbourWallInfo,
144     const scalar tol
147     return update(neighbourWallInfo);
151 // Update this with w2 if w2 nearer to pt.
152 inline bool Foam::wallNormalInfo::updateFace
154     const polyMesh&,
155     const label thisFaceI,
156     const label neighbourCellI,
157     const wallNormalInfo& neighbourWallInfo,
158     const scalar tol
161     return update(neighbourWallInfo);
165 // Update this with w2 if w2 nearer to pt.
166 inline bool Foam::wallNormalInfo::updateFace
168     const polyMesh&,
169     const label thisFaceI,
170     const wallNormalInfo& neighbourWallInfo,
171     const scalar tol
174     return update(neighbourWallInfo);
175 }    
178 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
180 inline bool Foam::wallNormalInfo::operator==(const Foam::wallNormalInfo& rhs)
181  const
183     return normal() == rhs.normal();
187 inline bool Foam::wallNormalInfo::operator!=(const Foam::wallNormalInfo& rhs)
188  const
190     return !(*this == rhs);
194 // ************************************************************************* //