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-2018 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  // Private Member Functions
73 
74  //- Disallow default bitwise copy construct and assignment
75  void operator=(const springRenumber&);
77 
78 
79 public:
80 
81  //- Runtime type information
82  TypeName("spring");
83 
84 
85  // Constructors
86 
87  //- Construct given the renumber dictionary
88  springRenumber(const dictionary& renumberDict);
89 
90 
91  //- Destructor
92  virtual ~springRenumber()
93  {}
94 
95 
96  // Member Functions
97 
98  //- Return the order in which cells need to be visited, i.e.
99  // from ordered back to original cell label.
100  // This is only defined for geometric renumberMethods.
101  virtual labelList renumber(const pointField&) const
102  {
104  return labelList(0);
105  }
106 
107  //- Return the order in which cells need to be visited, i.e.
108  // from ordered back to original cell label.
109  // Use the mesh connectivity (if needed)
110  virtual labelList renumber
111  (
112  const polyMesh& mesh,
113  const pointField& cc
114  ) const;
115 
116  //- Return the order in which cells need to be visited, i.e.
117  // from ordered back to original cell label.
118  // The connectivity is equal to mesh.cellCells() except
119  // - the connections are across coupled patches
120  virtual labelList renumber
121  (
122  const labelListList& cellCells,
123  const pointField& cc
124  ) const;
125 };
126 
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 } // End namespace Foam
131 
132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 
134 #endif
135 
136 // ************************************************************************* //
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
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:137
virtual labelList renumber(const pointField &) const
Return the order in which cells need to be visited, i.e.
TypeName("spring")
Runtime type information.
Abstract base class for renumbering.
dynamicFvMesh & mesh
List< label > labelList
A List of labels.
Definition: labelList.H:56
Use spring analogy - attract neighbouring cells according to the distance of their cell indices...
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:366
virtual ~springRenumber()
Destructor.
Namespace for OpenFOAM.