1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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 \*---------------------------------------------------------------------------*/
29 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
32 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
35 inline Foam::directionInfo::directionInfo()
42 // Construct from components
43 inline Foam::directionInfo::directionInfo
55 inline Foam::directionInfo::directionInfo(const directionInfo& w2)
62 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
64 inline bool Foam::directionInfo::valid() const
70 // No geometric data so never any problem on cyclics
71 inline bool Foam::directionInfo::sameGeometry
74 const directionInfo& w2,
83 // index_ is already offset in face
84 inline void Foam::directionInfo::leaveDomain
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] ,,
98 inline void Foam::directionInfo::enterDomain
101 const polyPatch& patch,
102 const label patchFaceI,
103 const point& faceCentre
108 const face& f = patch[patchFaceI];
110 index_ = (f.size() - index_) % f.size();
115 // No geometric data.
116 inline void Foam::directionInfo::transform
119 const tensor& rotTensor
124 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
126 inline bool Foam::directionInfo::operator==(const Foam::directionInfo& rhs)
129 return index() == rhs.index() && n() == rhs.n();
133 inline bool Foam::directionInfo::operator!=(const Foam::directionInfo& rhs)
136 return !(*this == rhs);
140 // ************************************************************************* //