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 Copyright (C) 2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::renumberMethod
29
30Description
31 Abstract base class for renumbering
32
33SourceFiles
34 renumberMethod.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_renumberMethod_H
39#define Foam_renumberMethod_H
40
41#include "polyMesh.H"
42#include "pointField.H"
43#include "CompactListList.H"
44
45namespace Foam
46{
47
48/*---------------------------------------------------------------------------*\
49 Class renumberMethod Declaration
50\*---------------------------------------------------------------------------*/
53{
54protected:
55
56 // Protected Data
59
60
61 // Protected Member Functions
62
63 //- No copy construct
64 renumberMethod(const renumberMethod&) = delete;
65
66 //- No copy assignment
67 void operator=(const renumberMethod&) = delete;
68
69
70public:
71
72 //- Runtime type information
73 TypeName("renumberMethod");
74
75
76 // Declare run-time constructor selection tables
79 (
80 autoPtr,
83 (
84 const dictionary& renumberDict
85 ),
86 (renumberDict)
87 );
88
89
90 // Selectors
91
92 //- Return a reference to the selected renumbering method
94 (
95 const dictionary& renumberDict
96 );
97
98
99 // Constructors
100
101 //- Construct given the renumber dictionary
102 explicit renumberMethod(const dictionary& dict)
103 :
105 {}
106
107
108 //- Destructor
109 virtual ~renumberMethod() = default;
110
111
112 // Member Functions
113
114 //- Return the order in which cells need to be visited
115 //- (ie. from ordered back to original cell label).
116 // This is only defined for geometric renumberMethods.
117 virtual labelList renumber(const pointField&) const
118 {
120 return labelList();
121 }
122
123 //- Return the order in which cells need to be visited
124 //- (ie. from ordered back to original cell label).
125 // Use the mesh connectivity (if needed)
126 virtual labelList renumber(const polyMesh&, const pointField&) const;
127
128 //- Return the order in which cells need to be visited
129 //- (ie. from ordered back to original cell label).
130 // Addressing in losort addressing (= neighbour + offsets into
131 // neighbour)
132 virtual labelList renumber
133 (
134 const labelList& cellCells,
135 const labelList& offsets,
136 const pointField&
137 ) const;
138
139 //- Return the order in which cells need to be visited
140 //- (ie. from ordered back to original cell label).
141 // Gets passed agglomeration map (from fine to coarse cells) and coarse
142 // cell
143 // location. Can be overridden by renumberMethods that provide this
144 // functionality natively. Coarse cells are local to the processor
145 // (if in parallel). If you want to have coarse cells spanning
146 // processors use the globalCellCells instead.
147 virtual labelList renumber
148 (
149 const polyMesh& mesh,
150 const labelList& fineToCoarse,
151 const pointField& coarsePoints
152 ) const;
153
154 //- Return the order in which cells need to be visited
155 //- (ie. from ordered back to original cell label).
156 // Uses 'unpack' internally, so should be overloaded when possible
157 virtual labelList renumber
158 (
159 const CompactListList<label>& cellCells,
160 const pointField& cellCentres
161 ) const;
162
163 //- Return the order in which cells need to be visited
164 //- (ie. from ordered back to original cell label).
165 // The connectivity is equal to mesh.cellCells() except
166 // - the connections are across coupled patches
167 virtual labelList renumber
168 (
169 const labelListList& cellCells,
170 const pointField& cellCentres
171 ) const = 0;
172};
173
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177} // End namespace Foam
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
A packed storage unstructured matrix of objects of type <T> using an offset table for access.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Abstract base class for renumbering.
virtual ~renumberMethod()=default
Destructor.
TypeName("renumberMethod")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, renumberMethod, dictionary,(const dictionary &renumberDict),(renumberDict))
const dictionary & renumberDict_
static autoPtr< renumberMethod > New(const dictionary &renumberDict)
Return a reference to the selected renumbering method.
renumberMethod(const dictionary &dict)
Construct given the renumber dictionary.
renumberMethod(const renumberMethod &)=delete
No copy construct.
void operator=(const renumberMethod &)=delete
No copy assignment.
virtual labelList renumber(const pointField &) const
dynamicFvMesh & mesh
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:517
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73