symmetryPlanePolyPatch.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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2013-2014 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::symmetryPlanePolyPatch
28 
29 Description
30  Symmetry-plane patch.
31 
32 SourceFiles
33  symmetryPlanePolyPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef symmetryPlanePolyPatch_H
38 #define symmetryPlanePolyPatch_H
39 
40 #include "polyPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class symmetryPlanePolyPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
52 :
53  public polyPatch
54 {
55  // Private data
56 
57  //- Symmetry plane normal
58  vector n_;
59 
60 
61 protected:
62 
63  // Protected Member Functions
64 
65  //- Calculate the patch geometry
66  virtual void calcGeometry(PstreamBuffers&);
67 
68 
69 public:
70 
71  //- Runtime type information
72  TypeName("symmetryPlane");
73 
74 
75  // Constructors
76 
77  //- Construct from components
79  (
80  const word& name,
81  const label size,
82  const label start,
83  const label index,
84  const polyBoundaryMesh& bm,
85  const word& patchType
86  );
87 
88  //- Construct from dictionary
90  (
91  const word& name,
92  const dictionary& dict,
93  const label index,
94  const polyBoundaryMesh& bm,
95  const word& patchType
96  );
97 
98  //- Construct as copy, resetting the boundary mesh
100  (
101  const symmetryPlanePolyPatch&,
102  const polyBoundaryMesh&
103  );
104 
105  //- Construct given the original patch and resetting the
106  // face list and boundary mesh information
108  (
109  const symmetryPlanePolyPatch& pp,
110  const polyBoundaryMesh& bm,
111  const label index,
112  const label newSize,
113  const label newStart
114  );
115 
116  //- Construct given the original patch and a map
118  (
119  const symmetryPlanePolyPatch& pp,
120  const polyBoundaryMesh& bm,
121  const label index,
122  const labelUList& mapAddressing,
123  const label newStart
124  );
125 
126  //- Construct and return a clone, resetting the boundary mesh
127  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
128  {
129  return autoPtr<polyPatch>(new symmetryPlanePolyPatch(*this, bm));
130  }
131 
132  //- Construct and return a clone, resetting the face list
133  // and boundary mesh
135  (
136  const polyBoundaryMesh& bm,
137  const label index,
138  const label newSize,
139  const label newStart
140  ) const
141  {
142  return autoPtr<polyPatch>
143  (
144  new symmetryPlanePolyPatch(*this, bm, index, newSize, newStart)
145  );
146  }
147 
148  //- Construct and return a clone, resetting the face list
149  // and boundary mesh
151  (
152  const polyBoundaryMesh& bm,
153  const label index,
154  const labelUList& mapAddressing,
155  const label newStart
156  ) const
157  {
158  return autoPtr<polyPatch>
159  (
161  (
162  *this,
163  bm,
164  index,
165  mapAddressing,
166  newStart
167  )
168  );
169  }
170 
171 
172  // Member Functions
173 
174  //- Return symmetry plane normal
175  const vector& n() const
176  {
177  return n_;
178  }
179 };
180 
181 
182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
183 
184 } // End namespace Foam
185 
186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 
188 #endif
189 
190 // ************************************************************************* //
Foam::symmetryPlanePolyPatch::n
const vector & n() const
Return symmetry plane normal.
Definition: symmetryPlanePolyPatch.H:174
Foam::symmetryPlanePolyPatch::clone
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
Definition: symmetryPlanePolyPatch.H:126
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
polyPatch.H
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:88
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::symmetryPlanePolyPatch
Symmetry-plane patch.
Definition: symmetryPlanePolyPatch.H:50
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::symmetryPlanePolyPatch::symmetryPlanePolyPatch
symmetryPlanePolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition: symmetryPlanePolyPatch.C:88
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::patchIdentifier::index
label index() const noexcept
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:147
Foam::polyPatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:361
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::symmetryPlanePolyPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: symmetryPlanePolyPatch.C:45
Foam::Vector< scalar >
Foam::UList< label >
Foam::patchIdentifier::name
const word & name() const noexcept
The patch name.
Definition: patchIdentifier.H:135
Foam::symmetryPlanePolyPatch::TypeName
TypeName("symmetryPlane")
Runtime type information.