mappedPolyPatch.C
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 \*---------------------------------------------------------------------------*/
25 
26 #include "mappedPolyPatch.H"
28 
29 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(mappedPolyPatch, 0);
34 
35  addToRunTimeSelectionTable(polyPatch, mappedPolyPatch, word);
36  addToRunTimeSelectionTable(polyPatch, mappedPolyPatch, dictionary);
37 }
38 
39 
40 // * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
41 
43 (
44  const word& name,
45  const label size,
46  const label start,
47  const label index,
48  const polyBoundaryMesh& bm,
49  const word& patchType
50 )
51 :
52  polyPatch(name, size, start, index, bm, patchType),
53  mappedPatchBase(static_cast<const polyPatch&>(*this))
54 {
55  // mapped is not constraint type so add mapped group explicitly
56  if (findIndex(inGroups(), typeName) == -1)
57  {
58  inGroups().append(typeName);
59  }
60 }
61 
62 
64 (
65  const word& name,
66  const label size,
67  const label start,
68  const label index,
69  const word& sampleRegion,
70  const mappedPatchBase::sampleMode mode,
71  const word& samplePatch,
72  const vectorField& offset,
73  const polyBoundaryMesh& bm
74 )
75 :
76  polyPatch(name, size, start, index, bm, typeName),
78  (
79  static_cast<const polyPatch&>(*this),
80  sampleRegion,
81  mode,
82  samplePatch,
83  offset
84  )
85 {}
86 
87 
89 (
90  const word& name,
91  const label size,
92  const label start,
93  const label index,
94  const word& sampleRegion,
95  const mappedPatchBase::sampleMode mode,
96  const word& samplePatch,
97  const vector& offset,
98  const polyBoundaryMesh& bm
99 )
100 :
101  polyPatch(name, size, start, index, bm, typeName),
103  (
104  static_cast<const polyPatch&>(*this),
105  sampleRegion,
106  mode,
107  samplePatch,
108  offset
109  )
110 {}
111 
112 
114 (
115  const word& name,
116  const dictionary& dict,
117  const label index,
118  const polyBoundaryMesh& bm,
119  const word& patchType
120 )
121 :
122  polyPatch(name, dict, index, bm, patchType),
123  mappedPatchBase(*this, dict)
124 {
125  // mapped is not constraint type so add mapped group explicitly
126  if (findIndex(inGroups(), typeName) == -1)
127  {
128  inGroups().append(typeName);
129  }
130 }
131 
132 
134 (
135  const mappedPolyPatch& pp,
136  const polyBoundaryMesh& bm
137 )
138 :
139  polyPatch(pp, bm),
140  mappedPatchBase(*this, pp)
141 {}
142 
143 
145 (
146  const mappedPolyPatch& pp,
147  const polyBoundaryMesh& bm,
148  const label index,
149  const label newSize,
150  const label newStart
151 )
152 :
153  polyPatch(pp, bm, index, newSize, newStart),
154  mappedPatchBase(*this, pp)
155 {}
156 
157 
159 (
160  const mappedPolyPatch& pp,
161  const polyBoundaryMesh& bm,
162  const label index,
163  const labelUList& mapAddressing,
164  const label newStart
165 )
166 :
167  polyPatch(pp, bm, index, mapAddressing, newStart),
168  mappedPatchBase(*this, pp, mapAddressing)
169 {}
170 
171 
172 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
173 
175 {
177 }
178 
179 
180 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
181 
183 {
185 }
186 
187 
189 {
192 }
193 
194 
196 (
197  PstreamBuffers& pBufs,
198  const pointField& p
199 )
200 {
201  polyPatch::initMovePoints(pBufs, p);
202 }
203 
204 
206 (
207  PstreamBuffers& pBufs,
208  const pointField& p
209 )
210 {
211  polyPatch::movePoints(pBufs, p);
213 }
214 
215 
217 {
219 }
220 
221 
223 {
224  polyPatch::topoChange(pBufs);
226 }
227 
228 
230 {
231  polyPatch::write(os);
233 }
234 
235 
236 // ************************************************************************* //
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
virtual void write(Ostream &) const
Write as a dictionary.
mappedPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
virtual void initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: polyPatch.H:108
virtual void initTopoChange(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: polyPatch.H:115
Macros for easy insertion into run-time selection tables.
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: polyPatch.C:382
A class for handling words, derived from string.
Definition: word.H:59
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Determines a mapping between patch face centres and mesh cell or face centres and processors they&#39;re ...
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:60
Foam::polyBoundaryMesh.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: polyPatch.H:101
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
label findIndex(const ListType &, typename ListType::const_reference, const label start=0)
Find first occurrence of given element and return index,.
Buffers for inter-processor communications streams (UOPstream, UIPstream).
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
virtual void topoChange(PstreamBuffers &)
Update of the patch topology.
Definition: polyPatch.C:69
virtual void movePoints(const pointField &p)
Correct patches after moving points.
Definition: polyPatch.C:57
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: polyPatch.H:97
sampleMode
Mesh items to sample.
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:66
virtual ~mappedPolyPatch()
Destructor.
virtual void initCalcGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Namespace for OpenFOAM.