simpleGeomDecomp.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 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::simpleGeomDecomp
29 
30 Description
31  Simple geometric decomposition, selectable as \c simple
32 
33  Method coefficients:
34  \table
35  Property | Description | Required | Default
36  n | (nx ny nz) | yes |
37  order | order of operation (unused) | no | xyz
38  delta | delta (jitter) for rotation matrix | no | 0.001
39  transform | cartesian coordinate transformation | no |
40  \endtable
41 
42 SourceFiles
43  simpleGeomDecomp.C
44 
45 \*---------------------------------------------------------------------------*/
46 
47 #ifndef Foam_simpleGeomDecomp_H
48 #define Foam_simpleGeomDecomp_H
49 
50 #include "geomDecomp.H"
51 
52 namespace Foam
53 {
54 
55 /*---------------------------------------------------------------------------*\
56  Class simpleGeomDecomp Declaration
57 \*---------------------------------------------------------------------------*/
58 
59 class simpleGeomDecomp
60 :
61  public geomDecomp
62 {
63  // Private Member Functions
64 
65  labelList decomposeOneProc(const pointField& points) const;
66 
67  labelList decomposeOneProc
68  (
69  const pointField& points,
70  const scalarField& weights
71  ) const;
72 
73 
74 public:
75 
76  // Generated Methods
77 
78  //- No copy construct
80 
81  //- No copy assignment
82  void operator=(const simpleGeomDecomp&) = delete;
83 
84 
85  //- Runtime type information
86  TypeName("simple");
87 
88 
89  // Constructors
90 
91  //- Construct with number of x/y/z division
92  //- (no coefficients or constraints)
93  explicit simpleGeomDecomp(const Vector<label>& divisions);
94 
95  //- Construct given decomposition dictionary and optional region name
96  explicit simpleGeomDecomp
97  (
98  const dictionary& decompDict,
99  const word& regionName = ""
100  );
101 
102 
103  //- Destructor
104  virtual ~simpleGeomDecomp() = default;
105 
106 
107  // Member Functions
108 
109  //- Sends all points to the master for decomposition.
110  virtual bool parallelAware() const
111  {
112  return true;
113  }
114 
115  //- Return for every coordinate the wanted processor number.
116  //- using uniform or specified point weights.
117  virtual labelList decompose
118  (
119  const pointField& points,
120  const scalarField& weights = scalarField::null()
121  ) const;
122 
123  //- Decompose with uniform or specified point weights.
124  virtual labelList decompose
125  (
126  const polyMesh& mesh,
127  const pointField& points,
128  const scalarField& pointWeights = scalarField::null()
129  ) const
130  {
131  checkDecompositionDirections(mesh.geometricD());
132  return decompose(points, pointWeights);
133  }
134 
135  //- Explicitly provided connectivity
136  virtual labelList decompose
137  (
138  const CompactListList<label>& globalCellCells,
139  const pointField& cc,
140  const scalarField& cWeights = scalarField::null()
141  ) const
142  {
143  return decompose(cc, cWeights);
144  }
145 
146  //- Explicitly provided connectivity
147  virtual labelList decompose
148  (
149  const labelListList& globalCellCells,
150  const pointField& cc,
151  const scalarField& cWeights = scalarField::null()
152  ) const
153  {
154  return decompose(cc, cWeights);
155  }
156 };
157 
158 
159 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 
161 } // End namespace Foam
162 
163 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164 
165 #endif
166 
167 // ************************************************************************* //
simpleGeomDecomp(const simpleGeomDecomp &)=delete
No copy construct.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
Definition: dictionary.H:129
TypeName("simple")
Runtime type information.
virtual labelList decompose(const pointField &points, const scalarField &weights=scalarField::null()) const
Return for every coordinate the wanted processor number. using uniform or specified point weights...
virtual ~simpleGeomDecomp()=default
Destructor.
void checkDecompositionDirections(const Vector< label > &) const
Check that mesh directions are compatible with decomposition.
Definition: geomDecomp.C:124
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:38
dynamicFvMesh & mesh
const pointField & points
virtual bool parallelAware() const
Sends all points to the master for decomposition.
A class for handling words, derived from Foam::string.
Definition: word.H:63
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void operator=(const simpleGeomDecomp &)=delete
No copy assignment.
Simple geometric decomposition, selectable as simple.
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
static const Field< scalar > & null()
Return nullObject reference Field.
Definition: FieldI.H:24
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:74
List< label > labelList
A List of labels.
Definition: List.H:62
Namespace for OpenFOAM.