1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
9 This file is part of OpenFOAM.
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.
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
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/>.
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.
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.
38 The current set of cuts (vertIsCut, edgeIsCut, edgeWeight) are not being
39 used by this implementation.
41 All non-splitHexes are done by the parent classes.
47 \*---------------------------------------------------------------------------*/
49 #ifndef topoCellLooper_H
50 #define topoCellLooper_H
52 #include "hexCellLooper.H"
55 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
60 // Forward declaration of classes
63 /*---------------------------------------------------------------------------*\
64 Class topoCellLooper Declaration
65 \*---------------------------------------------------------------------------*/
72 // Private Member Functions
74 //- In-memory truncate a list
76 static void subsetList
83 //- walk across superface discarding non-feature points.
86 const cellFeatures& features,
88 const label startEdgeI,
89 const label startVertI,
90 const label nFeaturePts,
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
99 labelList getSuperEdge
101 const cellFeatures& features,
103 const label startEdgeI,
104 const label startVertI
107 // Return non-feature edge from cells' edges that is most
108 // perpendicular to refinement direction. Used as starting edge.
109 label getAlignedNonFeatureEdge
111 const vector& refDir,
113 const cellFeatures& features
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
119 // by walking point-edge and crossing nFeats featurePoints.
122 const cellFeatures& features,
124 const label startEdgeI,
125 const label startVertI,
132 //- Walks splitcell circumference. Sets loop/loopweights to walk on
137 const cellFeatures& features,
138 const label fromFaceI,
139 const label fromEdgeI,
140 const label fromVertI,
142 DynamicList<label>& loop,
143 DynamicList<scalar>& loopWeights
147 //- Disallow default bitwise copy construct
148 topoCellLooper(const topoCellLooper&);
150 //- Disallow default bitwise assignment
151 void operator=(const topoCellLooper&);
156 //- Runtime type information
157 TypeName("topoCellLooper");
159 // Static data members
161 //- cos of angle for feature recognition (of splitHexes)
162 static const scalar featureCos;
167 //- Construct from components
168 topoCellLooper(const polyMesh& mesh);
172 virtual ~topoCellLooper();
177 //- Create cut along circumference of cellI. Gets current mesh cuts.
178 // Cut along circumference is expressed as loop of cuts plus weights
179 // for cuts along edges (only valid for edge cuts).
180 // Return true if successful cut.
183 const vector& refDir,
185 const boolList& vertIsCut,
186 const boolList& edgeIsCut,
187 const scalarField& edgeWeight,
190 scalarField& loopWeights
193 //- Same but now also base point of cut provided (instead of always
197 const plane& cutPlane,
199 const boolList& vertIsCut,
200 const boolList& edgeIsCut,
201 const scalarField& edgeWeight,
204 scalarField& loopWeights
209 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
211 } // End namespace Foam
213 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
217 // ************************************************************************* //