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  //- No copy construct
73 
74  //- No copy assignment
75  void operator=(const decompositionConstraint&) = delete;
76 
77 public:
78 
79  //- Runtime type information
80  TypeName("decompositionConstraint");
81 
82 
83  // Declare run-time constructor selection table
84 
86  (
87  autoPtr,
89  dictionary,
90  (
91  const dictionary& dict
92  ),
93  (dict)
94  );
95 
96 
97  // Constructors
98 
99  //- Construct with constraint dictionary
100  explicit decompositionConstraint(const dictionary& constraintDict);
101 
102  //- Construct with constraint dictionary and model type.
103  // The model type could be used for defining a coefficients
104  // sub-dictionary.
106  (
107  const dictionary& constraintDict,
108  const word& modelType
109  );
110 
111 
112  // Selectors
113 
114  //- Return a reference to the selected decompositionConstraint
116  (
117  const dictionary& constraintDict
118  );
119 
120  //- Return a reference to the selected decompositionConstraint
122  (
123  const dictionary& constraintDict,
124  const word& modelType
125  );
126 
127 
128  //- Destructor
129  virtual ~decompositionConstraint() = default;
130 
131 
132  // Member Functions
133 
134  //- Add this constraint to list of constraints
135  virtual void add
136  (
137  const polyMesh& mesh,
138  boolList& blockedFace,
139  PtrList<labelList>& specifiedProcessorFaces,
140  labelList& specifiedProcessor,
141  List<labelPair>& explicitConnections
142  ) const = 0;
143 
144  //- Apply any additional post-decomposition constraints.
145  // Usually no need to do anything since decomposition method
146  // should have already obeyed the constraints
147  virtual void apply
148  (
149  const polyMesh& mesh,
150  const boolList& blockedFace,
151  const PtrList<labelList>& specifiedProcessorFaces,
152  const labelList& specifiedProcessor,
153  const List<labelPair>& explicitConnections,
154  labelList& decomposition
155  ) const
156  {}
157 };
158 
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 } // End namespace Foam
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 #endif
167 
168 // ************************************************************************* //
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:62
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:147
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::New
static autoPtr< decompositionConstraint > New(const dictionary &constraintDict)
Return a reference to the selected decompositionConstraint.
Definition: decompositionConstraint.C:64
labelList.H
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
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:121
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< bool >
dictionary.H
Foam::decompositionConstraint::TypeName
TypeName("decompositionConstraint")
Runtime type information.
labelPair.H