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