initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / OpenFOAM / meshes / polyMesh / polyPatches / basic / generic / genericPolyPatch.H
blob53bde568734f2f4b877b89c32f431b7d9f02e9ca
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::genericPolyPatch
28 Description
29     Determines a mapping between patch face centres and mesh cell centres and
30     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     genericPolyPatch.C
39 \*---------------------------------------------------------------------------*/
41 #ifndef genericPolyPatch_H
42 #define genericPolyPatch_H
44 #include "polyPatch.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 /*---------------------------------------------------------------------------*\
52                       Class genericPolyPatch Declaration
53 \*---------------------------------------------------------------------------*/
55 class genericPolyPatch
57     public polyPatch
59     // Private data
61         word actualTypeName_;
62         dictionary dict_;
64 public:
66     //- Runtime type information
67     TypeName("genericPatch");
70     // Constructors
72         //- Construct from components
73         genericPolyPatch
74         (
75             const word& name,
76             const label size,
77             const label start,
78             const label index,
79             const polyBoundaryMesh& bm
80         );
82         //- Construct from dictionary
83         genericPolyPatch
84         (
85             const word& name,
86             const dictionary& dict,
87             const label index,
88             const polyBoundaryMesh& bm
89         );
91         //- Construct as copy, resetting the boundary mesh
92         genericPolyPatch
93         (
94             const genericPolyPatch&,
95             const polyBoundaryMesh&
96         );
98         //- Construct given the original patch and resetting the
99         //  face list and boundary mesh information
100         genericPolyPatch
101         (
102             const genericPolyPatch& pp,
103             const polyBoundaryMesh& bm,
104             const label index,
105             const label newSize,
106             const label newStart
107         );
109         //- Construct and return a clone, resetting the boundary mesh
110         virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
111         {
112             return autoPtr<polyPatch>(new genericPolyPatch(*this, bm));
113         }
115         //- Construct and return a clone, resetting the face list
116         //  and boundary mesh
117         virtual autoPtr<polyPatch> clone
118         (
119             const polyBoundaryMesh& bm,
120             const label index,
121             const label newSize,
122             const label newStart
123         ) const
124         {
125             return autoPtr<polyPatch>
126             (
127                 new genericPolyPatch(*this, bm, index, newSize, newStart)
128             );
129         }
132     // Destructor
134         ~genericPolyPatch();
137     // Member functions
139         //- Write the polyPatch data as a dictionary
140         virtual void write(Ostream&) const;
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 } // End namespace Foam
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150 #endif
152 // ************************************************************************* //