initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / meshCut / directions / directionInfo / directionInfoI.H
blob44a9745977b322071758dc98cb4e3852ab58ccc3
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  * * * * * * * * * * * //
32 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
34 // Null constructor
35 inline Foam::directionInfo::directionInfo()
37     index_(-3),
38     n_(vector::zero)
42 // Construct from components
43 inline Foam::directionInfo::directionInfo
45     const label index,
46     const vector& n
49     index_(index),
50     n_(n)
54 // Construct as copy
55 inline Foam::directionInfo::directionInfo(const directionInfo& w2)
57     index_(w2.index()),
58     n_(w2.n())
62 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
64 inline bool Foam::directionInfo::valid() const
66     return index_ != -3;
70 // No geometric data so never any problem on cyclics
71 inline bool Foam::directionInfo::sameGeometry
73     const polyMesh&,
74     const directionInfo& w2,
75     const scalar tol
77  const
79     return true;
83 // index_ is already offset in face
84 inline void Foam::directionInfo::leaveDomain
86     const polyMesh&,
87     const polyPatch& patch,
88     const label patchFaceI,
89     const point& faceCentre
94 // index_ is offset in face on other side. So reverse it here.
95 // (Note: f[0] on other domain is connected to f[0] in this domain,
96 //        f[1]      ,,                         f[size-1]   ,, 
97 // etc.)
98 inline void Foam::directionInfo::enterDomain
100     const polyMesh&,
101     const polyPatch& patch,
102     const label patchFaceI,
103     const point& faceCentre
106     if (index_ >= 0)
107     {
108         const face& f = patch[patchFaceI];
110         index_ = (f.size() - index_) % f.size();
111     }
115 // No geometric data.
116 inline void Foam::directionInfo::transform
118     const polyMesh&,
119     const tensor& rotTensor
124 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
126 inline bool Foam::directionInfo::operator==(const Foam::directionInfo& rhs)
127  const
129     return  index() == rhs.index() && n() == rhs.n();
133 inline bool Foam::directionInfo::operator!=(const Foam::directionInfo& rhs)
134  const
136     return !(*this == rhs);
140 // ************************************************************************* //