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-2023 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 postprocessing when only
29  basic polyPatch info is needed.
30 
31  Note:
32  Storage is not optimal. It stores all face centres and cells on all
33  processors to keep the addressing calculation simple.
34 
35 SourceFiles
36  genericPolyPatch.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef genericPolyPatch_H
41 #define genericPolyPatch_H
42 
43 #include "polyPatch.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class genericPolyPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 class genericPolyPatch
55 :
56  public polyPatch
57 {
58  // Private Data
59 
60  word actualTypeName_;
61  dictionary dict_;
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  const word& patchType
80  );
81 
82  //- Construct from dictionary
84  (
85  const word& name,
86  const dictionary& dict,
87  const label index,
88  const polyBoundaryMesh& bm,
89  const word& patchType
90  );
91 
92  //- Construct as copy, resetting the boundary mesh
94  (
95  const genericPolyPatch&,
96  const polyBoundaryMesh&
97  );
98 
99  //- Construct given the original patch and resetting the
100  // face list and boundary mesh information
102  (
103  const genericPolyPatch& pp,
104  const polyBoundaryMesh& bm,
105  const label index,
106  const label newSize,
107  const label newStart
108  );
109 
110  //- Construct and return a clone, resetting the boundary mesh
111  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
112  {
113  return autoPtr<polyPatch>(new genericPolyPatch(*this, bm));
114  }
115 
116  //- Construct and return a clone, resetting the face list
117  // and boundary mesh
118  virtual autoPtr<polyPatch> clone
119  (
120  const polyBoundaryMesh& bm,
121  const label index,
122  const label newSize,
123  const label newStart
124  ) const
125  {
126  return autoPtr<polyPatch>
127  (
128  new genericPolyPatch(*this, bm, index, newSize, newStart)
129  );
130  }
131 
132 
133  //- Destructor
135 
136 
137  // Member Functions
138 
139  //- Write the polyPatch data as a dictionary
140  virtual void write(Ostream&) const;
141 };
142 
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:57
autoPtr< PrimitivePatch< FaceList, PointField > > clone() const
Construct and return a clone.
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 keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:160
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
TypeName("genericPatch")
Runtime type information.
~genericPolyPatch()
Destructor.
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
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:70
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:280
A class for handling words, derived from string.
Definition: word.H:62
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