randomRenumber.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-2012 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::randomRenumber
29 
30 Description
31  Random renumber. Just to see effect of renumbering.
32 
33 SourceFiles
34  randomRenumber.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_randomRenumber_H
39 #define Foam_randomRenumber_H
40 
41 #include "renumberMethod.H"
42 
43 namespace Foam
44 {
45 
46 /*---------------------------------------------------------------------------*\
47  Class randomRenumber Declaration
48 \*---------------------------------------------------------------------------*/
49 
50 class randomRenumber
51 :
52  public renumberMethod
53 {
54 public:
55 
56  //- Runtime type information
57  TypeNameNoDebug("random");
58 
59 
60  // Constructors
61 
62  //- Default construct
64 
65  //- Construct given the renumber dictionary (unused)
66  explicit randomRenumber(const dictionary& dict);
67 
68 
69  //- Destructor
70  virtual ~randomRenumber() = default;
71 
72 
73  // Member Functions
74 
75  //- Renumbering method without mesh or cell-cell topology!
76  virtual bool no_topology() const { return true; }
77 
78 
79  // No topology
80 
81  //- Return the cell visit order (from ordered back to original cell id)
82  //- based solely on the number of cells.
83  virtual labelList renumber(const label nCells) const;
84 
85  //- Return the cell visit order (from ordered back to original cell id).
86  //- based solely on pointField size
87  virtual labelList renumber(const pointField&) const;
88 
89 
90  // With mesh topology
91 
92  //- Return the cell visit order (from ordered back to original cell id)
93  //- using the mesh only for the number of cells
94  virtual labelList renumber
95  (
97  const polyMesh& mesh
98  ) const;
99 
100 
101  // With explicit topology
102 
103  //- Return the cell visit order (from ordered back to original cell id)
104  //- using the topology only for the number of cells
105  virtual labelList renumber
106  (
108  const CompactListList<label>& cellCells
109  ) const;
110 
111  //- Return the cell visit order (from ordered back to original cell id)
112  //- using the topology only for the number of cells
113  virtual labelList renumber
114  (
116  const labelListList& cellCells
117  ) const;
118 };
119 
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 } // End namespace Foam
124 
125 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 
127 #endif
128 
129 // ************************************************************************* //
dictionary dict
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeNameNoDebug("random")
Runtime type information.
virtual bool no_topology() const
Renumbering method without mesh or cell-cell topology!
randomRenumber()
Default construct.
Abstract base class for renumbering.
dynamicFvMesh & mesh
A packed storage of objects of type <T> using an offset table for access.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:75
virtual ~randomRenumber()=default
Destructor.
virtual labelList renumber(const label nCells) const
Return the cell visit order (from ordered back to original cell id) based solely on the number of cel...
Random renumber. Just to see effect of renumbering.
Namespace for OpenFOAM.