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-2022 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 and return a clone, resetting the boundary mesh
126  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
127  {
128  return autoPtr<polyPatch>(new wedgePolyPatch(*this, bm));
129  }
130 
131  //- Construct and return a clone, resetting the face list
132  // and boundary mesh
133  virtual autoPtr<polyPatch> clone
134  (
135  const polyBoundaryMesh& bm,
136  const label index,
137  const label newSize,
138  const label newStart
139  ) const
140  {
141  return autoPtr<polyPatch>
142  (
143  new wedgePolyPatch(*this, bm, index, newSize, newStart)
144  );
145  }
146 
147 
148  // Member Functions
149 
150  // Access
151 
152  //- Return axis of the wedge
153  const vector& axis() const
154  {
155  return axis_;
156  }
157 
158  //- Return plane normal between the wedge boundaries
159  const vector& centreNormal() const
160  {
161  return centreNormal_;
162  }
163 
164  //- Return the normal to the patch
165  const vector& n() const
166  {
167  return n_;
168  }
169 
170  //- Return the cosine of the wedge angle
171  scalar cosAngle() const
172  {
173  return cosAngle_;
174  }
175 
176  //- Return face transformation tensor
177  const tensor& faceT() const
178  {
179  return faceT_;
180  }
181 
182  //- Return neighbour-cell transformation tensor
183  const tensor& cellT() const
184  {
185  return cellT_;
186  }
187 };
188 
189 
190 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
191 
192 } // End namespace Foam
193 
194 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 
196 #endif
197 
198 // ************************************************************************* //
autoPtr< PrimitivePatch< SubList< face >, const pointField & > > clone() const
Construct and return a clone.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
label size() const
Return the number of elements in the UList.
Definition: UListI.H:311
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:162
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
Wedge front and back plane patch.
const vector & centreNormal() const
Return plane normal between the wedge boundaries.
scalar cosAngle() const
Return the cosine of the wedge angle.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
const tensor & cellT() const
Return neighbour-cell transformation tensor.
wedgePolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
const vector & n() const
Return the normal to the patch.
TypeName("wedge")
Runtime type information.
const vector & axis() const
Return axis of the wedge.
const tensor & faceT() const
Return face transformation tensor.
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