manualDecomp.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) 2011-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::manualDecomp
29 
30 Description
31  Decompose based on cell-to-processor association in a file
32 
33  Method coefficients:
34  \table
35  Property | Description | Required | Default
36  dataFile | filename of cell decomposition data | yes |
37  \endtable
38 
39 SourceFiles
40  manualDecomp.C
41 
42 \*---------------------------------------------------------------------------*/
43 
44 #ifndef manualDecomp_H
45 #define manualDecomp_H
46 
47 #include "decompositionMethod.H"
48 
49 namespace Foam
50 {
51 
52 /*---------------------------------------------------------------------------*\
53  Class manualDecomp Declaration
54 \*---------------------------------------------------------------------------*/
55 
56 class manualDecomp
57 :
58  public decompositionMethod
59 {
60  // Private data
61 
62  fileName dataFile_;
63 
64 
65  // Private Member Functions
66 
67  //- No copy construct
68  manualDecomp(const manualDecomp&) = delete;
69 
70  //- No copy assignment
71  void operator=(const manualDecomp&) = delete;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("manual");
78 
79 
80  // Constructors
81 
82  //- Construct given the decomposition dictionary
83  manualDecomp(const dictionary& decompDict);
84 
85  //- Construct given the decomposition dictionary and region name
87  (
88  const dictionary& decompDict,
89  const word& regionName
90  );
91 
92 
93  //- Destructor
94  virtual ~manualDecomp() = default;
95 
96 
97  // Member Functions
98 
99  //- Manual decompose does not care about proc boundaries.
100  //- Is all up to the user.
101  virtual bool parallelAware() const
102  {
103  return true;
104  }
105 
106  //- Return for every coordinate the wanted processor number.
107  // Use the mesh connectivity (if needed)
108  virtual labelList decompose
109  (
110  const polyMesh& mesh,
111  const pointField& cc,
112  const scalarField& cWeights
113  ) const;
114 
115  //- Return for every coordinate the wanted processor number.
116  // Explicitly provided connectivity - does not use mesh_.
117  virtual labelList decompose
118  (
119  const labelListList& globalCellCells,
120  const pointField& cc,
121  const scalarField& cWeights
122  ) const
123  {
125  return labelList();
126  }
127 
128 };
129 
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 } // End namespace Foam
134 
135 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
136 
137 #endif
138 
139 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:74
Foam::manualDecomp::parallelAware
virtual bool parallelAware() const
Definition: manualDecomp.H:110
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::manualDecomp::TypeName
TypeName("manual")
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
NotImplemented
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:419
Foam::Field< vector >
Foam::manualDecomp
Decompose based on cell-to-processor association in a file.
Definition: manualDecomp.H:65
Foam::manualDecomp::decompose
virtual labelList decompose(const polyMesh &mesh, const pointField &cc, const scalarField &cWeights) const
Return for every coordinate the wanted processor number.
Definition: manualDecomp.C:84
Foam::manualDecomp::~manualDecomp
virtual ~manualDecomp()=default
Destructor.
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::List< label >