Home
Downloads
Documentation
Installation
User Guide
man-pages
API Documentation
README
Release Notes
Changes
License
Support
SourceForge Project
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
dynamicMesh
meshCut
meshModifiers
meshCutAndRemove
meshCutAndRemove.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 | Copyright (C) 1991-2010 OpenCFD Ltd.
6
\\/ M anipulation |
7
-------------------------------------------------------------------------------
8
License
9
This file is part of OpenFOAM.
10
11
OpenFOAM is free software: you can redistribute it and/or modify it
12
under the terms of the GNU General Public License as published by
13
the Free Software Foundation, either version 3 of the License, or
14
(at your option) any later version.
15
16
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19
for more details.
20
21
You should have received a copy of the GNU General Public License
22
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23
24
Class
25
Foam::meshCutAndRemove
26
27
Description
28
like meshCutter but also removes non-anchor side of cell.
29
30
SourceFiles
31
meshCutAndRemove.C
32
33
\*---------------------------------------------------------------------------*/
34
35
#ifndef meshCutAndRemove_H
36
#define meshCutAndRemove_H
37
38
#include <
dynamicMesh/edgeVertex.H
>
39
#include <
OpenFOAM/boolList.H
>
40
#include <
OpenFOAM/labelList.H
>
41
#include <
OpenFOAM/typeInfo.H
>
42
#include <
OpenFOAM/Map.H
>
43
44
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46
namespace
Foam
47
{
48
49
// Forward declaration of classes
50
class
Time;
51
class
polyTopoChange;
52
class
cellCuts;
53
class
polyMesh;
54
class
face;
55
class
mapPolyMesh;
56
57
/*---------------------------------------------------------------------------*\
58
Class meshCutAndRemove Declaration
59
\*---------------------------------------------------------------------------*/
60
61
class
meshCutAndRemove
62
:
63
public
edgeVertex
64
{
65
// Private data
66
67
//- Faces added in last setRefinement. Per split cell label of added
68
// face
69
Map<label>
addedFaces_;
70
71
//- Points added in last setRefinement. Per split edge label of added
72
// point
73
HashTable<label, edge, Hash<edge>
> addedPoints_;
74
75
76
// Private Static Functions
77
78
// Returns -1 or index in elems1 of first shared element.
79
static
label firstCommon(
const
labelList
& lst1,
const
labelList
& lst2);
80
81
//- Do the elements of edge appear in consecutive order in the list
82
static
bool
isIn(
const
edge
&,
const
labelList
&);
83
84
85
// Private Member Functions
86
87
//- Returns -1 or the cell in cellLabels that is cut.
88
label findCutCell(
const
cellCuts
&,
const
labelList
&)
const
;
89
90
//- Returns first pointI in pointLabels that uses an internal
91
// face. Used to find point to inflate cell/face from (has to be
92
// connected to internal face)
93
label findInternalFacePoint(
const
labelList
&
pointLabels
)
const
;
94
95
//- Find point on face that is part of original mesh and that is
96
// point connected to the patch
97
label findPatchFacePoint(
const
face
&
f
,
const
label patchI)
const
;
98
99
//- Get new owner and neighbour of face. Checks anchor points to see if
100
// need to get original or added cell.
101
void
faceCells
102
(
103
const
cellCuts
& cuts,
104
const
label exposedPatchI,
105
const
label faceI,
106
label& own,
107
label& nei,
108
label& patchID
109
)
const
;
110
111
//- Get zone information for face.
112
void
getZoneInfo
113
(
114
const
label faceI,
115
label& zoneID,
116
bool
& zoneFlip
117
)
const
;
118
119
//- Adds a face from point. Flips face if owner>neighbour
120
void
addFace
121
(
122
polyTopoChange
& meshMod,
123
const
label faceI,
124
const
label masterPointI,
125
const
face
& newFace,
126
const
label owner,
127
const
label neighbour,
128
const
label patchID
129
);
130
131
//- Modifies existing faceI for either new owner/neighbour or
132
// new face points. Checks if anything changed and flips face
133
// if owner>neighbour
134
void
modFace
135
(
136
polyTopoChange
& meshMod,
137
const
label faceI,
138
const
face
& newFace,
139
const
label owner,
140
const
label neighbour,
141
const
label patchID
142
);
143
144
// Copies face starting from startFp. Jumps cuts. Marks visited
145
// vertices in visited.
146
void
copyFace
147
(
148
const
face
& f,
149
const
label startFp,
150
const
label endFp,
151
face
& newFace
152
)
const
;
153
154
//- Split face along cut into two faces. Faces are in same point
155
// order as original face (i.e. maintain normal direction)
156
void
splitFace
157
(
158
const
face
& f,
159
const
label v0,
160
const
label
v1
,
161
162
face
& f0,
163
face
& f1
164
)
const
;
165
166
//- Add cuts of edges to face
167
face
addEdgeCutsToFace(
const
label faceI)
const
;
168
169
//- Convert loop of cuts into face.
170
face
loopToFace
171
(
172
const
label cellI,
173
const
labelList
& loop
174
)
const
;
175
176
177
178
//- Disallow default bitwise copy construct
179
meshCutAndRemove
(
const
meshCutAndRemove
&);
180
181
//- Disallow default bitwise assignment
182
void
operator=(
const
meshCutAndRemove
&);
183
184
public
:
185
186
//- Runtime type information
187
ClassName
(
"meshCutAndRemove"
);
188
189
190
// Constructors
191
192
//- Construct from mesh
193
meshCutAndRemove
(
const
polyMesh
&
mesh
);
194
195
196
// Member Functions
197
198
// Edit
199
200
//- Do actual cutting with cut description. Inserts mesh changes
201
// into meshMod.
202
// cuts: all loops and topological information
203
// cutPatch: for every cell that has loop the patch number
204
// exposedPatch: patch for other exposed faces
205
void
setRefinement
206
(
207
const
label exposedPatchI,
208
const
cellCuts
& cuts,
209
const
labelList
& cutPatch,
210
polyTopoChange
& meshMod
211
);
212
213
//- Force recalculation of locally stored data on topological change
214
void
updateMesh
(
const
mapPolyMesh
&);
215
216
217
// Access
218
219
//- Faces added. Per split cell label of added face
220
const
Map<label>
&
addedFaces
()
const
221
{
222
return
addedFaces_;
223
}
224
225
//- Points added. Per split edge label of added point.
226
// (note: fairly useless across topology changes since one of the
227
// points of the edge will probably disappear)
228
const
HashTable<label, edge, Hash<edge>
>&
addedPoints
()
const
229
{
230
return
addedPoints_;
231
}
232
};
233
234
235
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
236
237
}
// End namespace Foam
238
239
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
240
241
#endif
242
243
// ************************ vim: set sw=4 sts=4 et: ************************ //