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-2015 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  return labelList(0);
119  }
120 
121  //- Return the order in which cells need to be visited, i.e.
122  // from ordered back to original cell label.
123  // Use the mesh connectivity (if needed)
124  virtual labelList renumber(const polyMesh&, const pointField&) const;
125 
126  //- Return the order in which cells need to be visited, i.e.
127  // from ordered back to original cell label.
128  // Addresing in losort addressing (= neighbour + offsets into
129  // neighbour)
130  virtual labelList renumber
131  (
132  const labelList& cellCells,
133  const labelList& offsets,
134  const pointField&
135  ) const;
136 
137  //- Return the order in which cells need to be visited, i.e.
138  // from ordered back to original cell label.
139  // Gets passed agglomeration map (from fine to coarse cells) and coarse
140  // cell
141  // location. Can be overridden by renumberMethods that provide this
142  // functionality natively. Coarse cells are local to the processor
143  // (if in parallel). If you want to have coarse cells spanning
144  // processors use the globalCellCells instead.
145  virtual labelList renumber
146  (
147  const polyMesh& mesh,
148  const labelList& cellToRegion,
149  const pointField& regionPoints
150  ) const;
151 
152  //- Return the order in which cells need to be visited, i.e.
153  // from ordered back to original cell label.
154  // The connectivity is equal to mesh.cellCells() except
155  // - the connections are across coupled patches
156  virtual labelList renumber
157  (
158  const labelListList& cellCells,
159  const pointField& cc
160  ) const = 0;
161 
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
virtual ~renumberMethod()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
const dictionary & renumberDict_
static autoPtr< renumberMethod > New(const dictionary &renumberDict)
Return a reference to the selected renumbering method.
declareRunTimeSelectionTable(autoPtr, renumberMethod, dictionary,(const dictionary &renumberDict),(renumberDict))
Abstract base class for renumbering.
dynamicFvMesh & mesh
TypeName("renumberMethod")
Runtime type information.
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.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:53
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
Namespace for OpenFOAM.