multiLevel.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-2024 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::decompositionMethods::multiLevel
26 
27 Description
28  Decomposition given using consecutive application of decomposers.
29 
30 SourceFiles
31  multiLevel.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef multiLevel_H
36 #define multiLevel_H
37 
38 #include "decompositionMethod.H"
39 
40 namespace Foam
41 {
42 namespace decompositionMethods
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class multiLevel Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class multiLevel
50 :
51  public decompositionMethod
52 {
53  // Private Data
54 
55  dictionary methodsDict_;
56 
58 
59 
60  // Private Member Functions
61 
62  //- Given connectivity across processors work out connectivity
63  // for a (consistent) subset
64  void subsetGlobalCellCells
65  (
66  const label nDomains,
67  const label domainI,
68  const labelList& dist,
69 
70  const labelListList& cellCells,
71  const labelList& set,
72  labelListList& subCellCells,
73  labelList& cutConnections
74  ) const;
75 
76  //- Decompose level methodI without addressing
77  void decompose
78  (
79  const labelListList& pointPoints,
80  const pointField& points,
81  const scalarField& pointWeights,
82  const labelList& pointMap, // map back to original points
83  const label levelI,
84 
85  labelField& finalDecomp
86  );
87 
88 
89 public:
90 
91  //- Runtime type information
92  TypeName("multiLevel");
93 
94 
95  // Constructors
96 
97  //- Construct given the decomposition dictionary
98  multiLevel(const dictionary& decompositionDict);
99 
100  //- Disallow default bitwise copy construction
101  multiLevel(const multiLevel&) = delete;
102 
103 
104  //- Destructor
105  virtual ~multiLevel()
106  {}
107 
108 
109  // Member Functions
110 
111  //- Inherit decompose from decompositionMethod
113 
114  //- Return for every coordinate the wanted processor number. Use the
115  // mesh connectivity (if needed)
116  virtual labelList decompose
117  (
118  const polyMesh& mesh,
119  const pointField& points,
120  const scalarField& pointWeights
121  );
122 
123  //- Return for every coordinate the wanted processor number. Explicitly
124  // provided connectivity - does not use mesh_.
125  virtual labelList decompose
126  (
127  const labelListList& globalCellCells,
128  const pointField& cellCentres,
129  const scalarField& cellWeights
130  );
131 
132 
133  // Member Operators
134 
135  //- Disallow default bitwise assignment
136  void operator=(const multiLevel&) = delete;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace decompositionMethods
143 } // End namespace Foam
144 
145 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
146 
147 #endif
148 
149 // ************************************************************************* //
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
Abstract base class for decomposition.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Return for every coordinate the wanted processor number.
Decomposition given using consecutive application of decomposers.
Definition: multiLevel.H:51
void operator=(const multiLevel &)=delete
Disallow default bitwise assignment.
virtual labelList decompose(const pointField &points, const scalarField &pointWeights)
Inherit decompose from decompositionMethod.
multiLevel(const dictionary &decompositionDict)
Construct given the decomposition dictionary.
Definition: multiLevel.C:340
TypeName("multiLevel")
Runtime type information.
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
const pointField & points
Namespace for OpenFOAM.
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