genericPolyPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011-2012 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 
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 given the original patch and a map
112  (
113  const genericPolyPatch& pp,
114  const polyBoundaryMesh& bm,
115  const label index,
116  const labelUList& mapAddressing,
117  const label newStart
118  );
119 
120  //- Construct and return a clone, resetting the boundary mesh
121  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
122  {
123  return autoPtr<polyPatch>(new genericPolyPatch(*this, bm));
124  }
125 
126  //- Construct and return a clone, resetting the face list
127  // and boundary mesh
129  (
130  const polyBoundaryMesh& bm,
131  const label index,
132  const label newSize,
133  const label newStart
134  ) const
135  {
136  return autoPtr<polyPatch>
137  (
138  new genericPolyPatch(*this, bm, index, newSize, newStart)
139  );
140  }
141 
142  //- Construct and return a clone, resetting the face list
143  // and boundary mesh
145  (
146  const polyBoundaryMesh& bm,
147  const label index,
148  const labelUList& mapAddressing,
149  const label newStart
150  ) const
151  {
152  return autoPtr<polyPatch>
153  (
154  new genericPolyPatch(*this, bm, index, mapAddressing, newStart)
155  );
156  }
157 
158 
159  //- Destructor
161 
162 
163  // Member functions
164 
165  //- Write the polyPatch data as a dictionary
166  virtual void write(Ostream&) const;
167 };
168 
169 
170 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
171 
172 } // End namespace Foam
173 
174 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
175 
176 #endif
177 
178 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
Foam::polyBoundaryMesh
Foam::polyBoundaryMesh.
Definition: polyBoundaryMesh.H:60
polyPatch.H
Foam::genericPolyPatch::TypeName
TypeName("genericPatch")
Runtime type information.
Foam::genericPolyPatch
Substitute for unknown patches. Used for postprocessing when only basic polyPatch info is needed.
Definition: genericPolyPatch.H:53
Foam::genericPolyPatch::actualTypeName_
word actualTypeName_
Definition: genericPolyPatch.H:59
Foam::genericPolyPatch::genericPolyPatch
genericPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition: genericPolyPatch.C:43
Foam::label
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
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyPatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:312
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::genericPolyPatch::clone
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
Definition: genericPolyPatch.H:120
Foam::genericPolyPatch::dict_
dictionary dict_
Definition: genericPolyPatch.H:60
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:60
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
Foam::patchIdentifier::name
const word & name() const
Return name.
Definition: patchIdentifier.H:109
Foam::patchIdentifier::index
label index() const
Return the index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:133
Foam::genericPolyPatch::write
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: genericPolyPatch.C:121
Foam::genericPolyPatch::~genericPolyPatch
~genericPolyPatch()
Destructor.
Definition: genericPolyPatch.C:115