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 -------------------------------------------------------------------------------
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 \*---------------------------------------------------------------------------*/
27 
28 #include "mappedPolyPatch.H"
30 
31 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
32 
33 namespace Foam
34 {
35  defineTypeNameAndDebug(mappedPolyPatch, 0);
36 
37  addToRunTimeSelectionTable(polyPatch, mappedPolyPatch, word);
38  addToRunTimeSelectionTable(polyPatch, mappedPolyPatch, dictionary);
39 }
40 
41 
42 // * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * * * * //
43 
45 (
46  const word& name,
47  const label size,
48  const label start,
49  const label index,
50  const polyBoundaryMesh& bm,
51  const word& patchType
52 )
53 :
54  polyPatch(name, size, start, index, bm, patchType),
55  mappedPatchBase(static_cast<const polyPatch&>(*this))
56 {
57  // mapped is not constraint type so add mapped group explicitly
58  if (!inGroups().found(typeName))
59  {
60  inGroups().append(typeName);
61  }
62 }
63 
64 
66 (
67  const word& name,
68  const label size,
69  const label start,
70  const label index,
71  const word& sampleRegion,
73  const word& samplePatch,
74  const vectorField& offset,
75  const polyBoundaryMesh& bm
76 )
77 :
78  polyPatch(name, size, start, index, bm, typeName),
80  (
81  static_cast<const polyPatch&>(*this),
82  sampleRegion,
83  mode,
84  samplePatch,
85  offset
86  )
87 {}
88 
89 
91 (
92  const word& name,
93  const label size,
94  const label start,
95  const label index,
96  const word& sampleRegion,
98  const word& samplePatch,
99  const vector& offset,
100  const polyBoundaryMesh& bm
101 )
102 :
103  polyPatch(name, size, start, index, bm, typeName),
105  (
106  static_cast<const polyPatch&>(*this),
107  sampleRegion,
108  mode,
109  samplePatch,
110  offset
111  )
112 {}
113 
114 
116 (
117  const word& name,
118  const dictionary& dict,
119  const label index,
120  const polyBoundaryMesh& bm,
121  const word& patchType
122 )
123 :
124  polyPatch(name, dict, index, bm, patchType),
125  mappedPatchBase(*this, dict)
126 {
127  // mapped is not constraint type so add mapped group explicitly
128  if (!inGroups().found(typeName))
129  {
130  inGroups().append(typeName);
131  }
132 }
133 
134 
136 (
137  const mappedPolyPatch& pp,
138  const polyBoundaryMesh& bm
139 )
140 :
141  polyPatch(pp, bm),
142  mappedPatchBase(*this, pp)
143 {}
144 
145 
147 (
148  const mappedPolyPatch& pp,
149  const polyBoundaryMesh& bm,
150  const label index,
151  const label newSize,
152  const label newStart
153 )
154 :
155  polyPatch(pp, bm, index, newSize, newStart),
156  mappedPatchBase(*this, pp)
157 {}
158 
159 
161 (
162  const mappedPolyPatch& pp,
163  const polyBoundaryMesh& bm,
164  const label index,
165  const labelUList& mapAddressing,
166  const label newStart
167 )
168 :
169  polyPatch(pp, bm, index, mapAddressing, newStart),
170  mappedPatchBase(*this, pp, mapAddressing)
171 {}
172 
173 
174 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
175 
177 {
179 }
180 
181 
182 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
183 
185 {
187 }
188 
189 
191 {
194 }
195 
196 
198 (
199  PstreamBuffers& pBufs,
200  const pointField& p
201 )
202 {
204 }
205 
206 
208 (
209  PstreamBuffers& pBufs,
210  const pointField& p
211 )
212 {
213  polyPatch::movePoints(pBufs, p);
215 }
216 
217 
219 {
221 }
222 
223 
225 {
226  polyPatch::updateMesh(pBufs);
228 }
229 
230 
232 {
233  polyPatch::write(os);
235 }
236 
237 
238 // ************************************************************************* //
Foam::addToRunTimeSelectionTable
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
mappedPolyPatch.H
Foam::mappedPatchBase::write
virtual void write(Ostream &) const
Write as a dictionary.
Definition: mappedPatchBase.C:1898
Foam::mappedPatchBase::clearOut
void clearOut()
Definition: mappedPatchBase.C:1560
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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:62
Foam::mappedPolyPatch::initMovePoints
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: mappedPolyPatch.C:198
Foam::PstreamBuffers
Buffers for inter-processor communications streams (UOPstream, UIPstream).
Definition: PstreamBuffers.H:87
Foam::polyPatch::write
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: polyPatch.C:405
Foam::mappedPolyPatch::initUpdateMesh
virtual void initUpdateMesh(PstreamBuffers &)
Initialise the update of the patch topology.
Definition: mappedPolyPatch.C:218
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:184
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:45
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:117
Foam::Field< vector >
Foam::polyPatch::initMovePoints
virtual void initMovePoints(PstreamBuffers &, const pointField &)
Initialise the patches for moving points.
Definition: polyPatch.H:110
Foam::polyPatch
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:68
Foam::name
word name(const complex &c)
Return string representation of complex.
Definition: complex.C:76
Foam::mappedPolyPatch::write
virtual void write(Ostream &) const
Write the polyPatch data as a dictionary.
Definition: mappedPolyPatch.C:231
Foam::polyPatch::initGeometry
virtual void initGeometry(PstreamBuffers &)
Initialise the calculation of the patch geometry.
Definition: polyPatch.H:102
Foam::mappedPolyPatch::calcGeometry
virtual void calcGeometry(PstreamBuffers &)
Calculate the patch geometry.
Definition: mappedPolyPatch.C:190
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:121
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:224
found
bool found
Definition: TABSMDCalcMethod2.H:32
Foam::mappedPolyPatch::movePoints
virtual void movePoints(PstreamBuffers &, const pointField &)
Correct patches after moving points.
Definition: mappedPolyPatch.C:208
Foam::Vector< scalar >
Foam::mappedPolyPatch::~mappedPolyPatch
virtual ~mappedPolyPatch()
Destructor.
Definition: mappedPolyPatch.C:176
Foam::UList< label >
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:106
Foam::defineTypeNameAndDebug
defineTypeNameAndDebug(combustionModel, 0)
Foam::mappedPatchBase::sampleMode
sampleMode
Mesh items to sample.
Definition: mappedPatchBase.H:120
Foam::mappedPolyPatch
Determines a mapping between patch face centres and mesh cell or face centres and processors they're ...
Definition: mappedPolyPatch.H:59