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-------------------------------------------------------------------------------
11License
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
27Class
28 Foam::decompositionConstraints::singleProcessorFaceSets
29
30Description
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
58SourceFiles
59 singleProcessorFaceSetsConstraint.C
60
61\*---------------------------------------------------------------------------*/
62
63#ifndef singleProcessorFaceSetsConstraint_H
64#define singleProcessorFaceSetsConstraint_H
65
67#include "Tuple2.H"
68
69// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
70
71namespace Foam
72{
73namespace decompositionConstraints
74{
75
76/*---------------------------------------------------------------------------*\
77 Class singleProcessorFaceSets Declaration
78\*---------------------------------------------------------------------------*/
79
80class 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
93public:
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
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;
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// ************************************************************************* //
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Definition: List.H:77
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
Definition: Tuple2.H:58
Abstract class for handling decomposition constraints.
Constraint to keep all cells connected to face or point of faceSet on a single processor.
TypeName("singleProcessorFaceSets")
Runtime type information.
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.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add this constraint to list of constraints.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
dynamicFvMesh & mesh
Namespace for OpenFOAM.
dictionary dict
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73