mappedPolyPatch.C
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-2013 OpenFOAM Foundation
9  Copyright (C) 2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
12  This file is part of OpenFOAM.
13 
14  OpenFOAM is free software: you can redistribute it and/or modify it
15  under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22  for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26 
27 \*---------------------------------------------------------------------------*/
28 
29 #include "mappedPolyPatch.H"
31 
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
33 
34 namespace Foam
35 {
36  defineTypeNameAndDebug(mappedPolyPatch, 0);
37 
38  addToRunTimeSelectionTable(polyPatch, mappedPolyPatch, word);
39  addToRunTimeSelectionTable(polyPatch, mappedPolyPatch, dictionary);
40 }
41 
42 
43 // * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
44 
46 (
47  const word& name,
48  const label size,
49  const label start,
50  const label index,
51  const polyBoundaryMesh& bm,
52  const word& patchType
53 )
54 :
55  polyPatch(name, size, start, index, bm, patchType),
56  mappedPatchBase(static_cast<const polyPatch&>(*this))
57 {
58  // mapped is not constraint type so add mapped group explicitly
59  inGroups().appendUniq(typeName);
60 }
61 
62 
64 (
65  const word& name,
66  const label size,
67  const label start,
68  const label index,
69  const word& sampleRegion,
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,
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  inGroups().appendUniq(typeName);
127 }
128 
129 
131 (
132  const mappedPolyPatch& pp,
133  const polyBoundaryMesh& bm
134 )
135 :
136  polyPatch(pp, bm),
137  mappedPatchBase(*this, pp)
138 {}
139 
140 
142 (
143  const mappedPolyPatch& pp,
144  const polyBoundaryMesh& bm,
145  const label index,
146  const label newSize,
147  const label newStart
148 )
149 :
150  polyPatch(pp, bm, index, newSize, newStart),
151  mappedPatchBase(*this, pp)
152 {}
153 
154 
156 (
157  const mappedPolyPatch& pp,
158  const polyBoundaryMesh& bm,
159  const label index,
160  const labelUList& mapAddressing,
161  const label newStart
162 )
163 :
164  polyPatch(pp, bm, index, mapAddressing, newStart),
165  mappedPatchBase(*this, pp, mapAddressing)
166 {}
167 
168 
169 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
170 
172 {
174 }
175 
176 
177 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
178 
180 {
182 }
183 
184 
186 {
189 }
190 
191 
193 (
194  PstreamBuffers& pBufs,
195  const pointField& p
196 )
197 {
199 }
200 
201 
203 (
204  PstreamBuffers& pBufs,
205  const pointField& p
206 )
207 {
208  polyPatch::movePoints(pBufs, p);
210 }
211 
212 
214 {
216 }
217 
218 
220 {
221  polyPatch::updateMesh(pBufs);
223 }
224 
225 
227 {
230 }
231 
232 
233 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
mappedPolyPatch.H
Foam::mappedPatchBase::clearOut
void clearOut()
Definition: mappedPatchBase.C:1573
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::polyPatch::movePoints
virtual void movePoints(PstreamBuffers &, const pointField &p)
Correct patches after moving points.
Definition: polyPatch.C:61
Foam::polyBoundaryMesh
A polyBoundaryMesh is a polyPatch list with additional search methods and registered IO.
Definition: polyBoundaryMesh.H:63
Foam::mappedPolyPatch::initMovePoints
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: mappedPolyPatch.C:193
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:88
Foam::mappedPolyPatch::initUpdateMesh
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: mappedPolyPatch.C:213
Foam::mappedPatchBase
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPatchBase.H:112
Foam::mappedPolyPatch::initGeometry
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: mappedPolyPatch.C:179
Foam::polyPatch::updateMesh
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Definition: polyPatch.C:67
Foam::mappedPolyPatch::mappedPolyPatch
mappedPolyPatch(const word &name, const label size, const label start, const label index, const polyBoundaryMesh &bm, const word &patchType)
Construct from components.
Definition: mappedPolyPatch.C:46
Foam::mode
mode_t mode(const fileName &name, const bool followLink=true)
Return the file mode, normally following symbolic links.
Definition: MSwindows.C:564
Foam::polyPatch::initUpdateMesh
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: polyPatch.H:114
Foam::Field< vector >
Foam::polyPatch::initMovePoints
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: polyPatch.H:107
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::mappedPolyPatch::write
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: mappedPolyPatch.C:226
Foam::polyPatch::initGeometry
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: polyPatch.H:99
Foam::mappedPolyPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: mappedPolyPatch.C:185
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::polyPatch::write
virtual void write(Ostream &os) const
Write the polyPatch data as a dictionary.
Definition: polyPatch.C:413
os
OBJstream os(runTime.globalPath()/outputName)
addToRunTimeSelectionTable.H
Macros for easy insertion into run-time selection tables.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::mappedPolyPatch::updateMesh
virtual void updateMesh(PstreamBuffers &)
Update of the patch topology.
Definition: mappedPolyPatch.C:219
Foam::mappedPolyPatch::movePoints
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: mappedPolyPatch.C:203
Foam::Vector< scalar >
Foam::mappedPolyPatch::~mappedPolyPatch
virtual ~mappedPolyPatch()
Destructor.
Definition: mappedPolyPatch.C:171
Foam::UList< label >
Foam::mappedPatchBase::write
virtual void write(Ostream &os) const
Write as a dictionary.
Definition: mappedPatchBase.C:1942
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::polyPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: polyPatch.H:103
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::mappedPatchBase::sampleMode
sampleMode
Mesh items to sample.
Definition: mappedPatchBase.H:119
Foam::mappedPolyPatch
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPolyPatch.H:59