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 
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
97  (
98  const dictionary& decompositionDict,
99  const dictionary& methodDict
100  );
101 
102  //- Disallow default bitwise copy construction
103  multiLevel(const multiLevel&) = delete;
104 
105 
106  //- Destructor
107  virtual ~multiLevel()
108  {}
109 
110 
111  // Member Functions
112 
113  //- Inherit decompose from decompositionMethod
115 
116  //- Return for every coordinate the wanted processor number. Use the
117  // mesh connectivity (if needed)
118  virtual labelList decompose
119  (
120  const polyMesh& mesh,
121  const pointField& points,
122  const scalarField& pointWeights
123  );
124 
125  //- Return for every coordinate the wanted processor number. Explicitly
126  // provided connectivity - does not use mesh_.
127  virtual labelList decompose
128  (
129  const labelListList& globalCellCells,
130  const pointField& cellCentres,
131  const scalarField& cellWeights
132  );
133 
134 
135  // Member Operators
136 
137  //- Disallow default bitwise assignment
138  void operator=(const multiLevel&) = delete;
139 };
140 
141 
142 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
143 
144 } // End namespace decompositionMethods
145 } // End namespace Foam
146 
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
148 
149 #endif
150 
151 // ************************************************************************* //
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, const dictionary &methodDict)
Construct given the decomposition dictionary.
Definition: multiLevel.C:250
TypeName("multiLevel")
Runtime type information.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
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