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-2021 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::simpleGeomDecomp
29
30Description
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
42SourceFiles
43 simpleGeomDecomp.C
44
45\*---------------------------------------------------------------------------*/
46
47#ifndef simpleGeomDecomp_H
48#define simpleGeomDecomp_H
49
50#include "geomDecomp.H"
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class simpleGeomDecomp Declaration
57\*---------------------------------------------------------------------------*/
58
59class simpleGeomDecomp
60:
61 public geomDecomp
62{
63 // Private Member Functions
64
65 static void assignToProcessorGroup
66 (
67 labelList& processorGroup,
68 const label nProcGroup
69 );
70
71 static void assignToProcessorGroup
72 (
73 labelList& processorGroup,
74 const label nProcGroup,
75 const labelList& indices,
76 const scalarField& weights,
77 const scalar summedWeights
78 );
79
80 labelList decomposeOneProc(const pointField& points) const;
81
82 labelList decomposeOneProc
83 (
84 const pointField& points,
85 const scalarField& weights
86 ) const;
87
88
89public:
90
91 //- No copy construct
92 void operator=(const simpleGeomDecomp&) = delete;
93
94 //- No copy assignment
95 simpleGeomDecomp(const simpleGeomDecomp&) = delete;
96
97 //- Runtime type information
98 TypeName("simple");
99
100
101 // Constructors
102
103 //- Construct given decomposition dictionary and optional region name
104 explicit simpleGeomDecomp
105 (
106 const dictionary& decompDict,
107 const word& regionName = ""
108 );
109
110
111 //- Destructor
112 virtual ~simpleGeomDecomp() = default;
113
114
115 // Member Functions
117 //- Simple sends all points to the master for decomposition.
118 virtual bool parallelAware() const
120 return true;
121 }
123 //- Decompose with uniform weights.
124 virtual labelList decompose(const pointField& points) const;
125
126 //- Return for every coordinate the wanted processor number.
127 virtual labelList decompose
128 (
129 const pointField& points,
130 const scalarField& weights
131 ) const;
132
133 //- Decompose with uniform weights.
134 virtual labelList decompose
135 (
137 const pointField& points
138 ) const
139 {
141 return decompose(points);
143
144 //- Return for every coordinate the wanted processor number.
145 virtual labelList decompose
146 (
147 const polyMesh& mesh,
148 const pointField& points,
149 const scalarField& weights
150 ) const
151 {
153 return decompose(points, weights);
154 }
155
156 //- Explicitly provided connectivity
157 virtual labelList decompose
159 const labelListList& globalCellCells, // unused
160 const pointField& cc,
161 const scalarField& cWeights
162 ) const
163 {
164 return decompose(cc, cWeights);
165 }
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Base for geometrical domain decomposition methods.
Definition: geomDecomp.H:89
void checkDecompositionDirections(const Vector< label > &) const
Check that mesh directions are compatible with decomposition.
Definition: geomDecomp.C:131
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
const Vector< label > & geometricD() const
Return the vector of geometric directions in mesh.
Definition: polyMesh.C:872
Simple geometric decomposition, selectable as simple.
simpleGeomDecomp(const simpleGeomDecomp &)=delete
No copy assignment.
virtual bool parallelAware() const
Simple sends all points to the master for decomposition.
virtual labelList decompose(const pointField &points) const
Decompose with uniform weights.
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &weights) const
Return for every coordinate the wanted processor number.
virtual ~simpleGeomDecomp()=default
Destructor.
void operator=(const simpleGeomDecomp &)=delete
No copy construct.
virtual labelList decompose(const polyMesh &mesh, const pointField &points) const
Decompose with uniform weights.
TypeName("simple")
Runtime type information.
virtual labelList decompose(const labelListList &globalCellCells, const pointField &cc, const scalarField &cWeights) const
Explicitly provided connectivity.
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Foam::word regionName(Foam::polyMesh::defaultRegion)
const pointField & points
Namespace for OpenFOAM.
List< label > labelList
A List of labels.
Definition: List.H:66
vectorField pointField
pointField is a vectorField.
Definition: pointFieldFwd.H:44
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73