random.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) 2022-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::random
26 
27 Description
28  Random decomposition. Good for testing. Very bad for anything else.
29 
30 SourceFiles
31  random.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef random_H
36 #define random_H
37 
38 #include "decompositionMethod.H"
39 
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
41 
42 namespace Foam
43 {
44 namespace decompositionMethods
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class random Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class random
52 :
53  public decompositionMethod
54 {
55  // Private Data
56 
57  //- Generator seed
58  label seed_;
59 
60 
61 public:
62 
63  //- Runtime type information
64  TypeName("random");
65 
66 
67  // Constructors
68 
69  //- Construct given the decomposition dictionary
70  random(const dictionary& decompositionDict);
71 
72  //- Disallow default bitwise copy construction
73  random(const random&) = delete;
74 
75 
76  //- Destructor
77  virtual ~random()
78  {}
79 
80 
81  // Member Functions
82 
83  //- Return for every coordinate the wanted processor number. Use the
84  // mesh connectivity.
85  virtual labelList decompose
86  (
87  const polyMesh& mesh,
88  const pointField& cellCentres,
89  const scalarField& cellWeights
90  );
91 
92  //- Return for every coordinate the wanted processor number. Explicitly
93  // provided connectivity. Does not use the mesh.
94  virtual labelList decompose
95  (
96  const labelListList& globalCellCells,
97  const pointField& cellCentres,
98  const scalarField& cellWeights
99  )
100  {
102  return labelList(0);
103  }
104 
105 
106  // Member Operators
107 
108  //- Disallow default bitwise assignment
109  void operator=(const random&) = delete;
110 };
111 
112 
113 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
114 
115 } // End namespace decompositionMethods
116 } // End namespace Foam
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 #endif
121 
122 // ************************************************************************* //
Abstract base class for decomposition.
Random decomposition. Good for testing. Very bad for anything else.
Definition: random.H:53
TypeName("random")
Runtime type information.
virtual ~random()
Destructor.
Definition: random.H:76
virtual labelList decompose(const polyMesh &mesh, const pointField &cellCentres, const scalarField &cellWeights)
Return for every coordinate the wanted processor number. Use the.
Definition: random.C:74
void operator=(const random &)=delete
Disallow default bitwise assignment.
random(const dictionary &decompositionDict)
Construct given the decomposition dictionary.
Definition: random.C:58
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
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:381
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: labelList.H:56
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