adding scalarIOList
[OpenFOAM-1.5.x.git] / src / meshTools / regionSplit / regionSplit.H
blob2cfe75f636f56e349e32755e56429a30b574e4c0
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::regionSplit
28 Description
29     This class separates the mesh into distinct unconnected regions,
30     each of which is then given a label.
32 SourceFiles
33     regionSplit.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef regionSplit_H
38 #define regionSplit_H
40 #include "polyMesh.H"
41 #include "demandDrivenData.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 namespace Foam
48 /*---------------------------------------------------------------------------*\
49                            Class regionSplit Declaration
50 \*---------------------------------------------------------------------------*/
52 class regionSplit
54     public labelList
56     // Private data
58         //- Reference to mesh
59         const polyMesh& mesh_;
61         //- Number of regions
62         label nRegions_;
65     // Private Member Functions
67         //- Transfer faceRegion data from one face to the other (or vice versa)
68         void transferCoupledFaceRegion
69         (
70             const label faceI,
71             const label otherFaceI,
73             labelList& faceRegion,
74             DynamicList<label>& newChangedFaces
75         ) const;
77         //- Given a seed cell label, fill cellRegion/faceRegion with markValue
78         //  for contiguous region around it
79         void fillSeedMask
80         (
81             const List<labelPair>& explicitConnections,
82             labelList& cellRegion,
83             labelList& faceRegion,
84             const label seedCellID,
85             const label markValue
86         ) const;
88         //- Calculate region split. Return number of regions.
89         label calcRegionSplit
90         (
91             const boolList& blockedFace,
92             const List<labelPair>& explicitConnections,
93             labelList& cellRegion
94         ) const;
96 public:
98     //- Runtime type information
99     ClassName("regionSplit");
101     // Constructors
103         //- Construct from mesh
104         regionSplit(const polyMesh&);
106         //- Construct from mesh and whether face is blocked
107         //  NOTE: blockedFace has to be consistent across coupled faces!
108         regionSplit(const polyMesh&, const boolList& blockedFace);
110         //- Construct from mesh and whether face is blocked. Additional explicit
111         //  connections between normal boundary faces.
112         //  NOTE: blockedFace has to be consistent across coupled faces!
113         regionSplit
114         (
115             const polyMesh&,
116             const boolList& blockedFace,
117             const List<labelPair>&
118         );
120     // Member Functions
122         //- Return number of regions
123         label nRegions() const
124         {
125             return nRegions_;
126         }
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 } // End namespace Foam
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 #endif
138 // ************************************************************************* //