All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
renumberMethod.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 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 
59 public:
60 
61  //- Runtime type information
62  TypeName("renumberMethod");
63 
64 
65  // Declare run-time constructor selection tables
66 
68  (
69  autoPtr,
71  dictionary,
72  (
73  const dictionary& renumberDict
74  ),
75  (renumberDict)
76  );
77 
78 
79  // Constructors
80 
81  //- Construct given the renumber dictionary
82  renumberMethod(const dictionary& renumberDict)
83  :
84  renumberDict_(renumberDict)
85  {}
86 
87  //- Disallow default bitwise copy construction
88  renumberMethod(const renumberMethod&) = delete;
89 
90 
91  // Selectors
92 
93  //- Return a reference to the selected renumbering method
95  (
96  const dictionary& renumberDict
97  );
98 
99 
100  //- Destructor
101  virtual ~renumberMethod()
102  {}
103 
104 
105  // Member Functions
106 
107  //- Return the order in which cells need to be visited, i.e.
108  // from ordered back to original cell label.
109  // This is only defined for geometric renumberMethods.
110  virtual labelList renumber(const pointField&) const
111  {
113  return labelList(0);
114  }
115 
116  //- Return the order in which cells need to be visited, i.e.
117  // from ordered back to original cell label.
118  // Use the mesh connectivity (if needed)
119  virtual labelList renumber(const polyMesh&, const pointField&) const;
120 
121  //- Return the order in which cells need to be visited, i.e.
122  // from ordered back to original cell label.
123  // Addressing in losort addressing (= neighbour + offsets into
124  // neighbour)
125  virtual labelList renumber
126  (
127  const labelList& cellCells,
128  const labelList& offsets,
129  const pointField&
130  ) const;
131 
132  //- Return the order in which cells need to be visited, i.e.
133  // from ordered back to original cell label.
134  // Gets passed agglomeration map (from fine to coarse cells) and coarse
135  // cell
136  // location. Can be overridden by renumberMethods that provide this
137  // functionality natively. Coarse cells are local to the processor
138  // (if in parallel). If you want to have coarse cells spanning
139  // processors use the globalCellCells instead.
140  virtual labelList renumber
141  (
142  const polyMesh& mesh,
143  const labelList& cellToRegion,
144  const pointField& regionPoints
145  ) const;
146 
147  //- Return the order in which cells need to be visited, i.e.
148  // from ordered back to original cell label.
149  // The connectivity is equal to mesh.cellCells() except
150  // - the connections are across coupled patches
151  virtual labelList renumber
152  (
153  const labelListList& cellCells,
154  const pointField& cc
155  ) const = 0;
156 
157 
158  // Member Operators
159 
160  //- Disallow default bitwise assignment
161  void operator=(const renumberMethod&) = delete;
162 };
163 
164 
165 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 
167 } // End namespace Foam
168 
169 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170 
171 #endif
172 
173 // ************************************************************************* //
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
virtual ~renumberMethod()
Destructor.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:158
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))
renumberMethod(const dictionary &renumberDict)
Construct given the renumber dictionary.
Abstract base class for renumbering.
dynamicFvMesh & mesh
TypeName("renumberMethod")
Runtime type information.
List< label > labelList
A List of labels.
Definition: labelList.H:56
void operator=(const renumberMethod &)=delete
Disallow default bitwise assignment.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
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.