singleProcessorFaceSetsConstraint.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::decompositionConstraints::singleProcessorFaceSets
29 
30 Description
31  Constraint to keep all cells connected to face or point of faceSet on
32  a single processor.
33 
34  \heading Dictionary parameters
35  \table
36  Property | Description | Required | Default
37  type | singleProcessorFaceSets | yes |
38  sets | List of sets and processers | yes |
39  \endtable
40 
41  Example,
42  \verbatim
43  constraints
44  {
45  procs
46  {
47  type singleProcessorFaceSets;
48  sets
49  (
50  (faceSet1 0)
51  (faceSet5 12)
52  (faceSet25 510)
53  );
54  }
55  }
56  \endverbatim
57 
58 SourceFiles
59  singleProcessorFaceSetsConstraint.C
60 
61 \*---------------------------------------------------------------------------*/
62 
63 #ifndef singleProcessorFaceSetsConstraint_H
64 #define singleProcessorFaceSetsConstraint_H
65 
67 #include "Tuple2.H"
68 
69 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70 
71 namespace Foam
72 {
73 namespace decompositionConstraints
74 {
75 
76 /*---------------------------------------------------------------------------*\
77  Class singleProcessorFaceSets Declaration
78 \*---------------------------------------------------------------------------*/
79 
80 class singleProcessorFaceSets
81 :
82  public decompositionConstraint
83 {
84  // Private data
85 
86  //- List of faceSet+processor
87  List<Tuple2<word, label>> setNameAndProcs_;
88 
89  //- Report names of sets and processor numnbers
90  void printInfo() const;
91 
92 
93 public:
94 
95  //- Runtime type information
96  TypeName("singleProcessorFaceSets");
97 
98 
99  // Constructors
100 
101  //- Construct with constraint dictionary
102  explicit singleProcessorFaceSets(const dictionary& dict);
103 
104  //- Copy construct from components
105  explicit singleProcessorFaceSets
106  (
107  const List<Tuple2<word, label>>& setNameAndProcs
108  );
109 
110  //- Read construct a List of (setName processor)
111  explicit singleProcessorFaceSets(Istream& is);
112 
113 
114  //- Destructor
115  virtual ~singleProcessorFaceSets() = default;
116 
117 
118  // Member Functions
119 
120  //- Add this constraint to list of constraints
121  virtual void add
122  (
123  const polyMesh& mesh,
124  boolList& blockedFace,
125  PtrList<labelList>& specifiedProcessorFaces,
126  labelList& specifiedProcessor,
127  List<labelPair>& explicitConnections
128  ) const;
129 
130  //- Add this constraint post-decomposition
131  virtual void apply
132  (
133  const polyMesh& mesh,
134  const boolList& blockedFace,
135  const PtrList<labelList>& specifiedProcessorFaces,
136  const labelList& specifiedProcessor,
137  const List<labelPair>& explicitConnections,
138  labelList& decomposition
139  ) const;
140 };
141 
142 
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
144 
145 } // End namespace decompositionConstraints
146 } // End namespace Foam
147 
148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 
150 #endif
151 
152 // ************************************************************************* //
Foam::decompositionConstraint
Abstract class for handling decomposition constraints.
Definition: decompositionConstraint.H:58
Foam::decompositionConstraints::singleProcessorFaceSets
Constraint to keep all cells connected to face or point of faceSet on a single processor.
Definition: singleProcessorFaceSetsConstraint.H:94
Tuple2.H
decompositionConstraint.H
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::decompositionConstraints::singleProcessorFaceSets::singleProcessorFaceSets
singleProcessorFaceSets(const dictionary &dict)
Construct with constraint dictionary.
Definition: singleProcessorFaceSetsConstraint.C:68
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
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::decompositionConstraints::singleProcessorFaceSets::TypeName
TypeName("singleProcessorFaceSets")
Runtime type information.
Foam::decompositionConstraints::singleProcessorFaceSets::add
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add this constraint to list of constraints.
Definition: singleProcessorFaceSetsConstraint.C:129
Foam::List
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: BitOps.H:63
Foam::decompositionConstraints::singleProcessorFaceSets::apply
virtual void apply(const polyMesh &mesh, const boolList &blockedFace, const PtrList< labelList > &specifiedProcessorFaces, const labelList &specifiedProcessor, const List< labelPair > &explicitConnections, labelList &decomposition) const
Add this constraint post-decomposition.
Definition: singleProcessorFaceSetsConstraint.C:252
Foam::Tuple2
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: stringOps.H:60
Foam::decompositionConstraints::singleProcessorFaceSets::~singleProcessorFaceSets
virtual ~singleProcessorFaceSets()=default
Destructor.