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 -------------------------------------------------------------------------------
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::decompositionConstraint
29 
30 Description
31  Abstract class for handling decomposition constraints.
32 
33 SourceFiles
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"
45 #include "runTimeSelectionTables.H"
46 
47 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 
49 namespace Foam
50 {
51 
52 // Forward declarations
53 class polyMesh;
54 
55 /*---------------------------------------------------------------------------*\
56  Class decompositionConstraint Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61 protected:
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 
86 public:
87 
88  //- Runtime type information
89  TypeName("decompositionConstraint");
90 
91 
92  // Declare run-time constructor selection table
93 
95  (
96  autoPtr,
98  dictionary,
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 // ************************************************************************* //
Foam::decompositionConstraint
Abstract class for handling decomposition constraints.
Definition: decompositionConstraint.H:58
boolList.H
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::decompositionConstraint::apply
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.
Definition: decompositionConstraint.H:156
Foam::decompositionConstraint::coeffDict_
dictionary coeffDict_
Constraint coefficients dictionary.
Definition: decompositionConstraint.H:65
Foam::decompositionConstraint::~decompositionConstraint
virtual ~decompositionConstraint()=default
Destructor.
Foam::decompositionConstraint::add
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.
Foam::decompositionConstraint::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, decompositionConstraint, dictionary,(const dictionary &dict),(dict))
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::decompositionConstraint::getMinBoundaryValue
void getMinBoundaryValue(const polyMesh &mesh, const labelList &decomposition, labelList &destProc) const
Get minimum label across coupled boundary faces.
Definition: decompositionConstraint.C:45
Foam::decompositionConstraint::New
static autoPtr< decompositionConstraint > New(const dictionary &constraintDict)
Return a reference to the selected decompositionConstraint.
Definition: decompositionConstraint.C:155
labelList.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
mesh
dynamicFvMesh & mesh
Definition: createDynamicFvMesh.H:6
Foam::decompositionConstraint::operator=
void operator=(const decompositionConstraint &)=delete
No copy assignment.
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::decompositionConstraint::decompositionConstraint
decompositionConstraint(const decompositionConstraint &)=delete
No copy construct.
runTimeSelectionTables.H
Macros to ease declaration of run-time selection tables.
Foam::List< label >
dictionary.H
Foam::decompositionConstraint::TypeName
TypeName("decompositionConstraint")
Runtime type information.
labelPair.H