Loading...
Searching...
No Matches
SloanRenumber.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) 2012-2015 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
27Class
28 Foam::SloanRenumber
29
30Description
31 Sloan renumbering algorithm
32
33 E.g. http://www.apav.it/sito_ratio/file_pdf/ratio_4/capitolo_1.pdf
34
35SourceFiles
36 SloanRenumber.C
37
38\*---------------------------------------------------------------------------*/
39
40#ifndef Foam_SloanRenumber_H
41#define Foam_SloanRenumber_H
42
43#include "renumberMethod.H"
44
45namespace Foam
46{
48/*---------------------------------------------------------------------------*\
49 Class SloanRenumber Declaration
50\*---------------------------------------------------------------------------*/
51
52class SloanRenumber
53:
54 public renumberMethod
55{
56 // Private Data
57
58 //- Use reverse indexing
59 bool reverse_;
60
61
62public:
63
64 //- Runtime type information
65 TypeName("Sloan");
66
67
68 // Constructors
69
70 //- Default construct, optionally with reverse
71 explicit SloanRenumber(const bool reverse = false);
72
73 //- Construct given the renumber dictionary
74 explicit SloanRenumber(const dictionary& dict);
75
76
77 //- Destructor
78 virtual ~SloanRenumber() = default;
79
80
81 // Member Functions
82
83 //- Toggle reverse on/off
84 void reverse(bool on) noexcept { reverse_ = on; }
85
86
87 // With mesh topology
88
89 //- Return the cell visit order (from ordered back to original cell id)
90 //- using the mesh to determine the connectivity.
91 virtual labelList renumber(const polyMesh& mesh) const;
92
93
94 // With explicit topology
95
96 //- Return the cell visit order (from ordered back to original cell id)
97 virtual labelList renumber
98 (
99 const CompactListList<label>& cellCells
100 ) const;
101
102 //- Return the cell visit order (from ordered back to original cell id)
103 virtual labelList renumber
104 (
105 const labelListList& cellCells
106 ) const;
107};
108
109
110// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111
112} // End namespace Foam
113
114// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115
116#endif
117
118// ************************************************************************* //
A packed storage of objects of type <T> using an offset table for access.
void reverse(bool on) noexcept
Toggle reverse on/off.
TypeName("Sloan")
Runtime type information.
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...
virtual ~SloanRenumber()=default
Destructor.
SloanRenumber(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:133
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
renumberMethod()
Default construct.
dynamicFvMesh & mesh
Namespace for OpenFOAM.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68