Loading...
Searching...
No Matches
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-------------------------------------------------------------------------------
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 Foam_simpleGeomDecomp_H
48#define Foam_simpleGeomDecomp_H
49
50#include "geomDecomp.H"
51
52namespace Foam
53{
54
55/*---------------------------------------------------------------------------*\
56 Class simpleGeomDecomp Declaration
57\*---------------------------------------------------------------------------*/
58
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
74public:
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 );
102
103 //- Destructor
104 virtual ~simpleGeomDecomp() = default;
105
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 {
132 return decompose(points, pointWeights);
133 }
134
135 //- Explicitly provided connectivity
137 (
138 const CompactListList<label>& globalCellCells,
139 const pointField& cc,
140 const scalarField& cWeights = scalarField::null()
141 ) const
142 {
143 return decompose(cc, cWeights);
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
163// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
164
165#endif
166
167// ************************************************************************* //
A packed storage of objects of type <T> using an offset table for access.
static const Field< scalar > & null() noexcept
Definition Field.H:192
Templated 3D Vector derived from VectorSpace adding construction from 3 components,...
Definition Vector.H:61
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Base for geometrical domain decomposition methods.
Definition geomDecomp.H:85
geomDecomp(const Vector< label > &divisions)
Construct with number of x/y/z division (no coefficients or constraints).
Definition geomDecomp.C:145
void checkDecompositionDirections(const Vector< label > &) const
Check that mesh directions are compatible with decomposition.
Definition geomDecomp.C:124
Mesh consisting of general polyhedral cells.
Definition polyMesh.H:79
Simple geometric decomposition, selectable as simple.
simpleGeomDecomp(const simpleGeomDecomp &)=delete
No copy construct.
virtual bool parallelAware() const
Sends all points to the master for decomposition.
virtual ~simpleGeomDecomp()=default
Destructor.
void operator=(const simpleGeomDecomp &)=delete
No copy assignment.
virtual labelList decompose(const labelListList &globalCellCells, const pointField &cc, const scalarField &cWeights=scalarField::null()) const
Explicitly provided connectivity.
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 labelList decompose(const CompactListList< label > &globalCellCells, const pointField &cc, const scalarField &cWeights=scalarField::null()) const
Explicitly provided connectivity.
virtual labelList decompose(const polyMesh &mesh, const pointField &points, const scalarField &pointWeights=scalarField::null()) const
Decompose with uniform or specified point weights.
A class for handling words, derived from Foam::string.
Definition word.H:66
dynamicFvMesh & mesh
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
const pointField & points
Namespace for OpenFOAM.
List< labelList > labelListList
List of labelList.
Definition labelList.H:38
List< label > labelList
A List of labels.
Definition List.H:62
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
vectorField pointField
pointField is a vectorField.
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68