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