springRenumber.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::springRenumber
26 
27 Description
28  Use spring analogy - attract neighbouring cells according to the distance
29  of their cell indices.
30 
31  // Maximum jump of cell indices. Is fraction of number of cells
32  maxCo 0.1;
33 
34  // Limit the amount of movement; the fraction maxCo gets decreased
35  // with every iteration.
36  freezeFraction 0.9;
37 
38  // Maximum number of iterations
39  maxIter 1000;
40 
41 SourceFiles
42  springRenumber.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef springRenumber_H
47 #define springRenumber_H
48 
49 #include "renumberMethod.H"
50 
51 namespace Foam
52 {
53 
54 /*---------------------------------------------------------------------------*\
55  Class springRenumber Declaration
56 \*---------------------------------------------------------------------------*/
57 
58 class springRenumber
59 :
60  public renumberMethod
61 {
62  // Private Data
63 
64  const dictionary& dict_;
65 
66  const scalar maxCo_;
67 
68  const label maxIter_;
69 
70  const scalar freezeFraction_;
71 
72 
73 public:
74 
75  //- Runtime type information
76  TypeName("spring");
77 
78 
79  // Constructors
80 
81  //- Construct given the renumber dictionary
82  springRenumber(const dictionary& renumberDict);
83 
84  //- Disallow default bitwise copy construction
85  springRenumber(const springRenumber&) = delete;
86 
87 
88  //- Destructor
89  virtual ~springRenumber()
90  {}
91 
92 
93  // Member Functions
94 
95  //- Return the order in which cells need to be visited, i.e.
96  // from ordered back to original cell label.
97  // This is only defined for geometric renumberMethods.
98  virtual labelList renumber(const pointField&) const
99  {
101  return labelList(0);
102  }
103 
104  //- Return the order in which cells need to be visited, i.e.
105  // from ordered back to original cell label.
106  // Use the mesh connectivity (if needed)
107  virtual labelList renumber
108  (
109  const polyMesh& mesh,
110  const pointField& cc
111  ) const;
112 
113  //- Return the order in which cells need to be visited, i.e.
114  // from ordered back to original cell label.
115  // The connectivity is equal to mesh.cellCells() except
116  // - the connections are across coupled patches
117  virtual labelList renumber
118  (
119  const labelListList& cellCells,
120  const pointField& cc
121  ) const;
122 
123 
124  // Member Operators
125 
126  //- Disallow default bitwise assignment
127  void operator=(const springRenumber&) = delete;
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Abstract base class for renumbering.
Use spring analogy - attract neighbouring cells according to the distance of their cell indices.
virtual ~springRenumber()
Destructor.
TypeName("spring")
Runtime type information.
void operator=(const springRenumber &)=delete
Disallow default bitwise assignment.
springRenumber(const dictionary &renumberDict)
Construct given the renumber dictionary.
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: labelList.H:56
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59