1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
33 \*---------------------------------------------------------------------------*/
39 #include "regIOobject.H"
41 #include "pointFieldsFwd.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 // Forward declaration of friend functions and operators
52 template<class ZoneType, class MeshType> class ZoneMesh;
54 template<class ZoneType, class MeshType>
55 Ostream& operator<<(Ostream&, const ZoneMesh<ZoneType, MeshType>&);
57 /*---------------------------------------------------------------------------*\
58 Class ZoneMesh Declaration
59 \*---------------------------------------------------------------------------*/
61 template<class ZoneType, class MeshType>
64 public PtrList<ZoneType>,
70 const MeshType& mesh_;
72 //- Map of zone labels for given element
73 mutable Map<label>* zoneMapPtr_;
76 // Private member functions
78 //- Disallow construct as copy
79 ZoneMesh(const ZoneMesh&);
81 //- Disallow assignment
82 void operator=(const ZoneMesh<ZoneType, MeshType>&);
86 void calcZoneMap() const;
89 void clearAddressing();
96 //- Read constructor given IOobject and a MeshType reference
103 //- Construct given size
118 //- Return the mesh reference
119 const MeshType& mesh() const
124 //- Map of zones containing zone index for all zoned elements
125 // Return -1 if the object is not in the zone
126 const Map<label>& zoneMap() const;
128 //- Given a global object index, return the zone it is in. If
129 // object does not belong to any zones, return -1
130 label whichZone(const label objectIndex) const;
132 //- Return a list of zone types
133 wordList types() const;
135 //- Return a list of zone names
136 wordList names() const;
138 //- Find zone index given a name
139 label findZoneID(const word& zoneName) const;
144 //- Check zone definition. Return true if in error.
145 bool checkDefinition(const bool report = false) const;
147 //- Correct zone mesh after moving points
148 void movePoints(const pointField&);
150 //- Correct after topology update
153 //- writeData member function required by regIOobject
154 bool writeData(Ostream&) const;
159 friend Ostream& operator<< <ZoneType, MeshType>
162 const ZoneMesh<ZoneType, MeshType>&
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 } // End namespace Foam
171 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174 # include "ZoneMesh.C"
177 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181 // ************************************************************************* //