simple.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::simple
26 
27 Description
28 
29 SourceFiles
30  simple.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef simple_H
35 #define simple_H
36 
37 #include "geometric.H"
38 
39 namespace Foam
40 {
41 namespace decompositionMethods
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class simple Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 class simple
49 :
50  public geometric
51 {
52  // Private Member Functions
53 
54  void assignToProcessorGroup(labelList&, const label) const;
55 
56  void assignToProcessorGroup
57  (
58  labelList& processorGroup,
59  const label nProcGroup,
60  const labelList& indices,
61  const scalarField& weights,
62  const scalar summedWeights
63  ) const;
64 
65  labelList decomposeOneProc(const pointField& points) const;
66 
67  labelList decomposeOneProc
68  (
69  const pointField& points,
70  const scalarField& weights
71  ) const;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("simple");
78 
79 
80  // Constructors
81 
82  //- Construct given the decomposition dictionary
83  simple(const dictionary& decompositionDict);
84 
85  //- Disallow default bitwise copy construction
86  simple(const simple&) = delete;
87 
88 
89  //- Destructor
90  virtual ~simple()
91  {}
92 
93 
94  // Member Functions
95 
96  virtual labelList decompose(const pointField&);
97 
98  virtual labelList decompose(const pointField&, const scalarField&);
99 
100  virtual labelList decompose(const polyMesh&, const pointField& points)
101  {
102  return decompose(points);
103  }
104 
105  virtual labelList decompose
106  (
107  const polyMesh&,
108  const pointField& points,
109  const scalarField& pointWeights
110  )
111  {
112  return decompose(points, pointWeights);
113  }
114 
115  //- Explicitly provided connectivity
116  virtual labelList decompose
117  (
118  const labelListList& globalCellCells,
119  const pointField& cellCentres,
120  const scalarField& cellWeights
121  )
122  {
123  return decompose(cellCentres, cellWeights);
124  }
125 
126 
127  // Member Operators
128 
129  //- Disallow default bitwise assignment
130  void operator=(const simple&) = delete;
131 };
132 
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 } // End namespace decompositionMethods
137 } // End namespace Foam
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 #endif
142 
143 // ************************************************************************* //
Geometrical domain decomposition.
Definition: geometric.H:52
simple(const dictionary &decompositionDict)
Construct given the decomposition dictionary.
Definition: simple.C:311
TypeName("simple")
Runtime type information.
void operator=(const simple &)=delete
Disallow default bitwise assignment.
virtual ~simple()
Destructor.
Definition: simple.H:89
virtual labelList decompose(const pointField &)
Like decompose but with uniform weights on the points.
Definition: simple.C:320
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