Loading...
Searching...
No Matches
bandCompression.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-2013 OpenFOAM Foundation
9 Copyright (C) 2022-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
27InNamespace
28 Foam
29
30Description
31 The bandCompression function renumbers the addressing such that the
32 band of the matrix is reduced. The algorithm uses a simple search
33 through the neighbour list in order of connectivity.
34
35 See http://en.wikipedia.org/wiki/Cuthill-McKee_algorithm
36
37SourceFiles
38 bandCompression.C
39
40\*---------------------------------------------------------------------------*/
41
42#ifndef Foam_bandCompression_H
43#define Foam_bandCompression_H
44
45#include "labelList.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward Declarations
53class polyMesh;
54template<class T> class CompactListList;
55
56} // End namespace Foam
57
58
59// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60
61namespace Foam
62{
63namespace meshTools
64{
65
66// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
67
68//- Renumber (mesh) addressing to reduce the band of the mesh connectivity,
69//- using the Cuthill-McKee algorithm.
70//
71// \returns order in which the cells are to be visited (ordered to original)
72labelList bandCompression(const polyMesh& mesh);
73
74//- Renumber (mesh) addressing to reduce the band of the matrix,
75//- using the Cuthill-McKee algorithm.
76//
77// \returns order in which the cells are to be visited (ordered to original)
78labelList bandCompression(const CompactListList<label>& addressing);
79
80//- Renumber (mesh) addressing to reduce the band of the matrix,
81//- using the Cuthill-McKee algorithm.
82//
83// \returns order in which the cells are to be visited (ordered to original)
84labelList bandCompression(const labelListList& addressing);
85
86//- Renumber with addressing in losort form (neighbour + start in neighbour),
87//- using the Cuthill-McKee algorithm.
88//
89// \returns order in which the cells are to be visited (ordered to original)
91(
92 const labelUList& cellCells,
93 const labelUList& offsets
94);
95
96
97} // End namespace meshTools
98} // End namespace Foam
99
100
101// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102
103namespace Foam
104{
105
106//- Deprecated - prefer meshTools::bandCompression()
107// \deprecated(2022-03) prefer meshTools::bandCompression()
108FOAM_DEPRECATED_FOR(2022-03, "meshTools::bandCompression()")
109inline labelList bandCompression(const labelListList& cellCellAddressing)
110{
111 return meshTools::bandCompression(cellCellAddressing);
112}
113
114//- Deprecated - prefer meshTools::bandCompression()
115// \deprecated(2022-03) prefer meshTools::bandCompression()
116FOAM_DEPRECATED_FOR(2022-03, "meshTools::bandCompression()")
118(
119 const labelUList& cellCells,
120 const labelUList& offsets
121)
122{
123 return meshTools::bandCompression(cellCells, offsets);
124}
125
126} // End namespace Foam
127
128
129// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130
131#endif
132
133// ************************************************************************* //
A packed storage of objects of type <T> using an offset table for access.
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
dynamicFvMesh & mesh
Collection of static functions to do various simple mesh related things.
labelList bandCompression(const polyMesh &mesh)
Renumber (mesh) addressing to reduce the band of the mesh connectivity, using the Cuthill-McKee algor...
Namespace for OpenFOAM.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
labelList bandCompression(const labelListList &cellCellAddressing)
Deprecated - prefer meshTools::bandCompression().
UList< label > labelUList
A UList of labels.
Definition UList.H:75
#define FOAM_DEPRECATED_FOR(since, replacement)
Definition stdFoam.H:43