multiLevelDecomp.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 Copyright (C) 2017-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::multiLevelDecomp
29
30Description
31 Decompose given using consecutive application of decomposers.
32
33SourceFiles
34 multiLevelDecomp.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef multiLevelDecomp_H
39#define multiLevelDecomp_H
40
41#include "decompositionMethod.H"
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class multiLevelDecomp Declaration
48\*---------------------------------------------------------------------------*/
51:
53{
54 // Private Data
55
56 //- Original coefficients for this method
57 const dictionary& coeffsDict_;
58
59 //- Rewritten dictionary of individual methods
60 dictionary methodsDict_;
61
63
64
65 // Private Member Functions
66
67 //- Fill the methodsDict_
68 void createMethodsDict();
69
70 //- Set methods based on the contents of the methodsDict_
71 void setMethods();
72
73
74 //- Given connectivity across processors work out connectivity
75 // for a (consistent) subset
76 void subsetGlobalCellCells
77 (
78 const label nDomains,
79 const label domainI,
80 const labelList& dist,
81
82 const labelListList& cellCells,
83 const labelList& set,
84 labelListList& subCellCells,
85 labelList& cutConnections
86 ) const;
87
88 //- Decompose at 'currLevel' without addressing
89 void decompose
90 (
91 const labelListList& pointPoints,
92 const pointField& points,
93 const scalarField& pointWeights,
94 const labelUList& pointMap, // map back to original points
95 const label currLevel,
96 const label leafOffset,
97
98 labelList& finalDecomp
99 ) const;
100
101
102 //- No copy construct
103 multiLevelDecomp(const multiLevelDecomp&) = delete;
104
105 //- No copy assignment
106 void operator=(const multiLevelDecomp&) = delete;
107
108
109public:
110
111 //- Runtime type information
112 TypeName("multiLevel");
113
114
115 // Constructors
116
117 //- Construct given decomposition dictionary and optional region name
118 explicit multiLevelDecomp
119 (
120 const dictionary& decompDict,
121 const word& regionName = ""
122 );
123
124
125 //- Destructor
126 virtual ~multiLevelDecomp() = default;
127
128
129 // Member Functions
130
131 //- Is method parallel aware?
132 // i.e. does it synchronize domains across proc boundaries
133 virtual bool parallelAware() const;
134
135 //- Inherit decompose from decompositionMethod
137
138 //- Return for every coordinate the wanted processor number.
139 // Use the mesh connectivity (if needed)
140 virtual labelList decompose
141 (
142 const polyMesh& mesh,
143 const pointField& points,
144 const scalarField& pointWeights
145 ) const;
146
147 //- Return for every coordinate the wanted processor number.
148 // Explicitly provided connectivity - does not use mesh_.
149 virtual labelList decompose
150 (
151 const labelListList& globalCellCells,
152 const pointField& cc,
153 const scalarField& cWeights
154 ) const;
155};
156
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160} // End namespace Foam
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164#endif
165
166// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Abstract base class for domain decomposition.
label nDomains() const noexcept
Number of domains.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Decompose given using consecutive application of decomposers.
virtual bool parallelAware() const
Is method parallel aware?
virtual ~multiLevelDecomp()=default
Destructor.
TypeName("multiLevel")
Runtime type information.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
bool decompose() const noexcept
Query the decompose flag (normally off)
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Foam::word regionName(Foam::polyMesh::defaultRegion)
const pointField & points
Namespace for OpenFOAM.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73