1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
25 Foam::directMappedPolyPatch
28 Determines a mapping between patch face centres and mesh cell or face
29 centres and processors they're on.
32 Storage is not optimal. It stores all face centres and cells on all
33 processors to keep the addressing calculation simple.
36 directMappedPolyPatch.C
38 \*---------------------------------------------------------------------------*/
40 #ifndef directMappedPolyPatch_H
41 #define directMappedPolyPatch_H
43 #include "polyPatch.H"
44 #include "directMappedPatchBase.H"
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 /*---------------------------------------------------------------------------*\
55 Class directMappedPolyPatch Declaration
56 \*---------------------------------------------------------------------------*/
58 class directMappedPolyPatch
61 public directMappedPatchBase
66 //- Initialise the calculation of the patch geometry
67 virtual void initGeometry(PstreamBuffers&);
69 //- Calculate the patch geometry
70 virtual void calcGeometry(PstreamBuffers&);
72 //- Initialise the patches for moving points
73 virtual void initMovePoints(PstreamBuffers&, const pointField&);
75 //- Correct patches after moving points
76 virtual void movePoints(PstreamBuffers&, const pointField&);
78 //- Initialise the update of the patch topology
79 virtual void initUpdateMesh(PstreamBuffers&);
81 //- Update of the patch topology
82 virtual void updateMesh(PstreamBuffers&);
87 //- Runtime type information
88 TypeName("directMappedPatch");
93 //- Construct from components
100 const polyBoundaryMesh& bm
103 //- Construct from components
104 directMappedPolyPatch
110 const word& sampleRegion,
111 const directMappedPatchBase::sampleMode mode,
112 const word& samplePatch,
113 const vectorField& offset,
114 const polyBoundaryMesh& bm
117 //- Construct from components. Uniform offset.
118 directMappedPolyPatch
124 const word& sampleRegion,
125 const directMappedPatchBase::sampleMode mode,
126 const word& samplePatch,
127 const vector& offset,
128 const polyBoundaryMesh& bm
131 //- Construct from dictionary
132 directMappedPolyPatch
135 const dictionary& dict,
137 const polyBoundaryMesh& bm
140 //- Construct as copy, resetting the boundary mesh
141 directMappedPolyPatch
143 const directMappedPolyPatch&,
144 const polyBoundaryMesh&
147 //- Construct given the original patch and resetting the
148 // face list and boundary mesh information
149 directMappedPolyPatch
151 const directMappedPolyPatch& pp,
152 const polyBoundaryMesh& bm,
158 //- Construct given the original patch and a map
159 directMappedPolyPatch
161 const directMappedPolyPatch& pp,
162 const polyBoundaryMesh& bm,
164 const labelUList& mapAddressing,
168 //- Construct and return a clone, resetting the boundary mesh
169 virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
171 return autoPtr<polyPatch>(new directMappedPolyPatch(*this, bm));
174 //- Construct and return a clone, resetting the face list
176 virtual autoPtr<polyPatch> clone
178 const polyBoundaryMesh& bm,
184 return autoPtr<polyPatch>
186 new directMappedPolyPatch(*this, bm, index, newSize, newStart)
190 //- Construct and return a clone, resetting the face list
192 virtual autoPtr<polyPatch> clone
194 const polyBoundaryMesh& bm,
196 const labelUList& mapAddressing,
200 return autoPtr<polyPatch>
202 new directMappedPolyPatch
215 virtual ~directMappedPolyPatch();
220 //- Write the polyPatch data as a dictionary
221 virtual void write(Ostream&) const;
225 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
227 } // End namespace Foam
229 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
233 // ************************************************************************* //