preservePatchesConstraint.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::preservePatches
29 
30 Description
31  Constraint to keep owner and neighbour of (cyclic) patch on same
32  processor.
33 
34  \heading Dictionary parameters
35  \table
36  Property | Description | Required | Default
37  type | preservePatches | yes |
38  patches | List of patch names or regexs | yes |
39  \endtable
40 
41 SourceFiles
42  preservePatchesConstraint.C
43 
44 \*---------------------------------------------------------------------------*/
45 
46 #ifndef preservePatchesConstraint_H
47 #define preservePatchesConstraint_H
48 
50 #include "wordRes.H"
51 
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 
54 namespace Foam
55 {
56 
57 namespace decompositionConstraints
58 {
59 
60 /*---------------------------------------------------------------------------*\
61  Class preservePatches Declaration
62 \*---------------------------------------------------------------------------*/
63 
64 class preservePatches
65 :
66  public decompositionConstraint
67 {
68  // Private data
69 
70  //- List of patches to keep together
71  wordRes patches_;
72 
73 
74 public:
75 
76  //- Runtime type information
77  TypeName("preservePatches");
78 
79 
80  // Constructors
81 
82  //- Construct with constraint dictionary
83  explicit preservePatches(const dictionary& dict);
84 
85  //- Construct from components
86  explicit preservePatches(const UList<wordRe>& patches);
87 
88 
89  //- Destructor
90  virtual ~preservePatches() = default;
91 
92 
93  // Member Functions
94 
95  //- Add my constraints to list of constraints
96  virtual void add
97  (
98  const polyMesh& mesh,
99  boolList& blockedFace,
100  PtrList<labelList>& specifiedProcessorFaces,
101  labelList& specifiedProcessor,
102  List<labelPair>& explicitConnections
103  ) const;
104 
105  //- Apply any additional post-decomposition constraints
106  virtual void apply
107  (
108  const polyMesh& mesh,
109  const boolList& blockedFace,
110  const PtrList<labelList>& specifiedProcessorFaces,
111  const labelList& specifiedProcessor,
112  const List<labelPair>& explicitConnections,
113  labelList& decomposition
114  ) const;
115 };
116 
117 
118 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
119 
120 } // End namespace decompositionConstraints
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #endif
126 
127 // ************************************************************************* //
Foam::decompositionConstraints::preservePatches::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: preservePatchesConstraint.C:137
wordRes.H
Foam::decompositionConstraint
Abstract class for handling decomposition constraints.
Definition: decompositionConstraint.H:58
Foam::decompositionConstraints::preservePatches
Constraint to keep owner and neighbour of (cyclic) patch on same processor.
Definition: preservePatchesConstraint.H:78
decompositionConstraint.H
Foam::decompositionConstraints::preservePatches::add
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add my constraints to list of constraints.
Definition: preservePatchesConstraint.C:94
Foam::polyMesh
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:77
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::preservePatches::preservePatches
preservePatches(const dictionary &dict)
Construct with constraint dictionary.
Definition: preservePatchesConstraint.C:54
Foam::List< bool >
Foam::UList
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition: HashTable.H:103
Foam::wordRes
A List of wordRe with additional matching capabilities.
Definition: wordRes.H:51
patches
const polyBoundaryMesh & patches
Definition: convertProcessorPatches.H:65
Foam::decompositionConstraints::preservePatches::TypeName
TypeName("preservePatches")
Runtime type information.
Foam::decompositionConstraints::preservePatches::~preservePatches
virtual ~preservePatches()=default
Destructor.