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 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
32 
33 SourceFiles
34  CuthillMcKeeRenumber.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_CuthillMcKeeRenumber_H
39 #define Foam_CuthillMcKeeRenumber_H
40 
41 #include "renumberMethod.H"
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class CuthillMcKeeRenumber Declaration
48 \*---------------------------------------------------------------------------*/
49 
51 :
52  public renumberMethod
53 {
54  // Private Data
55 
56  const bool reverse_;
57 
58 
59  // Private Member Functions
60 
61  //- No copy construct
63 
64  //- No copy assignment
65  void operator=(const CuthillMcKeeRenumber&) = delete;
66 
67 
68 public:
69 
70  //- Runtime type information
71  TypeName("CuthillMcKee");
72 
73 
74  // Constructors
75 
76  //- Construct given the renumber dictionary
77  explicit CuthillMcKeeRenumber(const dictionary& dict);
78 
79 
80  //- Destructor
81  virtual ~CuthillMcKeeRenumber() = default;
82 
83 
84  // Member Functions
85 
86  //- Return the order in which cells need to be visited
87  //- (ie. from ordered back to original cell label).
88  // This is only defined for geometric renumberMethods.
89  virtual labelList renumber(const pointField&) const
90  {
92  return labelList();
93  }
94 
95  //- Return the order in which cells need to be visited
96  //- (ie. from ordered back to original cell label).
97  // Use the mesh connectivity (if needed)
98  virtual labelList renumber
99  (
100  const polyMesh& mesh,
101  const pointField& cc
102  ) const;
103 
104  //- Return the order in which cells need to be visited
105  //- (ie. from ordered back to original cell label).
106  // Connectivity in losort addressing (= neighbour + offsets into
107  // neighbour)
108  virtual labelList renumber
109  (
110  const labelList& cellCells,
111  const labelList& offsets,
112  const pointField& cc
113  ) const;
114 
115  //- Return the order in which cells need to be visited
116  //- (ie. from ordered back to original cell label).
117  virtual labelList renumber
118  (
119  const CompactListList<label>& cellCells,
120  const pointField& cellCentres
121  ) const;
122 
123  //- Return the order in which cells need to be visited
124  //- (ie. from ordered back to original cell label).
125  // The connectivity is equal to mesh.cellCells() except
126  // - the connections are across coupled patches
127  virtual labelList renumber
128  (
129  const labelListList& cellCells,
130  const pointField& cellCentres
131  ) const;
132 };
133 
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("CuthillMcKee")
Runtime type information.
virtual ~CuthillMcKeeRenumber()=default
Destructor.
Abstract base class for renumbering.
dynamicFvMesh & mesh
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited (ie. from ordered back to original cell label)...
Cuthill-McKee renumbering.
A packed storage of objects of type <T> using an offset table for access.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< label > labelList
A List of labels.
Definition: List.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:686
Namespace for OpenFOAM.