OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

walkPatch.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software; you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM; if not, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     Foam::walkPatch
00027 
00028 Description
00029     Collection of static functions to do various simple patch related things.
00030 
00031 SourceFiles
00032     walkPatch.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef walkPatch_H
00037 #define walkPatch_H
00038 
00039 #include "labelList.H"
00040 #include "primitivePatch.H"
00041 
00042 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00043 
00044 namespace Foam
00045 {
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class walkPatch Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class walkPatch
00052 {
00053     // Private data
00054 
00055         //- Reference to patch to walk on
00056         const primitivePatch& pp_;
00057 
00058         //- Reference to zones
00059         const labelList& faceZone_;
00060 
00061         //- How to walk through faces
00062         const bool reverse_;
00063 
00064         //- Reference to list to mark off visited faces
00065         boolList& visited_;
00066 
00067 
00068         // Faces visited
00069         DynamicList<label> visitOrder_;
00070 
00071         // Index in face of vertex it was visited through
00072         DynamicList<label> indexInFace_;
00073 
00074 
00075     // Private Member Functions
00076 
00077         //- Get other face using v0, v1. Returns -1 if none.
00078         label getNeighbour
00079         (
00080             const label faceI,
00081             const label fp,
00082             const label v0,
00083             const label v1
00084         ) const;
00085 
00086         //- Gets labels of changed faces and enterVertices on faces.
00087         // Returns labels of faces changed and enterVertices on them.
00088         void faceToFace
00089         (
00090             const labelList& changedFaces,
00091             const labelList& enterVerts,
00092 
00093             labelList& nbrFaces,
00094             labelList& nbrEnterVerts
00095         );
00096 
00097 
00098         //- Disallow default bitwise copy construct
00099         walkPatch(const walkPatch&);
00100 
00101         //- Disallow default bitwise assignment
00102         void operator=(const walkPatch&);
00103 
00104 public:
00105 
00106     ClassName("walkPatch");
00107 
00108 
00109     // Constructors
00110 
00111         //- Construct from components
00112         walkPatch
00113         (
00114             const primitivePatch& pp,
00115             const labelList& faceZone,  // Per face which zone it belongs to
00116             const bool reverse,         // Reverse walk
00117             const label faceI,          // Current face
00118             const label enterVertI,     // Vertex across which this face
00119                                         // is visited.
00120             boolList& visited
00121         );
00122 
00123 
00124     // Member Functions
00125 
00126         const DynamicList<label>& visitOrder() const
00127         {
00128             return visitOrder_;
00129         }
00130 
00131         const DynamicList<label>& indexInFace() const
00132         {
00133             return indexInFace_;
00134         }
00135 
00136 };
00137 
00138 
00139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00140 
00141 } // End namespace Foam
00142 
00143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00144 
00145 #endif
00146 
00147 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd