1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
5 \\ / A nd | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "directMappedPolyPatch.H"
27 #include "addToRunTimeSelectionTable.H"
30 #include "polyBoundaryMesh.H"
32 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
36 defineTypeNameAndDebug(directMappedPolyPatch, 0);
38 addToRunTimeSelectionTable(polyPatch, directMappedPolyPatch, word);
39 addToRunTimeSelectionTable(polyPatch, directMappedPolyPatch, dictionary);
43 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
45 Foam::directMappedPolyPatch::directMappedPolyPatch
51 const polyBoundaryMesh& bm
54 polyPatch(name, size, start, index, bm),
55 directMappedPatchBase(static_cast<const polyPatch&>(*this))
59 Foam::directMappedPolyPatch::directMappedPolyPatch
65 const word& sampleRegion,
66 const directMappedPatchBase::sampleMode mode,
67 const word& samplePatch,
68 const vectorField& offset,
69 const polyBoundaryMesh& bm
72 polyPatch(name, size, start, index, bm),
75 static_cast<const polyPatch&>(*this),
84 Foam::directMappedPolyPatch::directMappedPolyPatch
90 const word& sampleRegion,
91 const directMappedPatchBase::sampleMode mode,
92 const word& samplePatch,
94 const polyBoundaryMesh& bm
97 polyPatch(name, size, start, index, bm),
100 static_cast<const polyPatch&>(*this),
109 Foam::directMappedPolyPatch::directMappedPolyPatch
112 const dictionary& dict,
114 const polyBoundaryMesh& bm
117 polyPatch(name, dict, index, bm),
118 directMappedPatchBase(*this, dict)
122 Foam::directMappedPolyPatch::directMappedPolyPatch
124 const directMappedPolyPatch& pp,
125 const polyBoundaryMesh& bm
129 directMappedPatchBase(*this, pp)
133 Foam::directMappedPolyPatch::directMappedPolyPatch
135 const directMappedPolyPatch& pp,
136 const polyBoundaryMesh& bm,
142 polyPatch(pp, bm, index, newSize, newStart),
143 directMappedPatchBase(*this, pp)
147 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
149 Foam::directMappedPolyPatch::~directMappedPolyPatch()
151 directMappedPatchBase::clearOut();
155 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
157 //- Initialise the calculation of the patch geometry
158 void Foam::directMappedPolyPatch::initGeometry()
160 polyPatch::initGeometry();
163 //- Calculate the patch geometry
164 void Foam::directMappedPolyPatch::calcGeometry()
166 polyPatch::calcGeometry();
169 //- Initialise the patches for moving points
170 void Foam::directMappedPolyPatch::initMovePoints(const pointField& p)
172 polyPatch::initMovePoints(p);
174 // Force recalculation of mapping with new point position
175 // Note: this uses parallel communications. HJ, 13/Mar/2012
176 directMappedPatchBase::clearOut();
177 directMappedPatchBase::map();
180 //- Correct patches after moving points
181 void Foam::directMappedPolyPatch::movePoints(const pointField& p)
183 polyPatch::movePoints(p);
186 //- Initialise the update of the patch topology
187 void Foam::directMappedPolyPatch::initUpdateMesh()
189 polyPatch::initUpdateMesh();
191 // Force recalculation of mapping with new point position
192 // Note: this uses parallel communications. HJ, 13/Mar/2012
193 directMappedPatchBase::clearOut();
195 // Only carry out mapping if the sampled region has been created already
197 if (boundaryMesh().mesh().time().found(sampleRegion()))
199 directMappedPatchBase::map();
203 //- Update of the patch topology
204 void Foam::directMappedPolyPatch::updateMesh()
206 polyPatch::updateMesh();
210 void Foam::directMappedPolyPatch::write(Ostream& os) const
212 polyPatch::write(os);
213 directMappedPatchBase::write(os);
217 // ************************************************************************* //