|
|
|
sortLabelledTri.HGo 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::sortLabelledTri 00027 00028 Description 00029 Helper class which when constructed with a triSurface 00030 sorts the faces according to region number (or rather constructs a 00031 mapping). 00032 00033 SourceFiles 00034 sortLabelledTri.C 00035 00036 \*---------------------------------------------------------------------------*/ 00037 00038 #ifndef sortLabelledTri_H 00039 #define sortLabelledTri_H 00040 00041 #include "labelList.H" 00042 00043 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00044 00045 namespace Foam 00046 { 00047 00048 class sortLabelledTri; 00049 class triSurface; 00050 00051 /*---------------------------------------------------------------------------*\ 00052 Class surfAndLabel Declaration 00053 \*---------------------------------------------------------------------------*/ 00054 00055 //- Hold surface and label 00056 class surfAndLabel 00057 { 00058 const triSurface* surfPtr_; 00059 00060 label index_; 00061 00062 // Private Classes 00063 00064 //- scalar comparison function used for sorting 00065 class less 00066 { 00067 public: 00068 00069 inline bool operator() 00070 ( 00071 const surfAndLabel& one, 00072 const surfAndLabel& two 00073 ) const; 00074 }; 00075 00076 00077 public: 00078 00079 friend class sortLabelledTri; 00080 00081 // Constructors 00082 00083 //- Construct null 00084 surfAndLabel() 00085 : 00086 surfPtr_(NULL), 00087 index_(-1) 00088 {} 00089 00090 //- Construct from surface and index 00091 surfAndLabel(const triSurface& surf, const label index) 00092 : 00093 surfPtr_(&surf), 00094 index_(index) 00095 {} 00096 }; 00097 00098 00099 /*---------------------------------------------------------------------------*\ 00100 Class sortLabelledTri Declaration 00101 \*---------------------------------------------------------------------------*/ 00102 00103 class sortLabelledTri 00104 : 00105 public List<surfAndLabel> 00106 { 00107 00108 public: 00109 00110 // Constructors 00111 00112 //- Construct from surface, sorting the faces according to patch 00113 sortLabelledTri(const triSurface&); 00114 00115 00116 // Member Functions 00117 00118 // Access 00119 00120 //- Set the labelList to those of sorted point indices 00121 void indices(labelList&) const; 00122 00123 //- Return the list of sorted point indices 00124 labelList indices() const; 00125 }; 00126 00127 00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00129 00130 } // End namespace Foam 00131 00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00133 00134 #endif 00135 00136 // ************************************************************************* // |