none.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) 2012-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::none
26 
27 Description
28  Dummy decomposition method
29 
30 SourceFiles
31  none.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef none_H
36 #define none_H
37 
38 #include "decompositionMethod.H"
39 
40 namespace Foam
41 {
42 namespace decompositionMethods
43 {
44 
45 /*---------------------------------------------------------------------------*\
46  Class none Declaration
47 \*---------------------------------------------------------------------------*/
48 
49 class none
50 :
51  public decompositionMethod
52 {
53 public:
54 
55  //- Runtime type information
56  TypeName("none");
57 
58 
59  // Constructors
60 
61  //- Construct given the decomposition dictionary
62  none
63  (
64  const dictionary& decompositionDict,
65  const dictionary& methodDict
66  );
67 
68  //- Disallow default bitwise copy construction
69  none(const none&) = delete;
70 
71 
72  //- Destructor
73  virtual ~none()
74  {}
75 
76 
77  // Member Functions
78 
79  //- Return for every coordinate the wanted processor number. Use the
80  // mesh connectivity (if needed)
81  virtual labelList decompose
82  (
83  const polyMesh& mesh,
84  const pointField& cellCentres,
85  const scalarField& cellWeights
86  )
87  {
88  return labelList(cellCentres.size(), Pstream::myProcNo());
89  }
90 
91  //- Return for every coordinate the wanted processor number. Explicitly
92  // provided connectivity - does not use mesh_.
93  // The connectivity is equal to mesh.cellCells() except for
94  // - in parallel the cell numbers are global cell numbers (starting
95  // from 0 at processor0 and then incrementing all through the
96  // processors)
97  // - the connections are across coupled patches
98  virtual labelList decompose
99  (
100  const labelListList& globalCellCells,
101  const pointField& cellCentres,
102  const scalarField& cellWeights
103  )
104  {
105  return labelList(globalCellCells.size(), Pstream::myProcNo());
106  }
107 
108 
109  // Member Operators
110 
111  //- Disallow default bitwise assignment
112  void operator=(const none&) = delete;
113 };
114 
115 
116 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 
118 } // End namespace decompositionMethods
119 } // End namespace Foam
120 
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
122 
123 #endif
124 
125 // ************************************************************************* //
void size(const label)
Override size to be inconsistent with allocated storage.
Definition: ListI.H:164
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:429
Abstract base class for decomposition.
Dummy decomposition method.
Definition: none.H:51
TypeName("none")
Runtime type information.
virtual ~none()
Destructor.
Definition: none.H:72
none(const dictionary &decompositionDict, const dictionary &methodDict)
Construct given the decomposition dictionary.
Definition: none.C:45
void operator=(const none &)=delete
Disallow default bitwise assignment.
virtual labelList decompose(const polyMesh &mesh, const pointField &cellCentres, const scalarField &cellWeights)
Return for every coordinate the wanted processor number. Use the.
Definition: none.H:81
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)
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: labelList.H:56