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-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::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 decomposition dictionary and optional region name
83  explicit manualDecomp
84  (
85  const dictionary& decompDict,
86  const word& regionName = ""
87  );
88 
89 
90  //- Destructor
91  virtual ~manualDecomp() = default;
92 
93 
94  // Member Functions
95 
96  //- Manual decompose does not care about proc boundaries.
97  //- Is all up to the user.
98  virtual bool parallelAware() const
99  {
100  return true;
101  }
102 
103  //- Return for every coordinate the wanted processor number.
104  // Use the mesh connectivity (if needed)
105  virtual labelList decompose
106  (
107  const polyMesh& mesh,
108  const pointField& cc,
109  const scalarField& cWeights
110  ) const;
111 
112  //- Return for every coordinate the wanted processor number.
113  // Explicitly provided connectivity - does not use mesh_.
114  virtual labelList decompose
115  (
116  const labelListList& globalCellCells,
117  const pointField& cc,
118  const scalarField& cWeights
119  ) const
120  {
122  return labelList();
123  }
124 };
125 
126 
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128 
129 } // End namespace Foam
130 
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
132 
133 #endif
134 
135 // ************************************************************************* //
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::manualDecomp::parallelAware
virtual bool parallelAware() const
Definition: manualDecomp.H:107
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
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:517
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:66
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: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::List< label >