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-2023 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 Foam_manualDecomp_H
45 #define Foam_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 public:
65 
66  // Generated Methods
67 
68  //- No copy construct
69  manualDecomp(const manualDecomp&) = delete;
70 
71  //- No copy assignment
72  void operator=(const manualDecomp&) = delete;
73 
74 
75  //- Runtime type information
76  TypeName("manual");
77 
78 
79  // Constructors
80 
81  //- Construct given decomposition dictionary and optional region name
82  explicit manualDecomp
83  (
84  const dictionary& decompDict,
85  const word& regionName = ""
86  );
87 
88 
89  //- Destructor
90  virtual ~manualDecomp() = default;
91 
92 
93  // Member Functions
94 
95  //- Manual decompose does not care about proc boundaries.
96  //- Is all up to the user.
97  virtual bool parallelAware() const
98  {
99  return true;
100  }
101 
102  //- Return for every coordinate the wanted processor number.
103  // Use the mesh connectivity (if needed)
104  virtual labelList decompose
105  (
106  const polyMesh& mesh,
107  const pointField& cc,
108  const scalarField& cWeights = scalarField::null()
109  ) const;
110 
111  //- Return for every coordinate the wanted processor number.
112  // Explicitly provided connectivity - does not use mesh_.
113  virtual labelList decompose
114  (
115  const CompactListList<label>& globalCellCells,
116  const pointField& cc,
117  const scalarField& cWeights = scalarField::null()
118  ) const
119  {
121  return labelList();
122  }
123 
124  //- Return for every coordinate the wanted processor number.
125  // Explicitly provided connectivity - does not use mesh_.
126  virtual labelList decompose
127  (
128  const labelListList& globalCellCells,
129  const pointField& cc,
130  const scalarField& cWeights = scalarField::null()
131  ) const
132  {
134  return labelList();
135  }
136 };
138 
139 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
140 
141 } // End namespace Foam
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 #endif
146 
147 // ************************************************************************* //
A class for handling file names.
Definition: fileName.H:72
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
virtual labelList decompose(const polyMesh &mesh, const pointField &cc, const scalarField &cWeights=scalarField::null()) const
Return for every coordinate the wanted processor number.
Definition: manualDecomp.C:59
manualDecomp(const manualDecomp &)=delete
No copy construct.
dynamicFvMesh & mesh
A class for handling words, derived from Foam::string.
Definition: word.H:63
virtual ~manualDecomp()=default
Destructor.
TypeName("manual")
Runtime type information.
virtual bool parallelAware() const
Manual decompose does not care about proc boundaries. Is all up to the user.
Definition: manualDecomp.H:114
A packed storage of objects of type <T> using an offset table for access.
void operator=(const manualDecomp &)=delete
No copy assignment.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
static const Field< scalar > & null()
Return nullObject reference Field.
Definition: FieldI.H:24
Decompose based on cell-to-processor association in a file.
Definition: manualDecomp.H:61
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< label > labelList
A List of labels.
Definition: List.H:62
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
Definition: error.H:686
Namespace for OpenFOAM.