initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / applications / utilities / mesh / advanced / modifyMesh / cellSplitter.H
bloba931217900f974396a6557c5e68f9ebd48d44885
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::cellSplitter
28 Description
29     Does pyramidal decomposition of selected cells. So all faces will become
30     base of pyramid with as top a user-supplied point (usually the cell centre)
32 SourceFiles
33     cellSplitter.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef cellSplitter_H
38 #define cellSplitter_H
40 #include "Map.H"
41 #include "edge.H"
42 #include "typeInfo.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 namespace Foam
49 // Forward declaration of classes
50 class polyTopoChange;
51 class mapPolyMesh;
52 class polyMesh;
55 /*---------------------------------------------------------------------------*\
56                            Class cellSplitter Declaration
57 \*---------------------------------------------------------------------------*/
59 class cellSplitter
61     // Private data
63         //- Reference to mesh
64         const polyMesh& mesh_;
66         //- Per cell the mid point added.
67         Map<label> addedPoints_;
70     // Private Member Functions
72         //- Get patch and zone info for face
73         void getFaceInfo
74         (
75             const label faceI,
76             label& patchID,
77             label& zoneID,
78             label& zoneFlip
79         ) const;
81         //- Find the new owner (if any) of the face.
82         label newOwner
83         (
84             const label faceI,
85             const Map<labelList>& cellToCells
86         ) const;
88         //- Find the new neighbour (if any) of the face.
89         label newNeighbour
90         (
91             const label faceI,
92             const Map<labelList>& cellToCells
93         ) const;
95         //- Disallow default bitwise copy construct
96         cellSplitter(const cellSplitter&);
98         //- Disallow default bitwise assignment
99         void operator=(const cellSplitter&);
101 public:
103     //- Runtime type information
104     ClassName("cellSplitter");
106     // Constructors
108         //- Construct from mesh
109         cellSplitter(const polyMesh& mesh);
112     // Destructor
114         ~cellSplitter();
117     // Member Functions
119         // Edit
121             //- Insert mesh changes into meshMod.
122             //  cellToMidPoint : cell to cut and position of its new midpoint
123             void setRefinement
124             (
125                 const Map<point>& cellToMidPoint,
126                 polyTopoChange& meshMod
127             );
129             //- Force recalculation of locally stored data on topological change
130             void updateMesh(const mapPolyMesh&);
133         // Access
135             //- Per cell the mid point added.
136             const Map<label>& addedPoints() const
137             {
138                 return addedPoints_;
139             }
143 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 } // End namespace Foam
147 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
149 #endif
151 // ************************************************************************* //