initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / src / OpenFOAM / meshes / primitiveMesh / primitivePatch / walkPatch.H
blob35ac7dfc9d53571180afbc32f9dde94d6e761ea5
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 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 "label.H"
40 #include "labelList.H"
41 #include "primitivePatch.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class walkPatch Declaration
50 \*---------------------------------------------------------------------------*/
52 class walkPatch
54     // Private data
56         //- Reference to patch to walk on
57         const primitivePatch& pp_;
59         //- Reference to zones
60         const labelList& faceZone_;
62         //- How to walk through faces
63         const bool reverse_;
65         //- Reference to list to mark off visited faces
66         boolList& visited_;
69         // Faces visited
70         DynamicList<label> visitOrder_;
72         // Index in face of vertex it was visited through
73         DynamicList<label> indexInFace_;
76     // Private Member Functions
78         //- Get other face using v0, v1. Returns -1 if none.
79         label getNeighbour
80         (
81             const label faceI,
82             const label fp,
83             const label v0,
84             const label v1
85         ) const;
87         //- Gets labels of changed faces and enterVertices on faces.
88         // Returns labels of faces changed and enterVertices on them.
89         void faceToFace
90         (
91             const labelList& changedFaces,
92             const labelList& enterVerts,
94             labelList& nbrFaces,
95             labelList& nbrEnterVerts
96         );
99         //- Disallow default bitwise copy construct
100         walkPatch(const walkPatch&);
102         //- Disallow default bitwise assignment
103         void operator=(const walkPatch&);
105 public:
107     ClassName("walkPatch");
110     // Constructors
112         //- Construct from components
113         walkPatch
114         (
115             const primitivePatch& pp,
116             const labelList& faceZone,  // Per face which zone it belongs to
117             const bool reverse,         // Reverse walk
118             const label faceI,          // Current face
119             const label enterVertI,     // Vertex across which this face
120                                         // is visited.
121             boolList& visited
122         );
125     // Member Functions
127         const DynamicList<label>& visitOrder() const
128         {
129             return visitOrder_;
130         }
132         const DynamicList<label>& indexInFace() const
133         {
134             return indexInFace_;
135         }
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 } // End namespace Foam
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 #endif
148 // ************************************************************************* //