singleProcessorFaceSetsConstraint.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-2020 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::decompositionConstraints::singleProcessorFaceSetsConstraint
26 
27 Description
28  Constraint to keep all cells connected to face or point of faceSet on
29  a single processor.
30 
31 SourceFiles
32  singleProcessorFaceSetsConstraint.C
33 
34 \*---------------------------------------------------------------------------*/
35 
36 #ifndef singleProcessorFaceSetsConstraint_H
37 #define singleProcessorFaceSetsConstraint_H
38 
40 #include "Tuple2.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 
47 namespace decompositionConstraints
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class singleProcessorFaceSetsConstraint Declaration
52 \*---------------------------------------------------------------------------*/
53 
55 :
57 {
58  // Private Data
59 
60  //- List of faceSet+processor
61  List<Tuple2<word, label>> setNameAndProcs_;
62 
63 public:
64 
65  //- Runtime type information
66  TypeName("singleProcessorFaceSets");
67 
68 
69  // Constructors
70 
71  //- Construct with generic dictionary with optional entry for type
73  (
74  const dictionary& constraintsDict,
75  const word& type
76  );
77 
78  //- Construct from components
80  (
81  const List<Tuple2<word, label>>& setNameAndProcs
82  );
83 
84 
85  //- Destructor
87  {}
88 
89 
90  // Member Functions
91 
92  //- Add my constraints to list of constraints
93  virtual void add
94  (
95  const polyMesh& mesh,
96  boolList& blockedFace,
97  PtrList<labelList>& specifiedProcessorFaces,
98  labelList& specifiedProcessor,
99  List<labelPair>& explicitConnections
100  ) const;
101 
102  //- Apply any additional post-decomposition constraints
103  virtual void apply
104  (
105  const polyMesh& mesh,
106  const boolList& blockedFace,
107  const PtrList<labelList>& specifiedProcessorFaces,
108  const labelList& specifiedProcessor,
109  const List<labelPair>& explicitConnections,
110  labelList& decomposition
111  ) const;
112 };
113 
114 
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
116 
117 } // End namespace decompositionConstraints
118 } // End namespace Foam
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 #endif
123 
124 // ************************************************************************* //
singleProcessorFaceSetsConstraint(const dictionary &constraintsDict, const word &type)
Construct with generic dictionary with optional entry for type.
A list of keyword definitions, which are a keyword followed by any number of values (e...
Definition: dictionary.H:156
A 2-tuple for storing two objects of different types.
Definition: HashTable.H:65
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: HashTable.H:59
fvMesh & mesh
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add my constraints to list of constraints.
A class for handling words, derived from string.
Definition: word.H:59
TypeName("singleProcessorFaceSets")
Runtime type information.
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:70
fileType type(const fileName &, const bool checkVariants=true, const bool followLink=true)
Return the file type: directory or file.
Definition: POSIX.C:488
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.
Constraint to keep all cells connected to face or point of faceSet on a single processor.
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:76
Namespace for OpenFOAM.