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-2022 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::decompositionConstraints::geometric
28
29Description
30 Keep faces together based on geometric considerations from a
31 list of topoSetFaceSource.
32 The faces selected (inside) of each source 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 selection | Dictionary of geometric selections | yes |
75 \endtable
76
77Note
78 Any searchableSurface selections must describe a closed volume.
79 Ie, its hasVolumeType() method must be true.
80
81 The combined face selections are 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
89SourceFiles
90 geometricConstraint.C
91
92\*---------------------------------------------------------------------------*/
93
94#ifndef Foam_geometricConstraint_H
95#define Foam_geometricConstraint_H
96
98#include "PtrList.H"
99#include "topoSetFaceSource.H"
100
101// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
102
103namespace Foam
104{
105namespace decompositionConstraints
106{
107
108/*---------------------------------------------------------------------------*\
109 Class geometric Declaration
110\*---------------------------------------------------------------------------*/
111
112class 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
128public:
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// ************************************************************************* //
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Abstract class for handling decomposition constraints.
Keep faces together based on geometric considerations from a list of topoSetFaceSource....
TypeName("geometric")
Runtime type information.
virtual void add(const polyMesh &mesh, boolList &blockedFace, PtrList< labelList > &specifiedProcessorFaces, labelList &specifiedProcessor, List< labelPair > &explicitConnections) const
Add this constraint to list of constraints.
virtual ~geometric()=default
Destructor.
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