Loading...
Searching...
No Matches
structuredRenumber.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) 2012-2016 OpenFOAM Foundation
9 Copyright (C) 2020-2024 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::structuredRenumber
29
30Description
31 Renumbering according to mesh layers.
32 depthFirst = true:
33 first column gets ids 0..nLayer-1,
34 second nLayers..2*nLayers-1 etc.
35 depthFirst = false:
36 first layer gets ids 0,1,2 etc.
37
38SourceFiles
39 structuredRenumber.C
40
41\*---------------------------------------------------------------------------*/
42
43#ifndef Foam_structuredRenumber_H
44#define Foam_structuredRenumber_H
45
46#include "renumberMethod.H"
47
48namespace Foam
49{
50
51// Forward Declarations
52template<class Type> class topoDistanceData;
54/*---------------------------------------------------------------------------*\
55 Class structuredRenumber Declaration
56\*---------------------------------------------------------------------------*/
57
58class structuredRenumber
59:
60 public renumberMethod
61{
62public:
63
64 // Public Classes
65
66 //- Function class for sorting according to column and layer
67 class layerLess
68 {
69 const bool depthFirst_;
70 const labelList& order_;
71 const List<topoDistanceData<label>>& distance_;
73 public:
74
76 (
77 const bool depthFirst,
78 const labelList& order,
80 )
81 :
82 depthFirst_(depthFirst),
83 order_(order),
84 distance_(distance)
85 {}
86
87 bool operator()(const label a, const label b) const;
88 };
89
90
91private:
92
93 // Private Data
94
95 const dictionary& coeffsDict_;
96
97 const wordRes patches_;
98
99 const label nLayers_;
100
101 const bool depthFirst_;
102
103 const bool reverse_;
104
105 const autoPtr<renumberMethod> method_;
106
107
108 // Private Member Functions
109
110 //- No copy construct
111 structuredRenumber(const structuredRenumber&) = delete;
112
113 //- No copy assignment
114 void operator=(const structuredRenumber&) = delete;
115
116
117public:
118
119 //- Runtime type information
120 TypeName("structured");
121
122
123 // Constructors
124
125 //- Construct given the renumber dictionary
126 explicit structuredRenumber(const dictionary& dict);
127
128
129 //- Destructor
130 virtual ~structuredRenumber() = default;
131
132
133 // Member Functions
134
135 //- Renumbering method requires a polyMesh!
136 virtual bool needs_mesh() const { return true; }
138
139 // With mesh topology
140
141 //- Return the cell visit order (from ordered back to original cell id)
142 // using the mesh.
143 virtual labelList renumber
144 (
146 ) const;
147
148
149 // With explicit topology - Not implemented!
150
151 //- Return the cell visit order (from ordered back to original cell id).
152 //- Not implemented!
153 virtual labelList renumber
154 (
155 const CompactListList<label>& cellCells
156 ) const
157 {
159 return labelList();
160 }
161
162 //- Return the cell visit order (from ordered back to original cell id).
163 //- Not implemented!
164 virtual labelList renumber
165 (
166 const labelListList& cellCells
167 ) const
168 {
170 return labelList();
171 }
172};
173
174
175// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176
177} // End namespace Foam
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
181#endif
182
183// ************************************************************************* //
A packed storage of objects of type <T> using an offset table for access.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition List.H:72
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
renumberMethod()
Default construct.
layerLess(const bool depthFirst, const labelList &order, const List< topoDistanceData< label > > &distance)
bool operator()(const label a, const label b) const
Renumbering according to mesh layers. depthFirst = true: first column gets ids 0.....
virtual ~structuredRenumber()=default
Destructor.
virtual bool needs_mesh() const
Renumbering method requires a polyMesh!
virtual labelList renumber(const labelListList &cellCells) const
Return the cell visit order (from ordered back to original cell id). Not implemented!
TypeName("structured")
Runtime type information.
virtual labelList renumber(const polyMesh &mesh) const
Return the cell visit order (from ordered back to original cell id).
virtual labelList renumber(const CompactListList< label > &cellCells) const
Return the cell visit order (from ordered back to original cell id). Not implemented!
For use with FaceCellWave. Determines topological distance to starting faces. Templated on passive tr...
A List of wordRe with additional matching capabilities.
Definition wordRes.H:56
dynamicFvMesh & mesh
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition error.H:688
Namespace for OpenFOAM.
scalar distance(const vector &p1, const vector &p2)
Definition curveTools.C:12
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
dictionary dict
volScalarField & b
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68