ENH: splitMeshRegions now fills in coupling information in directMapped patch.
[OpenFOAM-1.6.x.git] / src / meshTools / directMapped / directMappedPolyPatch / directMappedPolyPatch.H
blobd40e7a057576b25401137f6aaf352476c5ab7c1c
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::directMappedPolyPatch
28 Description
29     Determines a mapping between patch face centres and mesh cell or face
30     centres and processors they're on.
32 Note
33     Storage is not optimal. It stores all face centres and cells on all
34     processors to keep the addressing calculation simple.
36 SourceFiles
37     directMappedPolyPatch.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef directMappedPolyPatch_H
42 #define directMappedPolyPatch_H
44 #include "polyPatch.H"
45 #include "directMappedPatchBase.H"
48 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 namespace Foam
53 class polyMesh;
55 /*---------------------------------------------------------------------------*\
56                       Class directMappedPolyPatch Declaration
57 \*---------------------------------------------------------------------------*/
59 class directMappedPolyPatch
61     public polyPatch,
62     public directMappedPatchBase
65 protected:
67         //- Initialise the calculation of the patch geometry
68         virtual void initGeometry();
70         //- Calculate the patch geometry
71         virtual void calcGeometry();
73         //- Initialise the patches for moving points
74         virtual void initMovePoints(const pointField&);
76         //- Correct patches after moving points
77         virtual void movePoints(const pointField&);
79         //- Initialise the update of the patch topology
80         virtual void initUpdateMesh();
82         //- Update of the patch topology
83         virtual void updateMesh();
86 public:
88     //- Runtime type information
89     TypeName("directMappedPatch");
92     // Constructors
94         //- Construct from components
95         directMappedPolyPatch
96         (
97             const word& name,
98             const label size,
99             const label start,
100             const label index,
101             const polyBoundaryMesh& bm
102         );
104         //- Construct from components
105         directMappedPolyPatch
106         (
107             const word& name,
108             const label size,
109             const label start,
110             const label index,
111             const word& sampleRegion,
112             const directMappedPatchBase::sampleMode mode,
113             const word& samplePatch,
114             const vectorField& offset,
115             const polyBoundaryMesh& bm
116         );
118         //- Construct from components. Uniform offset.
119         directMappedPolyPatch
120         (
121             const word& name,
122             const label size,
123             const label start,
124             const label index,
125             const word& sampleRegion,
126             const directMappedPatchBase::sampleMode mode,
127             const word& samplePatch,
128             const vector& offset,
129             const polyBoundaryMesh& bm
130         );
132         //- Construct from dictionary
133         directMappedPolyPatch
134         (
135             const word& name,
136             const dictionary& dict,
137             const label index,
138             const polyBoundaryMesh& bm
139         );
141         //- Construct as copy, resetting the boundary mesh
142         directMappedPolyPatch
143         (
144             const directMappedPolyPatch&,
145             const polyBoundaryMesh&
146         );
148         //- Construct given the original patch and resetting the
149         //  face list and boundary mesh information
150         directMappedPolyPatch
151         (
152             const directMappedPolyPatch& pp,
153             const polyBoundaryMesh& bm,
154             const label index,
155             const label newSize,
156             const label newStart
157         );
159         //- Construct and return a clone, resetting the boundary mesh
160         virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
161         {
162             return autoPtr<polyPatch>(new directMappedPolyPatch(*this, bm));
163         }
165         //- Construct and return a clone, resetting the face list
166         //  and boundary mesh
167         virtual autoPtr<polyPatch> clone
168         (
169             const polyBoundaryMesh& bm,
170             const label index,
171             const label newSize,
172             const label newStart
173         ) const
174         {
175             return autoPtr<polyPatch>
176             (
177                 new directMappedPolyPatch(*this, bm, index, newSize, newStart)
178             );
179         }
182     //- Destructor
183     virtual ~directMappedPolyPatch();
186     // Member functions
188         //- Write the polyPatch data as a dictionary
189         virtual void write(Ostream&) const;
193 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
195 } // End namespace Foam
197 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
199 #endif
201 // ************************************************************************* //