wedgePolyPatch.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) 2011-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::wedgePolyPatch
28 
29 Description
30  Wedge front and back plane patch.
31 
32 SourceFiles
33  wedgePolyPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef wedgePolyPatch_H
38 #define wedgePolyPatch_H
39 
40 #include "polyPatch.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class wedgePolyPatch Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class wedgePolyPatch
52 :
53  public polyPatch
54 {
55  // Private data
56 
57  //- Axis of the wedge
58  vector axis_;
59 
60  //- Centre normal between the wedge boundaries
61  vector centreNormal_;
62 
63  //- Normal to the patch
64  vector n_;
65 
66  //- Cosine of the wedge angle
67  scalar cosAngle_;
68 
69  //- Face transformation tensor
70  tensor faceT_;
71 
72  //- Neighbour-cell transformation tensor
73  tensor cellT_;
74 
75 
76 protected:
77 
78  // Protected Member Functions
79 
80  //- Calculate the patch geometry
81  virtual void calcGeometry(PstreamBuffers&);
82 
83 
84 public:
85 
86  //- Runtime type information
87  TypeName("wedge");
88 
89 
90  // Constructors
91 
92  //- Construct from components
94  (
95  const word& name,
96  const label size,
97  const label start,
98  const label index,
99  const polyBoundaryMesh& bm,
100  const word& patchType
101  );
102 
103  //- Construct from dictionary
105  (
106  const word& name,
107  const dictionary& dict,
108  const label index,
109  const polyBoundaryMesh& bm,
110  const word& patchType
111  );
112 
113  //- Construct as copy, resetting the boundary mesh
115 
116  //- Construct given the original patch and resetting the
117  // face list and boundary mesh information
119  (
120  const wedgePolyPatch& pp,
121  const polyBoundaryMesh& bm,
122  const label index,
123  const label newSize,
124  const label newStart
125  );
126 
127  //- Construct given the original patch and a map
129  (
130  const wedgePolyPatch& pp,
131  const polyBoundaryMesh& bm,
132  const label index,
133  const labelUList& mapAddressing,
134  const label newStart
135  );
136 
137  //- Construct and return a clone, resetting the boundary mesh
138  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
139  {
140  return autoPtr<polyPatch>(new wedgePolyPatch(*this, bm));
141  }
142 
143  //- Construct and return a clone, resetting the face list
144  // and boundary mesh
146  (
147  const polyBoundaryMesh& bm,
148  const label index,
149  const label newSize,
150  const label newStart
151  ) const
152  {
153  return autoPtr<polyPatch>
154  (
155  new wedgePolyPatch(*this, bm, index, newSize, newStart)
156  );
157  }
158 
159  //- Construct and return a clone, resetting the face list
160  // and boundary mesh
162  (
163  const polyBoundaryMesh& bm,
164  const label index,
165  const labelUList& mapAddressing,
166  const label newStart
167  ) const
168  {
169  return autoPtr<polyPatch>
170  (
171  new wedgePolyPatch(*this, bm, index, mapAddressing, newStart)
172  );
173  }
174 
175 
176  // Member functions
177 
178  // Access
179 
180  //- Return axis of the wedge
181  const vector& axis() const
182  {
183  return axis_;
184  }
185 
186  //- Return plane normal between the wedge boundaries
187  const vector& centreNormal() const
188  {
189  return centreNormal_;
190  }
191 
192  //- Return the normal to the patch
193  const vector& n() const
194  {
195  return n_;
196  }
197 
198  //- Return the cosine of the wedge angle
199  scalar cosAngle() const
200  {
201  return cosAngle_;
202  }
203 
204  //- Return face transformation tensor
205  const tensor& faceT() const
206  {
207  return faceT_;
208  }
209 
210  //- Return neighbour-cell transformation tensor
211  const tensor& cellT() const
212  {
213  return cellT_;
214  }
215 };
216 
217 
218 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
219 
220 } // End namespace Foam
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 #endif
225 
226 // ************************************************************************* //
Foam::Tensor< scalar >
Foam::wedgePolyPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: wedgePolyPatch.C:46
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::wedgePolyPatch
Wedge front and back plane patch.
Definition: wedgePolyPatch.H:50
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:62
polyPatch.H
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:87
Foam::wedgePolyPatch::cellT
const tensor & cellT() const
Return neighbour-cell transformation tensor.
Definition: wedgePolyPatch.H:210
Foam::wedgePolyPatch::axis
const vector & axis() const
Return axis of the wedge.
Definition: wedgePolyPatch.H:180
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
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:121
Foam::wedgePolyPatch::clone
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
Definition: wedgePolyPatch.H:137
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::polyPatch::start
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:313
Foam::wedgePolyPatch::faceT
const tensor & faceT() const
Return face transformation tensor.
Definition: wedgePolyPatch.H:204
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::Vector< scalar >
Foam::wedgePolyPatch::n
const vector & n() const
Return the normal to the patch.
Definition: wedgePolyPatch.H:192
Foam::UList< label >
Foam::wedgePolyPatch::cosAngle
scalar cosAngle() const
Return the cosine of the wedge angle.
Definition: wedgePolyPatch.H:198
Foam::wedgePolyPatch::TypeName
TypeName("wedge")
Runtime type information.
Foam::wedgePolyPatch::wedgePolyPatch
wedgePolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition: wedgePolyPatch.C:135
Foam::patchIdentifier::name
const word & name() const
The patch name.
Definition: patchIdentifier.H:134
Foam::patchIdentifier::index
label index() const
The index of this patch in the boundaryMesh.
Definition: patchIdentifier.H:158
Foam::wedgePolyPatch::centreNormal
const vector & centreNormal() const
Return plane normal between the wedge boundaries.
Definition: wedgePolyPatch.H:186