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 | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2011-2015 OpenFOAM Foundation
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::renumberMethod
28 
29 Description
30  Abstract base class for renumbering
31 
32 SourceFiles
33  renumberMethod.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef renumberMethod_H
38 #define renumberMethod_H
39 
40 #include "polyMesh.H"
41 #include "pointField.H"
42 #include "CompactListList.H"
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class renumberMethod Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class renumberMethod
52 {
53 
54 protected:
55 
56  // Protected data
57 
59 
60 private:
61 
62  // Private Member Functions
63 
64  //- No copy construct
65  renumberMethod(const renumberMethod&) = delete;
66 
67  //- No copy assignment
68  void operator=(const renumberMethod&) = delete;
69 
70 
71 public:
72 
73  //- Runtime type information
74  TypeName("renumberMethod");
75 
76 
77  // Declare run-time constructor selection tables
78 
80  (
81  autoPtr,
83  dictionary,
84  (
85  const dictionary& renumberDict
86  ),
87  (renumberDict)
88  );
89 
90 
91  // Selectors
92 
93  //- Return a reference to the selected renumbering method
95  (
96  const dictionary& renumberDict
97  );
98 
99 
100  // Constructors
101 
102  //- Construct given the renumber dictionary
103  renumberMethod(const dictionary& renumberDict)
104  :
105  renumberDict_(renumberDict)
106  {}
107 
108 
109  //- Destructor
110  virtual ~renumberMethod() = default;
111 
112 
113  // Member Functions
114 
115  //- Return the order in which cells need to be visited, i.e.
116  // from ordered back to original cell label.
117  // This is only defined for geometric renumberMethods.
118  virtual labelList renumber(const pointField&) const
119  {
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  // Addressing 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 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::pointField
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Foam::renumberMethod::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, renumberMethod, dictionary,(const dictionary &renumberDict),(renumberDict))
Foam::renumberMethod::~renumberMethod
virtual ~renumberMethod()=default
Destructor.
polyMesh.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Foam::renumberMethod::renumber
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
Definition: renumberMethod.H:117
Foam::Field< vector >
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::renumberMethod
Abstract base class for renumbering.
Definition: renumberMethod.H:50
pointField.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::labelListList
List< labelList > labelListList
A List of labelList.
Definition: labelList.H:56
Foam::List< label >
Foam::renumberMethod::renumberMethod
renumberMethod(const dictionary &renumberDict)
Construct given the renumber dictionary.
Definition: renumberMethod.H:102
Foam::renumberMethod::TypeName
TypeName("renumberMethod")
Runtime type information.
Foam::renumberMethod::New
static autoPtr< renumberMethod > New(const dictionary &renumberDict)
Return a reference to the selected renumbering method.
Definition: renumberMethod.C:46
CompactListList.H
Foam::renumberMethod::renumberDict_
const dictionary & renumberDict_
Definition: renumberMethod.H:57