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