decompositionConstraint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2015-2024 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::decompositionConstraint
26 
27 Description
28 
29 SourceFiles
30  decompositionConstraint.C
31 
32 \*---------------------------------------------------------------------------*/
33 
34 #ifndef decompositionConstraint_H
35 #define decompositionConstraint_H
36 
37 #include "dictionary.H"
38 #include "runTimeSelectionTables.H"
39 #include "boolList.H"
40 #include "labelList.H"
41 #include "labelPair.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declaration of classes
49 class polyMesh;
50 
51 /*---------------------------------------------------------------------------*\
52  Class decompositionConstraint Declaration
53 \*---------------------------------------------------------------------------*/
54 
56 {
57 
58 public:
59 
60  //- Runtime type information
61  TypeName("decompositionConstraint");
62 
63 
64  // Declare run-time constructor selection table
65 
67  (
68  autoPtr,
70  dictionary,
71  (
72  const dictionary& constraintsDict,
73  const word& type
74  ),
75  (constraintsDict, type)
76  );
77 
78 
79  // Constructors
80 
81  //- Construct with generic dictionary with optional entry for type
83  (
84  const dictionary& constraintsDict,
85  const word& type
86  );
87 
88  //- Disallow default bitwise copy construction
90 
91 
92  // Selectors
93 
94  //- Return a reference to the selected decompositionConstraint
96  (
97  const dictionary& constraintsDict,
98  const word& type
99  );
100 
101 
102  //- Destructor
103  virtual ~decompositionConstraint();
104 
105 
106  // Member Functions
107 
108  //- Add my constraints to list of constraints
109  virtual void add
110  (
111  const polyMesh& mesh,
112  boolList& blockedFace,
113  PtrList<labelList>& specifiedProcessorFaces,
114  labelList& specifiedProcessor,
115  List<labelPair>& explicitConnections
116  ) const = 0;
117 
118  //- Apply any additional post-decomposition constraints. Usually no
119  // need to do anything since decomposition method should have already
120  // obeyed the constraints
121  virtual void apply
122  (
123  const polyMesh& mesh,
124  const boolList& blockedFace,
125  const PtrList<labelList>& specifiedProcessorFaces,
126  const labelList& specifiedProcessor,
127  const List<labelPair>& explicitConnections,
128  labelList& decomposition
129  ) const
130  {}
131 
132 
133  // Member Operators
134 
135  //- Disallow default bitwise assignment
136  void operator=(const decompositionConstraint&) = delete;
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: PtrList.H:75
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: autoPtr.H:51
static autoPtr< decompositionConstraint > New(const dictionary &constraintsDict, const word &type)
Return a reference to the selected decompositionConstraint.
decompositionConstraint(const dictionary &constraintsDict, const word &type)
Construct with generic dictionary with optional entry for type.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const =0
Add my constraints to list of constraints.
TypeName("decompositionConstraint")
Runtime type information.
declareRunTimeSelectionTable(autoPtr, decompositionConstraint, dictionary,(const dictionary &constraintsDict, const word &type),(constraintsDict, type))
virtual ~decompositionConstraint()
Destructor.
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. Usually no.
void operator=(const decompositionConstraint &)=delete
Disallow default bitwise assignment.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Definition: dictionary.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:80
A class for handling words, derived from string.
Definition: word.H:62
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
Namespace for OpenFOAM.
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
Macros to ease declaration of run-time selection tables.