renumberMethod.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) 2011-2013 OpenFOAM Foundation
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::renumberMethod
26 
27 Description
28  Abstract base class for renumbering
29 
30 SourceFiles
31  renumberMethod.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef renumberMethod_H
36 #define renumberMethod_H
37 
38 #include "polyMesh.H"
39 #include "pointField.H"
40 #include "CompactListList.H"
41 
42 namespace Foam
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class renumberMethod Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class renumberMethod
50 {
51 
52 protected:
53 
54  // Protected data
55 
57 
58 private:
59 
60  // Private Member Functions
61 
62  //- Disallow default bitwise copy construct and assignment
64  void operator=(const renumberMethod&);
65 
66 
67 public:
68 
69  //- Runtime type information
70  TypeName("renumberMethod");
71 
72 
73  // Declare run-time constructor selection tables
74 
76  (
77  autoPtr,
79  dictionary,
80  (
81  const dictionary& renumberDict
82  ),
83  (renumberDict)
84  );
85 
86 
87  // Selectors
88 
89  //- Return a reference to the selected renumbering method
91  (
92  const dictionary& renumberDict
93  );
94 
95 
96  // Constructors
97 
98  //- Construct given the renumber dictionary
99  renumberMethod(const dictionary& renumberDict)
100  :
101  renumberDict_(renumberDict)
102  {}
103 
104 
105  //- Destructor
106  virtual ~renumberMethod()
107  {}
108 
109 
110  // Member Functions
111 
112  //- Return the order in which cells need to be visited, i.e.
113  // from ordered back to original cell label.
114  // This is only defined for geometric renumberMethods.
115  virtual labelList renumber(const pointField&) const
116  {
118  (
119  "renumberMethod:renumber(const pointField&)"
120  );
121  return labelList(0);
122  }
123 
124  //- Return the order in which cells need to be visited, i.e.
125  // from ordered back to original cell label.
126  // Use the mesh connectivity (if needed)
127  virtual labelList renumber(const polyMesh&, const pointField&) const;
128 
129  //- Return the order in which cells need to be visited, i.e.
130  // from ordered back to original cell label.
131  // Addresing in losort addressing (= neighbour + offsets into
132  // neighbour)
133  virtual labelList renumber
134  (
135  const labelList& cellCells,
136  const labelList& offsets,
137  const pointField&
138  ) const;
139 
140  //- Return the order in which cells need to be visited, i.e.
141  // from ordered back to original cell label.
142  // Gets passed agglomeration map (from fine to coarse cells) and coarse
143  // cell
144  // location. Can be overridden by renumberMethods that provide this
145  // functionality natively. Coarse cells are local to the processor
146  // (if in parallel). If you want to have coarse cells spanning
147  // processors use the globalCellCells instead.
148  virtual labelList renumber
149  (
150  const polyMesh& mesh,
151  const labelList& cellToRegion,
152  const pointField& regionPoints
153  ) const;
154 
155  //- Return the order in which cells need to be visited, i.e.
156  // from ordered back to original cell label.
157  // The connectivity is equal to mesh.cellCells() except
158  // - the connections are across coupled patches
159  virtual labelList renumber
160  (
161  const labelListList& cellCells,
162  const pointField& cc
163  ) const = 0;
164 
165 };
166 
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 } // End namespace Foam
171 
172 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
173 
174 #endif
175 
176 // ************************************************************************* //
const dictionary & renumberDict_
static autoPtr< renumberMethod > New(const dictionary &renumberDict)
Return a reference to the selected renumbering method.
dynamicFvMesh & mesh
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
Namespace for OpenFOAM.
declareRunTimeSelectionTable(autoPtr, renumberMethod, dictionary,( const dictionary &renumberDict ),(renumberDict))
TypeName("renumberMethod")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< label > labelList
A List of labels.
Definition: labelList.H:56
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
Abstract base class for renumbering.
virtual ~renumberMethod()
Destructor.
#define notImplemented(functionName)
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:356
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117