pointZone.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2025 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::pointZone
26 
27 Description
28  Named list of point indices representing a sub-set of the mesh faces
29 
30  Used by mesh-manipulation tools.
31 
32 See also
33  pointZoneList
34  Zone
35  zoneGenerator
36 
37 SourceFiles
38  pointZone.C
39 
40 \*---------------------------------------------------------------------------*/
41 
42 #ifndef pointZone_H
43 #define pointZone_H
44 
45 #include "Zone.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 class pointZoneList;
53 
54 /*---------------------------------------------------------------------------*\
55  Class pointZone Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class pointZone
59 :
60  public Zone<pointZone, pointZoneList>
61 {
62 
63 public:
64 
65  // Static Data Members
66 
67  //- The name associated with the zone-labels dictionary entry
68  static const char* const labelsName;
69 
70  //- Runtime type information
71  ClassName("pointZone");
72 
73 
74  // Constructors
75 
76  using Zone::Zone;
77 
78  //- Construct and return a clone
80  {
81  return autoPtr<pointZone>
82  (
83  new pointZone(*this, name(), *this, zones())
84  );
85  }
86 
87  //- Construct and return a clone with a new name
88  autoPtr<pointZone> clone(const word& name) const
89  {
90  return autoPtr<pointZone>
91  (
92  new pointZone(*this, name, *this, zones())
93  );
94  }
95 
96  //- Construct and return a clone, resetting the mesh zones
97  autoPtr<pointZone> clone(const pointZoneList& mz) const
98  {
99  return autoPtr<pointZone>
100  (
101  new pointZone(*this, name(), *this, mz)
102  );
103  }
104 
105  //- Construct and return a clone, resetting the point list
106  // and mesh zones
108  (
109  const labelUList& addr,
110  const pointZoneList& mz
111  ) const
112  {
113  return autoPtr<pointZone>
114  (
115  new pointZone(*this, name(), addr, mz)
116  );
117  }
118 
119 
120  // Member Functions
121 
122  //- Check zone definition. Return true if in error.
123  bool checkDefinition(const bool report = false) const;
124 
125  //- Check whether zone is synchronised across coupled boundaries. Return
126  // true if in error.
127  bool checkParallelSync(const bool report = false) const;
128 
129  //- Update zone using the given map
130  void topoChange(const polyTopoChangeMap& map);
131 
132  //- Write dictionary
133  void writeDict(Ostream&) const;
134 
135 
136  // Member Operators
137 
138  using Zone::operator=;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace Foam
145 
146 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
147 
148 #endif
149 
150 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
Base class for zones.
Definition: Zone.H:68
Zone(const word &name, const labelUList &indices, const ZonesType &zones, const bool moveUpdate=false, const bool topoUpdate=false)
Construct from components.
Definition: Zone.C:112
friend Ostream & operator(Ostream &, const Zone< ZoneType, ZonesType > &)
Ostream Operator.
const word & name() const
Return name.
Definition: Zone.H:171
const pointZoneList & zones() const
Return ZonesType reference.
Definition: Zone.C:213
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
Named list of point indices representing a sub-set of the mesh faces.
Definition: pointZone.H:60
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
Definition: pointZone.C:44
ClassName("pointZone")
Runtime type information.
autoPtr< pointZone > clone() const
Construct and return a clone.
Definition: pointZone.H:78
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
Definition: pointZone.H:67
void writeDict(Ostream &) const
Write dictionary.
Definition: pointZone.C:115
bool checkParallelSync(const bool report=false) const
Check whether zone is synchronised across coupled boundaries. Return.
Definition: pointZone.C:54
void topoChange(const polyTopoChangeMap &map)
Update zone using the given map.
Definition: pointZone.C:106
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
A class for handling words, derived from string.
Definition: word.H:62
Namespace for OpenFOAM.