mappedVariableThicknessWallPolyPatch.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-2012 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::mappedVariableThicknessWallPolyPatch
28 
29 Description
30  Foam::mappedVariableThicknessWallPolyPatch
31 
32 SourceFiles
33  mappedVariableThicknessWallPolyPatch.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef mappedVariableThicknessWallPolyPatch_H
38 #define mappedVariableThicknessWallPolyPatch_H
39 
40 #include "scalarField.H"
41 #include "wallPolyPatch.H"
42 #include "mappedWallPolyPatch.H"
43 
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class mappedVariableThicknessWallPolyPatch Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public mappedWallPolyPatch
56 {
57 
58  // Private data
59 
60  //- Thickness
61  scalarField thickness_;
62 
63 
64 public:
65 
66  //- Runtime type information
67  TypeName("mappedWallVariableThickness");
68 
69 
70  // Constructors
71 
72  //- Construct from components
74  (
75  const word& name,
76  const label size,
77  const label start,
78  const label index,
79  const polyBoundaryMesh& bm,
80  const word& patchType
81  );
82 
83  //- Construct from components
85  (
86  const word& name,
87  const label size,
88  const label start,
89  const label index,
90  const word& sampleRegion,
92  const word& samplePatch,
93  const vectorField& offset,
94  const polyBoundaryMesh& bm
95  );
96 
97  //- Construct from components. Uniform offset.
99  (
100  const word& name,
101  const label size,
102  const label start,
103  const label index,
104  const word& sampleRegion,
106  const word& samplePatch,
107  const vector& offset,
108  const polyBoundaryMesh& bm
109  );
110 
111  //- Construct from dictionary
113  (
114  const word& name,
115  const dictionary& dict,
116  const label index,
117  const polyBoundaryMesh& bm,
118  const word& patchType
119  );
120 
121  //- Construct as copy, resetting the boundary mesh
123  (
125  const polyBoundaryMesh&
126  );
127 
128  //- Construct given the original patch and resetting the
129  // face list and boundary mesh information
131  (
133  const polyBoundaryMesh& bm,
134  const label index,
135  const label newSize,
136  const label newStart
137  );
138 
139  //- Construct given the original patch and a map
141  (
143  const polyBoundaryMesh& bm,
144  const label index,
145  const labelUList& mapAddressing,
146  const label newStart
147  );
148 
149  //- Construct and return a clone, resetting the boundary mesh
150  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
151  {
152  return autoPtr<polyPatch>
153  (
155  );
156  }
157 
158  //- Construct and return a clone, resetting the face list
159  // and boundary mesh
160  virtual autoPtr<polyPatch> clone
161  (
162  const polyBoundaryMesh& bm,
163  const label index,
164  const label newSize,
165  const label newStart
166  ) const
167  {
168  return autoPtr<polyPatch>
169  (
171  (
172  *this,
173  bm,
174  index,
175  newSize,
176  newStart
177  )
178  );
179  }
181  //- Construct and return a clone, resetting the face list
182  // and boundary mesh
183  virtual autoPtr<polyPatch> clone
184  (
185  const polyBoundaryMesh& bm,
186  const label index,
187  const labelUList& mapAddressing,
188  const label newStart
189  ) const
190  {
191  return autoPtr<polyPatch>
192  (
194  (
195  *this,
196  bm,
197  index,
198  mapAddressing,
199  newStart
200  )
201  );
202  }
203 
204 
205  //- Destructor
207 
208 
209  // Member Functions
210 
211  //- Return thickness (non-const access)
212  scalarField& thickness() noexcept { return thickness_; }
213 
214  //- Return thickness (const access)
215  const scalarField& thickness() const noexcept { return thickness_; }
216 
217  //- Write the polyPatch data as a dictionary
218  void write(Ostream&) const;
219 };
220 
221 
222 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
223 
224 } // End namespace Foam
225 
226 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 
228 #endif
229 
230 // ************************************************************************* //
mappedVariableThicknessWallPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
dictionary dict
TypeName("mappedWallVariableThickness")
Runtime type information.
const vector & offset() const noexcept
Offset vector (from patch faces to destination mesh objects)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
label start() const noexcept
Return start label of this patch in the polyMesh face list.
Definition: polyPatch.H:441
void write(Ostream &) const
Write the polyPatch data as a dictionary.
scalarField & thickness() noexcept
Return thickness (non-const access)
virtual autoPtr< polyPatch > clone(const polyBoundaryMesh &bm) const
Construct and return a clone, resetting the boundary mesh.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
virtual ~mappedVariableThicknessWallPolyPatch()=default
Destructor.
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO...
const word & name() const noexcept
The patch name.
const direction noexcept
Definition: Scalar.H:258
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
Foam::mappedVariableThicknessWallPolyPatch.
sampleMode mode() const noexcept
What to sample.
sampleMode
Mesh items to sample.
const word & samplePatch() const
Patch (only if NEARESTPATCHFACE)
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
label index() const noexcept
The index of this patch in the boundaryMesh.
const word & sampleRegion() const
Region to sample.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
Namespace for OpenFOAM.