initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / meshCut / cellLooper / hexCellLooper.H
bloba415827930a86c77f2ef6855692e9419f47a6511
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
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
19     for more details.
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
25 Class
26     Foam::hexCellLooper
28 Description
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)
39 SourceFiles
40     hexCellLooper.C
42 \*---------------------------------------------------------------------------*/
44 #ifndef hexCellLooper_H
45 #define hexCellLooper_H
47 #include "geomCellLooper.H"
48 #include "typeInfo.H"
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 namespace Foam
55 // Forward declaration of classes
56 class cellModel;
58 /*---------------------------------------------------------------------------*\
59                            Class hexCellLooper Declaration
60 \*---------------------------------------------------------------------------*/
62 class hexCellLooper
64     public geomCellLooper
67 protected:
69     // Protected data
71         //- Reference to hex cell shape.
72         const cellModel& hex_;
74 private:
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!)
80         bool walkHex
81         (
82             const label cellI,
83             const label startFaceI,
84             const label startEdgeI,
86             labelList& loop,
87             scalarField& loopWeights
88         ) const;
90         //- Convert loop into face and points
91         void makeFace
92         (
93             const labelList& loop,
94             const scalarField& loopWeights,
96             labelList& faceVerts,
97             pointField& facePoints
98         ) const;
101         //- Disallow default bitwise copy construct
102         hexCellLooper(const hexCellLooper&);
104         //- Disallow default bitwise assignment
105         void operator=(const hexCellLooper&);
108 public:
110     //- Runtime type information
111     TypeName("hexCellLooper");
114     // Constructors
116         //- Construct from components
117         hexCellLooper(const polyMesh& mesh);
120     // Destructor
122         virtual ~hexCellLooper();
125     // Member Functions
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.
131         virtual bool cut
132         (
133             const vector& refDir,
134             const label cellI,
135             const boolList& vertIsCut,
136             const boolList& edgeIsCut,
137             const scalarField& edgeWeight,
139             labelList& loop,
140             scalarField& loopWeights
141         ) const;
144         //- Same but now also base point of cut provided (instead of always
145         //  cell centre)
146         virtual bool cut
147         (
148             const plane& cutPlane,
149             const label cellI,
150             const boolList& vertIsCut,
151             const boolList& edgeIsCut,
152             const scalarField& edgeWeight,
154             labelList& loop,
155             scalarField& loopWeights
156         ) const;
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
162 } // End namespace Foam
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
166 #endif
168 // ************************************************************************* //