structuredDecomp.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-2012 OpenFOAM Foundation
9  Copyright (C) 2018-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::structuredDecomp
29 
30 Description
31  Walk out decomposition of patch cells mesh - selectable as \c structured.
32 
33 SourceFiles
34  structuredDecomp.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef Foam_structuredDecomp_H
39 #define Foam_structuredDecomp_H
40 
41 #include "decompositionMethod.H"
42 #include "wordRes.H"
43 
44 namespace Foam
45 {
46 
47 /*---------------------------------------------------------------------------*\
48  Class structuredDecomp Declaration
49 \*---------------------------------------------------------------------------*/
50 
51 class structuredDecomp
52 :
53  public decompositionMethod
54 {
55  // Private Data
56 
57  dictionary methodDict_;
58 
59  wordRes patches_;
60 
62 
63 
64 public:
65 
66  // Generated Methods
67 
68  //- No copy construct
69  structuredDecomp(const structuredDecomp&) = delete;
70 
71  //- No copy assignment
72  void operator=(const structuredDecomp&) = delete;
73 
74 
75  //- Runtime type information
76  TypeName("structured");
77 
78 
79  // Constructors
80 
81  //- Construct given decomposition dictionary. Region ignored
82  explicit structuredDecomp
83  (
84  const dictionary& decompDict,
85  const word& regionName = ""
86  );
87 
88 
89  //- Destructor
90  virtual ~structuredDecomp() = default;
91 
92 
93  // Member Functions
94 
95  //- Is method parallel aware
96  // (i.e. does it synchronize domains across proc boundaries)
97  virtual bool parallelAware() const;
98 
99  //- Return for every coordinate the wanted processor number.
100  // Use the mesh connectivity (if needed)
101  virtual labelList decompose
102  (
103  const polyMesh& mesh,
104  const pointField& points,
105  const scalarField& pointWeights = scalarField::null()
106  ) const;
107 
108  //- Return for every coordinate the wanted processor number.
109  // Explicitly provided connectivity - does not use mesh_.
110  virtual labelList decompose
111  (
112  const CompactListList<label>& globalCellCells,
113  const pointField& cc,
114  const scalarField& cWeights = scalarField::null()
115  ) const
116  {
118  return labelList();
119  }
120 
121  //- Return for every coordinate the wanted processor number.
122  // Explicitly provided connectivity - does not use mesh_.
123  virtual labelList decompose
124  (
125  const labelListList& globalCellCells,
126  const pointField& cc,
127  const scalarField& cWeights = scalarField::null()
128  ) const
129  {
131  return labelList();
132  }
133 };
134 
135 
136 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
137 
138 } // End namespace Foam
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
142 #endif
143 
144 // ************************************************************************* //
void operator=(const structuredDecomp &)=delete
No copy assignment.
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &pointWeights=scalarField::null()) const
Return for every coordinate the wanted processor number.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("structured")
Runtime type information.
structuredDecomp(const structuredDecomp &)=delete
No copy construct.
dynamicFvMesh & mesh
const pointField & points
A class for handling words, derived from Foam::string.
Definition: word.H:63
Walk out decomposition of patch cells mesh - selectable as structured.
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:53
Abstract base class for domain decomposition.
A packed storage of objects of type <T> using an offset table for access.
virtual bool parallelAware() const
Is method parallel aware.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
static const Field< scalar > & null()
Return nullObject reference Field.
Definition: FieldI.H:24
virtual ~structuredDecomp()=default
Destructor.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
Definition: HashPtrTable.H:48
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.