genericPolyPatch.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-2026 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::genericPolyPatch
26 
27 Description
28  Substitute for unknown patches. Used for post-processing when only
29  basic polyPatch info is needed.
30 
31 SourceFiles
32  genericPolyPatch.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef genericPolyPatch_H
37 #define genericPolyPatch_H
38 
39 #include "polyPatch.H"
40 
41 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class genericPolyPatch Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class genericPolyPatch
51 :
52  public polyPatch
53 {
54  // Private Data
55 
56  //- Actual patch type name
57  word actualTypeName_;
58 
59  //- Patch dictionary
60  dictionary dict_;
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("genericPatch");
67 
68 
69  // Constructors
70 
71  //- Construct from components
73  (
74  const word& name,
75  const label size,
76  const label start,
77  const label index,
78  const polyBoundaryMesh& bm
79  );
80 
81  //- Construct from dictionary
83  (
84  const word& name,
85  const dictionary& dict,
86  const label index,
87  const polyBoundaryMesh& bm
88  );
89 
90  //- Construct as copy, resetting the boundary mesh
92  (
93  const genericPolyPatch&,
94  const polyBoundaryMesh&
95  );
96 
97  //- Construct given the original patch and resetting the
98  // face list and boundary mesh information
100  (
101  const genericPolyPatch& pp,
102  const polyBoundaryMesh& bm,
103  const label index,
104  const label newSize,
105  const label newStart
106  );
107 
108  //- Construct and return a clone, resetting the boundary mesh
109  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
110  {
111  return autoPtr<polyPatch>(new genericPolyPatch(*this, bm));
112  }
113 
114  //- Construct and return a clone, resetting the face list
115  // and boundary mesh
116  virtual autoPtr<polyPatch> clone
117  (
118  const polyBoundaryMesh& bm,
119  const label index,
120  const label newSize,
121  const label newStart
122  ) const
123  {
124  return autoPtr<polyPatch>
125  (
126  new genericPolyPatch(*this, bm, index, newSize, newStart)
127  );
128  }
129 
130 
131  //- Destructor
133 
134 
135  // Member Functions
136 
137  //- Write the polyPatch data as a dictionary
138  virtual void write(Ostream&) const;
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
autoPtr< PrimitivePatch< SubList< face >, const pointField & > > clone() const
Construct and return a clone.
label size() const
Return the number of elements in the UList.
Definition: UListI.H:311
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 list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Substitute for unknown patches. Used for post-processing when only basic polyPatch info is needed.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm)
Construct from components.
TypeName("genericPatch")
Runtime type information.
~genericPolyPatch()
Destructor.
label index() const
Return the index of this patch in the boundaryMesh.
const word & name() const
Return name.
Foam::polyBoundaryMesh.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:71
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:277
A class for handling words, derived from string.
Definition: word.H:63
Namespace for OpenFOAM.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
dictionary dict