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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::wedgePolyPatch
28
29Description
30 Wedge front and back plane patch.
31
32SourceFiles
33 wedgePolyPatch.C
34
35\*---------------------------------------------------------------------------*/
36
37#ifndef wedgePolyPatch_H
38#define wedgePolyPatch_H
39
40#include "polyPatch.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47/*---------------------------------------------------------------------------*\
48 Class wedgePolyPatch Declaration
49\*---------------------------------------------------------------------------*/
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
76protected:
77
78 // Protected Member Functions
79
80 //- Calculate the patch geometry
81 virtual void calcGeometry(PstreamBuffers&);
82
83
84public:
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// ************************************************************************* //
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & name() const noexcept
The patch name.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
friend class polyBoundaryMesh
Definition: polyPatch.H:99
label start() const
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:364
Wedge front and back plane patch.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
const tensor & faceT() const
Return face transformation tensor.
const vector & axis() const
Return axis of the wedge.
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.
const vector & n() const
Return the normal to the patch.
const vector & centreNormal() const
Return plane normal between the wedge boundaries.
TypeName("wedge")
Runtime type information.
A class for handling words, derived from Foam::string.
Definition: word.H:68
Namespace for OpenFOAM.
UList< label > labelUList
A UList of labels.
Definition: UList.H:85
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73