decompositionConstraint.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) 2015-2016 OpenFOAM Foundation
9 Copyright (C) 2018 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::decompositionConstraint
29
30Description
31 Abstract class for handling decomposition constraints.
32
33SourceFiles
34 decompositionConstraint.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef decompositionConstraint_H
39#define decompositionConstraint_H
40
41#include "dictionary.H"
42#include "boolList.H"
43#include "labelList.H"
44#include "labelPair.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward declarations
53class polyMesh;
54
55/*---------------------------------------------------------------------------*\
56 Class decompositionConstraint Declaration
57\*---------------------------------------------------------------------------*/
60{
61protected:
62
63 // Protected data
64
65 //- Constraint coefficients dictionary
67
68
69 // Protected Member Functions
70
71 //- Get minimum label across coupled boundary faces
73 (
74 const polyMesh& mesh,
75 const labelList& decomposition,
76 labelList& destProc
77 ) const;
78
79
80 //- No copy construct
82
83 //- No copy assignment
84 void operator=(const decompositionConstraint&) = delete;
85
86public:
87
88 //- Runtime type information
89 TypeName("decompositionConstraint");
90
91
92 // Declare run-time constructor selection table
95 (
96 autoPtr,
99 (
100 const dictionary& dict
101 ),
102 (dict)
103 );
104
105
106 // Constructors
107
108 //- Construct with constraint dictionary
109 explicit decompositionConstraint(const dictionary& constraintDict);
110
111 //- Construct with constraint dictionary and model type.
112 // The model type could be used for defining a coefficients
113 // sub-dictionary.
115 (
116 const dictionary& constraintDict,
117 const word& modelType
118 );
119
120
121 // Selectors
122
123 //- Return a reference to the selected decompositionConstraint
125 (
126 const dictionary& constraintDict
127 );
128
129 //- Return a reference to the selected decompositionConstraint
131 (
132 const dictionary& constraintDict,
133 const word& modelType
134 );
135
136
137 //- Destructor
138 virtual ~decompositionConstraint() = default;
139
140
141 // Member Functions
142
143 //- Add this constraint to list of constraints
144 virtual void add
145 (
146 const polyMesh& mesh,
147 boolList& blockedFace,
148 PtrList<labelList>& specifiedProcessorFaces,
149 labelList& specifiedProcessor,
150 List<labelPair>& explicitConnections
151 ) const = 0;
152
153 //- Apply any additional post-decomposition constraints.
154 // Usually no need to do anything since decomposition method
155 // should have already obeyed the constraints
156 virtual void apply
157 (
158 const polyMesh& mesh,
159 const boolList& blockedFace,
160 const PtrList<labelList>& specifiedProcessorFaces,
161 const labelList& specifiedProcessor,
162 const List<labelPair>& explicitConnections,
163 labelList& decomposition
164 ) const
165 {}
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#endif
176
177// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract class for handling decomposition constraints.
dictionary coeffDict_
Constraint coefficients dictionary.
void getMinBoundaryValue(const polyMesh &mesh, const labelList &decomposition, labelList &destProc) const
Get minimum label across coupled boundary faces.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const =0
Add this constraint to list of constraints.
decompositionConstraint(const decompositionConstraint &)=delete
No copy construct.
TypeName("decompositionConstraint")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, decompositionConstraint, dictionary,(const dictionary &dict),(dict))
static autoPtr< decompositionConstraint > New(const dictionary &constraintDict)
Return a reference to the selected decompositionConstraint.
virtual void apply(const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &decomposition) const
Apply any additional post-decomposition constraints.
void operator=(const decompositionConstraint &)=delete
No copy assignment.
virtual ~decompositionConstraint()=default
Destructor.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
A class for handling words, derived from Foam::string.
Definition: word.H:68
dynamicFvMesh & mesh
Namespace for OpenFOAM.
Macros to ease declaration of run-time selection tables.
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes)
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73