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/>.
28 A subset of mesh points.
29 The labels of points in the zone can be obtained from the addressing()
32 For quick check whether a point belongs to the zone use the lookup
33 mechanism in pointZoneMesh, where all the zoned points are registered
34 with their zone number.
40 \*---------------------------------------------------------------------------*/
46 #include "pointZoneMeshFwd.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Forward declaration of friend functions and operators
56 Ostream& operator<<(Ostream&, const pointZone&);
59 /*---------------------------------------------------------------------------*\
60 Class pointZone Declaration
61 \*---------------------------------------------------------------------------*/
72 //- Reference to zone list
73 const pointZoneMesh& zoneMesh_;
75 // Private Member Functions
77 //- Disallow default bitwise copy construct
78 pointZone(const pointZone&);
82 // Static data members
84 //- The name associated with the zone-labels dictionary entry
85 static const char * const labelsName;
88 //- Runtime type information
89 TypeName("pointZone");
92 // Declare run-time constructor selection tables
94 declareRunTimeSelectionTable
101 const dictionary& dict,
103 const pointZoneMesh& zm
105 (name, dict, index, zm)
111 //- Construct from components
115 const labelUList& addr,
120 //- Construct from components, transferring contents
124 const Xfer<labelList>& addr,
129 //- Construct from dictionary
138 //- Construct given the original zone and resetting the
139 // point list and zone mesh information
143 const labelUList& addr,
148 //- Construct given the original zone, resetting the
149 // face list and zone mesh information
153 const Xfer<labelList>& addr,
158 //- Construct and return a clone, resetting the zone mesh
159 virtual autoPtr<pointZone> clone(const pointZoneMesh& zm) const
161 return autoPtr<pointZone>
163 new pointZone(*this, *this, index(), zm)
167 //- Construct and return a clone, resetting the point list
169 virtual autoPtr<pointZone> clone
171 const pointZoneMesh& zm,
173 const labelUList& addr
176 return autoPtr<pointZone>
178 new pointZone(*this, addr, index, zm)
185 //- Return a pointer to a new point zone
186 // created on freestore from dictionary
187 static autoPtr<pointZone> New
197 virtual ~pointZone();
202 //- Return zoneMesh reference
203 const pointZoneMesh& zoneMesh() const;
205 //- Helper function to re-direct to zone::localID(...)
206 label whichPoint(const label globalPointID) const;
208 //- Check zone definition. Return true if in error.
209 virtual bool checkDefinition(const bool report = false) const;
211 //- Check whether zone is synchronised across coupled boundaries. Return
213 virtual bool checkParallelSync(const bool report = false) const;
215 //- Correct patch after moving points
216 virtual void movePoints(const pointField&)
220 virtual void writeDict(Ostream&) const;
225 //- Assign to zone, clearing demand-driven data
226 void operator=(const pointZone&);
228 //- Assign addressing, clearing demand-driven data
229 void operator=(const labelUList&);
231 //- Assign addressing, clearing demand-driven data
232 void operator=(const Xfer<labelList>&);
238 friend Ostream& operator<<(Ostream&, const pointZone&);
242 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
244 } // End namespace Foam
246 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
250 // ************************************************************************* //