Forward compatibility: flex
[foam-extend-3.2.git] / src / foam / meshes / primitiveMesh / primitivePatch / walkPatch.H
blobf40ff2b88708ce6a4090b54eda5e1cfa8a66a406
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend 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 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     Foam::walkPatch
27 Description
28     Collection of static functions to do various simple patch related things.
30 SourceFiles
31     walkPatch.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef walkPatch_H
36 #define walkPatch_H
38 #include "labelList.H"
39 #include "primitivePatch.H"
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 namespace Foam
46 /*---------------------------------------------------------------------------*\
47                            Class walkPatch Declaration
48 \*---------------------------------------------------------------------------*/
50 class walkPatch
52     // Private data
54         //- Reference to patch to walk on
55         const primitivePatch& pp_;
57         //- Reference to zones
58         const labelList& faceZone_;
60         //- How to walk through faces
61         const bool reverse_;
63         //- Reference to list to mark off visited faces
64         boolList& visited_;
67         // Faces visited
68         dynamicLabelList visitOrder_;
70         // Index in face of vertex it was visited through
71         dynamicLabelList indexInFace_;
74     // Private Member Functions
76         //- Get other face using v0, v1. Returns -1 if none.
77         label getNeighbour
78         (
79             const label faceI,
80             const label fp,
81             const label v0,
82             const label v1
83         ) const;
85         //- Gets labels of changed faces and enterVertices on faces.
86         // Returns labels of faces changed and enterVertices on them.
87         void faceToFace
88         (
89             const labelList& changedFaces,
90             const labelList& enterVerts,
92             labelList& nbrFaces,
93             labelList& nbrEnterVerts
94         );
97         //- Disallow default bitwise copy construct
98         walkPatch(const walkPatch&);
100         //- Disallow default bitwise assignment
101         void operator=(const walkPatch&);
103 public:
105     ClassName("walkPatch");
108     // Constructors
110         //- Construct from components
111         walkPatch
112         (
113             const primitivePatch& pp,
114             const labelList& faceZone,  // Per face which zone it belongs to
115             const bool reverse,         // Reverse walk
116             const label faceI,          // Current face
117             const label enterVertI,     // Vertex across which this face
118                                         // is visited.
119             boolList& visited
120         );
123     // Member Functions
125         const dynamicLabelList& visitOrder() const
126         {
127             return visitOrder_;
128         }
130         const dynamicLabelList& indexInFace() const
131         {
132             return indexInFace_;
133         }
138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 } // End namespace Foam
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 #endif
146 // ************************************************************************* //