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