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
29 Holds direction in which to split cell (in fact a local coordinate axes).
30 Information is a label and a direction.
32 The direction is the normal
33 direction to cut in. The label's meaning depends on whether the info
34 is on a cell or on a face:
35 - in cell: edge that is being cut. (determines for hex how cut is)
36 - in face: local face point that is being cut or -1.
37 -# (-1) : cut is tangential to plane
38 -# (>= 0): edge fp..fp+1 is cut
40 (has to be facepoint, not vertex since vertex not valid across
41 processors whereas f[0] should correspond to f[0] on other side)
43 The rule is that if the label is set (-1 or higher) it is used
44 (topological information only), otherwise the vector is used. This makes
45 sure that we use topological information as much as possible and so a
46 hex mesh is cut purely topologically. All other shapes are cut
53 \*---------------------------------------------------------------------------*/
55 #ifndef directionInfo_H
56 #define directionInfo_H
59 #include "labelList.H"
62 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 /*---------------------------------------------------------------------------*\
74 Class directionInfo Declaration
75 \*---------------------------------------------------------------------------*/
81 // Either mesh edge or face point
88 // Private Member Functions
90 //- edge uses two labels
91 static bool equal(const edge& e, const label, const label);
93 //- Calculate mid point of edge.
94 static point eMid(const primitiveMesh& mesh, const label edgeI);
96 //- Find edge among edgeLabels that uses v0 and v1
99 const primitiveMesh& mesh,
100 const labelList& edgeLabels,
105 //- Return 'lowest' of a,b in face of size.
117 //- Given edge on hex cell find corresponding edge on face. Is either
118 // index in face or -1 (cut tangential to face). Public since is
119 // needed to fill in seed faces in meshWave.
120 static label edgeToFaceIndex
122 const primitiveMesh& mesh,
131 inline directionInfo();
133 //- Construct from components
140 //- Construct as copy
141 inline directionInfo(const directionInfo&);
148 inline label index() const
153 inline const vector& n() const
158 // Needed by FaceCellWave
160 //- Check whether origin has been changed at all or
161 // still contains original (invalid) value.
162 inline bool valid() const;
164 //- Check for identical geometrical data. Used for cyclics checking.
165 inline bool sameGeometry
168 const directionInfo&,
172 //- Convert any absolute coordinates into relative to (patch)face
174 inline void leaveDomain
178 const label patchFaceI,
179 const point& faceCentre
182 //- Reverse of leaveDomain
183 inline void enterDomain
187 const label patchFaceI,
188 const point& faceCentre
191 //- Apply rotation matrix to any coordinates
192 inline void transform
198 //- Influence of neighbouring face.
202 const label thisCellI,
203 const label neighbourFaceI,
204 const directionInfo& neighbourInfo,
208 //- Influence of neighbouring cell.
212 const label thisFaceI,
213 const label neighbourCellI,
214 const directionInfo& neighbourInfo,
218 //- Influence of different value on same face.
222 const label thisFaceI,
223 const directionInfo& neighbourInfo,
229 // Needed for List IO
230 inline bool operator==(const directionInfo&) const;
232 inline bool operator!=(const directionInfo&) const;
235 // IOstream Operators
237 friend Ostream& operator<<(Ostream&, const directionInfo&);
238 friend Istream& operator>>(Istream&, directionInfo&);
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 } // End namespace Foam
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
248 #include "directionInfoI.H"
250 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
254 // ************************************************************************* //