geometricConstraint.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) 2018 OpenCFD Ltd.
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::decompositionConstraints::geometric
28 
29 Description
30  Keep faces together based on geometric considerations from a
31  searchableSurfaces list.
32  The faces inside of each searchableSurface are to be kept together
33  during the decomposition.
34 
35  \verbatim
36  constraints
37  {
38  geom1
39  {
40  type geometric;
41 
42  grow false;
43 
44  selection
45  {
46  box1
47  {
48  source box;
49  min (-0.1 -0.01 -0.1);
50  max (0.1 0.30 0.1);
51  }
52  ball
53  {
54  source sphere;
55  origin (-0.1 -0.01 -0.1);
56  radius 0.25;
57  }
58  blob
59  {
60  source surface;
61  surfaceType triSurfaceMesh;
62  surfaceName blob.obj;
63  }
64  }
65  }
66  }
67  \endverbatim
68 
69  \heading Dictionary parameters
70  \table
71  Property | Description | Required | Default
72  type | geometric | yes |
73  grow | Grow cells with partial connectivity | no | false
74  geometry | Dictionary of enclosing volumes | yes |
75  \endtable
76 
77 Note
78  The searchableSurface must describe a closed volume.
79  Ie, its hasVolumeType() method must be true.
80 
81  The selection of enclosing volumes is treated as an OR operation.
82 
83  The "grow" mode includes an additional check to include cell faces
84  for any cell that already has two or more of its faces "unblocked".
85  This could indicate a connection over a corner, but does not distinguish
86  between connectivity introduced by the constraint and the connectivity
87  defined by other constraints.
88 
89 SourceFiles
90  geometricConstraint.C
91 
92 \*---------------------------------------------------------------------------*/
93 
94 #ifndef geometricConstraint_H
95 #define geometricConstraint_H
96 
98 #include "PtrList.H"
99 #include "topoSetFaceSource.H"
100 
101 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102 
103 namespace Foam
104 {
105 namespace decompositionConstraints
106 {
107 
108 /*---------------------------------------------------------------------------*\
109  Class geometric Declaration
110 \*---------------------------------------------------------------------------*/
111 
112 class geometric
113 :
114  public decompositionConstraint
115 {
116  // Private data
117 
118  //- Face selections as topoSetFaceSource
119  PtrList<topoSetFaceSource> sources_;
120 
121  //- Dictionary of face selections for topoSetFaceSource
122  dictionary selection_;
123 
124  //- Additional check of cell connection (via corners?)
125  bool grow_;
126 
127 
128 public:
129 
130  //- Runtime type information
131  TypeName("geometric");
132 
133 
134  // Constructors
135 
136  //- Construct with constraint dictionary
137  explicit geometric(const dictionary& dict);
138 
139  //- Move construct from components.
140  // (topoSetFaceSource cannot be cloned)
141  explicit geometric(PtrList<topoSetFaceSource>&& selections);
142 
143 
144  //- Destructor
145  virtual ~geometric() = default;
146 
147 
148  // Member Functions
149 
150  //- Add this constraint to list of constraints
151  virtual void add
152  (
153  const polyMesh& mesh,
154  boolList& blockedFace,
155  PtrList<labelList>& specifiedProcessorFaces,
156  labelList& specifiedProcessor,
157  List<labelPair>& explicitConnections
158  ) const;
159 };
160 
161 
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 
164 } // End namespace decompositionConstraints
165 } // End namespace Foam
166 
167 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 
169 #endif
170 
171 // ************************************************************************* //
Foam::decompositionConstraints::geometric::TypeName
TypeName("geometric")
Runtime type information.
Foam::decompositionConstraint
Abstract class for handling decomposition constraints.
Definition: decompositionConstraint.H:58
Foam::decompositionConstraints::geometric
Keep faces together based on geometric considerations from a searchableSurfaces list....
Definition: geometricConstraint.H:131
decompositionConstraint.H
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::decompositionConstraints::geometric::geometric
geometric(const dictionary &dict)
Construct with constraint dictionary.
Definition: geometricConstraint.C:56
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::List< bool >
Foam::decompositionConstraints::geometric::~geometric
virtual ~geometric()=default
Destructor.
PtrList.H
topoSetFaceSource.H
Foam::decompositionConstraints::geometric::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: geometricConstraint.C:98