FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

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-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::walkPatch
00026 
00027 Description
00028     Collection of static functions to do various simple patch related things.
00029 
00030 SourceFiles
00031     walkPatch.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef walkPatch_H
00036 #define walkPatch_H
00037 
00038 #include <OpenFOAM/labelList.H>
00039 #include "primitivePatch.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                            Class walkPatch Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 class walkPatch
00051 {
00052     // Private data
00053 
00054         //- Reference to patch to walk on
00055         const primitivePatch& pp_;
00056 
00057         //- Reference to zones
00058         const labelList& faceZone_;
00059 
00060         //- How to walk through faces
00061         const bool reverse_;
00062 
00063         //- Reference to list to mark off visited faces
00064         boolList& visited_;
00065 
00066 
00067         // Faces visited
00068         DynamicList<label> visitOrder_;
00069 
00070         // Index in face of vertex it was visited through
00071         DynamicList<label> indexInFace_;
00072 
00073 
00074     // Private Member Functions
00075 
00076         //- Get other face using v0, v1. Returns -1 if none.
00077         label getNeighbour
00078         (
00079             const label faceI,
00080             const label fp,
00081             const label v0,
00082             const label v1
00083         ) const;
00084 
00085         //- Gets labels of changed faces and enterVertices on faces.
00086         // Returns labels of faces changed and enterVertices on them.
00087         void faceToFace
00088         (
00089             const labelList& changedFaces,
00090             const labelList& enterVerts,
00091 
00092             labelList& nbrFaces,
00093             labelList& nbrEnterVerts
00094         );
00095 
00096 
00097         //- Disallow default bitwise copy construct
00098         walkPatch(const walkPatch&);
00099 
00100         //- Disallow default bitwise assignment
00101         void operator=(const walkPatch&);
00102 
00103 public:
00104 
00105     ClassName("walkPatch");
00106 
00107 
00108     // Constructors
00109 
00110         //- Construct from components
00111         walkPatch
00112         (
00113             const primitivePatch& pp,
00114             const labelList& faceZone,  // Per face which zone it belongs to
00115             const bool reverse,         // Reverse walk
00116             const label faceI,          // Current face
00117             const label enterVertI,     // Vertex across which this face
00118                                         // is visited.
00119             boolList& visited
00120         );
00121 
00122 
00123     // Member Functions
00124 
00125         const DynamicList<label>& visitOrder() const
00126         {
00127             return visitOrder_;
00128         }
00129 
00130         const DynamicList<label>& indexInFace() const
00131         {
00132             return indexInFace_;
00133         }
00134 
00135 };
00136 
00137 
00138 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00139 
00140 } // End namespace Foam
00141 
00142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00143 
00144 #endif
00145 
00146 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines