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-2018 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 
57  // Private Member Functions
58 
59  //- No copy construct
60  noDecomp(const noDecomp&) = delete;
61 
62  //- No copy assignment
63  void operator=(const noDecomp&) = delete;
64 
65 
66 public:
67 
68  //- Runtime type information
69  TypeName("noDecomp");
70 
71 
72  // Constructors
73 
74  //- Construct given the decomposition dictionary
75  noDecomp(const dictionary& decompDict);
76 
77  //- Construct given the decomposition dictionary and region name
78  noDecomp
79  (
80  const dictionary& decompDict,
81  const word& regionName
82  );
83 
84 
85  //- Destructor
86  virtual ~noDecomp() = default;
87 
88 
89  // Member Functions
90 
91  //- Does not care about proc boundaries, it is all up to the user.
92  virtual bool parallelAware() const
93  {
94  return true;
95  }
96 
97  //- Return for every coordinate the wanted processor number.
98  // Use the mesh connectivity (if needed)
100  (
101  const polyMesh& mesh,
102  const pointField& cc,
103  const scalarField& cWeights
104  ) const
105  {
106  return labelList(cc.size(), Pstream::myProcNo());
107  }
108 
109  //- Return for every coordinate the wanted processor number.
110  // Explicitly provided connectivity - does not use mesh_.
111  // The connectivity is equal to mesh.cellCells() except for
112  // - in parallel the cell numbers are global cell numbers (starting
113  // from 0 at processor0 and then incrementing all through the
114  // processors)
115  // - the connections are across coupled patches
117  (
118  const labelListList& globalCellCells,
119  const pointField& cc,
120  const scalarField& cWeights
121  ) const
122  {
123  return labelList(globalCellCells.size(), Pstream::myProcNo());
124  }
125 
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace Foam
132 
133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
134 
135 #endif
136 
137 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:74
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
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:121
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, it is all up to the user.
Definition: noDecomp.H:91
Foam::UPstream::myProcNo
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
Definition: UPstream.H:444
Foam::noDecomp
A dummy decomposition method, selected as none.
Definition: noDecomp.H:51
Foam::noDecomp::TypeName
TypeName("noDecomp")
Runtime type information.
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:99