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 -------------------------------------------------------------------------------
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::CuthillMcKeeRenumber
28 
29 Description
30  Cuthill-McKee renumbering
31 
32 SourceFiles
33  CuthillMcKeeRenumber.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef CuthillMcKeeRenumber_H
38 #define CuthillMcKeeRenumber_H
39 
40 #include "renumberMethod.H"
41 #include "Switch.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  CuthillMcKeeRenumber(const dictionary& renumberDict);
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, i.e.
87  // 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(0);
93  }
94 
95  //- Return the order in which cells need to be visited, i.e.
96  // 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, i.e.
105  // 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, i.e.
116  // from ordered back to original cell label.
117  // The connectivity is equal to mesh.cellCells() except
118  // - the connections are across coupled patches
119  virtual labelList renumber
120  (
121  const labelListList& cellCells,
122  const pointField& cc
123  ) const;
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::CuthillMcKeeRenumber::renumber
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
Definition: CuthillMcKeeRenumber.H:88
Foam::CuthillMcKeeRenumber::~CuthillMcKeeRenumber
virtual ~CuthillMcKeeRenumber()=default
Destructor.
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
renumberMethod.H
Foam::Field< vector >
Foam::CuthillMcKeeRenumber::TypeName
TypeName("CuthillMcKee")
Runtime type information.
Switch.H
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
Foam::List< label >
Foam::CuthillMcKeeRenumber
Cuthill-McKee renumbering.
Definition: CuthillMcKeeRenumber.H:49