initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / primitiveMesh / primitivePatch / walkPatch.H
blobefa5c883bada6b487e457febb6d1d5c8d973321d
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 Class
26     Foam::walkPatch
28 Description
29     Collection of static functions to do various simple patch related things.
31 SourceFiles
32     walkPatch.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef walkPatch_H
37 #define walkPatch_H
39 #include "labelList.H"
40 #include "primitivePatch.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 namespace Foam
47 /*---------------------------------------------------------------------------*\
48                            Class walkPatch Declaration
49 \*---------------------------------------------------------------------------*/
51 class walkPatch
53     // Private data
55         //- Reference to patch to walk on
56         const primitivePatch& pp_;
58         //- Reference to zones
59         const labelList& faceZone_;
61         //- How to walk through faces
62         const bool reverse_;
64         //- Reference to list to mark off visited faces
65         boolList& visited_;
68         // Faces visited
69         DynamicList<label> visitOrder_;
71         // Index in face of vertex it was visited through
72         DynamicList<label> indexInFace_;
75     // Private Member Functions
77         //- Get other face using v0, v1. Returns -1 if none.
78         label getNeighbour
79         (
80             const label faceI,
81             const label fp,
82             const label v0,
83             const label v1
84         ) const;
86         //- Gets labels of changed faces and enterVertices on faces.
87         // Returns labels of faces changed and enterVertices on them.
88         void faceToFace
89         (
90             const labelList& changedFaces,
91             const labelList& enterVerts,
93             labelList& nbrFaces,
94             labelList& nbrEnterVerts
95         );
98         //- Disallow default bitwise copy construct
99         walkPatch(const walkPatch&);
101         //- Disallow default bitwise assignment
102         void operator=(const walkPatch&);
104 public:
106     ClassName("walkPatch");
109     // Constructors
111         //- Construct from components
112         walkPatch
113         (
114             const primitivePatch& pp,
115             const labelList& faceZone,  // Per face which zone it belongs to
116             const bool reverse,         // Reverse walk
117             const label faceI,          // Current face
118             const label enterVertI,     // Vertex across which this face
119                                         // is visited.
120             boolList& visited
121         );
124     // Member Functions
126         const DynamicList<label>& visitOrder() const
127         {
128             return visitOrder_;
129         }
131         const DynamicList<label>& indexInFace() const
132         {
133             return indexInFace_;
134         }
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 } // End namespace Foam
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 #endif
147 // ************************************************************************* //