boundaryCutter.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2020 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::boundaryCutter
29
30Description
31 Does modifications to boundary faces.
32
33 Does
34 - move boundary points
35 - split boundary edges (multiple per edge if necessary)
36 - face-centre decomposes boundary faces
37 - diagonal split of boundary faces
38
39
40SourceFiles
41 boundaryCutter.C
42
43\*---------------------------------------------------------------------------*/
44
45#ifndef boundaryCutter_H
46#define boundaryCutter_H
47
48#include "Map.H"
49#include "labelList.H"
50#include "edgeHashes.H"
51#include "typeInfo.H"
52#include "labelPair.H"
53
54// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55
56namespace Foam
57{
58
59// Forward Declarations
60class polyTopoChange;
61class mapPolyMesh;
62class polyMesh;
63class face;
64
65/*---------------------------------------------------------------------------*\
66 Class boundaryCutter Declaration
67\*---------------------------------------------------------------------------*/
70{
71 // Private data
72
73 //- Reference to mesh
74 const polyMesh& mesh_;
75
76 //- Per edge sorted (start to end) list of points added.
77 EdgeMap<labelList> edgeAddedPoints_;
78
79 //- Per face the mid point added.
80 Map<label> faceAddedPoint_;
81
82
83 // Private Member Functions
84
85 //- Get patch and zone info for face
86 void getFaceInfo
87 (
88 const label facei,
89 label& patchID,
90 label& zoneID,
91 label& zoneFlip
92 ) const;
93
94 //- Add cuts of edges to face
95 face addEdgeCutsToFace(const label facei, const Map<labelList>&) const;
96
97 //- Splits faces with multiple cut edges. Return true if anything split.
98 bool splitFace
99 (
100 const label facei,
101 const Map<point>& pointToPos,
102 const Map<labelList>& edgeToAddedPoints,
103 polyTopoChange& meshMod
104 ) const;
105
106 //- Add/modify facei for new vertices.
107 void addFace
108 (
109 const label facei,
110 const face& newFace,
111
112 bool& modifiedFace, // have we already 'used' facei?
113 polyTopoChange& meshMod
114 ) const;
115
116
117 //- No copy construct
118 boundaryCutter(const boundaryCutter&) = delete;
119
120 //- No copy assignment
121 void operator=(const boundaryCutter&) = delete;
122
123public:
124
125 //- Runtime type information
126 ClassName("boundaryCutter");
127
128 // Constructors
129
130 //- Construct from mesh
131 explicit boundaryCutter(const polyMesh& mesh);
132
133
134 //- Destructor
135 ~boundaryCutter() = default;
136
137
138 // Member Functions
139
140 // Edit
141
142 //- Do actual cutting with cut description. Inserts mesh changes
143 // into meshMod.
144 // pointToPos : new position for selected points
145 // edgeToCuts : per edge set of points that need to be introduced
146 // faceToSplit : per face the diagonal split
147 // faceToFeaturePoint : per face the feature point. Triangulation
148 // around this feature point.
149 void setRefinement
150 (
151 const Map<point>& pointToPos,
152 const Map<List<point>>& edgeToCuts,
153 const Map<labelPair>& faceToSplit,
154 const Map<point>& faceToFeaturePoint,
155 polyTopoChange& meshMod
156 );
157
158 //- Force recalculation of locally stored data on topological change
159 void updateMesh(const mapPolyMesh&);
160
161
162 // Access
163
164 //- Per edge a sorted list (start to end) of added points.
166 {
167 return edgeAddedPoints_;
168 }
169
170 //- Per face the mid point added.
171 const Map<label>& faceAddedPoint() const
172 {
173 return faceAddedPoint_;
174 }
175
176};
177
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181} // End namespace Foam
182
183// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
184
185#endif
186
187// ************************************************************************* //
Map from edge (expressed as its endpoints) to value. For easier forward declaration it is currently i...
Definition: EdgeMap.H:54
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 HashTable to objects of type <T> with a label key.
Definition: Map.H:60
Does modifications to boundary faces.
const Map< label > & faceAddedPoint() const
Per face the mid point added.
ClassName("boundaryCutter")
Runtime type information.
const EdgeMap< labelList > & edgeAddedPoints() const
Per edge a sorted list (start to end) of added points.
~boundaryCutter()=default
Destructor.
void updateMesh(const mapPolyMesh &)
Force recalculation of locally stored data on topological change.
void setRefinement(const Map< point > &pointToPos, const Map< List< point > > &edgeToCuts, const Map< labelPair > &faceToSplit, const Map< point > &faceToFeaturePoint, polyTopoChange &meshMod)
Do actual cutting with cut description. Inserts mesh changes.
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Mesh consisting of general polyhedral cells.
Definition: polyMesh.H:81
Direct mesh changes based on v1.3 polyTopoChange syntax.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
dynamicFvMesh & mesh
const labelIOList & zoneID
Namespace for OpenFOAM.