Loading...
Searching...
No Matches
geomDecomp.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::geomDecomp
29
30Description
31 Base for geometrical domain decomposition methods
32
33 Base coefficients:
34 \table
35 Property | Description | Required | Default
36 n | (nx ny nz) | yes |
37 order | order of operation | no | xyz
38 delta | delta (jitter) for rotation matrix | no | 0.001
39 rotation | coordinate rotation | no |
40 \endtable
41
42SourceFiles
43 geomDecomp.C
44
45\*---------------------------------------------------------------------------*/
46
47#ifndef Foam_geomDecomp_H
48#define Foam_geomDecomp_H
49
50#include "decompositionMethod.H"
51#include "cartesianCS.H"
52#include "Vector.H"
53#include "tmp.H"
54
55namespace Foam
56{
57
58/*---------------------------------------------------------------------------*\
59 Class geomDecomp Declaration
60\*---------------------------------------------------------------------------*/
61
62class geomDecomp
63:
65{
66 // Private Data
67
68 //- Small delta (default: 0.001) to avoid staggering when
69 //- mesh itself is aligned with x/y/z
70 scalar delta_;
71
72 //- Local coordinates, or delta rotation tensor
73 coordSystem::cartesian csys_;
74
75
76 // Private Member Functions
77
78 //- Convert ordering string ("xyz") into list of components.
79 // Checks for bad entries, but no check for duplicate entries.
80 void setOrder();
81
82 //- Read input values and initialize rotation matrix
83 void readCoeffs();
84
85
86protected:
87
88 // Protected Data
89
90 //- The divisions
92
93 //- Decomposition order in terms of components (optional)
95
96 //- Coefficients for all derived methods
98
99
100 // Protected Member Functions
101
102 //- Apply delta (jitter) or rotation to coordinates
104
105 //- Check that mesh directions are compatible with decomposition
107
108public:
109
110 // Constructors
111
112 //- Construct with number of x/y/z division
113 //- (no coefficients or constraints)
114 explicit geomDecomp(const Vector<label>& divisions);
115
116 //- Construct for derived type name and decomposition dictionary
118 (
119 const word& derivedType,
120 const dictionary& decompDict,
121 int select = selectionType::DEFAULT
122 );
123
124 //- Construct for derived type name, decomposition dictionary
125 //- and region name
128 const word& derivedType,
129 const dictionary& decompDict,
130 const word& regionName,
131 int select = selectionType::DEFAULT
132 );
133
134
135 // Member Functions
136
137 //- Purely geometric methods
138 virtual bool geometric() const { return true; }
139
140 //- Return for every coordinate the wanted processor number.
141 virtual labelList decompose
142 (
143 const pointField& points,
144 const scalarField& pointWeights = scalarField::null()
145 ) const = 0;
146};
147
148
149// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
150
151} // End namespace Foam
152
153// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
154
155#endif
156
157// ************************************************************************* //
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 Cartesian coordinate system.
Definition cartesianCS.H:68
Abstract base class for domain decomposition.
decompositionMethod(const label numDomains)
Construct with specified number of domains, no coefficients or constraints.
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
const dictionary & coeffsDict_
Coefficients for all derived methods.
Definition geomDecomp.H:132
virtual bool geometric() const
Purely geometric methods.
Definition geomDecomp.H:185
Vector< direction > order_
Decomposition order in terms of components (optional).
Definition geomDecomp.H:127
tmp< pointField > adjustPoints(const pointField &) const
Apply delta (jitter) or rotation to coordinates.
Definition geomDecomp.C:115
Vector< label > n_
The divisions.
Definition geomDecomp.H:122
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
virtual labelList decompose(const pointField &points, const scalarField &pointWeights=scalarField::null()) const =0
Return for every coordinate the wanted processor number.
A class for managing temporary objects.
Definition tmp.H:75
A class for handling words, derived from Foam::string.
Definition word.H:66
Foam::word regionName(args.getOrDefault< word >("region", Foam::polyMesh::defaultRegion))
const pointField & points
Namespace for OpenFOAM.
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.