noDecomp.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) 2012-2015 OpenFOAM Foundation
9  Copyright (C) 2017-2021 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::noDecomp
29 
30 Description
31  A dummy decomposition method, selected as \c none.
32 
33  Method coefficients: \a none
34 
35 SourceFiles
36  noDecomp.C
37 
38 \*---------------------------------------------------------------------------*/
39 
40 #ifndef noDecomp_H
41 #define noDecomp_H
42 
43 #include "decompositionMethod.H"
44 
45 namespace Foam
46 {
47 
48 /*---------------------------------------------------------------------------*\
49  Class noDecomp Declaration
50 \*---------------------------------------------------------------------------*/
51 
52 class noDecomp
53 :
54  public decompositionMethod
55 {
56  // Private Member Functions
57 
58  //- No copy construct
59  noDecomp(const noDecomp&) = delete;
60 
61  //- No copy assignment
62  void operator=(const noDecomp&) = delete;
63 
64 
65 public:
66 
67  //- Runtime type information
68  TypeNameNoDebug("none");
69 
70 
71  // Constructors
72 
73  //- Construct given decomposition dictionary and optional region name
74  explicit noDecomp
75  (
76  const dictionary& decompDict,
77  const word& regionName = ""
78  );
79 
80 
81  //- Destructor
82  virtual ~noDecomp() = default;
83 
84 
85  // Member Functions
86 
87  //- Does not care about proc boundaries
88  virtual bool parallelAware() const
89  {
90  return true;
91  }
92 
93  //- Return for every coordinate the wanted processor number.
94  // Use the mesh connectivity (if needed)
96  (
97  const polyMesh& mesh,
98  const pointField& cc,
99  const scalarField& cWeights
100  ) const
101  {
102  return labelList(cc.size(), Pstream::myProcNo());
103  }
104 
105  //- Return for every coordinate the wanted processor number.
106  // Explicitly provided connectivity - does not use mesh_.
107  // The connectivity is equal to mesh.cellCells() except for
108  // - in parallel the cell numbers are global cell numbers (starting
109  // from 0 at processor0 and then incrementing all through the
110  // processors)
111  // - the connections are across coupled patches
113  (
114  const labelListList& globalCellCells,
115  const pointField& cc,
116  const scalarField& cWeights
117  ) const
118  {
119  return labelList(globalCellCells.size(), Pstream::myProcNo());
120  }
121 };
122 
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 } // End namespace Foam
127 
128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 
130 #endif
131 
132 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::noDecomp::TypeNameNoDebug
TypeNameNoDebug("none")
Runtime type information.
decompositionMethod.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
regionName
Foam::word regionName
Definition: createNamedDynamicFvMesh.H:1
Foam::Field< vector >
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::decompositionMethod
Abstract base class for domain decomposition.
Definition: decompositionMethod.H:51
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::noDecomp::~noDecomp
virtual ~noDecomp()=default
Destructor.
Foam::noDecomp::parallelAware
virtual bool parallelAware() const
Does not care about proc boundaries.
Definition: noDecomp.H:87
Foam::noDecomp
A dummy decomposition method, selected as none.
Definition: noDecomp.H:51
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:463
Foam::List< label >
Foam::noDecomp::decompose
virtual labelList decompose(const polyMesh &mesh, const pointField &cc, const scalarField &cWeights) const
Return for every coordinate the wanted processor number.
Definition: noDecomp.H:95