1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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/>.
33 \*---------------------------------------------------------------------------*/
38 #include "labelList.H"
40 #include "dictionary.H"
42 #include "pointFieldFwd.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 // Forward declaration of friend functions and operators
52 Ostream& operator<<(Ostream&, const zone&);
54 /*---------------------------------------------------------------------------*\
55 Class zone Declaration
56 \*---------------------------------------------------------------------------*/
74 // Demand-driven private data
76 //- Map of labels in zone for fast location lookup
77 mutable Map<label>* lookupMapPtr_;
80 // Protected Member Functions
82 //- Return a reference to the look-up map
83 const Map<label>& lookupMap() const;
85 //- Construct the look-up map
86 void calcLookupMap() const;
88 //- Disallow default bitwise copy construct
94 //- Runtime type information
100 //- Construct from components
104 const labelUList& addr,
108 //- Construct from components, transferring contents
112 const Xfer<labelList>& addr,
116 //- Construct from dictionary
121 const word& labelsName,
125 //- Construct given the original zone and resetting the
126 // cell list and zone mesh information
130 const labelUList& addr,
134 //- Construct given the original zone, resetting the
135 // cell list and zone mesh information
139 const Xfer<labelList>& addr,
151 const word& name() const
156 //- Map storing the local index for every global index. Used to find
157 // the index of the item in the zone from the known global index. If
158 // the item is not in the zone, returns -1
159 label localID(const label globalID) const;
161 //- Return the index of this zone in zone list
168 virtual void clearAddressing();
170 //- Check zone definition. Return true if in error.
171 virtual bool checkDefinition(const bool report = false) const = 0;
173 //- Check zone definition with max size given. Return true if in error.
174 virtual bool checkDefinition
177 const bool report = false
180 //- Correct patch after moving points
181 virtual void movePoints(const pointField&)
185 virtual void write(Ostream&) const;
188 virtual void writeDict(Ostream&) const = 0;
194 friend Ostream& operator<<(Ostream&, const zone&);
198 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
200 } // End namespace Foam
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
206 // ************************************************************************* //