1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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 the
13 Free Software Foundation; either version 2 of the License, or (at your
14 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, write to the Free Software Foundation,
23 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 Implementation of cellLooper.
31 This one walks hexes in a topological way:
32 - cross edge to other face
33 - cross face by walking edge-point-edge across to reach the other side.
34 (edges are always cut through the middle)
36 For anything else (tet, prism, .. poly) it will use geomCellLooper
37 (which does a purely geometric cut using a plane through cell centre)
42 \*---------------------------------------------------------------------------*/
44 #ifndef hexCellLooper_H
45 #define hexCellLooper_H
47 #include "geomCellLooper.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
55 // Forward declaration of classes
58 /*---------------------------------------------------------------------------*\
59 Class hexCellLooper Declaration
60 \*---------------------------------------------------------------------------*/
71 //- Reference to hex cell shape.
72 const cellModel& hex_;
76 // Private Member Functions
78 //- walk across faces of hex. Update loop/loopWeights with edges cut.
79 // Return true if successful walk. (should be always!)
83 const label startFaceI,
84 const label startEdgeI,
87 scalarField& loopWeights
90 //- Convert loop into face and points
93 const labelList& loop,
94 const scalarField& loopWeights,
97 pointField& facePoints
101 //- Disallow default bitwise copy construct
102 hexCellLooper(const hexCellLooper&);
104 //- Disallow default bitwise assignment
105 void operator=(const hexCellLooper&);
110 //- Runtime type information
111 TypeName("hexCellLooper");
116 //- Construct from components
117 hexCellLooper(const polyMesh& mesh);
122 virtual ~hexCellLooper();
127 //- Create cut along circumference of cellI. Gets current mesh cuts.
128 // Cut along circumference is expressed as loop of cuts plus weights
129 // for cuts along edges (only valid for edge cuts).
130 // Return true if successful cut.
133 const vector& refDir,
135 const boolList& vertIsCut,
136 const boolList& edgeIsCut,
137 const scalarField& edgeWeight,
140 scalarField& loopWeights
144 //- Same but now also base point of cut provided (instead of always
148 const plane& cutPlane,
150 const boolList& vertIsCut,
151 const boolList& edgeIsCut,
152 const scalarField& edgeWeight,
155 scalarField& loopWeights
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
168 // ************************************************************************* //