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.
30 This one walks hexes in a topological way:
31 - cross edge to other face
32 - cross face by walking edge-point-edge across to reach the other side.
33 (edges are always cut through the middle)
35 For anything else (tet, prism, .. poly) it will use geomCellLooper
36 (which does a purely geometric cut using a plane through cell centre)
41 \*---------------------------------------------------------------------------*/
43 #ifndef hexCellLooper_H
44 #define hexCellLooper_H
46 #include "geomCellLooper.H"
49 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
54 // Forward declaration of classes
57 /*---------------------------------------------------------------------------*\
58 Class hexCellLooper Declaration
59 \*---------------------------------------------------------------------------*/
70 //- Reference to hex cell shape.
71 const cellModel& hex_;
75 // Private Member Functions
77 //- walk across faces of hex. Update loop/loopWeights with edges cut.
78 // Return true if successful walk. (should be always!)
82 const label startFaceI,
83 const label startEdgeI,
86 scalarField& loopWeights
89 //- Convert loop into face and points
92 const labelList& loop,
93 const scalarField& loopWeights,
96 pointField& facePoints
100 //- Disallow default bitwise copy construct
101 hexCellLooper(const hexCellLooper&);
103 //- Disallow default bitwise assignment
104 void operator=(const hexCellLooper&);
109 //- Runtime type information
110 TypeName("hexCellLooper");
115 //- Construct from components
116 hexCellLooper(const polyMesh& mesh);
120 virtual ~hexCellLooper();
125 //- Create cut along circumference of cellI. Gets current mesh cuts.
126 // Cut along circumference is expressed as loop of cuts plus weights
127 // for cuts along edges (only valid for edge cuts).
128 // Return true if successful cut.
131 const vector& refDir,
133 const boolList& vertIsCut,
134 const boolList& edgeIsCut,
135 const scalarField& edgeWeight,
138 scalarField& loopWeights
142 //- Same but now also base point of cut provided (instead of always
146 const plane& cutPlane,
148 const boolList& vertIsCut,
149 const boolList& edgeIsCut,
150 const scalarField& edgeWeight,
153 scalarField& loopWeights
158 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
160 } // End namespace Foam
162 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 // ************************************************************************* //