Loading...
Searching...
No Matches
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 Foam_wedgePolyPatch_H
38#define Foam_wedgePolyPatch_H
39
40#include "polyPatch.H"
41
42// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43
44namespace Foam
45{
47/*---------------------------------------------------------------------------*\
48 Class wedgePolyPatch Declaration
49\*---------------------------------------------------------------------------*/
50
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
161 virtual autoPtr<polyPatch> clone
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 noexcept { return axis_; }
182
183 //- Return plane normal between the wedge boundaries
184 const vector& centreNormal() const noexcept { return centreNormal_; }
185
186 //- Return the normal to the patch
187 const vector& n() const noexcept { return n_; }
188
189 //- Return the cosine of the wedge angle
190 scalar cosAngle() const noexcept { return cosAngle_; }
192 //- Return face transformation tensor
193 const tensor& faceT() const noexcept { return faceT_; }
194
195 //- Return neighbour-cell transformation tensor
196 const tensor& cellT() const noexcept { return cellT_; }
197};
198
199
200// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
201
202} // End namespace Foam
203
204// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
205
206#endif
207
208// ************************************************************************* //
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Buffers for inter-processor communications streams (UOPstream, UIPstream).
void size(const label n)
Definition UList.H:118
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
label index() const noexcept
The index of this patch in the boundaryMesh.
A polyBoundaryMesh is a polyPatch list with registered IO, a reference to the associated polyMesh,...
friend class polyBoundaryMesh
Definition polyPatch.H:112
polyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition polyPatch.C:75
label start() const noexcept
Return start label of this patch in the polyMesh face list.
Definition polyPatch.H:446
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
const vector & axis() const noexcept
Return axis of the wedge.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm, const label index, const label newSize, const label newStart) const
Construct and return a clone, resetting the face list.
wedgePolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
const tensor & cellT() const noexcept
Return neighbour-cell transformation tensor.
const vector & n() const noexcept
Return the normal to the patch.
const tensor & faceT() const noexcept
Return face transformation tensor.
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm, const label index, const labelUList &mapAddressing, const label newStart) const
Construct and return a clone, resetting the face list.
scalar cosAngle() const noexcept
Return the cosine of the wedge angle.
TypeName("wedge")
Runtime type information.
const vector & centreNormal() const noexcept
Return plane normal between the wedge boundaries.
A class for handling words, derived from Foam::string.
Definition word.H:66
Namespace for OpenFOAM.
Tensor< scalar > tensor
Definition symmTensor.H:57
const direction noexcept
Definition scalarImpl.H:265
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
Vector< scalar > vector
Definition vector.H:57
UList< label > labelUList
A UList of labels.
Definition UList.H:75
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68