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-2024 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  A subset of mesh points.
29  The labels of points in the zone can be obtained from the addressing()
30  list.
31 
32  For quick check whether a point belongs to the zone use the lookup
33  mechanism in pointZoneList, where all the zoned points are registered
34  with their zone number.
35 
36 SourceFiles
37  pointZone.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef pointZone_H
42 #define pointZone_H
43 
44 #include "Zone.H"
45 
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 
48 namespace Foam
49 {
50 
51 class pointZoneList;
52 
53 /*---------------------------------------------------------------------------*\
54  Class pointZone Declaration
55 \*---------------------------------------------------------------------------*/
56 
57 class pointZone
58 :
59  public Zone<pointZone, pointZoneList>
60 {
61 
62 public:
63 
64  // Static Data Members
65 
66  //- The name associated with the zone-labels dictionary entry
67  static const char* const labelsName;
68 
69 
70  //- Runtime type information
71  TypeName("pointZone");
72 
73 
74  // Constructors
75 
76  using Zone::Zone;
77 
78  //- Construct and return a clone, resetting the mesh zones
79  virtual autoPtr<pointZone> clone(const pointZoneList& mz) const
80  {
81  return autoPtr<pointZone>
82  (
83  new pointZone(*this, *this, mz)
84  );
85  }
86 
87  //- Construct and return a clone, resetting the point list
88  // and mesh zones
90  (
91  const labelUList& addr,
92  const pointZoneList& mz
93  ) const
94  {
95  return autoPtr<pointZone>
96  (
97  new pointZone(*this, addr, mz)
98  );
99  }
100 
101 
102  // Member Functions
103 
104  //- Return the mesh points
105  const pointField& meshCentres() const;
106 
107  //- Check zone definition. Return true if in error.
108  bool checkDefinition(const bool report = false) const;
109 
110  //- Check whether zone is synchronised across coupled boundaries. Return
111  // true if in error.
112  bool checkParallelSync(const bool report = false) const;
113 
114  //- Update zone using the given map
115  virtual void topoChange(const polyTopoChangeMap& map);
116 
117  //- Write dictionary
118  virtual void writeDict(Ostream&) const;
119 
120 
121  // Member Operators
122 
123  using Zone::operator=;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
autoPtr< List< label > > clone() const
Clone.
Definition: ListI.H:109
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:67
Zone(const word &name, const labelUList &indices, const ZonesType &zones)
Construct from components.
Definition: Zone.C:112
friend Ostream & operator(Ostream &, const Zone< ZoneType, ZonesType > &)
Ostream Operator.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
A subset of mesh points. The labels of points in the zone can be obtained from the addressing() list.
Definition: pointZone.H:59
bool checkDefinition(const bool report=false) const
Check zone definition. Return true if in error.
Definition: pointZone.C:55
const pointField & meshCentres() const
Return the mesh points.
Definition: pointZone.C:49
TypeName("pointZone")
Runtime type information.
static const char *const labelsName
The name associated with the zone-labels dictionary entry.
Definition: pointZone.H:66
virtual void writeDict(Ostream &) const
Write dictionary.
Definition: pointZone.C:123
bool checkParallelSync(const bool report=false) const
Check whether zone is synchronised across coupled boundaries. Return.
Definition: pointZone.C:65
virtual void topoChange(const polyTopoChangeMap &map)
Update zone using the given map.
Definition: pointZone.C:117
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Namespace for OpenFOAM.