1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
13 the Free Software Foundation, either version 3 of the License, or
14 (at your 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
21 You should have received a copy of the GNU General Public License
22 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 Helper class which when constructed with a triSurface
29 sorts the faces according to region number (or rather constructs a
35 \*---------------------------------------------------------------------------*/
37 #ifndef sortLabelledTri_H
38 #define sortLabelledTri_H
40 #include "labelList.H"
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 class sortLabelledTri;
50 /*---------------------------------------------------------------------------*\
51 Class surfAndLabel Declaration
52 \*---------------------------------------------------------------------------*/
54 //- Hold surface and label
57 const triSurface* surfPtr_;
63 //- scalar comparison function used for sorting
68 inline bool operator()
70 const surfAndLabel& one,
71 const surfAndLabel& two
78 friend class sortLabelledTri;
89 //- Construct from surface and index
90 surfAndLabel(const triSurface& surf, const label index)
98 /*---------------------------------------------------------------------------*\
99 Class sortLabelledTri Declaration
100 \*---------------------------------------------------------------------------*/
102 class sortLabelledTri
104 public List<surfAndLabel>
111 //- Construct from surface, sorting the faces according to patch
112 sortLabelledTri(const triSurface&);
119 //- Set the labelList to those of sorted point indices
120 void indices(labelList&) const;
122 //- Return the list of sorted point indices
123 labelList indices() const;
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 } // End namespace Foam
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 // ************************************************************************* //