FreeFOAM The Cross-Platform CFD Toolkit
genericPolyPatch.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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.
20 
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/>.
23 
24 Class
25  Foam::genericPolyPatch
26 
27 Description
28  Determines a mapping between patch face centres and mesh cell centres and
29  processors they're on.
30 
31 Note
32  Storage is not optimal. It stores all face centres and cells on all
33  processors to keep the addressing calculation simple.
34 
35 SourceFiles
36  genericPolyPatch.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef genericPolyPatch_H
41 #define genericPolyPatch_H
42 
43 #include <OpenFOAM/polyPatch.H>
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class genericPolyPatch Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
56  public polyPatch
57 {
58  // Private data
59 
60  word actualTypeName_;
61  dictionary dict_;
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("genericPatch");
67 
68 
69  // Constructors
70 
71  //- Construct from components
73  (
74  const word& name,
75  const label size,
76  const label start,
77  const label index,
78  const polyBoundaryMesh& bm
79  );
80 
81  //- Construct from dictionary
83  (
84  const word& name,
85  const dictionary& dict,
86  const label index,
87  const polyBoundaryMesh& bm
88  );
89 
90  //- Construct as copy, resetting the boundary mesh
92  (
93  const genericPolyPatch&,
94  const polyBoundaryMesh&
95  );
96 
97  //- Construct given the original patch and resetting the
98  // face list and boundary mesh information
100  (
101  const genericPolyPatch& pp,
102  const polyBoundaryMesh& bm,
103  const label index,
104  const label newSize,
105  const label newStart
106  );
107 
108  //- Construct and return a clone, resetting the boundary mesh
109  virtual autoPtr<polyPatch> clone(const polyBoundaryMesh& bm) const
110  {
111  return autoPtr<polyPatch>(new genericPolyPatch(*this, bm));
112  }
113 
114  //- Construct and return a clone, resetting the face list
115  // and boundary mesh
116  virtual autoPtr<polyPatch> clone
117  (
118  const polyBoundaryMesh& bm,
119  const label index,
120  const label newSize,
121  const label newStart
122  ) const
123  {
124  return autoPtr<polyPatch>
125  (
126  new genericPolyPatch(*this, bm, index, newSize, newStart)
127  );
128  }
129 
130 
131  // Destructor
132 
134 
135 
136  // Member functions
137 
138  //- Write the polyPatch data as a dictionary
139  virtual void write(Ostream&) const;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************ vim: set sw=4 sts=4 et: ************************ //