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
cellLooper
topoCellLooper.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::topoCellLooper
26
27
Description
28
Implementation of cellLooper. This one recognizes splitHexes and tries
29
to make a cut such that if the neighbour was split (in a previous iteration)
30
this one also gets split in the same direction so that the result
31
will be a mesh without splitHexes.
32
33
'splitHexes' are cells of which the 'featureEdges'
34
(see cellFeatures class) form a hex. The remaining non-feature edges
35
are assumed to result from splitting the neighbour and this class tries
36
to start from one of these and cut through to an opposite edge.
37
38
The current set of cuts (vertIsCut, edgeIsCut, edgeWeight) are not being
39
used by this implementation.
40
41
All non-splitHexes are done by the parent classes.
42
43
44
SourceFiles
45
topoCellLooper.C
46
47
\*---------------------------------------------------------------------------*/
48
49
#ifndef topoCellLooper_H
50
#define topoCellLooper_H
51
52
#include "
hexCellLooper.H
"
53
#include <
OpenFOAM/typeInfo.H
>
54
55
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
56
57
namespace
Foam
58
{
59
60
// Forward declaration of classes
61
class
cellFeatures;
62
63
/*---------------------------------------------------------------------------*\
64
Class topoCellLooper Declaration
65
\*---------------------------------------------------------------------------*/
66
67
class
topoCellLooper
68
:
69
public
hexCellLooper
70
{
71
72
// Private Member Functions
73
74
//- In-memory truncate a list
75
template
<
class
T>
76
static
void
subsetList
77
(
78
const
label startI,
79
const
label freeI,
80
DynamicList<T>
& lst
81
);
82
83
//- walk across superface discarding non-feature points.
84
void
walkFace
85
(
86
const
cellFeatures
& features,
87
const
label faceI,
88
const
label startEdgeI,
89
const
label startVertI,
90
const
label nFeaturePts,
91
92
label& edgeI,
93
label& vertI
94
)
const
;
95
96
//- Returns list of vertices on 'superEdge' i.e. list of edges connected
97
// by non-feature points. First and last are feature points, ones
98
// inbetween are not.
99
labelList
getSuperEdge
100
(
101
const
cellFeatures
& features,
102
const
label faceI,
103
const
label startEdgeI,
104
const
label startVertI
105
)
const
;
106
107
// Return non-feature edge from cells' edges that is most
108
// perpendicular to refinement direction. Used as starting edge.
109
label getAlignedNonFeatureEdge
110
(
111
const
vector
& refDir,
112
const
label cellI,
113
const
cellFeatures
& features
114
)
const
;
115
116
//- Starts from edge and vertex on edge on face (or neighbouring face)
117
// and steps either to existing vertex (vertI != -1) or to edge
118
// (vertI == -1)
119
// by walking point-edge and crossing nFeats featurePoints.
120
void
walkAcrossFace
121
(
122
const
cellFeatures
& features,
123
const
label faceI,
124
const
label startEdgeI,
125
const
label startVertI,
126
const
label nFeats,
127
128
label& edgeI,
129
label& vertI
130
)
const
;
131
132
//- Walks splitcell circumference. Sets loop/loopweights to walk on
133
// outside of cell.
134
void
walkSplitHex
135
(
136
const
label cellI,
137
const
cellFeatures
& features,
138
const
label fromFaceI,
139
const
label fromEdgeI,
140
const
label fromVertI,
141
142
DynamicList<label>
& loop,
143
DynamicList<scalar>
& loopWeights
144
)
const
;
145
146
147
//- Disallow default bitwise copy construct
148
topoCellLooper
(
const
topoCellLooper
&);
149
150
//- Disallow default bitwise assignment
151
void
operator=(
const
topoCellLooper
&);
152
153
154
public
:
155
156
//- Runtime type information
157
TypeName
(
"topoCellLooper"
);
158
159
// Static data members
160
161
//- cos of angle for feature recognition (of splitHexes)
162
static
const
scalar
featureCos
;
163
164
165
// Constructors
166
167
//- Construct from components
168
topoCellLooper
(
const
polyMesh
&
mesh
);
169
170
171
// Destructor
172
173
virtual
~topoCellLooper
();
174
175
176
// Member Functions
177
178
//- Create cut along circumference of cellI. Gets current mesh cuts.
179
// Cut along circumference is expressed as loop of cuts plus weights
180
// for cuts along edges (only valid for edge cuts).
181
// Return true if successful cut.
182
virtual
bool
cut
183
(
184
const
vector
& refDir,
185
const
label cellI,
186
const
boolList
& vertIsCut,
187
const
boolList
& edgeIsCut,
188
const
scalarField
& edgeWeight,
189
190
labelList
& loop,
191
scalarField
& loopWeights
192
)
const
;
193
194
//- Same but now also base point of cut provided (instead of always
195
// cell centre)
196
virtual
bool
cut
197
(
198
const
plane
& cutPlane,
199
const
label cellI,
200
const
boolList
& vertIsCut,
201
const
boolList
& edgeIsCut,
202
const
scalarField
& edgeWeight,
203
204
labelList
& loop,
205
scalarField
& loopWeights
206
)
const
;
207
};
208
209
210
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211
212
}
// End namespace Foam
213
214
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
215
216
#endif
217
218
// ************************ vim: set sw=4 sts=4 et: ************************ //