CuthillMcKeeRenumber.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-2024 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::CuthillMcKeeRenumber
29 
30 Description
31  Cuthill-McKee renumbering (CM or RCM)
32 
33 SeeAlso
34  Foam::meshTools::bandCompression
35 
36 SourceFiles
37  CuthillMcKeeRenumber.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef Foam_CuthillMcKeeRenumber_H
42 #define Foam_CuthillMcKeeRenumber_H
43 
44 #include "renumberMethod.H"
45 
46 namespace Foam
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class CuthillMcKeeRenumber Declaration
51 \*---------------------------------------------------------------------------*/
52 
54 :
55  public renumberMethod
56 {
57  // Private Data
58 
59  //- Use reverse indexing
60  bool reverse_;
61 
62 
63 public:
64 
65  //- Runtime type information
66  TypeNameNoDebug("CuthillMcKee");
67 
68 
69  // Constructors
70 
71  //- Default construct, optionally with reverse
72  explicit CuthillMcKeeRenumber(const bool reverse = false);
73 
74  //- Construct given the renumber dictionary
75  explicit CuthillMcKeeRenumber(const dictionary& dict);
76 
77  //- Construct given the renumber dictionary (ignored)
78  //- and specified reverse handling
79  CuthillMcKeeRenumber(const dictionary& dict, const bool reverse);
80 
81 
82  //- Destructor
83  virtual ~CuthillMcKeeRenumber() = default;
84 
85 
86  // Member Functions
87 
88  //- Toggle reverse on/off
89  void reverse(bool on) noexcept { reverse_ = on; }
90 
91 
92  // With mesh topology
93 
94  //- Return the cell visit order (from ordered back to original cell id)
95  //- using the mesh to determine the connectivity.
96  virtual labelList renumber
97  (
99  const polyMesh& mesh
100  ) const;
101 
102 
103  // With explicit topology
104 
105  //- Return the cell visit order (from ordered back to original cell id).
106  virtual labelList renumber
107  (
109  const CompactListList<label>& cellCells
110  ) const;
111 
112  //- Return the cell visit order (from ordered back to original cell id).
113  virtual labelList renumber
114  (
116  const labelListList& cellCells
117  ) const;
118 };
119 
120 
121 /*---------------------------------------------------------------------------*\
122  Class reverseCuthillMcKeeRenumber Declaration
123 \*---------------------------------------------------------------------------*/
124 
125 //- Reverse Cuthill-McKee renumbering
127 :
128  public CuthillMcKeeRenumber
129 {
130 public:
131 
132  //- Runtime type information
133  TypeNameNoDebug("reverseCuthillMcKee");
134 
135 
136  // Constructors
137 
138  //- Default construct
140 
141  //- Construct given the renumber dictionary (ignored)
144 
145  //- Destructor
146  virtual ~reverseCuthillMcKeeRenumber() = default;
147 };
148 
149 
150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
151 
152 } // End namespace Foam
153 
154 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
155 
156 #endif
157 
158 // ************************************************************************* //
dictionary dict
reverseCuthillMcKeeRenumber()
Default construct.
CuthillMcKeeRenumber(const bool reverse=false)
Default construct, optionally with reverse.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:130
virtual ~CuthillMcKeeRenumber()=default
Destructor.
TypeNameNoDebug("reverseCuthillMcKee")
Runtime type information.
Reverse Cuthill-McKee renumbering.
Abstract base class for renumbering.
dynamicFvMesh & mesh
Cuthill-McKee renumbering (CM or RCM)
A packed storage of objects of type <T> using an offset table for access.
const direction noexcept
Definition: scalarImpl.H:265
virtual labelList renumber(const polyMesh &mesh) const
Return the cell visit order (from ordered back to original cell id) using the mesh to determine the c...
TypeNameNoDebug("CuthillMcKee")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
Namespace for OpenFOAM.
void reverse(bool on) noexcept
Toggle reverse on/off.
virtual ~reverseCuthillMcKeeRenumber()=default
Destructor.